45 AnyNumber< SFNode > > > {
49 AUTOREF_DEBUG_NAME( value,
"SFNode::value" )
58 AUTOREF_DEBUG_NAME( value,
"SFNode::value" )
63 return classTypeName();
73 virtual X3DTypes::X3DType
getX3DType() {
return X3DTypes::SFNODE; }
77 Node *pn = getPrototypeNode( n );
82 virtual Node *preOnRemove( Node *n ) {
83 Node *pn = getPrototypeNode( n );
88 Node *getPrototypeNode( Node *n );
96 template<
class NodeType >
109 if( !
dynamic_cast< NodeType *
>( n ) ) {
110 Node *pi = getPrototypeNode( n );
111 if( !
dynamic_cast< NodeType *
>( pi ) ) {
113 s <<
"Expecting " <<
typeid( NodeType ).
name();
126 #ifdef DISABLE_PROTOTYPENODE
135 Node *pn = getPrototypeNode( n );
137 return static_cast< NodeType *
>( pn );
139 return static_cast< NodeType *
>( n );
157 template<
class Type >
162 if( !
dynamic_cast< Type *
>( n ) ) {
163 Node *pi = getPrototypeNode( n );
164 if( !
dynamic_cast< Type *
>( pi ) ) {
166 s <<
"Expecting " <<
typeid( Type ).
name();
178 Node *pn = getPrototypeNode( n );
180 return reinterpret_cast< Type *
>( pn );
182 return reinterpret_cast< Type *
>( n );
#define H3D_FULL_LOCATION
Contains different templates to modify field behaviour.
Contains the RefCountSField class.
std::string getTypeName() const
The Field class.
Definition: Field.h:46
string name
The name of the field.
Definition: Field.h:312
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
RefCountSField is almost like any SField but it encapsulates a pointer to a RefCountedClass.
Definition: RefCountSField.h:42
virtual void onAdd(Node *n)
This function will be called when the value of RefCountSField changes.
Definition: RefCountSField.h:164
virtual Node * getValue(int id=0)
Get the value of the field.
Definition: RefCountSField.h:217
SFNode is almost like any SField but it encapsulates a pointer to a Node.
Definition: SFNode.h:45
SFNode(Node *_value)
Constructor.
Definition: SFNode.h:53
virtual string getTypeName()
Returns a string name for this field type i.e. SFNode.
Definition: SFNode.h:62
virtual X3DTypes::X3DType getX3DType()
Returns the X3DType of the field.
Definition: SFNode.h:73
SFNode()
Constructor.
Definition: SFNode.h:48
static string classTypeName()
Returns a string name for this field type i.e. SFNode.
Definition: SFNode.h:67
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Template to make sure that the Node that is set in a SFNode is of a specified type.
Definition: SFNode.h:158
virtual void onAdd(Node *n)
We check that the type of the Node is of the correct type.
Definition: SFNode.h:161
virtual Type * getCastedValue(int id=0)
Get the value casted to the Type.
Definition: SFNode.h:176
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
NodeType typed_class_type
The subclass of value_type of that the TypedSFNode has made sure that the node is of.
Definition: SFNode.h:101
virtual NodeType * getValue(int id=0)
Get the value casted to the NodeType.
Definition: SFNode.h:123
virtual NodeType * getCastedValue(int id=0)
Get the value casted to the NodeType.
Definition: SFNode.h:133
virtual void onAdd(Node *n)
We check that the type of the Node is of the correct type.
Definition: SFNode.h:108
NodeType * typed_value_type
A pointer type to the subclass value_type of that the TypedSFNode has made sure that the node is of.
Definition: SFNode.h:104
H3D API namespace.
Definition: Anchor.h:38
The AnyNumber template can be used in the OptionalArgTypes argument of a TypedField template instanti...
Definition: TypedFieldCheck.h:72