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>
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.
§ Item
§ AabbTreeData() [1/4]
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
| ) |
|
§ AabbTreeData() [2/4]
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
const AabbTreeData & |
data | ) |
|
§ AabbTreeData() [3/4]
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
const std::list< Item > & |
data | ) |
|
|
explicit |
Constructor with list of items.
§ AabbTreeData() [4/4]
SurgSim::DataStructures::AabbTreeData::AabbTreeData |
( |
std::list< Item > && |
data | ) |
|
|
explicit |
Constructor with moveable list of items.
§ ~AabbTreeData()
SurgSim::DataStructures::AabbTreeData::~AabbTreeData |
( |
| ) |
|
§ add()
Add an item to the data.
- Parameters
-
aabb | the AABB of the item |
id | an object identifier assigned by the user of this class |
§ getAabb()
- Returns
- the combined AABB of all the contained items
§ getIntersections()
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 |
§ getSize()
size_t SurgSim::DataStructures::AabbTreeData::getSize |
( |
| ) |
const |
- Returns
- the number of items
§ hasIntersections()
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.
§ isEmpty()
bool SurgSim::DataStructures::AabbTreeData::isEmpty |
( |
| ) |
const |
- Returns
- true when there are no items, false otherwise
§ isEqual()
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.
§ recalculateAabb()
void SurgSim::DataStructures::AabbTreeData::recalculateAabb |
( |
| ) |
|
|
private |
Recalculate the aabb of this class, in case items where updated.
§ takeLargerElements()
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.
§ m_aabb
§ m_data
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: