Ocean
Ocean::SceneDescription::SDXNode Class Reference

This class implements the base class for all SDX scene description nodes. More...

Inheritance diagram for Ocean::SceneDescription::SDXNode:

Data Structures

class  SDXEnvironment
 This class implements a node environment container. More...
 

Public Types

typedef std::unordered_map< NodeId, unsigned int > NodeIdMap
 Definition of a map mapping node ids to reference counters. More...
 
- 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 Member Functions

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...
 
virtual void initialize (const Rendering::SceneRef &scene, const Timestamp timestamp, const bool reinitialize=false)
 Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects. 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...
 

Protected Member Functions

 SDXNode (const SDXEnvironment *environment)
 Creates a new node object. More...
 
 ~SDXNode () override
 Destructs a node object. More...
 
virtual void onInitialize (const Rendering::SceneRef &scene, const Timestamp timestamp)
 Internal event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects. 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 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 Attributes

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...
 
- 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...
 

Additional Inherited Members

- 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 description nodes.

Member Typedef Documentation

◆ NodeIdMap

typedef std::unordered_map<NodeId, unsigned int> Ocean::SceneDescription::SDXNode::NodeIdMap

Definition of a map mapping node ids to reference counters.

Constructor & Destructor Documentation

◆ SDXNode()

Ocean::SceneDescription::SDXNode::SDXNode ( const SDXEnvironment environment)
explicitprotected

Creates a new node object.

Parameters
environmentNode environment

◆ ~SDXNode()

Ocean::SceneDescription::SDXNode::~SDXNode ( )
overrideprotected

Destructs a node object.

Member Function Documentation

◆ ancestorNodes()

SDXNodeSet Ocean::SceneDescription::SDXNode::ancestorNodes ( ) const

Returns all ancestor nodes of this node.

Returns
Set holding all possible ancestor nodes towards the root node.

◆ descriptionType()

DescriptionType Ocean::SceneDescription::SDXNode::descriptionType ( ) const
overridevirtual

Returns the scene description type of this node.

See also
Node::descriptionType().

Implements Ocean::SceneDescription::Node.

◆ engine()

const Rendering::EngineRef & Ocean::SceneDescription::SDXNode::engine ( ) const
inline

Returns the rendering engine used by this node.

Returns
Rendering engine

◆ filename()

const std::string & Ocean::SceneDescription::SDXNode::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()

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

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

Parameters
sceneRendering scene node
timestampInitialization timestamp
reinitializeTrue, if a reinitialization has to be done

Reimplemented in Ocean::SceneDescription::SDXScene.

◆ library()

const std::string & Ocean::SceneDescription::SDXNode::library ( ) const
inline

Returns the name of the scene description library defining this node.

Returns
Library name

◆ onFieldChanged()

virtual void Ocean::SceneDescription::SDXNode::onFieldChanged ( const std::string &  fieldName)
protectedvirtual

Event function to inform the node about a changed field.

Parameters
fieldNameName of the changed field

Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DTimeDependentNode, Ocean::SceneDescription::SDX::X3D::X3DLightNode, Ocean::SceneDescription::SDX::X3D::X3DBackgroundNode, Ocean::SceneDescription::SDX::X3D::Transform, Ocean::SceneDescription::SDX::X3D::TrackerTransform, Ocean::SceneDescription::SDX::X3D::TimeSensor, Ocean::SceneDescription::SDX::X3D::TextureTransform, Ocean::SceneDescription::SDX::X3D::TextureProperties, Ocean::SceneDescription::SDX::X3D::TextureCoordinate, Ocean::SceneDescription::SDX::X3D::Text, Ocean::SceneDescription::SDX::X3D::Switch, Ocean::SceneDescription::SDX::X3D::SpotLight, Ocean::SceneDescription::SDX::X3D::PointSet, Ocean::SceneDescription::SDX::X3D::PointLight, Ocean::SceneDescription::SDX::X3D::PhantomTextureCoordinate, Ocean::SceneDescription::SDX::X3D::PackagedShader, Ocean::SceneDescription::SDX::X3D::OrientationInterpolator, Ocean::SceneDescription::SDX::X3D::NormalInterpolator, Ocean::SceneDescription::SDX::X3D::Normal, Ocean::SceneDescription::SDX::X3D::NavigationInfo, Ocean::SceneDescription::SDX::X3D::MultiTexture, Ocean::SceneDescription::SDX::X3D::MovieTexture, Ocean::SceneDescription::SDX::X3D::Material, Ocean::SceneDescription::SDX::X3D::LOD, Ocean::SceneDescription::SDX::X3D::LiveVideoTexture, Ocean::SceneDescription::SDX::X3D::Inline, Ocean::SceneDescription::SDX::X3D::IndexedLineSet, Ocean::SceneDescription::SDX::X3D::IndexedFaceSet, Ocean::SceneDescription::SDX::X3D::ImageTexture, Ocean::SceneDescription::SDX::X3D::HeadUpTransform, Ocean::SceneDescription::SDX::X3D::DirectionalLight, Ocean::SceneDescription::SDX::X3D::CoordinateInterpolator, Ocean::SceneDescription::SDX::X3D::Coordinate, Ocean::SceneDescription::SDX::X3D::ComposedShader, Ocean::SceneDescription::SDX::X3D::ColorInterpolator, Ocean::SceneDescription::SDX::X3D::Color, Ocean::SceneDescription::SDX::X3D::Billboard, Ocean::SceneDescription::SDX::X3D::Background, and Ocean::SceneDescription::SDX::X3D::AudioClip.

◆ onInitialize()

virtual void Ocean::SceneDescription::SDXNode::onInitialize ( const Rendering::SceneRef scene,
const Timestamp  timestamp 
)
protectedvirtual

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

Parameters
sceneRendering scene node
timestampInitialization timestamp

Reimplemented in Ocean::SceneDescription::SDXScene, Ocean::SceneDescription::SDX::X3D::X3DTimeDependentNode, Ocean::SceneDescription::SDX::X3D::X3DTexture2DNode, Ocean::SceneDescription::SDX::X3D::X3DShapeNode, Ocean::SceneDescription::SDX::X3D::X3DScene, Ocean::SceneDescription::SDX::X3D::X3DLightNode, Ocean::SceneDescription::SDX::X3D::X3DInterpolatorNode, Ocean::SceneDescription::SDX::X3D::X3DGroupingNode, Ocean::SceneDescription::SDX::X3D::X3DComposedGeometryNode, Ocean::SceneDescription::SDX::X3D::X3DBackgroundNode, Ocean::SceneDescription::SDX::X3D::Transform, Ocean::SceneDescription::SDX::X3D::TrackerTransform, Ocean::SceneDescription::SDX::X3D::TimeSensor, Ocean::SceneDescription::SDX::X3D::TextureTransform, Ocean::SceneDescription::SDX::X3D::TextureProperties, Ocean::SceneDescription::SDX::X3D::Text, Ocean::SceneDescription::SDX::X3D::Switch, Ocean::SceneDescription::SDX::X3D::StaticGroup, Ocean::SceneDescription::SDX::X3D::SpotLight, Ocean::SceneDescription::SDX::X3D::Sphere, Ocean::SceneDescription::SDX::X3D::ShaderPart, Ocean::SceneDescription::SDX::X3D::PointSet, Ocean::SceneDescription::SDX::X3D::PointLight, Ocean::SceneDescription::SDX::X3D::PackagedShader, Ocean::SceneDescription::SDX::X3D::OrientationInterpolator, Ocean::SceneDescription::SDX::X3D::NormalInterpolator, Ocean::SceneDescription::SDX::X3D::NavigationInfo, Ocean::SceneDescription::SDX::X3D::MultiTextureTransform, Ocean::SceneDescription::SDX::X3D::MultiTexture, Ocean::SceneDescription::SDX::X3D::MovieTexture, Ocean::SceneDescription::SDX::X3D::Material, Ocean::SceneDescription::SDX::X3D::LOD, Ocean::SceneDescription::SDX::X3D::LiveVideoTexture, Ocean::SceneDescription::SDX::X3D::Inline, Ocean::SceneDescription::SDX::X3D::IndexedLineSet, Ocean::SceneDescription::SDX::X3D::IndexedFaceSet, Ocean::SceneDescription::SDX::X3D::ImageTexture, Ocean::SceneDescription::SDX::X3D::HeadUpTransform, Ocean::SceneDescription::SDX::X3D::FontStyle, Ocean::SceneDescription::SDX::X3D::DirectionalLight, Ocean::SceneDescription::SDX::X3D::Cylinder, Ocean::SceneDescription::SDX::X3D::CoordinateInterpolator, Ocean::SceneDescription::SDX::X3D::Cone, Ocean::SceneDescription::SDX::X3D::ComposedShader, Ocean::SceneDescription::SDX::X3D::ColorInterpolator, Ocean::SceneDescription::SDX::X3D::Box, Ocean::SceneDescription::SDX::X3D::Billboard, Ocean::SceneDescription::SDX::X3D::Background, Ocean::SceneDescription::SDX::X3D::AudioClip, and Ocean::SceneDescription::SDX::X3D::Appearance.

◆ parentNodes()

NodeRefs Ocean::SceneDescription::SDXNode::parentNodes ( ) const

Returns all parent nodes of this node.

Returns
Vector holding all father nodes of this child node

◆ registerParentNode()

void Ocean::SceneDescription::SDXNode::registerParentNode ( const NodeId  parentId)
inlineprotected

Registers a new parent node for this (child) node.

Parameters
parentIdId of the parent node to register

◆ registerThisNodeAsParent()

void Ocean::SceneDescription::SDXNode::registerThisNodeAsParent ( const SDXNodeRef child)
protected

Registers this node at a child as parent node.

Parameters
childNew child node for this node

◆ renderingObject()

virtual const Rendering::ObjectRef& Ocean::SceneDescription::SDXNode::renderingObject ( ) const
virtual

Returns the associated rendering object.

Returns
Associated rendering object

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

◆ sceneId()

SceneId Ocean::SceneDescription::SDXNode::sceneId ( ) const
inline

Returns the unique id of the scene defining this node originally.

Returns
Unique scene id

◆ setAnyField()

virtual bool Ocean::SceneDescription::SDXNode::setAnyField ( const std::string &  fieldName,
const Field field 
)
virtual

Sets or changes a specified standard or dynamic field of this node.

Parameters
fieldNameName of the field to set
fieldField to replace the current field
Returns
True, if succeeded

Reimplemented in Ocean::SceneDescription::SDXDynamicNode.

◆ setField()

virtual bool Ocean::SceneDescription::SDXNode::setField ( const std::string &  fieldName,
const Field field 
)
virtual

Sets or changes a specified (standard) field of this node.

Parameters
fieldNameName of the field to set
fieldField to replace the current field
Returns
True, if succeeded

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

◆ setName()

void Ocean::SceneDescription::SDXNode::setName ( const std::string &  name)
overridevirtual

Sets the name of this node.

See also
Node::setName().

Reimplemented from Ocean::SceneDescription::Node.

◆ unregisterParentNode()

void Ocean::SceneDescription::SDXNode::unregisterParentNode ( const NodeId  parentId)
inlineprotected

Unregisters a parent node for this (child) node.

Parameters
parentIdId of the parent node to unregister

◆ unregisterThisNodeAsParent()

void Ocean::SceneDescription::SDXNode::unregisterThisNodeAsParent ( const SDXNodeRef child)
protected

Unregisters this node from a child as parent.

Parameters
childChild node to unregister

Field Documentation

◆ environment_

const SDXEnvironment* Ocean::SceneDescription::SDXNode::environment_ = nullptr
protected

Object specifying the environment of this node.

◆ initialized_

bool Ocean::SceneDescription::SDXNode::initialized_ = false
protected

State determining whether the node has been initialized already.

◆ lock_

Lock Ocean::SceneDescription::SDXNode::lock_
mutableprotected

Node lock.

◆ parents_

NodeIdMap Ocean::SceneDescription::SDXNode::parents_
protected

Map holding all parent nodes.

◆ renderingObject_

Rendering::ObjectRef Ocean::SceneDescription::SDXNode::renderingObject_
protected

Corresponding rendering object.


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