H3D::H3DNodeDatabase Struct Reference

The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with that name. More...

#include <H3D/H3DNodeDatabase.h>

List of all members.

Classes

class  FieldDBConstIterator
 The FieldDBConstIterator is an iterator class used for iterating over the field instances in an H3DNodeDatabase. More...

Public Member Functions

 H3DNodeDatabase (const string &_name, H3DCreateNodeFunc _createf, const type_info &_ti, H3DNodeDatabase *_parent=0)
 Constructor.
 H3DNodeDatabase (const type_info &_ti, H3DNodeDatabase *_parent=0)
 Unnamed constructor, for nodes that cannot be instantiated but instead act as base classes for other nodes.
void addField (FieldDBElement *f)
 add a field to the node database entry
FieldgetField (Node *n, const string &f) const
 getField() will search the node's field database for a field matching the given name and returning a pointer to the field if found.
void initFields (Node *) const
 initialise the given Node using the contents of the database - initialise field names, field owner pointers and access restrictors.
void clearDynamicFields ()
 Remove all DynamicFieldDBElements from the database.
FieldDBConstIterator fieldDBBegin ()
 Gets an iterator to the beginning first field in the H3DNodeDatabase.
FieldDBConstIterator fieldDBEnd ()
 Returns an iterator pointing at the end of fields in the H3DNodeDatabase.
size_t fieldDBSize ()
 Returns the number of fields in the H3DNodeDatabase.

Static Public Member Functions

static H3DNodeDatabaselookupTypeId (const type_info &t)
 Search the node database for an entry with a matching type_info structure.
static H3DNodeDatabaselookupName (const string &name)
 Search the node database for an entry with a matching name.
static NodecreateNode (const string &name)
 Create a new instance of a Node type.
static NodeDatabaseConstIterator begin ()
 Iterator to the first element in the database.
static NodeDatabaseConstIterator end ()
 Returns an iterator pointing at the end of the H3DNodeDatabase created.

Static Public Attributes

static H3DNodeDatabaseType * database
 The database with all H3DNodeDatabase instances.


Detailed Description

The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with that name.

Each node that is to be used via X3D file input must register itself in the database in order to be available to X3D. To register a static H3DNodeDatabase member variable must be defined in the node class with the (nodename, constructor) pair that is wanted.


Constructor & Destructor Documentation

H3DNodeDatabase::H3DNodeDatabase ( const type_info &  _ti,
H3DNodeDatabase _parent = 0 
)

Unnamed constructor, for nodes that cannot be instantiated but instead act as base classes for other nodes.

References database.


Member Function Documentation

static NodeDatabaseConstIterator H3D::H3DNodeDatabase::begin (  )  [inline, static]

Iterator to the first element in the database.

Can be used to iterate over all H3DNodeDatabase instances that have been created.

Node * H3DNodeDatabase::createNode ( const string &  name  )  [static]

Create a new instance of a Node type.

Parameters:
name The name of the node in the database.
Returns:
A new instance of the node if it exists in the database, otherwise NULL is returned.

References database.

Referenced by H3D::X3D::X3DSAX2Handlers::startElement().

FieldDBConstIterator H3D::H3DNodeDatabase::fieldDBBegin (  )  [inline]

Gets an iterator to the beginning first field in the H3DNodeDatabase.

Can be used to iteratate through all the fields in the database.

Referenced by H3D::H3DNodeDatabase::FieldDBConstIterator::FieldDBConstIterator(), H3D::PyNode::getFieldList(), and H3D::H3DNodeDatabase::FieldDBConstIterator::operator++().

Field * H3DNodeDatabase::getField ( Node n,
const string &  f 
) const

getField() will search the node's field database for a field matching the given name and returning a pointer to the field if found.

References H3D::Field::getAccessType(), and H3D::Field::INPUT_OUTPUT.

Referenced by H3D::Node::getField(), and H3D::X3D::X3DSAX2Handlers::handleFieldValueElement().

void H3DNodeDatabase::initFields ( Node n  )  const

initialise the given Node using the contents of the database - initialise field names, field owner pointers and access restrictors.

References H3D::FieldDBElement::getAccessType(), H3D::FieldDBElement::getField(), H3D::FieldDBElement::getName(), initFields(), H3D::Field::setAccessType(), H3D::Field::setName(), and H3D::Field::setOwner().

Referenced by H3D::Anchor::Anchor(), H3D::AnyDevice::AnyDevice(), H3D::Appearance::Appearance(), H3D::Arc2D::Arc2D(), H3D::ArcClose2D::ArcClose2D(), H3D::AudioClip::AudioClip(), H3D::Background::Background(), H3D::Billboard::Billboard(), H3D::BooleanFilter::BooleanFilter(), H3D::BooleanToggle::BooleanToggle(), H3D::BooleanTrigger::BooleanTrigger(), H3D::Box::Box(), H3D::Circle2D::Circle2D(), H3D::ClipPlane::ClipPlane(), H3D::Collision::Collision(), H3D::CollisionOptions::CollisionOptions(), H3D::Color::Color(), H3D::ColorInterpolator::ColorInterpolator(), H3D::ColorRGBA::ColorRGBA(), H3D::Composed3DTexture::Composed3DTexture(), H3D::ComposedCubeMapTexture::ComposedCubeMapTexture(), H3D::ComposedShader::ComposedShader(), H3D::Cone::Cone(), H3D::ConeEmitter::ConeEmitter(), H3D::Contour2D::Contour2D(), H3D::ContourPolyline2D::ContourPolyline2D(), H3D::Coordinate::Coordinate(), H3D::CoordinateInterpolator::CoordinateInterpolator(), H3D::CoordinateInterpolator2D::CoordinateInterpolator2D(), H3D::Cylinder::Cylinder(), H3D::CylinderSensor::CylinderSensor(), H3D::DebugOptions::DebugOptions(), H3D::DefaultAppearance::DefaultAppearance(), H3D::DeformableShape::DeformableShape(), H3D::DepthMapSurface::DepthMapSurface(), H3D::DeviceInfo::DeviceInfo(), H3D::DirectionalLight::DirectionalLight(), H3D::Disk2D::Disk2D(), H3D::DynamicTransform::DynamicTransform(), H3D::ElevationGrid::ElevationGrid(), H3D::ExplosionEmitter::ExplosionEmitter(), H3D::Extrusion::Extrusion(), H3D::FakeHapticsDevice::FakeHapticsDevice(), H3D::FalconDevice::FalconDevice(), H3D::FillProperties::FillProperties(), H3D::FitToBoxTransform::FitToBoxTransform(), H3D::FloatVertexAttribute::FloatVertexAttribute(), H3D::Fog::Fog(), H3D::FogCoordinate::FogCoordinate(), H3D::FontStyle::FontStyle(), H3D::ForceDimensionDevice::ForceDimensionDevice(), H3D::ForceField::ForceField(), H3D::FrictionalSurface::FrictionalSurface(), H3D::FunctionPlotTexture::FunctionPlotTexture(), H3D::GaussianFunction::GaussianFunction(), H3D::GeneralFunction::GeneralFunction(), H3D::GeneratedCubeMapTexture::GeneratedCubeMapTexture(), H3D::GeometryBoundTreeOptions::GeometryBoundTreeOptions(), H3D::GlobalSettings::GlobalSettings(), H3D::GLUTWindow::GLUTWindow(), H3D::GraphicsCachingOptions::GraphicsCachingOptions(), H3D::GravityPhysicsModel::GravityPhysicsModel(), H3D::H3DFakeHapticsDevice::H3DFakeHapticsDevice(), H3D::H3DFrictionalSurfaceNode::H3DFrictionalSurfaceNode(), H3D::H3DHapticsDevice::H3DHapticsDevice(), H3D::H3DStiffnessSurfaceNode::H3DStiffnessSurfaceNode(), H3D::H3DWindowNode::H3DWindowNode(), H3D::HapticMasterDevice::HapticMasterDevice(), H3D::HapticsOptions::HapticsOptions(), H3D::HaptikDevice::HaptikDevice(), H3D::Image3DTexture::Image3DTexture(), H3D::ImageObjectTexture::ImageObjectTexture(), H3D::ImageTexture::ImageTexture(), H3D::ImportLibrary::ImportLibrary(), H3D::IndexedFaceSet::IndexedFaceSet(), H3D::IndexedLineSet::IndexedLineSet(), H3D::IndexedTriangleFanSet::IndexedTriangleFanSet(), H3D::IndexedTriangleSet::IndexedTriangleSet(), H3D::IndexedTriangleStripSet::IndexedTriangleStripSet(), initFields(), H3D::Inline::Inline(), H3D::IntegerTrigger::IntegerTrigger(), H3D::KeySensor::KeySensor(), H3D::LineProperties::LineProperties(), H3D::LineSet::LineSet(), H3D::LoadSensor::LoadSensor(), H3D::LocalFog::LocalFog(), H3D::LOD::LOD(), H3D::MagneticGeometryEffect::MagneticGeometryEffect(), H3D::MagneticSurface::MagneticSurface(), H3D::Material::Material(), H3D::Matrix3VertexAttribute::Matrix3VertexAttribute(), H3D::Matrix4VertexAttribute::Matrix4VertexAttribute(), H3D::MatrixTransform::MatrixTransform(), H3D::MetadataDouble::MetadataDouble(), H3D::MetadataFloat::MetadataFloat(), H3D::MetadataInteger::MetadataInteger(), H3D::MetadataSet::MetadataSet(), H3D::MetadataString::MetadataString(), H3D::MouseSensor::MouseSensor(), H3D::MultiTexture::MultiTexture(), H3D::MultiTextureCoordinate::MultiTextureCoordinate(), H3D::MultiTextureTransform::MultiTextureTransform(), H3D::NavigationInfo::NavigationInfo(), H3D::NormalInterpolator::NormalInterpolator(), H3D::NurbsCurve::NurbsCurve(), H3D::NurbsCurve2D::NurbsCurve2D(), H3D::NurbsPatchSurface::NurbsPatchSurface(), H3D::NurbsTextureCoordinate::NurbsTextureCoordinate(), H3D::NurbsTrimmedSurface::NurbsTrimmedSurface(), H3D::OpenHapticsOptions::OpenHapticsOptions(), H3D::OpenHapticsSurface::OpenHapticsSurface(), H3D::OrientationInterpolator::OrientationInterpolator(), H3D::OrthoViewpoint::OrthoViewpoint(), H3D::PackagedShader::PackagedShader(), H3D::ParticleSystem::ParticleSystem(), H3D::Pixel3DTexture::Pixel3DTexture(), H3D::PixelTexture::PixelTexture(), H3D::PlanarReflector::PlanarReflector(), H3D::PlaneSensor::PlaneSensor(), H3D::PointEmitter::PointEmitter(), H3D::PointLight::PointLight(), H3D::PointNormalClipPlane::PointNormalClipPlane(), H3D::PointSet::PointSet(), H3D::Polyline2D::Polyline2D(), H3D::Polypoint2D::Polypoint2D(), H3D::PositionFunctionEffect::PositionFunctionEffect(), H3D::PositionInterpolator::PositionInterpolator(), H3D::PositionInterpolator2D::PositionInterpolator2D(), H3D::ProgramShader::ProgramShader(), H3D::ProximitySensor::ProximitySensor(), H3D::PythonScript::PythonScript(), H3D::QuanserDevice::QuanserDevice(), H3D::RawImageLoader::RawImageLoader(), H3D::Rectangle2D::Rectangle2D(), H3D::RenderProperties::RenderProperties(), H3D::RuspiniRenderer::RuspiniRenderer(), H3D::ScalarInterpolator::ScalarInterpolator(), H3D::Scene::Scene(), H3D::ShaderPart::ShaderPart(), H3D::ShaderProgram::ShaderProgram(), H3D::SimballDevice::SimballDevice(), H3D::SimpleMovieTexture::SimpleMovieTexture(), H3D::SmoothSurface::SmoothSurface(), H3D::Sound::Sound(), H3D::SpaceballSensor::SpaceballSensor(), H3D::SpaceWareHapticsDevice::SpaceWareHapticsDevice(), H3D::SpaceWareSensor::SpaceWareSensor(), H3D::Sphere::Sphere(), H3D::SphereSensor::SphereSensor(), H3D::SplinePositionInterpolator::SplinePositionInterpolator(), H3D::SplinePositionInterpolator2D::SplinePositionInterpolator2D(), H3D::SplineScalarInterpolator::SplineScalarInterpolator(), H3D::SpotLight::SpotLight(), H3D::SpringEffect::SpringEffect(), H3D::StereoInfo::StereoInfo(), H3D::StringSensor::StringSensor(), H3D::SurfaceEmitter::SurfaceEmitter(), H3D::Switch::Switch(), H3D::TexGenGeometry::TexGenGeometry(), H3D::Text::Text(), H3D::TextureBackground::TextureBackground(), H3D::TextureCoordinate::TextureCoordinate(), H3D::TextureCoordinate3D::TextureCoordinate3D(), H3D::TextureCoordinate4D::TextureCoordinate4D(), H3D::TextureCoordinateGenerator::TextureCoordinateGenerator(), H3D::TextureMatrixTransform::TextureMatrixTransform(), H3D::TextureProperties::TextureProperties(), H3D::TextureTransform3D::TextureTransform3D(), H3D::TimeFunctionEffect::TimeFunctionEffect(), H3D::TimeTrigger::TimeTrigger(), H3D::ToggleGroup::ToggleGroup(), H3D::TouchSensor::TouchSensor(), H3D::TransferFunctionTexture::TransferFunctionTexture(), H3D::Transform::Transform(), H3D::TransformInfo::TransformInfo(), H3D::TriangleFanSet::TriangleFanSet(), H3D::TriangleSet::TriangleSet(), H3D::TriangleSet2D::TriangleSet2D(), H3D::TriangleStripSet::TriangleStripSet(), H3D::TwoSidedMaterial::TwoSidedMaterial(), H3D::Viewpoint::Viewpoint(), H3D::ViewpointGroup::ViewpointGroup(), H3D::ViscosityEffect::ViscosityEffect(), H3D::VisibilitySensor::VisibilitySensor(), H3D::WindPhysicsModel::WindPhysicsModel(), H3D::WorldInfo::WorldInfo(), H3D::X3DAppearanceNode::X3DAppearanceNode(), H3D::X3DBackgroundNode::X3DBackgroundNode(), H3D::X3DBindableNode::X3DBindableNode(), H3D::X3DComposedGeometryNode::X3DComposedGeometryNode(), H3D::X3DDragSensorNode::X3DDragSensorNode(), H3D::X3DEnvironmentalSensorNode::X3DEnvironmentalSensorNode(), H3D::X3DGeometryNode::X3DGeometryNode(), H3D::X3DGroupingNode::X3DGroupingNode(), H3D::X3DInterpolatorNode::X3DInterpolatorNode(), H3D::X3DLightNode::X3DLightNode(), H3D::X3DNode::X3DNode(), H3D::X3DNurbsControlCurveNode::X3DNurbsControlCurveNode(), H3D::X3DNurbsSurfaceGeometryNode::X3DNurbsSurfaceGeometryNode(), H3D::X3DParticleEmitterNode::X3DParticleEmitterNode(), H3D::X3DParticlePhysicsModelNode::X3DParticlePhysicsModelNode(), H3D::X3DPointingDeviceSensorNode::X3DPointingDeviceSensorNode(), H3D::X3DSensorNode::X3DSensorNode(), H3D::X3DSequencerNode::X3DSequencerNode(), H3D::X3DShaderNode::X3DShaderNode(), H3D::X3DShapeNode::X3DShapeNode(), H3D::X3DSoundSourceNode::X3DSoundSourceNode(), H3D::X3DTexture2DNode::X3DTexture2DNode(), H3D::X3DTexture3DNode::X3DTexture3DNode(), H3D::X3DTextureTransform2DNode::X3DTextureTransform2DNode(), H3D::X3DTimeDependentNode::X3DTimeDependentNode(), H3D::X3DTouchSensorNode::X3DTouchSensorNode(), H3D::X3DTriggerNode::X3DTriggerNode(), H3D::X3DVertexAttributeNode::X3DVertexAttributeNode(), and H3D::X3DViewpointNode::X3DViewpointNode().


The documentation for this struct was generated from the following files:

Generated on Fri Nov 7 10:30:18 2008 for H3D API by  doxygen 1.5.7