sofa::core::objectmodel::BaseObjectDescription Class Reference

Base Interface for classes containing the description of an object, used to construct it. More...

#include <BaseObjectDescription.h>

Inheritance diagram for sofa::core::objectmodel::BaseObjectDescription:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::objectmodel::BaseObjectDescription:

Collaboration graph
[legend]

Data Structures

class  Attribute

Public Types

typedef std::map< std::string,
Attribute > 
AttributeMap

Public Member Functions

 BaseObjectDescription (const char *name=NULL, const char *type=NULL)
virtual ~BaseObjectDescription ()
virtual Base * getObject ()
 Get the associated object (or NULL if it is not created yet).
virtual std::string getName ()
 Get the object instance name.
virtual BaseObjectDescription * getParent () const
 Get the parent node.
virtual std::string getBaseFile ()
 Get the file where this description was read from. Useful to resolve relative file paths.
template<class T >
void getAttributeList (T &container)
virtual BaseObjectDescription * find (const char *nodeName, bool absolute=false)
 Find an object description given its name (relative to this object).
virtual Base * findObject (const char *nodeName)
 Find an object given its name (relative to this object).
virtual const char * getAttribute (const std::string &attr, const char *defaultVal=NULL)
 Get an attribute given its name (return defaultVal if not present).
virtual bool removeAttribute (const std::string &attr)
 Remove an attribute given its name.
virtual std::string getFullName ()
 Get the full name of this object (i.e. concatenation if all the names of its ancestors and itself).

Protected Attributes

AttributeMap attributes

Detailed Description

Base Interface for classes containing the description of an object, used to construct it.

This class defines what informations are used as input (read from a file for instance) to create an object. This default implementation simply stores an attributes map and does not support any hierarchy.

Definition at line 52 of file BaseObjectDescription.h.


Member Typedef Documentation

Definition at line 71 of file BaseObjectDescription.h.


Constructor & Destructor Documentation

sofa::core::objectmodel::BaseObjectDescription::BaseObjectDescription ( const char *  name = NULL,
const char *  type = NULL 
)

Definition at line 41 of file BaseObjectDescription.cpp.

References attributes.

sofa::core::objectmodel::BaseObjectDescription::~BaseObjectDescription (  )  [virtual]

Definition at line 49 of file BaseObjectDescription.cpp.

References attributes.


Member Function Documentation

BaseObjectDescription * sofa::core::objectmodel::BaseObjectDescription::find ( const char *  nodeName,
bool  absolute = false 
) [virtual]

Find an object description given its name (relative to this object).

Reimplemented in sofa::simulation::tree::xml::BaseElement.

Definition at line 90 of file BaseObjectDescription.cpp.

Referenced by findObject().

Base * sofa::core::objectmodel::BaseObjectDescription::findObject ( const char *  nodeName  )  [virtual]

Find an object given its name (relative to this object).

Find an object given its name.

Definition at line 122 of file BaseObjectDescription.cpp.

References find(), sofa::core::objectmodel::BaseContext::getMechanicalState(), and getObject().

Referenced by sofa::component::topology::Triangle2EdgeTopologicalMapping::canCreate(), sofa::component::topology::Tetra2TriangleTopologicalMapping::canCreate(), sofa::component::topology::Quad2TriangleTopologicalMapping::canCreate(), sofa::component::topology::Hexa2QuadTopologicalMapping::canCreate(), sofa::component::topology::Edge2QuadTopologicalMapping::canCreate(), sofa::component::constraint::UnilateralInteractionConstraint< sofa::defaulttype::StdVectorTypes >::canCreate(), sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::canCreate(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::canCreate(), sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::canCreate(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::canCreate(), sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::canCreate(), sofa::component::topology::Triangle2EdgeTopologicalMapping::create(), sofa::component::topology::Tetra2TriangleTopologicalMapping::create(), sofa::component::topology::Quad2TriangleTopologicalMapping::create(), sofa::component::topology::Hexa2QuadTopologicalMapping::create(), sofa::component::topology::Edge2QuadTopologicalMapping::create(), sofa::component::constraint::UnilateralInteractionConstraint< sofa::defaulttype::StdVectorTypes >::create(), sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::create(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::create(), sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::create(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::create(), and sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::create().

const char * sofa::core::objectmodel::BaseObjectDescription::getAttribute ( const std::string &  attr,
const char *  defaultVal = NULL 
) [virtual]

Get an attribute given its name (return defaultVal if not present).

Definition at line 102 of file BaseObjectDescription.cpp.

References attributes.

Referenced by sofa::component::topology::Triangle2EdgeTopologicalMapping::canCreate(), sofa::component::topology::Tetra2TriangleTopologicalMapping::canCreate(), sofa::component::topology::Quad2TriangleTopologicalMapping::canCreate(), sofa::component::topology::Hexa2QuadTopologicalMapping::canCreate(), sofa::component::topology::Edge2QuadTopologicalMapping::canCreate(), sofa::component::constraint::UnilateralInteractionConstraint< sofa::defaulttype::StdVectorTypes >::canCreate(), sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::canCreate(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::canCreate(), sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::canCreate(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::canCreate(), sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::canCreate(), sofa::component::topology::Triangle2EdgeTopologicalMapping::create(), sofa::component::topology::Tetra2TriangleTopologicalMapping::create(), sofa::component::topology::Quad2TriangleTopologicalMapping::create(), sofa::component::topology::create(), sofa::component::topology::Hexa2QuadTopologicalMapping::create(), sofa::component::topology::Edge2QuadTopologicalMapping::create(), sofa::component::constraint::UnilateralInteractionConstraint< sofa::defaulttype::StdVectorTypes >::create(), sofa::helper::create(), sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::create(), sofa::core::componentmodel::behavior::PairInteractionForceField< DataTypes >::create(), sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::create(), sofa::core::componentmodel::behavior::MixedInteractionForceField< DataTypes1, DataTypes2 >::create(), sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::create(), sofa::core::ObjectFactory::createObject(), getName(), sofa::simulation::tree::xml::DataElement::initNode(), sofa::simulation::tree::xml::AttributeElement::initNode(), sofa::component::visualmodel::VisualModelImpl::parse(), sofa::component::visualmodel::OglTexture2D::parse(), sofa::component::topology::RegularGridTopology::parse(), sofa::component::topology::GridTopology::parse(), sofa::component::topology::CubeTopology::parse(), sofa::component::MechanicalObject< DataTypes >::parse(), sofa::component::mass::UniformMass< DataTypes, MassType >::parse(), sofa::component::mass::DiagonalMass< DataTypes, MassType >::parse(), sofa::component::mapping::SkinningMapping< BasicMapping >::parse(), sofa::component::mapping::ImplicitSurfaceMapping< In, Out >::parse(), sofa::component::forcefield::TetrahedronFEMForceField< DataTypes >::parse(), sofa::component::forcefield::TetrahedralCorotationalFEMForceField< DataTypes >::parse(), sofa::component::forcefield::SpringForceField< DataTypes >::parse(), sofa::component::forcefield::SparseGridSpringForceField< DataTypes >::parse(), sofa::component::forcefield::RegularGridSpringForceField< DataTypes >::parse(), sofa::component::forcefield::MeshSpringForceField< DataTypes >::parse(), sofa::core::objectmodel::Base::parse(), sofa::core::componentmodel::topology::BaseMeshTopology::parse(), sofa::component::visualmodel::OgreVisualModel::parse(), SofaFlowVR::FlowVRRenderMesh::parse(), and sofa::simulation::tree::xml::recReplaceAttribute().

template<class T >
void sofa::core::objectmodel::BaseObjectDescription::getAttributeList ( T &  container  )  [inline]

Definition at line 93 of file BaseObjectDescription.h.

Referenced by SofaFlowVR::FlowVRRenderMesh::parse().

std::string sofa::core::objectmodel::BaseObjectDescription::getBaseFile (  )  [virtual]

Get the file where this description was read from. Useful to resolve relative file paths.

Reimplemented in sofa::simulation::tree::xml::BaseElement.

Definition at line 78 of file BaseObjectDescription.cpp.

std::string sofa::core::objectmodel::BaseObjectDescription::getFullName (  )  [virtual]

Get the full name of this object (i.e. concatenation if all the names of its ancestors and itself).

Definition at line 111 of file BaseObjectDescription.cpp.

References getFullName(), getName(), and getParent().

Referenced by getFullName(), sofa::simulation::tree::xml::ObjectElement::initNode(), and sofa::simulation::tree::xml::BaseElement::pushNamedObjects().

std::string sofa::core::objectmodel::BaseObjectDescription::getName (  )  [virtual]

Get the object instance name.

Reimplemented in sofa::simulation::tree::xml::BaseElement.

Definition at line 66 of file BaseObjectDescription.cpp.

References getAttribute().

Referenced by getFullName().

Base * sofa::core::objectmodel::BaseObjectDescription::getObject (  )  [virtual]

BaseObjectDescription * sofa::core::objectmodel::BaseObjectDescription::getParent (  )  const [virtual]

Get the parent node.

Reimplemented in sofa::simulation::tree::xml::BaseElement.

Definition at line 72 of file BaseObjectDescription.cpp.

Referenced by getFullName().

bool sofa::core::objectmodel::BaseObjectDescription::removeAttribute ( const std::string &  attr  )  [virtual]


Field Documentation


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

Generated on Sun Nov 23 04:23:43 2008 for Sofa by  doxygen 1.5.7.1