BRL-CAD
BBNode Class Reference

#include <bbnode.h>

Inheritance diagram for BBNode:
[legend]
Collaboration diagram for BBNode:
[legend]

Public Member Functions

 BBNode (const ON_BoundingBox &node, const CurveTree *ct=NULL)
 
 BBNode (const CurveTree *ct, const ON_BoundingBox &node, const ON_Interval &u, const ON_Interval &v, bool checkTrim, bool trimmed)
 
 ~BBNode ()
 
 BBNode (Deserializer &deserieralizer, const CurveTree &ctree)
 
void serialize (Serializer &serializer) const
 
const ON_BrepFace & get_face () const
 
bool isLeaf () const
 
void getLeaves (std::list< const BBNode * > &out_leaves) const
 
void addChild (BBNode *child)
 
int depth () const
 
void GetBBox (float *min, float *max) const
 
void GetBBox (double *min, double *max) const
 
bool intersectsHierarchy (const ON_Ray &ray, std::list< const BBNode * > &results) const
 
ON_2dPoint getClosestPointEstimate (const ON_3dPoint &pt) const
 
ON_2dPoint getClosestPointEstimate (const ON_3dPoint &pt, ON_Interval &u, ON_Interval &v) const
 
int getLeavesBoundingPoint (const ON_3dPoint &pt, std::list< const BBNode * > &out) const
 
bool isTrimmed (const ON_2dPoint &uv, const BRNode **closest, double &closesttrim, double within_distance_tol) const
 
void BuildBBox ()
 
bool prepTrims ()
 
const std::vector< BBNode * > & get_children () const
 

Data Fields

ON_BoundingBox m_node
 
ON_Interval m_u
 
ON_Interval m_v
 
bool m_checkTrim
 
bool m_trimmed
 
ON_3dPoint m_estimate
 
ON_3dVector m_normal
 
const CurveTree *const m_ctree
 

Additional Inherited Members

- Static Public Member Functions inherited from PooledObject< BBNode >
static void * operator new (std::size_t size)
 
static void operator delete (void *pointer)
 

Detailed Description

Bounding Box Hierarchy Node

Definition at line 68 of file bbnode.h.

Constructor & Destructor Documentation

◆ BBNode() [1/3]

BBNode ( const ON_BoundingBox &  node,
const CurveTree ct = NULL 
)
explicit

◆ BBNode() [2/3]

BBNode ( const CurveTree ct,
const ON_BoundingBox &  node,
const ON_Interval &  u,
const ON_Interval &  v,
bool  checkTrim,
bool  trimmed 
)

◆ ~BBNode()

~BBNode ( )

◆ BBNode() [3/3]

BBNode ( Deserializer deserieralizer,
const CurveTree ctree 
)

Member Function Documentation

◆ serialize()

void serialize ( Serializer serializer) const

◆ get_face()

const ON_BrepFace & get_face ( ) const
inline

Definition at line 201 of file bbnode.h.

References BBNode::m_ctree.

◆ isLeaf()

bool isLeaf ( ) const
inline

Test if this node is a leaf node in the hierarchy

Definition at line 213 of file bbnode.h.

◆ getLeaves()

void getLeaves ( std::list< const BBNode * > &  out_leaves) const

Return all leaves below this node that are leaf nodes

◆ addChild()

void addChild ( BBNode child)
inline

Functions to add and remove child nodes from this node.

Definition at line 178 of file bbnode.h.

References LIKELY.

◆ depth()

int depth ( ) const

Report the depth of this node in the hierarchy

◆ GetBBox() [1/2]

void GetBBox ( float *  min,
float *  max 
) const
inline

Get 2 points defining a bounding box

*                _  max  _
*        _   -       +      -  _
*     *  _           +         _  *
*     |      -   _   + _   -      |
*     |             *+            |
*     |             |+            |
*     |          _  |+   _        |
*     |  _   -      |       -  _  |
*     *  _          |          _  *
*            -   _  |  _   -
*                  min
* 

Definition at line 219 of file bbnode.h.

References BBNode::m_node, and min.

◆ GetBBox() [2/2]

void GetBBox ( double *  min,
double *  max 
) const
inline

Definition at line 230 of file bbnode.h.

References BBNode::m_node, and min.

◆ intersectsHierarchy()

bool intersectsHierarchy ( const ON_Ray ray,
std::list< const BBNode * > &  results 
) const

Test whether a ray intersects the 3D bounding volume of the node - if so, and node is not a leaf node, query children. If leaf node, and intersects, add to list.

◆ getClosestPointEstimate() [1/2]

ON_2dPoint getClosestPointEstimate ( const ON_3dPoint &  pt) const

◆ getClosestPointEstimate() [2/2]

ON_2dPoint getClosestPointEstimate ( const ON_3dPoint &  pt,
ON_Interval &  u,
ON_Interval &  v 
) const

◆ getLeavesBoundingPoint()

int getLeavesBoundingPoint ( const ON_3dPoint &  pt,
std::list< const BBNode * > &  out 
) const

◆ isTrimmed()

bool isTrimmed ( const ON_2dPoint &  uv,
const BRNode **  closest,
double &  closesttrim,
double  within_distance_tol 
) const

◆ BuildBBox()

void BuildBBox ( )

◆ prepTrims()

bool prepTrims ( )

◆ get_children()

const std::vector< BBNode * > & get_children ( ) const
inline

Definition at line 207 of file bbnode.h.

Field Documentation

◆ m_node

ON_BoundingBox m_node

Bounding Box

Definition at line 132 of file bbnode.h.

Referenced by BBNode::GetBBox().

◆ m_u

ON_Interval m_u

Surface Information

Definition at line 135 of file bbnode.h.

◆ m_v

ON_Interval m_v

Definition at line 136 of file bbnode.h.

◆ m_checkTrim

bool m_checkTrim

Trimming Flags

Definition at line 139 of file bbnode.h.

◆ m_trimmed

bool m_trimmed

Definition at line 140 of file bbnode.h.

◆ m_estimate

ON_3dPoint m_estimate

Point used for closeness testing - usually based on evaluation of the curve/surface at the center of the parametric domain

Definition at line 145 of file bbnode.h.

◆ m_normal

ON_3dVector m_normal

Definition at line 148 of file bbnode.h.

◆ m_ctree

const CurveTree* const m_ctree

Curve Tree associated with the parent Surface Tree

Definition at line 151 of file bbnode.h.

Referenced by BBNode::get_face().


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