Ocean
Ocean::SceneDescription::SDXScene Class Reference

This class implements the base class for all sdx scene object providing access to all elements of a scene. More...

Inheritance diagram for Ocean::SceneDescription::SDXScene:

Public Member Functions

const std::string & filename () const
 Returns the name of the file defining this node. More...
 
Rendering::SceneRef renderingScene () const
 Returns the associated scene rendering object. More...
 
const SDXEnvironmentenvironment () const
 Returns the environment object of this scene. More...
 
virtual void registerGlobalLight (const Rendering::LightSourceRef &lightSource)
 Registers a global light source to this scene. More...
 
virtual void unregisterGlobalLight (const Rendering::LightSourceRef &lightSource)
 Unregisters a global light source from this scene. More...
 
virtual void initialize (const Timestamp timestamp)
 Event function to inform the scene that it has been initialized and can apply all internal values to corresponding rendering objects. More...
 
- Public Member Functions inherited from Ocean::SceneDescription::Scene
 Scene (const std::string &filename)
 Creates a new scene object. More...
 
const std::string & filename () const
 Returns the filename of this scene. More...
 
- Public Member Functions inherited from Ocean::SceneDescription::Node
NodeId id () const
 Returns the unique node id of this node. More...
 
const std::string & name () const
 Returns the name of this node. More...
 
const std::string & type () const
 Returns the type of this node. More...
 
const Fieldfield (const std::string &fieldName) const
 Returns the field base of a specified (standard) field. More...
 
Fieldfield (const std::string &fieldName)
 Returns the field base of a specified (standard) field. More...
 
virtual const FieldanyField (const std::string &fieldName) const
 Returns the field base of a specified standard or dynamic field. More...
 
virtual FieldanyField (const std::string &fieldName)
 Returns the field base of a specified standard or dynamic field. More...
 
template<typename T >
const T & field (const std::string &fieldName) const
 Returns a specified (standard) field. More...
 
template<typename T >
T & field (const std::string &fieldName)
 Returns a specified (standard) field. More...
 
template<typename T >
const T & anyField (const std::string &fieldName) const
 Returns a specified standard or dynamic field. More...
 
template<typename T >
T & anyField (const std::string &fieldName)
 Returns a specified standard or dynamic field. More...
 
FieldAccessType fieldAccessType (const std::string &fieldName) const
 Returns the access type of a specified field. More...
 
bool hasField (const std::string &fieldName) const
 Returns whether this node has a special (standard) field. More...
 
virtual bool hasAnyField (const std::string &fieldName) const
 Returns whether this node has a special standard or dynamic field. More...
 
virtual std::string originalFieldName (const std::string &fieldName) const
 Tries to translate an alias field name to the original field name. More...
 
Field::Type fieldType (const std::string &fieldName) const
 Returns the type of a special field. More...
 
unsigned int fieldDimension (const std::string &fieldName) const
 Return the dimension of a special field. More...
 
virtual bool isDynamic () const
 Returns whether this node can hold dynamic generated field. More...
 
- Public Member Functions inherited from Ocean::SceneDescription::SDXNode
DescriptionType descriptionType () const override
 Returns the scene description type of this node. More...
 
const Rendering::EngineRefengine () const
 Returns the rendering engine used by this node. More...
 
const std::string & library () const
 Returns the name of the scene description library defining this node. More...
 
const std::string & filename () const
 Returns the name of the file defining this node. More...
 
SceneId sceneId () const
 Returns the unique id of the scene defining this node originally. More...
 
virtual const Rendering::ObjectRefrenderingObject () const
 Returns the associated rendering object. More...
 
void setName (const std::string &name) override
 Sets the name of this node. More...
 
virtual bool setField (const std::string &fieldName, const Field &field)
 Sets or changes a specified (standard) field of this node. More...
 
virtual bool setAnyField (const std::string &fieldName, const Field &field)
 Sets or changes a specified standard or dynamic field of this node. More...
 
NodeRefs parentNodes () const
 Returns all parent nodes of this node. More...
 
SDXNodeSet ancestorNodes () const
 Returns all ancestor nodes of this node. More...
 

Protected Member Functions

 SDXScene (const std::string &filename, const Library &library, const Rendering::EngineRef &engine)
 Creates a new scene object. More...
 
void initialize (const Rendering::SceneRef &scene, const Timestamp timestamp, const bool reinitialize=false) override
 Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects. More...
 
virtual void onInitialize (const Timestamp timestamp)
 Internal event function to inform the scene that it has been initialized and can apply all internal values to corresponding rendering objects. More...
 
void onInitialize (const Rendering::SceneRef &scene, const Timestamp timestamp) override
 Internal event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects. More...
 
- Protected Member Functions inherited from Ocean::SceneDescription::Node
 Node ()
 Creates a new node. More...
 
 Node (const Node &node)=delete
 Disabled copy constructor. More...
 
virtual ~Node ()
 Destructs a node. More...
 
virtual size_t objectAddress () const
 Returns the address of the most derived object. More...
 
void registerField (NodeSpecification &specification, const std::string &fieldName, const Field &field, const FieldAccessType accessType=ACCESS_GET_SET)
 Registers a new field to a specified node type. More...
 
Nodeoperator= (const Node &node)=delete
 Disabled copy operator. More...
 
- Protected Member Functions inherited from Ocean::SceneDescription::SDXNode
 SDXNode (const SDXEnvironment *environment)
 Creates a new node object. More...
 
 ~SDXNode () override
 Destructs a node object. More...
 
virtual void onFieldChanged (const std::string &fieldName)
 Event function to inform the node about a changed field. More...
 
void registerParentNode (const NodeId parentId)
 Registers a new parent node for this (child) node. More...
 
void unregisterParentNode (const NodeId parentId)
 Unregisters a parent node for this (child) node. More...
 
void registerThisNodeAsParent (const SDXNodeRef &child)
 Registers this node at a child as parent node. More...
 
void unregisterThisNodeAsParent (const SDXNodeRef &child)
 Unregisters this node from a child as parent. More...
 

Protected Attributes

SDXEnvironment sceneEnvironment_
 Scene environment object. More...
 
- Protected Attributes inherited from Ocean::SceneDescription::Scene
std::string filename_
 Filename of this scene. More...
 
- Protected Attributes inherited from Ocean::SceneDescription::Node
NodeId nodeId_
 Unique node id. More...
 
std::string name_
 Node name. More...
 
NodeSpecificationspecification_ = nullptr
 Pointer to the node specification, guaranteed to exist as long as the node exist. More...
 
- Protected Attributes inherited from Ocean::SceneDescription::SDXNode
const SDXEnvironmentenvironment_ = nullptr
 Object specifying the environment of this node. More...
 
NodeIdMap parents_
 Map holding all parent nodes. More...
 
Rendering::ObjectRef renderingObject_
 Corresponding rendering object. More...
 
bool initialized_ = false
 State determining whether the node has been initialized already. More...
 
Lock lock_
 Node lock. More...
 

Additional Inherited Members

- Public Types inherited from Ocean::SceneDescription::Node
enum  FieldAccessType {
  ACCESS_NONE = 0 , ACCESS_GET = 1 , ACCESS_SET = 2 , ACCESS_GET_SET = ACCESS_GET | ACCESS_SET ,
  ACCESS_EXPLICIT_NOTIFICATION = 4
}
 Definition of different field access types. More...
 
- Public Types inherited from Ocean::SceneDescription::SDXNode
typedef std::unordered_map< NodeId, unsigned int > NodeIdMap
 Definition of a map mapping node ids to reference counters. More...
 
- Protected Types inherited from Ocean::SceneDescription::Node
typedef std::map< std::string, Field * > FieldMap
 Definition of a map mapping field names to fields. More...
 
- Static Protected Member Functions inherited from Ocean::SceneDescription::Node
static LocknodeIdCounterLock ()
 Returns the lock for the node id counter. More...
 
- Static Protected Attributes inherited from Ocean::SceneDescription::Node
static NodeId nodeIdCounter_
 Unique node id counter. More...
 

Detailed Description

This class implements the base class for all sdx scene object providing access to all elements of a scene.

A new scene object can be created by the scene description Manager object.

Constructor & Destructor Documentation

◆ SDXScene()

Ocean::SceneDescription::SDXScene::SDXScene ( const std::string &  filename,
const Library library,
const Rendering::EngineRef engine 
)
protected

Creates a new scene object.

Parameters
filenameName of the scene file, if any
libraryLibrary providing this scene node
engineRendering engine corresponding with this scene and all child nodes

Member Function Documentation

◆ environment()

const SDXScene::SDXEnvironment * Ocean::SceneDescription::SDXScene::environment ( ) const
inline

Returns the environment object of this scene.

Returns
Environment object

◆ filename()

const std::string & Ocean::SceneDescription::SDXScene::filename ( ) const
inline

Returns the name of the file defining this node.

Beware: A node can be defined outside a file context and thus does not have a file!

Returns
Filename

◆ initialize() [1/2]

void Ocean::SceneDescription::SDXScene::initialize ( const Rendering::SceneRef scene,
const Timestamp  timestamp,
const bool  reinitialize = false 
)
overrideprotectedvirtual

Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.

The scene node has an own initialize() function, use this instead

See also
SDXNode::initialize().

Reimplemented from Ocean::SceneDescription::SDXNode.

◆ initialize() [2/2]

virtual void Ocean::SceneDescription::SDXScene::initialize ( const Timestamp  timestamp)
virtual

Event function to inform the scene that it has been initialized and can apply all internal values to corresponding rendering objects.

Parameters
timestampInitialization timestamp

◆ onInitialize() [1/2]

void Ocean::SceneDescription::SDXScene::onInitialize ( const Rendering::SceneRef scene,
const Timestamp  timestamp 
)
overrideprotectedvirtual

Internal event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.

The scene node has an own onInitialize() function, use this instead

See also
SDXNode::onInitialize().

Reimplemented from Ocean::SceneDescription::SDXNode.

◆ onInitialize() [2/2]

virtual void Ocean::SceneDescription::SDXScene::onInitialize ( const Timestamp  timestamp)
protectedvirtual

Internal event function to inform the scene that it has been initialized and can apply all internal values to corresponding rendering objects.

Parameters
timestampInitialization timestamp

Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DScene.

◆ registerGlobalLight()

virtual void Ocean::SceneDescription::SDXScene::registerGlobalLight ( const Rendering::LightSourceRef lightSource)
virtual

Registers a global light source to this scene.

Licht sources in local transformations with global state should be registered only.
The transformation, position or orientation of the light source is unchanged.

Parameters
lightSourceRendering light source object to be registered
See also
unregisterGlobalLight().

◆ renderingScene()

Rendering::SceneRef Ocean::SceneDescription::SDXScene::renderingScene ( ) const
inline

Returns the associated scene rendering object.

Returns
Associated scene rendering object

◆ unregisterGlobalLight()

virtual void Ocean::SceneDescription::SDXScene::unregisterGlobalLight ( const Rendering::LightSourceRef lightSource)
virtual

Unregisters a global light source from this scene.

Parameters
lightSourceRenring light source object to be unregistered
See also
registerGlobalLight().

Field Documentation

◆ sceneEnvironment_

SDXEnvironment Ocean::SceneDescription::SDXScene::sceneEnvironment_
protected

Scene environment object.


The documentation for this class was generated from the following file: