16 #ifndef SURGSIM_DATASTRUCTURES_AABBTREENODE_H 17 #define SURGSIM_DATASTRUCTURES_AABBTREENODE_H 19 #include "SurgSim/DataStructures/TreeNode.h" 20 #include "SurgSim/DataStructures/AabbTreeData.h" 22 #include "SurgSim/Math/Aabb.h" 26 namespace DataStructures
54 const SurgSim::Math::Aabbd&
getAabb()
const;
56 void setAabb(
const SurgSim::Math::Aabbd& aabb);
64 void addData(
const SurgSim::Math::Aabbd& aabb,
size_t id,
size_t maxNodeData = 0);
72 void setData(
const AabbTreeData::ItemList& items,
size_t maxNodeData = 0);
81 void setData(AabbTreeData::ItemList&& items,
size_t maxNodeData);
86 void getIntersections(
const SurgSim::Math::Aabbd& aabb, std::vector<size_t>* result);
95 SurgSim::Math::Aabbd m_aabb;
void splitNode(size_t maxNodeData=0)
Splits the data into two parts, creates two children and puts the split data into the children the aa...
Definition: AabbTreeNode.cpp:35
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
AabbTreeNode()
Constructor.
Definition: AabbTreeNode.cpp:26
bool doAccept(TreeVisitor *visitor) override
Private function for use with the visitor pattern, this needs to be implemented to make the correct d...
Definition: AabbTreeNode.cpp:160
void addData(const SurgSim::Math::Aabbd &aabb, size_t id, size_t maxNodeData=0)
Add data to this node, if maxNodeData is >0 the node will split if the number of data items exceeds m...
Definition: AabbTreeNode.cpp:114
virtual ~AabbTreeNode()
Destructor.
Definition: AabbTreeNode.cpp:30
Abstract Class for visitors, this needs to be extended for other tree nodes when necessary return fal...
Definition: TreeVisitor.h:31
void getIntersections(const SurgSim::Math::Aabbd &aabb, std::vector< size_t > *result)
Fetch a list of items that have AABBs intersecting with the given AABB.
Definition: AabbTreeNode.cpp:165
Basic tree node structure.
Definition: TreeNode.h:36
void setData(const AabbTreeData::ItemList &items, size_t maxNodeData=0)
Set the data on this node, the node needs to be empty and not have any children for this to work...
Definition: AabbTreeNode.cpp:140
const SurgSim::Math::Aabbd & getAabb() const
Get the aabb of this node, it is the union of the aabb of all the items in the data when the node has...
Definition: AabbTreeNode.cpp:104
void setData(std::shared_ptr< TreeData > data)
Sets the data of this node.
Definition: TreeNode.cpp:57
Node class for the AabbTree, this handles groups of items and subdivision if the number of items gets...
Definition: AabbTreeNode.h:30