Public Member Functions | Private Attributes | List of all members
SurgSim::DataStructures::AabbTreeIntersectionVisitor Class Reference

Visitor class to collect the items that intersect with a given bounding box. More...

#include <SurgSim/DataStructures/AabbTreeIntersectionVisitor.h>

Inheritance diagram for SurgSim::DataStructures::AabbTreeIntersectionVisitor:
SurgSim::DataStructures::TreeVisitor

Public Member Functions

 AabbTreeIntersectionVisitor ()
 Constructor. More...
 
 AabbTreeIntersectionVisitor (const SurgSim::Math::Aabbd &aabb)
 Constructor. More...
 
virtual ~AabbTreeIntersectionVisitor ()
 Destructor. More...
 
bool handle (TreeNode *node) override
 Handle TreeNode basic type. More...
 
bool handle (AabbTreeNode *node) override
 Handle AabbTreeNode basic type, default body, override for specific work. More...
 
bool hasIntersections () const
 
void reset ()
 Resets the data in the tree. More...
 
SurgSim::Math::Aabbd getAabb () const
 
void setAabb (const SurgSim::Math::Aabbd &aabb)
 Sets a new bounding box, will also call reset() More...
 
const std::list< size_t > & getIntersections () const
 
- Public Member Functions inherited from SurgSim::DataStructures::TreeVisitor
virtual ~TreeVisitor ()
 Destructor. More...
 

Private Attributes

std::list< size_t > m_intersections
 List of ids found for intersections. More...
 
SurgSim::Math::Aabbd m_aabb
 Bounding box used for intersection test. More...
 

Detailed Description

Visitor class to collect the items that intersect with a given bounding box.

Constructor & Destructor Documentation

◆ AabbTreeIntersectionVisitor() [1/2]

SurgSim::DataStructures::AabbTreeIntersectionVisitor::AabbTreeIntersectionVisitor ( )

Constructor.

◆ AabbTreeIntersectionVisitor() [2/2]

SurgSim::DataStructures::AabbTreeIntersectionVisitor::AabbTreeIntersectionVisitor ( const SurgSim::Math::Aabbd &  aabb)
explicit

Constructor.

Parameters
aabbthe bounding box to be used.

◆ ~AabbTreeIntersectionVisitor()

SurgSim::DataStructures::AabbTreeIntersectionVisitor::~AabbTreeIntersectionVisitor ( )
virtual

Destructor.

Member Function Documentation

◆ getAabb()

SurgSim::Math::Aabbd SurgSim::DataStructures::AabbTreeIntersectionVisitor::getAabb ( ) const
Returns
the bounding box to be used for the test.

◆ getIntersections()

const std::list< size_t > & SurgSim::DataStructures::AabbTreeIntersectionVisitor::getIntersections ( ) const
Returns
a reference to the found intersections.

◆ handle() [1/2]

bool SurgSim::DataStructures::AabbTreeIntersectionVisitor::handle ( AabbTreeNode *  node)
overridevirtual

Handle AabbTreeNode basic type, default body, override for specific work.

Parameters
nodeNode to process.
Returns
true to continue traversal, false to abort.

Reimplemented from SurgSim::DataStructures::TreeVisitor.

◆ handle() [2/2]

bool SurgSim::DataStructures::AabbTreeIntersectionVisitor::handle ( TreeNode *  node)
overridevirtual

Handle TreeNode basic type.

Parameters
nodeNode to process.
Returns
true To indicates that the visitor wishes to continue traversal, false if the visitor wants to abort traversal.

Implements SurgSim::DataStructures::TreeVisitor.

◆ hasIntersections()

bool SurgSim::DataStructures::AabbTreeIntersectionVisitor::hasIntersections ( ) const
Returns
true if the visitor has found intersections

◆ reset()

void SurgSim::DataStructures::AabbTreeIntersectionVisitor::reset ( )

Resets the data in the tree.

◆ setAabb()

void SurgSim::DataStructures::AabbTreeIntersectionVisitor::setAabb ( const SurgSim::Math::Aabbd &  aabb)

Sets a new bounding box, will also call reset()

Parameters
aabbThe new bounding box.

Member Data Documentation

◆ m_aabb

SurgSim::Math::Aabbd SurgSim::DataStructures::AabbTreeIntersectionVisitor::m_aabb
private

Bounding box used for intersection test.

◆ m_intersections

std::list<size_t> SurgSim::DataStructures::AabbTreeIntersectionVisitor::m_intersections
private

List of ids found for intersections.


The documentation for this class was generated from the following files: