Ocean
|
This class implements the base class for all SDX scene description nodes. More...
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::EngineRef & | engine () 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::ObjectRef & | renderingObject () 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 Field & | field (const std::string &fieldName) const |
Returns the field base of a specified (standard) field. More... | |
Field & | field (const std::string &fieldName) |
Returns the field base of a specified (standard) field. More... | |
virtual const Field & | anyField (const std::string &fieldName) const |
Returns the field base of a specified standard or dynamic field. More... | |
virtual Field & | anyField (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... | |
Node & | operator= (const Node &node)=delete |
Disabled copy operator. More... | |
Protected Attributes | |
const SDXEnvironment * | environment_ = 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... | |
NodeSpecification * | specification_ = 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 Lock & | nodeIdCounterLock () |
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... | |
This class implements the base class for all SDX scene description nodes.
typedef std::unordered_map<NodeId, unsigned int> Ocean::SceneDescription::SDXNode::NodeIdMap |
Definition of a map mapping node ids to reference counters.
|
explicitprotected |
Creates a new node object.
environment | Node environment |
|
overrideprotected |
Destructs a node object.
SDXNodeSet Ocean::SceneDescription::SDXNode::ancestorNodes | ( | ) | const |
Returns all ancestor nodes of this node.
|
overridevirtual |
Returns the scene description type of this node.
Implements Ocean::SceneDescription::Node.
|
inline |
Returns the rendering engine used by this node.
|
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!
|
virtual |
Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
scene | Rendering scene node |
timestamp | Initialization timestamp |
reinitialize | True, if a reinitialization has to be done |
Reimplemented in Ocean::SceneDescription::SDXScene.
|
inline |
Returns the name of the scene description library defining this node.
|
protectedvirtual |
Event function to inform the node about a changed field.
fieldName | Name 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.
|
protectedvirtual |
Internal event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
scene | Rendering scene node |
timestamp | Initialization 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.
NodeRefs Ocean::SceneDescription::SDXNode::parentNodes | ( | ) | const |
Returns all parent nodes of this node.
|
inlineprotected |
Registers a new parent node for this (child) node.
parentId | Id of the parent node to register |
|
protected |
Registers this node at a child as parent node.
child | New child node for this node |
|
virtual |
Returns the associated rendering object.
Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DScene.
|
inline |
Returns the unique id of the scene defining this node originally.
|
virtual |
Sets or changes a specified standard or dynamic field of this node.
fieldName | Name of the field to set |
field | Field to replace the current field |
Reimplemented in Ocean::SceneDescription::SDXDynamicNode.
|
virtual |
Sets or changes a specified (standard) field of this node.
fieldName | Name of the field to set |
field | Field to replace the current field |
Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DNode.
|
overridevirtual |
Sets the name of this node.
Reimplemented from Ocean::SceneDescription::Node.
|
inlineprotected |
Unregisters a parent node for this (child) node.
parentId | Id of the parent node to unregister |
|
protected |
Unregisters this node from a child as parent.
child | Child node to unregister |
|
protected |
Object specifying the environment of this node.
|
protected |
State determining whether the node has been initialized already.
|
protected |
Map holding all parent nodes.
|
protected |
Corresponding rendering object.