Public Types | |
enum | DangerLevel { UNKNOWN = 0, NONE = 1, LOW = 2, MEDIUM = 4, HIGH = 8 } |
Public Member Functions | |
unsigned long | insertElement (const Vector3D &vecPosition, unsigned long nLevel, unsigned long nBitMask=0xffffffff) |
unsigned long | insertElement (const CSWMapElement &element, unsigned long nBitMask=0xffffffff) |
bool | isEmpty () const |
void | clear () |
CSWMapElement | findElementByID (unsigned long nID) |
CSWMapElement | findNearestElement (const Vector3D &vecPosition, double fRadius, unsigned long nLevel, unsigned long nNotLevel=0) |
std::vector< CSWMapElement > | findElements (const Vector3D &vecPosition, double fRadius, unsigned long nLevel, unsigned long nNotLevel=0) |
int | removeElements (unsigned long nLevel, unsigned long nNotLevel=0) |
int | removeElements (const Vector3D &vecPosition, double fRadius, unsigned long nLevel, unsigned long nNotLevel=0) |
enum CSWMap::DangerLevel |
The level of danger of objects in the map.
unsigned long CSWMap::insertElement | ( | const Vector3D & | vecPosition, | |
unsigned long | nLevel, | |||
unsigned long | nBitMask = 0xffffffff | |||
) |
Inserts an element with the given position and danger level to the map. That means an element is inserted or replacing an existing near element.
vecPosition | The position of the element in world coordinate system that should be inserted. | |
nLevel | The danger level regarding to the element. | |
nBitMask | The bitmask that is ANDed to the found elements level before ORing the given new nLevel. foundElement.nLevel' = (foundElement.nLevel & nBitMask) | nLevel |
unsigned long CSWMap::insertElement | ( | const CSWMapElement & | element, | |
unsigned long | nBitMask = 0xffffffff | |||
) |
Inserts an element to the map. That means an element is inserted or replacing an existing near element. The set velocity of the given element is ignored.
element | The element that should be inserted. | |
nBitMask | The bitmask that is ANDed to the found elements level before ORing the given new nLevel. foundElement.nLevel' = (foundElement.nLevel & nBitMask) | element.nLevel |
bool CSWMap::isEmpty | ( | ) | const |
Returns true if the map contains nothing.
void CSWMap::clear | ( | ) |
Clears the map.
CSWMapElement CSWMap::findElementByID | ( | unsigned long | nID | ) |
Finds the element in the map which has the given id.
nID | The id of the element which should be found. |
CSWMapElement CSWMap::findNearestElement | ( | const Vector3D & | vecPosition, | |
double | fRadius, | |||
unsigned long | nLevel, | |||
unsigned long | nNotLevel = 0 | |||
) |
Finds the nearest element in the map that is in radius to the given position and with the given danger level.
vecPosition | The position to which the nearest element should be found. | |
fRadius | The radius around the given position that should be checked. | |
nLevel | The danger level that must full fill the found element. | |
nNotLevel | The danger level that must not full fill the found element. |
std::vector< CSWMapElement > CSWMap::findElements | ( | const Vector3D & | vecPosition, | |
double | fRadius, | |||
unsigned long | nLevel, | |||
unsigned long | nNotLevel = 0 | |||
) |
Finds the elements in the map that are in radius to the given position and with the given danger level.
vecPosition | The position to which the elements should be found. | |
fRadius | The radius around the given position that should be checked. | |
nLevel | The danger level that must full fill the found elements. | |
nNotLevel | The danger level that must not full fill the found element. |
int CSWMap::removeElements | ( | unsigned long | nLevel, | |
unsigned long | nNotLevel = 0 | |||
) |
Removes elements in the map with the given danger level.
nLevel | The danger level that must full fill the deleted elements. | |
nNotLevel | The danger level that must not full fill the deleted element. |
int CSWMap::removeElements | ( | const Vector3D & | vecPosition, | |
double | fRadius, | |||
unsigned long | nLevel, | |||
unsigned long | nNotLevel = 0 | |||
) |
Removes elements in the map that are in radius to the given position and with the given danger level.
vecPosition | The position to which the elements should be deleted. | |
fRadius | The radius around the given position that should be checked. | |
nLevel | The danger level that must full fill the deleted elements. | |
nNotLevel | The danger level that must not full fill the deleted element. |