iso::space::Neighbors Class Reference

container class for space neighbor groups More...

#include <iso_space_neighbors.h>

Collaboration diagram for iso::space::Neighbors:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Neighbors (SpaceObject *pSpaceObject)
 create neighbor collection
 ~Neighbors ()
 destructor
unsigned int neighborGroupCount () const
 return number of neighbor groups
bool checkNeighborGroup (const base::String &pSpaceName)
 check whether neighbor collection for space exists
unsigned int neighborGroupIndex (const base::String &pSpaceName)
 return neighbor group index
NeighborGroupneighborGroup (unsigned int pIndex)
 return neighbor collection based on index
NeighborGroupneighborGroup (const base::String &pSpaceName)
 return neighbor collection for a particular space
void addNeighborGroup (NeighborGroup *pNeighborGroup)
 add new neighbor group
void removeNeighborGroup (NeighborGroup *pNeighborGroup)
 remove neighbor group
bool canHaveNeighbors (const base::String &pSpaceName) const
 check whether this object can have neighbors in a particular space
bool visible (const base::String &pSpaceName) const
 check whether this object is visible or not
void setVisible (bool pVisible)
 set object visibility in all spaces
void setVisible (const base::String &pSpaceName, bool pVisible)
 set object visibility in particular space
real neighborRadius (const base::String &pSpaceName) const
 return neighbor radius
bool replaceNeighborMode (const base::String &pSpaceName) const
unsigned int maxNeighborCount (const base::String &pSpaceName) const
 return maximum number of neighbors
unsigned int neighborCount (const base::String &pSpaceName) const
 return number of neighbors
bool full (const base::String &pSpaceName) const
 returns true if no more neighbors can be added to neighbor list
SpaceObjectneighbor (const base::String &pSpaceName, unsigned int pIndex)
 return neighboring space object
const math::Vector< real > & direction (const base::String &pSpaceName, unsigned int pIndex) const
 return direction vector pointing to neighboring space object
real distance (const base::String &pSpaceName, unsigned int pIndex) const
 return distance to neighboring space object
QVector< SpaceNeighborRelation * > & neighborRelations (const base::String &pSpaceName)
 return neighbor relations
SpaceNeighborRelationneighborRelation (const base::String &pSpaceName, unsigned int pIndex)
 return neighbor relation
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 from all spaces
void removeNeighbors (const base::String &pSpaceName)
 remove all neighbors from a single space
virtual base::String info (int pPropagationLevel=0) const
 print neighbor group information

Protected Member Functions

 Neighbors ()
 default constructor

Protected Attributes

SpaceObjectmSpaceObject
 space object this neighborlists is part of
data::IndexHash< base::String,
NeighborGroup
mNeighborGroups
 storage for single space neighbor collections

Friends

std::ostream & operator<< (std::ostream &pOstream, const Neighbors &pNeighborGroup)
 retrieve textual neighbor group info

Detailed Description

container class for space neighbor groups

for space neighbor groups

Created by Daniel Bisig on 10/6/07.


Constructor & Destructor Documentation

Neighbors::Neighbors ( SpaceObject pSpaceObject  ) 

create neighbor collection

Parameters:
pSpaceObject space object this neighbor collection is part of

Neighbors::~Neighbors (  ) 

destructor

Neighbors::Neighbors (  )  [protected]

default constructor


Member Function Documentation

unsigned int Neighbors::neighborGroupCount (  )  const

return number of neighbor groups

Returns:
number of neighbor groups

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

check whether neighbor collection for space exists

Parameters:
pSpaceName space name
Returns:
true, if it exists, false otherwise

unsigned int Neighbors::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 & Neighbors::neighborGroup ( unsigned int  pIndex  ) 

return neighbor collection based on index

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

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

return neighbor collection for a particular space

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

void Neighbors::addNeighborGroup ( NeighborGroup pNeighborGroup  ) 

add new neighbor group

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

void Neighbors::removeNeighborGroup ( NeighborGroup pNeighborGroup  ) 

remove neighbor group

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

bool Neighbors::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

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

check whether this object is visible 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 Neighbors::setVisible ( bool  pVisible  ) 

set object visibility in all spaces

Parameters:
pVisible object visibility

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

set object visibility in particular space

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

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

return neighbor radius

Returns:
neighbor radius
Remarks:
fails if space object is not in particular space or cannot have neighbors in that particular space

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

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

return maximum number of neighbors

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

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

return number of neighbors

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

bool Neighbors::full ( const base::String &  pSpaceName  )  const

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

Parameters:
pSpaceName space name
Remarks:
fails if space object is not in particular space or cannot have neighbors in that particular space

SpaceObject * Neighbors::neighbor ( const base::String &  pSpaceName,
unsigned int  pIndex 
)

return neighboring space object

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

const math::Vector< space::real > & Neighbors::direction ( const base::String &  pSpaceName,
unsigned int  pIndex 
) const

return direction vector pointing to neighboring space object

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

space::real Neighbors::distance ( const base::String &  pSpaceName,
unsigned int  pIndex 
) const

return distance to neighboring space object

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

QVector< SpaceNeighborRelation * > & Neighbors::neighborRelations ( const base::String &  pSpaceName  ) 

return neighbor relations

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

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

return neighbor relation

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

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

add neighbor object to neighbor list

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

bool Neighbors::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 space 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 cannot have neighbors in that particular space
creates new neighbor relation

void Neighbors::removeNeighbors (  ) 

remove all neighbors from all spaces

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

remove all neighbors from a single space

Remarks:
fails if space object is not in particular space or cannot have neighbors in that particular space

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

print neighbor group information

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


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const Neighbors pNeighborGroup 
) [friend]

retrieve textual neighbor group info

Parameters:
pOstream output text stream
pNeighborGroup neighbor group


Member Data Documentation

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

space object this neighborlists is part of

data::IndexHash<base::String, NeighborGroup> iso::space::Neighbors::mNeighborGroups [protected]

storage for single space neighbor collections


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