Ocean
|
This class is the base class for all scene description nodes. More...
Data Structures | |
class | NodeSpecification |
This class implements a node specification object. More... | |
Public Types | |
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 | |
virtual DescriptionType | descriptionType () const =0 |
Returns the scene description type of this node. More... | |
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... | |
virtual void | setName (const std::string &name) |
Sets the name of this node. 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 Types | |
typedef std::map< std::string, Field * > | FieldMap |
Definition of a map mapping field names to fields. More... | |
Protected Member Functions | |
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... | |
Static Protected Member Functions | |
static Lock & | nodeIdCounterLock () |
Returns the lock for the node id counter. More... | |
Protected Attributes | |
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... | |
Static Protected Attributes | |
static NodeId | nodeIdCounter_ |
Unique node id counter. More... | |
Friends | |
class | Ocean::ObjectRef< Node > |
This class is the base class for all scene description nodes.
|
protected |
Definition of a map mapping field names to fields.
Definition of different field access types.
Enumerator | |
---|---|
ACCESS_NONE | No access possible, which can be a static field. |
ACCESS_GET | Read only field. |
ACCESS_SET | Write only field. |
ACCESS_GET_SET | Read and write field. |
ACCESS_EXPLICIT_NOTIFICATION | Field which will produce an explicit update event if it receives a new value. |
|
protected |
Creates a new node.
|
protecteddelete |
Disabled copy constructor.
node | Object which would be copied |
|
protectedvirtual |
Destructs a node.
|
virtual |
Returns the field base of a specified standard or dynamic field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the (standard or dynamic) field to return |
Is | thrown if the field does not exist |
Reimplemented in Ocean::SceneDescription::DynamicNode.
T & Ocean::SceneDescription::Node::anyField | ( | const std::string & | fieldName | ) |
Returns a specified standard or dynamic field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
|
virtual |
Returns the field base of a specified standard or dynamic field.
fieldName | Name of the (standard or dynamic) field to return |
Is | thrown if the field does not exist |
Reimplemented in Ocean::SceneDescription::DynamicNode.
const T & Ocean::SceneDescription::Node::anyField | ( | const std::string & | fieldName | ) | const |
Returns a specified standard or dynamic field.
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
|
pure virtual |
Returns the scene description type of this node.
Implemented in Ocean::SceneDescription::SDXNode, and Ocean::SceneDescription::SDLNode.
Field& Ocean::SceneDescription::Node::field | ( | const std::string & | fieldName | ) |
Returns the field base of a specified (standard) field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
T & Ocean::SceneDescription::Node::field | ( | const std::string & | fieldName | ) |
Returns a specified (standard) field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
const Field& Ocean::SceneDescription::Node::field | ( | const std::string & | fieldName | ) | const |
Returns the field base of a specified (standard) field.
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
const T & Ocean::SceneDescription::Node::field | ( | const std::string & | fieldName | ) | const |
Returns a specified (standard) field.
fieldName | Name of the field to return |
Is | thrown if the field does not exist |
FieldAccessType Ocean::SceneDescription::Node::fieldAccessType | ( | const std::string & | fieldName | ) | const |
Returns the access type of a specified field.
fieldName | Name of the field to check |
Is | thrown if the field does not exist |
unsigned int Ocean::SceneDescription::Node::fieldDimension | ( | const std::string & | fieldName | ) | const |
Return the dimension of a special field.
fieldName | Name of the field |
Is | thrown if the field does not exist |
Field::Type Ocean::SceneDescription::Node::fieldType | ( | const std::string & | fieldName | ) | const |
Returns the type of a special field.
fieldName | Name of the field |
Is | thrown if the field does not exist |
|
virtual |
Returns whether this node has a special standard or dynamic field.
fieldName | Name of the field |
Reimplemented in Ocean::SceneDescription::DynamicNode.
bool Ocean::SceneDescription::Node::hasField | ( | const std::string & | fieldName | ) | const |
Returns whether this node has a special (standard) field.
fieldName | Name of the field |
|
inline |
Returns the unique node id of this node.
|
virtual |
Returns whether this node can hold dynamic generated field.
Reimplemented in Ocean::SceneDescription::DynamicNode.
|
inline |
Returns the name of this node.
|
staticprotected |
Returns the lock for the node id counter.
|
protectedvirtual |
Returns the address of the most derived object.
Each derived (not abstract) class must reimplement this function to guarantee a valid field mapping.
Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DScene, Ocean::SceneDescription::SDX::X3D::WorldInfo, Ocean::SceneDescription::SDX::X3D::Viewpoint, Ocean::SceneDescription::SDX::X3D::Transform, Ocean::SceneDescription::SDX::X3D::TrackerTransform, Ocean::SceneDescription::SDX::X3D::TouchSensor, Ocean::SceneDescription::SDX::X3D::TimeTrigger, 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::StaticGroup, Ocean::SceneDescription::SDX::X3D::SpotLight, Ocean::SceneDescription::SDX::X3D::Sphere, Ocean::SceneDescription::SDX::X3D::Shape, Ocean::SceneDescription::SDX::X3D::ShaderProgram, Ocean::SceneDescription::SDX::X3D::ShaderPart, Ocean::SceneDescription::SDX::X3D::ScalarInterpolator, Ocean::SceneDescription::SDX::X3D::ProximitySensor, Ocean::SceneDescription::SDX::X3D::PositionInterpolator2D, Ocean::SceneDescription::SDX::X3D::PositionInterpolator, 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::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::Group, Ocean::SceneDescription::SDX::X3D::FontStyle, Ocean::SceneDescription::SDX::X3D::DirectionalLight, Ocean::SceneDescription::SDX::X3D::Cylinder, Ocean::SceneDescription::SDX::X3D::CoordinateInterpolator, Ocean::SceneDescription::SDX::X3D::Coordinate, Ocean::SceneDescription::SDX::X3D::Cone, Ocean::SceneDescription::SDX::X3D::ComposedShader, Ocean::SceneDescription::SDX::X3D::ColorInterpolator, Ocean::SceneDescription::SDX::X3D::Color, Ocean::SceneDescription::SDX::X3D::Box, Ocean::SceneDescription::SDX::X3D::BooleanTrigger, Ocean::SceneDescription::SDX::X3D::BooleanToggle, Ocean::SceneDescription::SDX::X3D::BooleanFilter, Ocean::SceneDescription::SDX::X3D::Billboard, Ocean::SceneDescription::SDX::X3D::Background, Ocean::SceneDescription::SDX::X3D::AudioClip, and Ocean::SceneDescription::SDX::X3D::Appearance.
Disabled copy operator.
node | Object which would be copied |
|
virtual |
Tries to translate an alias field name to the original field name.
fieldName | Name of the alias field to return the original field name for |
Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DNode.
|
protected |
|
virtual |
Sets the name of this node.
name | The name of this node to set |
Reimplemented in Ocean::SceneDescription::SDXNode.
|
inline |
Returns the type of this node.
|
friend |
|
protected |
Node name.
|
protected |
Unique node id.
|
staticprotected |
Unique node id counter.
|
protected |
Pointer to the node specification, guaranteed to exist as long as the node exist.
This pointer has to be set in derivated classes. Because it's not a pointer only the object is not disposed.