Open CASCADE Technology  7.6.0
Public Types | Public Member Functions | Protected Attributes

BVH_Box< T, N > Class Template Reference

Defines axis aligned bounding box (AABB) based on BVH vectors. More...

#include <BVH_Box.hxx>

Inheritance diagram for BVH_Box< T, N >:
Inheritance graph
[legend]

Public Types

typedef BVH::VectorType< T, N >::Type BVH_VecNt
 

Public Member Functions

 BVH_Box ()
 Creates uninitialized bounding box. More...
 
 BVH_Box (const BVH_VecNt &thePoint)
 Creates bounding box of given point. More...
 
 BVH_Box (const BVH_VecNt &theMinPoint, const BVH_VecNt &theMaxPoint)
 Creates bounding box from corner points. More...
 
void Clear ()
 Clears bounding box. More...
 
Standard_Boolean IsValid () const
 Is bounding box valid? More...
 
void Add (const BVH_VecNt &thePoint)
 Appends new point to the bounding box. More...
 
void Combine (const BVH_Box &theBox)
 Combines bounding box with another one. More...
 
const BVH_VecNtCornerMin () const
 Returns minimum point of bounding box. More...
 
const BVH_VecNtCornerMax () const
 Returns maximum point of bounding box. More...
 
BVH_VecNtCornerMin ()
 Returns minimum point of bounding box. More...
 
BVH_VecNtCornerMax ()
 Returns maximum point of bounding box. More...
 
Area () const
 Returns surface area of bounding box. If the box is degenerated into line, returns the perimeter instead. More...
 
BVH_VecNt Size () const
 Returns diagonal of bounding box. More...
 
BVH_VecNt Center () const
 Returns center of bounding box. More...
 
Center (const Standard_Integer theAxis) const
 Returns center of bounding box along the given axis. More...
 
void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 
Standard_Boolean InitFromJson (const Standard_SStream &theSStream, Standard_Integer &theStreamPos)
 Inits the content of me from the stream. More...
 
Standard_Boolean IsOut (const BVH_Box< T, N > &theOther) const
 Checks if the Box is out of the other box. More...
 
Standard_Boolean IsOut (const BVH_VecNt &theMinPoint, const BVH_VecNt &theMaxPoint) const
 Checks if the Box is out of the other box defined by two points. More...
 
Standard_Boolean Contains (const BVH_Box< T, N > &theOther, Standard_Boolean &hasOverlap) const
 Checks if the Box fully contains the other box. More...
 
Standard_Boolean Contains (const BVH_VecNt &theMinPoint, const BVH_VecNt &theMaxPoint, Standard_Boolean &hasOverlap) const
 Checks if the Box is fully contains the other box. More...
 
Standard_Boolean IsOut (const BVH_VecNt &thePoint) const
 Checks if the Point is out of the box. More...
 

Protected Attributes

BVH_VecNt myMinPoint
 Minimum point of bounding box. More...
 
BVH_VecNt myMaxPoint
 Maximum point of bounding box. More...
 
Standard_Boolean myIsInited
 Is bounding box initialized? More...
 

Detailed Description

template<class T, int N>
class BVH_Box< T, N >

Defines axis aligned bounding box (AABB) based on BVH vectors.

Template Parameters
TNumeric data type
NVector dimension

Member Typedef Documentation

◆ BVH_VecNt

template<class T , int N>
typedef BVH::VectorType<T, N>::Type BVH_Box< T, N >::BVH_VecNt

Constructor & Destructor Documentation

◆ BVH_Box() [1/3]

template<class T , int N>
BVH_Box< T, N >::BVH_Box ( )
inline

Creates uninitialized bounding box.

◆ BVH_Box() [2/3]

template<class T , int N>
BVH_Box< T, N >::BVH_Box ( const BVH_VecNt thePoint)
inline

Creates bounding box of given point.

◆ BVH_Box() [3/3]

template<class T , int N>
BVH_Box< T, N >::BVH_Box ( const BVH_VecNt theMinPoint,
const BVH_VecNt theMaxPoint 
)
inline

Creates bounding box from corner points.

Member Function Documentation

◆ Add()

template<class T , int N>
void BVH_Box< T, N >::Add ( const BVH_VecNt thePoint)
inline

Appends new point to the bounding box.

◆ Area()

template<class T , int N>
T BVH_Box< T, N >::Area

Returns surface area of bounding box. If the box is degenerated into line, returns the perimeter instead.

◆ Center() [1/2]

template<class T , int N>
BVH_VecNt BVH_Box< T, N >::Center ( ) const
inline

Returns center of bounding box.

◆ Center() [2/2]

template<class T , int N>
T BVH_Box< T, N >::Center ( const Standard_Integer  theAxis) const

Returns center of bounding box along the given axis.

◆ Clear()

template<class T , int N>
void BVH_Box< T, N >::Clear ( )
inline

Clears bounding box.

◆ Combine()

template<class T , int N>
void BVH_Box< T, N >::Combine ( const BVH_Box< T, N > &  theBox)

Combines bounding box with another one.

◆ Contains() [1/2]

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::Contains ( const BVH_Box< T, N > &  theOther,
Standard_Boolean hasOverlap 
) const
inline

Checks if the Box fully contains the other box.

◆ Contains() [2/2]

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::Contains ( const BVH_VecNt theMinPoint,
const BVH_VecNt theMaxPoint,
Standard_Boolean hasOverlap 
) const
inline

Checks if the Box is fully contains the other box.

◆ CornerMax() [1/2]

template<class T , int N>
BVH_VecNt& BVH_Box< T, N >::CornerMax ( )
inline

Returns maximum point of bounding box.

◆ CornerMax() [2/2]

template<class T , int N>
const BVH_VecNt& BVH_Box< T, N >::CornerMax ( ) const
inline

Returns maximum point of bounding box.

◆ CornerMin() [1/2]

template<class T , int N>
BVH_VecNt& BVH_Box< T, N >::CornerMin ( )
inline

Returns minimum point of bounding box.

◆ CornerMin() [2/2]

template<class T , int N>
const BVH_VecNt& BVH_Box< T, N >::CornerMin ( ) const
inline

Returns minimum point of bounding box.

◆ DumpJson()

template<class T , int N>
void BVH_Box< T, N >::DumpJson ( Standard_OStream theOStream,
Standard_Integer  theDepth = -1 
) const
inline

Dumps the content of me into the stream.

◆ InitFromJson()

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::InitFromJson ( const Standard_SStream theSStream,
Standard_Integer theStreamPos 
)
inline

Inits the content of me from the stream.

◆ IsOut() [1/3]

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::IsOut ( const BVH_Box< T, N > &  theOther) const
inline

Checks if the Box is out of the other box.

◆ IsOut() [2/3]

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::IsOut ( const BVH_VecNt theMinPoint,
const BVH_VecNt theMaxPoint 
) const
inline

Checks if the Box is out of the other box defined by two points.

◆ IsOut() [3/3]

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::IsOut ( const BVH_VecNt thePoint) const
inline

Checks if the Point is out of the box.

◆ IsValid()

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::IsValid ( ) const
inline

Is bounding box valid?

◆ Size()

template<class T , int N>
BVH_VecNt BVH_Box< T, N >::Size ( void  ) const
inline

Returns diagonal of bounding box.

Field Documentation

◆ myIsInited

template<class T , int N>
Standard_Boolean BVH_Box< T, N >::myIsInited
protected

Is bounding box initialized?

◆ myMaxPoint

template<class T , int N>
BVH_VecNt BVH_Box< T, N >::myMaxPoint
protected

Maximum point of bounding box.

◆ myMinPoint

template<class T , int N>
BVH_VecNt BVH_Box< T, N >::myMinPoint
protected

Minimum point of bounding box.


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