#include <Base.h>
Inheritance diagram for Physsim::Base:

Public Member Functions | |
| Base (const Base *b) | |
| virtual void | clone (BasePtr &cloned, bimap< BasePtr, BasePtr > *obj_map=NULL) const |
| Clones this object. | |
| virtual void | load_state (BaseConstPtr object, bimap< BasePtr, BasePtr > *correspondence=NULL) |
| Loads state from a Base object. | |
| virtual void | save_state (BasePtr object, bimap< BasePtr, BasePtr > *correspondence=NULL) const |
| Saves state to a Base object. | |
| virtual void | save_to_xml (XMLTreePtr node, std::list< BaseConstPtr > &shared_objects) const |
| Method for saving this object to XML. | |
| virtual void | load_from_xml (XMLTreeConstPtr node, std::map< std::string, BasePtr > &id_map) |
| Method for loading the data for this object from XML. | |
| virtual void | output_object_state (std::ostream &out) const |
| Outputs this class data to the stream. | |
| virtual bool | is_struct_identical (BaseConstPtr object) const |
| const std::string & | id () const |
| Gets the unique identifier for this object. | |
| boost::shared_ptr< void > | user_data () const |
| Gets any userdata for this class. | |
| void | user_data (boost::shared_ptr< void > data) |
| Sets userdata for this class. | |
| const std::string & | name () const |
| Gets the name for this class. | |
| void | name (const std::string &name) |
| Sets the name for this class. | |
| void | id (const std::string &ID) |
| Sets the unique ID for this object. | |
Static Public Member Functions | |
| template<class T> | |
| static boost::shared_ptr< T > | clone (boost::shared_ptr< T > x) |
| Static method for cloning a shared pointer. | |
| void Base::clone | ( | BasePtr & | cloned, | |
| bimap< BasePtr, BasePtr > * | object_map = NULL | |||
| ) | const [virtual] |
Clones this object.
Most derived implementations of the Base class will want to override this method, but should call it as soon as a pointer is constructed - this method not only stores Base data (i.e., name, id, etc.) but also puts the newly constructed object into the object map. Methods that implement this class should generally follow a prescribed behavior: if cloned is NULL on entry, the implementation should construct an object of the class type, and otherwise should populate the given object.
| cloned | a reference to the cloned pointer; if this reference is NULL on entry, the derived class should construct an instance of the derived class type and set cloned to point to it | |
| object_map | a structure (possibly NULL) that maps original pointers to their clones; because cloning is a recursive process, cloning one object will generally result in many new objects being constructed; derived classes need not add this to the map: Base::clone() does that automatically |
Reimplemented in Physsim::ADFCollisionDetection, Physsim::CollisionDetection, Physsim::CollisionGeometry, Physsim::Contact, Physsim::ContactData, Physsim::CRBAlgorithm, Physsim::EulerIntegrator, Physsim::FSABAlgorithm, Physsim::ImpulseContactSimulator, Physsim::Joint, Physsim::LCPRestingContact, Physsim::MCArticulatedBody, Physsim::MirtichRestitutionModel, Physsim::NewtonRestitutionModel, Physsim::PenaltyRestingContact, Physsim::PoissonRestitutionModel, Physsim::PQPCollisionDetection, Physsim::PrismaticJoint, Physsim::RCArticulatedBody, Physsim::RCArticulatedBodyFwdDynAlgo, Physsim::RevoluteJoint, Physsim::RigidBody, Physsim::RungeKuttaImplicitIntegrator, Physsim::RungeKuttaIntegrator, Physsim::Simulator, Physsim::SphericalJoint, Physsim::ThreshContactSimulator, Physsim::UniversalJoint, and Physsim::Visualizable.
| void Base::load_state | ( | BaseConstPtr | object, | |
| bimap< BasePtr, BasePtr > * | correspondence = NULL | |||
| ) | [virtual] |
Loads state from a Base object.
| the | object from which to load this | |
| bimap | a pointer to a bidirectional map from objects being loaded to the objects being used to load them Loading/saving object state are similar to cloning, but without new objects being constructed; existing objects are used instead. Naturally, the object must have the same structure. This can be guaranteed by cloning this and then saving and loading states between this and the clone. |
Reimplemented in Physsim::ADFCollisionDetection, Physsim::CollisionDetection, Physsim::CollisionGeometry, Physsim::Contact, Physsim::ContactData, Physsim::CRBAlgorithm, Physsim::ImpulseContactSimulator, Physsim::Joint, Physsim::LCPRestingContact, Physsim::MCArticulatedBody, Physsim::MirtichRestitutionModel, Physsim::NewtonRestitutionModel, Physsim::PenaltyRestingContact, Physsim::PoissonRestitutionModel, Physsim::PQPCollisionDetection, Physsim::PrismaticJoint, Physsim::RCArticulatedBody, Physsim::RCArticulatedBodyFwdDynAlgo, Physsim::RevoluteJoint, Physsim::RigidBody, Physsim::Simulator, Physsim::SphericalJoint, Physsim::ThreshContactSimulator, Physsim::UniversalJoint, and Physsim::Visualizable.
| void Base::save_state | ( | BasePtr | object, | |
| bimap< BasePtr, BasePtr > * | correspondence = NULL | |||
| ) | const [virtual] |
Saves state to a Base object.
| the | object to which to save this | |
| bimap | a pointer to a bidirectional map from objects being saved to the objects being saved to Loading/saving object state are similar to cloning, but without new objects being constructed; existing objects are used instead. Naturally, the object must have the same structure. This can be guaranteed by cloning this and then saving and loading states between this and the clone. |
Reimplemented in Physsim::ADFCollisionDetection, Physsim::CollisionDetection, Physsim::CollisionGeometry, Physsim::Contact, Physsim::ContactData, Physsim::CRBAlgorithm, Physsim::FSABAlgorithm, Physsim::ImpulseContactSimulator, Physsim::Joint, Physsim::LCPRestingContact, Physsim::MCArticulatedBody, Physsim::MirtichRestitutionModel, Physsim::NewtonRestitutionModel, Physsim::PenaltyRestingContact, Physsim::PoissonRestitutionModel, Physsim::PQPCollisionDetection, Physsim::PrismaticJoint, Physsim::RCArticulatedBody, Physsim::RCArticulatedBodyFwdDynAlgo, Physsim::RevoluteJoint, Physsim::RigidBody, Physsim::Simulator, Physsim::SphericalJoint, Physsim::ThreshContactSimulator, Physsim::UniversalJoint, and Physsim::Visualizable.
| void Base::save_to_xml | ( | XMLTreePtr | node, | |
| std::list< BaseConstPtr > & | shared_objects | |||
| ) | const [virtual] |
Method for saving this object to XML.
| node | the XML node to which this object should be serialized | |
| on | output, a list of shared objects which should also be serialized |
Reimplemented in Physsim::ADFCollisionDetection, Physsim::Box, Physsim::CollisionDetection, Physsim::CollisionGeometry, Physsim::ContactData, Physsim::CRBAlgorithm, Physsim::Cylinder, Physsim::EulerIntegrator, Physsim::FSABAlgorithm, Physsim::ImpulseContactSimulator, Physsim::Joint, Physsim::LCPRestingContact, Physsim::MCArticulatedBody, Physsim::MirtichRestitutionModel, Physsim::NewtonRestitutionModel, Physsim::StaticFrictionInfo, Physsim::PenaltyRestingContact, Physsim::PoissonRestitutionModel, Physsim::PQPCollisionDetection, Physsim::Primitive, Physsim::PrismaticJoint, Physsim::RCArticulatedBody, Physsim::RevoluteJoint, Physsim::RigidBody, Physsim::RungeKuttaImplicitIntegrator, Physsim::RungeKuttaIntegrator, Physsim::Simulator, Physsim::SoSeparatorWrapper, Physsim::Sphere, Physsim::SphericalJoint, Physsim::ThreshContactSimulator, Physsim::TriangleMesh, Physsim::UniversalJoint, and Physsim::Visualizable.
| void Base::load_from_xml | ( | XMLTreeConstPtr | node, | |
| std::map< std::string, BasePtr > & | id_map | |||
| ) | [virtual] |
Method for loading the data for this object from XML.
| node | the subtree under which all data necessary to load this object is stored | |
| id_map | a map from node IDs to read objects |
Reimplemented in Physsim::ADFCollisionDetection, Physsim::Box, Physsim::CollisionDetection, Physsim::CollisionGeometry, Physsim::ContactData, Physsim::CRBAlgorithm, Physsim::Cylinder, Physsim::EulerIntegrator, Physsim::FSABAlgorithm, Physsim::ImpulseContactSimulator, Physsim::Joint, Physsim::LCPRestingContact, Physsim::MCArticulatedBody, Physsim::MirtichRestitutionModel, Physsim::NewtonRestitutionModel, Physsim::StaticFrictionInfo, Physsim::PenaltyRestingContact, Physsim::PoissonRestitutionModel, Physsim::PQPCollisionDetection, Physsim::Primitive, Physsim::PrismaticJoint, Physsim::RCArticulatedBody, Physsim::RevoluteJoint, Physsim::RigidBody, Physsim::RungeKuttaImplicitIntegrator, Physsim::RungeKuttaIntegrator, Physsim::Simulator, Physsim::SoSeparatorWrapper, Physsim::Sphere, Physsim::SphericalJoint, Physsim::ThreshContactSimulator, Physsim::TriangleMesh, Physsim::UniversalJoint, and Physsim::Visualizable.
| void Base::output_object_state | ( | std::ostream & | out | ) | const [virtual] |
Outputs this class data to the stream.
This method outputs all of the low-level details to the stream; if serialization is desired, use save_to_xml() instead.
Reimplemented in Physsim::CollisionDetection, Physsim::ImpulseContactSimulator, Physsim::RigidBody, and Physsim::ThreshContactSimulator.
| const std::string & Base::id | ( | ) | const |
Gets the unique identifier for this object.
If the unique identifier has not been set already, this method will return a string version of this.
1.5.1