CAD Exchanger SDK
cadex::ModelData_Box Class Reference

Defines a 3D bounding box. More...

Public Member Functions

 ModelData_Box ()
 Constructor. More...
 
 ModelData_Box (const ModelData_Pointd &theMinCorner, const ModelData_Pointd &theMaxCorner)
 Constructor. More...
 
 ModelData_Box (const Bnd_Box &theBox)
 Constructor. More...
 
const ModelData_PointMinCorner () const
 
ModelData_PointMinCorner ()
 
const ModelData_PointMaxCorner () const
 
ModelData_PointMaxCorner ()
 
const ModelData_PointCorner (size_t theIdx) const
 
ModelData_Point Center () const
 Returns a center point. More...
 
void Add (const ModelData_Point &thePoint)
 Adds a point into the bounding box. More...
 
void Add (const ModelData_Box &theBox)
 Accumulates another bounding box.
 
void Clear ()
 Resets the bounding box. More...
 
void SetXRange (double theMin, double theMax)
 
void SetYRange (double theMin, double theMax)
 
void SetZRange (double theMin, double theMax)
 
void SetRange (size_t theIdx, double theMin, double theMax)
 
double Range (size_t theIdx) const
 
double XRange () const
 
double YRange () const
 
double ZRange () const
 
void Enlarge (double theX, double theY, double theZ)
 
ModelData_Box Enlarged (double theX, double theY, double theZ) const
 
bool IsIn (const ModelData_Point &thePoint) const
 Returns true if the point lies inside the box.
 
bool Intersects (const ModelData_Box &theOther) const
 Returns the other box has at least one common point with this box.
 
bool IsInfinite () const
 Returns true if at least one coordinate is infinite. More...
 
void Multiply (double theValue)
 
ModelData_Box Multiplied (double theValue) const
 
void Transform (const ModelData_Transformation &theTransformation)
 Applies transformation.
 
ModelData_Box Transformed (const ModelData_Transformation &theTransformation) const
 
 operator Bnd_Box () const
 Casts to a Bnd_Box object.
 

Detailed Description

Defines a 3D bounding box.

The box is defined via two corners - MinCorner() and MaxCorner() - containing minimum and maximum coordinates respectively.

See also
ModelData_Box2d.
Examples:
exploring/validationproperties/main.cxx, and visualization/qtquick_qml/measurements/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_Box() [1/3]

cadex::ModelData_Box::ModelData_Box ( )
inline

Constructor.

Creates a box with infinite boundaries.

◆ ModelData_Box() [2/3]

cadex::ModelData_Box::ModelData_Box ( const ModelData_Pointd &  theMinCorner,
const ModelData_Pointd &  theMaxCorner 
)
inline

Constructor.

Creates a box with specified minimum and maximum corners.

◆ ModelData_Box() [3/3]

cadex::ModelData_Box::ModelData_Box ( const Bnd_Box &  theBox)

Constructor.

Creates a box from a Bnd_Box object. If theBox is void then creates an unlimited box.

Member Function Documentation

◆ Add()

void cadex::ModelData_Box::Add ( const ModelData_Point thePoint)

Adds a point into the bounding box.

Takes into account only finite coordinates of thePoint (those which are less than 1e+100).

◆ Center()

ModelData_Point cadex::ModelData_Box::Center ( ) const
inline

Returns a center point.

Returns a middle of the diagonal between MinCorner() and MaxCorner().

◆ Clear()

void cadex::ModelData_Box::Clear ( )

Resets the bounding box.

Assigns infinite values to the coordinates, so that IsInfinite() returns true.

◆ IsInfinite()

bool cadex::ModelData_Box::IsInfinite ( ) const

Returns true if at least one coordinate is infinite.

Returns true if at least one coordinate is greater than 1e+100.

See also
Clear().
Examples:
visualization/qtquick_qml/measurements/main.cxx.

◆ MaxCorner() [1/2]

const ModelData_Point& cadex::ModelData_Box::MaxCorner ( ) const
inline

Returns the MaxCorner property.

◆ MaxCorner() [2/2]

ModelData_Point& cadex::ModelData_Box::MaxCorner ( )
inline

Returns the MaxCorner property.

◆ MinCorner() [1/2]

ModelData_Point& cadex::ModelData_Box::MinCorner ( )
inline

Returns the MinCorner property.

◆ MinCorner() [2/2]

const ModelData_Point& cadex::ModelData_Box::MinCorner ( ) const
inline

Returns the MinCorner property.