#include <archon/x3d/server/type.H>
Collaboration diagram for Archon::X3D::NodeType:
Public Types | |
typedef vector< const NodeType * >::const_iterator | iterator |
Must be called with a scenegraph read lock. | |
Public Member Functions | |
unsigned long | getIndex () const |
Ref< NodeBase > | instantiate (BackRef< ExecutionContext > context) const |
Instantiate a new node of this type. | |
string | getName () const |
Get the name of this node type. | |
string | getContainerField () const |
Name of default container field for use in the XML parser. | |
bool | isAbstract () const |
bool | isVirtualBase () const |
bool | isInternalUseOnly () const |
bool | isDerivedFrom (const NodeType *baseType) const |
bool | isUserInstantiable () const |
May this node be instantiated through the X3D parser and the SAI? | |
unsigned long | getNumberOfImmediateFields () const |
Get the number fields defined by this node type excluding those fields inherited from other node types. | |
const FieldBase * | getImmediateField (unsigned long fieldIndex) const |
Get an immediate field by index. | |
const FieldBase * | lookupImmediateField (string name) const |
Like NodeType::lookupField except that this method does not include the fields of the base node types from which this one is derived. | |
const FieldBase * | lookupField (string name) const |
Search for a field of the specified name in this node type. | |
const NodeFieldBase * | lookupNodeField (const NodeType *) const |
Seach for a private or exposed node field whos type is a base type of the argument type. | |
void | setFields (const vector< const FieldBase * > *fields) |
You may use this method to assign a set of fields to a NodeType. | |
bool | changedSince (const NodeBase *, const Time &) const |
Must be called with a scenegraph read lock. | |
void | describe (Logger *) const |
iterator | derivedFromBegin () const |
iterator | derivedFromEnd () const |
Static Public Member Functions | |
static unsigned long | getTotalNumber () |
static const NodeType * | get (unsigned long index) |
Fetch an X3D node type by index. | |
static const NodeType * | lookup (const string &nodeTypeName) |
Lookup an X3D node type by name. | |
static const NodeType * | newAbstract (string name, bool virtualBase, const vector< const FieldBase * > *fields) |
static const NodeType * | newAbstract (string name, bool virtualBase, const vector< const FieldBase * > *fields, const NodeType *derivedFrom1) |
static const NodeType * | newAbstract (string name, bool virtualBase, const vector< const FieldBase * > *fields, const NodeType *derivedFrom1, const NodeType *derivedFrom2) |
static const NodeType * | newConcrete (string name, string conatinerField, Ref< NodeBase >(*instanceMaker)(BackRef< ExecutionContext >), const vector< const FieldBase * > *fields, const NodeType *derivedFrom1) |
static const NodeType * | newConcrete (string name, string conatinerField, Ref< NodeBase >(*instanceMaker)(BackRef< ExecutionContext >), const vector< const FieldBase * > *fields, const NodeType *derivedFrom1, const NodeType *derivedFrom2) |
static void | describeAll (Logger *) |
Static Public Attributes | |
static const int | maxIndexBits = 7 |
Examples of field types are: Group, Transform...
Node types may inherit fields from other node type through multiple iheritance. There are two restrictions though: The inheritance graph may not by cyclic (of cause), and the names of all local and inherited fields must be individually unique in every node type. This includes all set_* and *_changed variants.
There is a last restriction relating to the way XML encoded X3D documents are parsed: Among all local and inherited fields which are private or exposed and of node type (SFNode and MFNode), no two may have the same node type associated with them. Neither may the node type of one node field be derived in one or more steps from the node type of another such node field. This enables the XML parser to uniquely determine into which field a sub node must be placed.
Definition at line 288 of file type.H.
|
Name of default container field for use in the XML parser. Is always the empty string for abstract node types. Definition at line 326 of file type.H. Referenced by Archon::X3D::XML::Parser::parseStartElement(). |
|
Get an immediate field by index. The immediate fields are those defined directly by this type. Fields inherited from other node types are not included. The order in force is that given by the node type specifications in ISO/IEC 19775-1 section 7 - 30. Definition at line 358 of file type.H. Referenced by Archon::X3D::FieldBase::fetch(). |
|
Definition at line 127 of file type.C. Referenced by Archon::X3D::SAI::Session::createNode(). |
|
Instantiate a new node of this type. The new node will be linked ti the specified ExecutionContext. Definition at line 145 of file type.C. Referenced by Archon::X3D::SAI::Session::createNode(), Archon::Raytracer::main(), Archon::X3D::XML::Parser::parseStartElement(), and Archon::X3D::VRML::Parser::Context::pushNodeInstance(). |
|
Lookup an X3D node type by name.
Definition at line 139 of file type.C. Referenced by Archon::X3D::SAI::Session::createNode(), Archon::X3D::XML::Parser::parseStartElement(), and Archon::X3D::VRML::Parser::Context::pushNodeInstance(). |
|
Search for a field of the specified name in this node type. 'set_*' and '*_changed' variants are tryed automatically.
Definition at line 183 of file type.C. Referenced by Archon::X3D::UrlObject::addUri(), Archon::X3D::NodeBase::lookupField(), Archon::X3D::XML::Parser::parseStartElement(), and Archon::X3D::Viewer::ShapeCache::ShapeCache(). |
|
Like NodeType::lookupField except that this method does not include the fields of the base node types from which this one is derived. Also, this method does not detect the 'set_*' and '*_changed' variants of the field names, only the base names are included in the search. Definition at line 190 of file type.C. References Archon::X3D::FieldBase::getName(). |
|
Seach for a private or exposed node field whos type is a base type of the argument type. If more than one such field exists, the first one will be returned. Currently used only through the XML parser.
Definition at line 200 of file type.C. References Archon::X3D::FieldBase::getIsEventSource(), Archon::X3D::FieldBase::getIsEventTarget(), Archon::X3D::NodeFieldBase::getNodeType(), and isDerivedFrom(). Referenced by Archon::X3D::XML::Parser::parseStartElement(). |
|
You may use this method to assign a set of fields to a NodeType. Doing this will erase all previously specified fields for this NodeType. IMPORTANT: If this method is called on a NodeType after that same NodeType was specified as a base type for another NodeType, then this method has to be called on the derived NodeType afterwards, and this applies recursivly. Definition at line 106 of file type.C. References maxIndexBits. |