#include <BaseObjectDescription.h>


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 |
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.
| typedef std::map<std::string,Attribute> sofa::core::objectmodel::BaseObjectDescription::AttributeMap |
Definition at line 71 of file BaseObjectDescription.h.
| sofa::core::objectmodel::BaseObjectDescription::BaseObjectDescription | ( | const char * | name = NULL, |
|
| const char * | type = NULL | |||
| ) |
| sofa::core::objectmodel::BaseObjectDescription::~BaseObjectDescription | ( | ) | [virtual] |
| 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().
| 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] |
Get the associated object (or NULL if it is not created yet).
Reimplemented in sofa::simulation::tree::xml::Element< Object >, sofa::simulation::tree::xml::Element< sofa::core::objectmodel::BaseNode >, and sofa::simulation::tree::xml::Element< sofa::core::objectmodel::BaseObject >.
Definition at line 60 of file BaseObjectDescription.cpp.
Referenced by sofa::gui::qt::SofaModeler::fileOpen(), findObject(), sofa::simulation::tree::xml::ObjectElement::initNode(), sofa::simulation::tree::xml::NodeElement::initNode(), sofa::gui::qt::GraphModeler::loadNode(), sofa::gui::qt::RealGUI::loadObject(), sofa::gui::qt::GraphModeler::loadPreset(), sofa::simulation::tree::Simulation::processXML(), sofa::simulation::tree::xml::BaseElement::pushNamedObjects(), and sofa::simulation::tree::xml::BaseElement::pushObjects().
| 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] |
Remove an attribute given its name.
Reimplemented in sofa::simulation::tree::xml::BaseElement.
Definition at line 96 of file BaseObjectDescription.cpp.
Referenced by 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::core::Mapping< BaseMeshTopology, BaseMeshTopology >::create(), sofa::component::mass::DiagonalMass< DataTypes, MassType >::parse(), and sofa::core::componentmodel::topology::BaseMeshTopology::parse().
Definition at line 116 of file BaseObjectDescription.h.
Referenced by BaseObjectDescription(), getAttribute(), sofa::simulation::tree::xml::BaseElement::getName(), sofa::simulation::tree::xml::BaseElement::getType(), sofa::simulation::tree::xml::ObjectElement::initNode(), sofa::simulation::tree::xml::DataElement::initNode(), sofa::simulation::tree::xml::BaseElement::presenceAttribute(), sofa::simulation::tree::xml::BaseElement::removeAttribute(), sofa::simulation::tree::xml::BaseElement::setAttribute(), sofa::simulation::tree::xml::BaseElement::setName(), sofa::simulation::tree::xml::BaseElement::setType(), and ~BaseObjectDescription().
1.5.7.1