iso::space::SpaceObject Class Reference

an object in n-dimensional space More...

#include <iso_space_object.h>

Inherited by iso::space::SpaceShape.

Inheritance diagram for iso::space::SpaceObject:

Inheritance graph
[legend]
Collaboration diagram for iso::space::SpaceObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SpaceObject (unsigned int pDim)
 class name create space object
 SpaceObject (const math::Vector< real > &pPosition)
 create space object
 SpaceObject (SpaceObject &pSpaceObject)
 copy constructor
virtual ~SpaceObject ()
 destructor
unsigned int id () const
 return space object id
unsigned int dim () const
 return space object dimension
math::Vector< real > & position ()
 return space object position
const math::Vector< real > & position () const
 return space object position
virtual void setPosition (const math::Vector< real > &pPosition)
 set space object position
virtual void changePosition (const math::Vector< real > &pPosition)
 change space object position
bool checkNeighborGroup (const base::String &pSpaceName) const
 check whether space object has neighor group for particular space
void addNeighborGroup (NeighborGroup *pNeighborGroup)
 add new neighbor group
void removeNeighborGroup (NeighborGroup *pNeighborGroup)
 remove neighbor group
bool visible (const base::String &pSpaceName) const
 check whether this object is visible in a particular space or not
void setVisible (bool pVisible)
 set object visibility in all spaces
void setVisible (const base::String &pSpaceName, bool pVisible)
 set object visibility in a particular space
Neighborsneighbors ()
 return neighbors
unsigned int neighborGroupIndex (const base::String &pSpaceName)
 return neighbor group index
NeighborGroupneighborGroup (unsigned int pIndex)
 return neighbor group based on index
NeighborGroupneighborGroup (const base::String &pSpaceName)
 return neighbor group
SpaceneighborSpace (const base::String &pSpaceName)
 return neighbor space
bool canHaveNeighbors (const base::String &pSpaceName) const
 check whether this object can have neighbors in a particular space
unsigned int maxNeighborCount (const base::String &pSpaceName) const
 return number maximum of neighbors
unsigned int neighborCount (const base::String &pSpaceName) const
 return number of neighbors
real neighborRadius (const base::String &pSpaceName) const
 return neighbor radius
bool replaceNeighborMode (const base::String &pSpaceName) const
virtual SpaceObjectneighbor (const base::String &pSpaceName, unsigned int pIndex)
 return neighboring object
SpaceNeighborRelationneighborRelation (const base::String &pSpaceName, unsigned int pIndex)
 return neighbor relation
bool neighborListFull (const base::String &pSpaceName) const
 returns true if no more neighbors can be added to neighbor list
bool addNeighbor (const base::String &pSpaceName, SpaceObject *pNeighborObject)
 add neighbor object to neighbor list
bool addNeighbor (const base::String &pSpaceName, SpaceObject *pNeighborObject, real pDistance, const math::Vector< real > &pDirection)
 add neighbor object to neighbor list
void removeNeighbors ()
 remove all neighbors in all spaces
void removeNeighbors (const base::String &pSpaceName)
 remove all neighbors in particular space
virtual base::String info (int pPropagationLevel=0) const
 obtain textual space object information

Static Public Attributes

static const base::String sClassName

Protected Member Functions

 SpaceObject ()
 space object count default constructor

Protected Attributes

unsigned int mId
unsigned int mDim
 unique id
math::Vector< realmPosition
 dimension
NeighborsmNeighbors
 position

Static Protected Attributes

static unsigned int sObjectCount

Friends

class SpaceProxyObject
std::ostream & operator<< (std::ostream &pOstream, const SpaceObject &pSpaceObject)
 retrieve textual space object info

Detailed Description

an object in n-dimensional space

in n-dimensional space

class representing an object in n-dimensional space.
the class can possess neigboring space objects that are organized as neighbor relations in neighbor groups.

Created by Daniel Bisig on 3/23/07.


Constructor & Destructor Documentation

SpaceObject::SpaceObject ( unsigned int  pDim  ) 

class name create space object

Parameters:
pDim dimension of parameter (> 0)

SpaceObject::SpaceObject ( const math::Vector< real > &  pPosition  ) 

create space object

Parameters:
pPosition position of object

SpaceObject::SpaceObject ( SpaceObject pSpaceObject  ) 

copy constructor

Parameters:
pSpaceObject space object to copy

SpaceObject::~SpaceObject (  )  [virtual]

destructor

SpaceObject::SpaceObject (  )  [protected]

space object count default constructor


Member Function Documentation

unsigned int SpaceObject::id (  )  const

return space object id

Returns:
space object id

unsigned int SpaceObject::dim (  )  const

return space object dimension

Returns:
space object dimension

math::Vector< space::real > & SpaceObject::position (  ) 

return space object position

Returns:
space object position

const math::Vector< space::real > & SpaceObject::position (  )  const

return space object position

Returns:
space object position

void SpaceObject::setPosition ( const math::Vector< real > &  pPosition  )  [virtual]

set space object position

Parameters:
pPosition space object position
Remarks:
fails if new position has wrong dimension

Reimplemented in iso::space::SpaceShape.

void SpaceObject::changePosition ( const math::Vector< real > &  pPosition  )  [virtual]

change space object position

Parameters:
pPosition space object position offset
Remarks:
fails if object is not in particular space

Reimplemented in iso::space::SpaceShape.

bool SpaceObject::checkNeighborGroup ( const base::String &  pSpaceName  )  const

check whether space object has neighor group for particular space

Parameters:
pSpaceName space name
Returns:
true if it has neighbor group for particular space, false otherwise

void SpaceObject::addNeighborGroup ( NeighborGroup pNeighborGroup  ) 

add new neighbor group

Parameters:
pNeighborGroup new neighbor group
Remarks:
fails if neighbor group for the associated space already exists

void SpaceObject::removeNeighborGroup ( NeighborGroup pNeighborGroup  ) 

remove neighbor group

Parameters:
pNeighborGroup neighbor group to remove
Remarks:
fails if neighbor group for the associated space already exists

bool SpaceObject::visible ( const base::String &  pSpaceName  )  const

check whether this object is visible in a particular space or not

Parameters:
pSpaceName name of space
Returns:
true: object is visible, false: otherwise
Remarks:
fails if object is not in particular space
a visible object can be a neighbor for another object in the same space, an invisible can't

void SpaceObject::setVisible ( bool  pVisible  ) 

set object visibility in all spaces

Parameters:
pVisible object visibility

void SpaceObject::setVisible ( const base::String &  pSpaceName,
bool  pVisible 
)

set object visibility in a particular space

Parameters:
pSpaceName name of space
pVisible object visibility
Remarks:
fails if object is not in particular space

Neighbors & SpaceObject::neighbors (  ) 

return neighbors

Returns:
neighbors

unsigned int SpaceObject::neighborGroupIndex ( const base::String &  pSpaceName  ) 

return neighbor group index

Parameters:
pSpaceName space name
Returns:
neighbor group index
Remarks:
fails if space object is not in particular space or can have neighbors in that particular space

NeighborGroup & SpaceObject::neighborGroup ( unsigned int  pIndex  ) 

return neighbor group based on index

Parameters:
pIndex neighbor group index
Returns:
neighbor group
Remarks:
fails if index is out of bounds

NeighborGroup & SpaceObject::neighborGroup ( const base::String &  pSpaceName  ) 

return neighbor group

Parameters:
pSpaceName space name
Returns:
neighbor group
Remarks:
fails if space object is not in particular space or can have neighbors in that particular space

Space & SpaceObject::neighborSpace ( const base::String &  pSpaceName  ) 

return neighbor space

Parameters:
pSpaceName space name
Returns:
neighbor space
Remarks:
fails if space object is not in particular space

bool SpaceObject::canHaveNeighbors ( const base::String &  pSpaceName  )  const

check whether this object can have neighbors in a particular space

Parameters:
pSpaceName space name
Returns:
true: object can have neighbors, false: object can't have neighbors
Remarks:
fails if object is not in particular space

unsigned int SpaceObject::maxNeighborCount ( const base::String &  pSpaceName  )  const

return number maximum of neighbors

Parameters:
pSpaceName space name
Returns:
maximum number of neighbors
Remarks:
fails if object is not in particular space

unsigned int SpaceObject::neighborCount ( const base::String &  pSpaceName  )  const

return number of neighbors

Parameters:
pSpaceName space name
Returns:
number of neighbors
Remarks:
fails if object is not in particular space

space::real SpaceObject::neighborRadius ( const base::String &  pSpaceName  )  const

return neighbor radius

Parameters:
pSpaceName space name
Returns:
neighbor radius
Remarks:
fails if object is not in particular space

bool SpaceObject::replaceNeighborMode ( const base::String &  pSpaceName  )  const

SpaceObject * SpaceObject::neighbor ( const base::String &  pSpaceName,
unsigned int  pIndex 
) [virtual]

return neighboring object

Parameters:
pSpaceName space name
pIndex neighboring object index
Returns:
object
Remarks:
fails space object is not in particular space or if this object cannot have any neighbors or if pIndex is out of bounds

SpaceNeighborRelation * SpaceObject::neighborRelation ( const base::String &  pSpaceName,
unsigned int  pIndex 
)

return neighbor relation

Parameters:
pSpaceName space name
pIndex neighbor index
Returns:
neighbor relation
Remarks:
fails space object is not in particular space or if this object cannot have any neighbors or if pIndex is out of bounds

bool SpaceObject::neighborListFull ( const base::String &  pSpaceName  )  const

returns true if no more neighbors can be added to neighbor list

Parameters:
pSpaceName space name
Remarks:
fails space object is not in particular space

bool SpaceObject::addNeighbor ( const base::String &  pSpaceName,
SpaceObject pNeighborObject 
)

add neighbor object to neighbor list

Parameters:
pSpaceName space name
pNeighborObject neighbor object
Returns:
true, if neighbor object could be added, false otherwise
Remarks:
fails if space object is not in particular space or can have neighbors in that particular space

bool SpaceObject::addNeighbor ( const base::String &  pSpaceName,
SpaceObject pNeighborObject,
real  pDistance,
const math::Vector< real > &  pDirection 
)

add neighbor object to neighbor list

Parameters:
pSpaceName space name
pNeighborObject neighbor object
pDistance distance
pDirection direction
Returns:
true, if neighbor object could be added, false otherwise
Remarks:
fails if space object is not in particular space or can have neighbors in that particular space

void SpaceObject::removeNeighbors (  ) 

remove all neighbors in all spaces

void SpaceObject::removeNeighbors ( const base::String &  pSpaceName  ) 

remove all neighbors in particular space

Parameters:
pSpaceName space name
Remarks:
fails if space object is not in particular space

base::String SpaceObject::info ( int  pPropagationLevel = 0  )  const [virtual]

obtain textual space object information

Parameters:
pPropagationLevel how far the propagation method proceeds through composite classes (-1: unlimited, 0: no proceeding, >0: limited proceeding)

Reimplemented in iso::space::SpaceShape.


Friends And Related Function Documentation

friend class SpaceProxyObject [friend]

std::ostream& operator<< ( std::ostream &  pOstream,
const SpaceObject pSpaceObject 
) [friend]

retrieve textual space object info

Parameters:
pOstream output text stream
pSpaceObject space object


Member Data Documentation

const base::String SpaceObject::sClassName [static]

unsigned int SpaceObject::sObjectCount [static, protected]

unsigned int iso::space::SpaceObject::mId [protected]

unsigned int iso::space::SpaceObject::mDim [protected]

unique id

math::Vector<real> iso::space::SpaceObject::mPosition [protected]

dimension

Neighbors* iso::space::SpaceObject::mNeighbors [protected]

position


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:08:15 2011 for iso_space by  doxygen 1.5.1