Internal class to hold a list of AABBs and their respective object ids, it can calculate the elements that intersect with a given aabb each node in the AABB tree holds one of these.
More...
#include <SurgSim/DataStructures/AabbTreeData.h>
|
void | recalculateAabb () |
| Recalculate the aabb of this class, in case items where updated. More...
|
|
virtual bool | isEqual (const TreeData *data) const override |
| Returns true if the trees are equal; otherwise, returns false. More...
|
|
Internal class to hold a list of AABBs and their respective object ids, it can calculate the elements that intersect with a given aabb each node in the AABB tree holds one of these.
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
| ) |
|
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
const AabbTreeData & |
data | ) |
|
SurgSim::DataStructures::AabbTreeData::~AabbTreeData |
( |
| ) |
|
Add an item to the data.
- Parameters
-
aabb | the AABB of the item |
id | an object identifier assigned by the user of this class |
- Returns
- the combined AABB of all the contained items
void SurgSim::DataStructures::AabbTreeData::getIntersections |
( |
const SurgSim::Math::Aabbd & |
aabb, |
|
|
std::list< size_t > * |
result |
|
) |
| const |
Check all items bounding boxes against the one passed as a parameter and append items that overlap to the list given as a parameter.
- Parameters
-
| aabb | the bounding box being queried |
[out] | result | list to be used for intersecting items |
size_t SurgSim::DataStructures::AabbTreeData::getSize |
( |
| ) |
const |
- Returns
- the number of items
bool SurgSim::DataStructures::AabbTreeData::hasIntersections |
( |
const SurgSim::Math::Aabbd & |
aabb | ) |
const |
Check whether there could be any intersections with a given bounding box.
- Parameters
-
aabb | bounding box to use for the intersection check. |
- Returns
- true if the given AABB intersects with the AABB of all contained items.
bool SurgSim::DataStructures::AabbTreeData::isEmpty |
( |
| ) |
const |
- Returns
- true when there are no items, false otherwise
bool SurgSim::DataStructures::AabbTreeData::isEqual |
( |
const TreeData * |
data | ) |
const |
|
overrideprivatevirtual |
Returns true if the trees are equal; otherwise, returns false.
Implement this method in derived classes to do the comparison.
- Parameters
-
- Returns
- true if the data are equal; otherwise, returns false.
Implements SurgSim::DataStructures::TreeData.
void SurgSim::DataStructures::AabbTreeData::recalculateAabb |
( |
| ) |
|
|
private |
Recalculate the aabb of this class, in case items where updated.
std::shared_ptr< AabbTreeData > SurgSim::DataStructures::AabbTreeData::takeLargerElements |
( |
| ) |
|
Split the current items into two geometric halves, keep the first half and return a pointer to the second half.
The split is done along the longest axis of the enclosing aabb, the center of this axis is the point where the split occurs. This object will keep items that have a smaller coordinate than the center, the result will receive all items that have a larger coordinate on the determined axis.
- Returns
- AabbTreeData with the items to the right of the center of the longest axis.
std::list<Item> SurgSim::DataStructures::AabbTreeData::m_data |
|
private |
The items that were added to this list.
The documentation for this class was generated from the following files: