16 #ifndef SURGSIM_DATASTRUCTURES_AABBTREE_H 17 #define SURGSIM_DATASTRUCTURES_AABBTREE_H 22 #include "SurgSim/DataStructures/Tree.h" 23 #include "SurgSim/DataStructures/AabbTreeData.h" 24 #include "SurgSim/Math/Aabb.h" 29 namespace DataStructures
46 explicit AabbTree(
size_t maxObjectsPerNode);
58 void add(
const SurgSim::Math::Aabbd& aabb,
size_t objectId);
62 void set(
const AabbTreeData::ItemList& items);
66 void set(AabbTreeData::ItemList&& items);
69 const SurgSim::Math::Aabbd&
getAabb()
const;
84 std::vector<TreeNodePairType>* result)
const;
86 void updateBounds(
const std::vector<Math::Aabbd>& bounds);
93 size_t m_maxObjectsPerNode;
96 std::shared_ptr<AabbTreeNode> m_typedRoot;
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Basic tree structure.
Definition: Tree.h:32
std::pair< AabbTreeNode *, AabbTreeNode * > TreeNodePairType
Type indicating a relationship between two AabbTreeNodes.
Definition: AabbTree.h:72
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:37
const SurgSim::Math::Aabbd & getAabb() const
Definition: AabbTree.cpp:69
virtual ~AabbTree()
Destructor.
Definition: AabbTree.cpp:40
size_t getMaxObjectsPerNode() const
Definition: AabbTree.cpp:64
std::vector< TreeNodePairType > spatialJoin(const AabbTree &otherTree) const
Query to find all pairs of intersecting nodes between two aabb r-trees.
Definition: AabbTree.cpp:74
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
Node class for the AabbTree, this handles groups of items and subdivision if the number of items gets...
Definition: AabbTreeNode.h:30