16 #ifndef SURGSIM_DATASTRUCTURES_AABBTREE_H 17 #define SURGSIM_DATASTRUCTURES_AABBTREE_H 28 namespace DataStructures
45 explicit AabbTree(
size_t maxObjectsPerNode);
61 void set(
const std::list<AabbTreeData::Item>& items);
65 void set(std::list<AabbTreeData::Item>&& items);
71 typedef std::pair<std::shared_ptr<AabbTreeNode>, std::shared_ptr<AabbTreeNode>>
TreeNodePairType;
82 void spatialJoin(std::shared_ptr<AabbTreeNode> lhsParent,
83 std::shared_ptr<AabbTreeNode> rhsParent,
84 std::list<TreeNodePairType>* result)
const;
Definition: CompoundShapeToGraphics.cpp:29
Basic tree structure.
Definition: Tree.h:32
AabbTree is a tree that is organized by the bounding boxes of the referenced objects, the bounding box used is the Axis Aligned Bounding Box (AABB), with the extents of an AABB describing the min and max of each coordinate for the given object.
Definition: AabbTree.h:36
const SurgSim::Math::Aabbd & getAabb() const
Definition: AabbTree.cpp:69
Eigen::AlignedBox< double, 3 > Aabbd
Wrapper around the Eigen type.
Definition: Aabb.h:30
virtual ~AabbTree()
Destructor.
Definition: AabbTree.cpp:40
std::list< TreeNodePairType > spatialJoin(const AabbTree &otherTree) const
Query to find all pairs of intersecting nodes between two aabb r-trees.
Definition: AabbTree.cpp:74
size_t getMaxObjectsPerNode() const
Definition: AabbTree.cpp:64
size_t m_maxObjectsPerNode
Number of objects in a node that will trigger a split.
Definition: AabbTree.h:89
void add(const SurgSim::Math::Aabbd &aabb, size_t objectId)
Add a give object identified by objectId to the tree, this id should be unqiue on the users side...
Definition: AabbTree.cpp:45
AabbTree()
Constructor.
Definition: AabbTree.cpp:26
std::pair< std::shared_ptr< AabbTreeNode >, std::shared_ptr< AabbTreeNode > > TreeNodePairType
Type indicating a relationship between two AabbTreeNodes.
Definition: AabbTree.h:71
std::shared_ptr< AabbTreeNode > m_typedRoot
A typed version of the root for access without typecasting.
Definition: AabbTree.h:92