OpenSim::ObjectGroup Class Reference

A class implementing an object group. More...

#include <ObjectGroup.h>

Inheritance diagram for OpenSim::ObjectGroup:
OpenSim::Object

List of all members.

Public Member Functions

 ObjectGroup ()
 Default constructor.
 ObjectGroup (const std::string &aName)
 ObjectGroup (const ObjectGroup &aGroup)
 Copy constructor.
virtual ~ObjectGroup ()
 Destructor.
virtual Objectcopy () const
 Copy this muscle group and return a pointer to the copy.
ObjectGroupoperator= (const ObjectGroup &aGroup)
 Assignment operator.
void copyData (const ObjectGroup &aGroup)
 Copy data members from one ObjectGroup to another.
bool contains (const std::string &aName) const
void add (Object *aObject)
 Add an object to the group.
void remove (const Object *aObject)
 Remove an object from the group.
void replace (const Object *aOldObject, Object *aNewObject)
 Replace an object in the group with another object.
void setup (ArrayPtrs< Object > &aObjects)
 Set up the group, after the member names have been deserialized.
const Array< Object * > & getMembers () const
 OPENSIM_DECLARE_DERIVED (ObjectGroup, Object)

Protected Attributes

PropertyStrArray _memberNamesProp
Array< std::string > & _memberNames
Array< Object * > _memberObjects

Detailed Description

A class implementing an object group.

For most uses, object groups are owned and managed by the Set that contains the object.

Author:
Peter Loan
Version:
1.0

Constructor & Destructor Documentation

ObjectGroup::ObjectGroup (  ) 

Default constructor.

OpenSim::ObjectGroup::ObjectGroup ( const std::string &  aName  ) 
ObjectGroup::ObjectGroup ( const ObjectGroup aGroup  ) 

Copy constructor.

Parameters:
aGroup Group to be copied.
ObjectGroup::~ObjectGroup (  )  [virtual]

Destructor.


Member Function Documentation

void ObjectGroup::add ( Object aObject  ) 

Add an object to the group.

Parameters:
aObject pointer to the object.
bool OpenSim::ObjectGroup::contains ( const std::string &  aName  )  const
Object * ObjectGroup::copy (  )  const [virtual]

Copy this muscle group and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this group.

Reimplemented from OpenSim::Object.

void ObjectGroup::copyData ( const ObjectGroup aGroup  ) 

Copy data members from one ObjectGroup to another.

Parameters:
aGroup ObjectGroup to be copied.
const Array<Object*>& OpenSim::ObjectGroup::getMembers (  )  const [inline]
OpenSim::ObjectGroup::OPENSIM_DECLARE_DERIVED ( ObjectGroup  ,
Object   
)
ObjectGroup & ObjectGroup::operator= ( const ObjectGroup aGroup  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

void ObjectGroup::remove ( const Object aObject  ) 

Remove an object from the group.

Parameters:
aObject pointer to the object.
void ObjectGroup::replace ( const Object aOldObject,
Object aNewObject 
)

Replace an object in the group with another object.

Parameters:
aOldObject pointer to the old object.
aNewObject pointer to the new object.
void ObjectGroup::setup ( ArrayPtrs< Object > &  aObjects  ) 

Set up the group, after the member names have been deserialized.

For each member name, if the name is the name of an object in aObject (the objects in the set that this group belongs to), then store a pointer to the object in the same index in _memberObjects as the name is in _memberNames. If the member name does not correspond to an object in aObjects, remove the name from _memberNames.

Parameters:
aObjects list of objects that are in the set that this group belongs to.

Member Data Documentation

Array<std::string>& OpenSim::ObjectGroup::_memberNames [protected]

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

Generated on Wed Dec 16 15:03:40 2009 for OpenSim by  doxygen 1.6.1