31 ,
public std::enable_shared_from_this<CompoundRigidBody>
37 std::string expandStr;
38 std::vector<std::shared_ptr<RigidBody> > rigidBody;
45 if(rigidBody_->name.empty())
throw std::runtime_error(
"the object to be added must have a name");
46 for(
auto & i : rigidBody)
47 if(i->name==rigidBody_->name)
throw std::runtime_error(
"a object of the same name already exists");
48 rigidBody.push_back(rigidBody_);
49 rigidBody_->parent.reset();
50 rigidBody_->compound=shared_from_this();
53 std::vector<std::shared_ptr<RigidBody> >& getRigidBodies() {
60 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent)
override;
63 void setExpand(
bool expand) { expandStr=(expand)?
"true":
"false"; }
65 bool getExpand() {
return expandStr==
"true"?
true:
false; }
Definition compoundrigidbody.h:33
void setExpand(bool expand)
Definition compoundrigidbody.h:63
void addRigidBody(const std::shared_ptr< RigidBody > &rigidBody_)
Definition compoundrigidbody.h:44
void initializeUsingXML(xercesc::DOMElement *element) override
Definition compoundrigidbody.cc:47
Abstract base class for all rigid bodies.
Definition rigidbody.h:68