C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::BoxF Class Reference

More...

#include <vsn_box.h>

+ Collaboration diagram for VSN::BoxF:

Public Member Functions

 BoxF ()
 The empty constructor.
 
 BoxF (const BoxF &init)
 Copy constructor.
 
 BoxF (const MbCube &init)
 Copy constructor.
 
 BoxF (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, bool normalize=false)
 The constructor by coordinates. More...
 
 BoxF (const Point3DF &p0, const Point3DF &p1, bool normalize=false)
 The constructor by two points. More...
 
 ~BoxF ()
 Destructor.
 
bool IsEmpty () const
 The check for emptiness. More...
 
void SetEmpty ()
 Set empty ("reverted").
 
void Set (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, bool normalize=false)
 Initialize by coordinates. More...
 
void Set (const Point3DF &p0, const Point3DF &p1, bool normalize=false)
 Initialize by two points. More...
 
Point3DF GetMin () const
 Give the minimal coordinates.
 
Point3DF GetMax () const
 Give the maximal coordinates.
 
void AddRect (const RectF &r, const Matrix3DF &placeFrom)
 Add bounding box. More...
 
void ProjectionRect (const Matrix3DF &matrixInto, RectF &rect) const
 A projection onto the placement. More...
 
int GetLocation (const Matrix3DF &placeFrom, double eps) const
 Define the box position relative to the plane. More...
 
void Normalize ()
 Normalize itself.
 
void Include (float x, float y, float z)
 Enclose a point specified as XYZ. More...
 
void Include (const Point3DF &)
 Enclose a point.
 
void Include (const BoxF &)
 Enclose a box.
 
bool Union (const BoxF &cube1, const BoxF &cube2)
 A box of union of two boxes. More...
 
float GetLengthX () const
 Give the size of the X side of a box.
 
float GetLengthY () const
 Give the size of the Y side of a box.
 
float GetLengthZ () const
 Give the size of the Z side of a box.
 
float GetDiagonal () const
 Give the size of box diagonal.
 
void GetVertex (size_t index, Point3DF &p) const
 Get a box vertex by an index. More...
 
Point3DF GetCenter () const
 Give the box center.
 
void Enlarge (float delta)
 Expand the box in all directions on a "delta" amount.
 
void Enlarge (float dx, float dy, float dz)
 Expand the box in all directions on a corresponding amount.
 
void Move (const Vector3DF &to)
 Translate along a vector.
 
void Transform (const Matrix3DF &matrix)
 Transform according to the matrix.
 
void Scale (float sx, float sy, float sz)
 Scale.
 
bool IsSame (const BoxF &other) const
 Determine whether an object is equal?
 
void operator= (const BoxF &)
 Whether the box intersects the line or not. More...
 
BoxFoperator|= (const Point3DF &)
 Enclose a point.
 
BoxFoperator|= (const BoxF &)
 Enclose a bounding box.
 
bool operator== (const BoxF &) const
 The equality operator.
 
bool operator!= (const BoxF &) const
 The inequality operator.
 
Functions for access to fields.
void SetXMin (float s)
 Set the minimal coordinate by X.
 
void SetYMin (float s)
 Set the minimal coordinate by Y.
 
void SetZMin (float s)
 Set the minimal coordinate by Z.
 
void SetXMax (float s)
 Set the maximal coordinate by X.
 
void SetYMax (float s)
 Set the maximal coordinate by Y.
 
void SetZMax (float s)
 Set the maximal coordinate by Z.
 
float GetXMin () const
 Give the minimal coordinate by X.
 
float GetYMin () const
 Give the minimal coordinate by Y.
 
float GetZMin () const
 Give the minimal coordinate by Z.
 
float GetXMax () const
 Give the maximal coordinate by X.
 
float GetYMax () const
 Give the maximal coordinate by Y.
 
float GetZMax () const
 Give the maximal coordinate by Z.
 

Public Attributes

Point3DF pmin
 A point of a box diagonal with minimal coordinates.
 
Point3DF pmax
 A point of a box diagonal with maximal coordinates.
 

Detailed Description

.

Constructor & Destructor Documentation

◆ BoxF() [1/2]

VSN::BoxF::BoxF ( float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax,
bool  normalize = false 
)

The constructor by coordinates.

Parameters
[in]xmin,ymin,zmin- Coordinates of a box corner point with minimal coordinates.
[in]xmax,ymax,zmax- Coordinates of a box corner point with maximal coordinates.
[in]normalize- Normalize itself.

◆ BoxF() [2/2]

VSN::BoxF::BoxF ( const Point3DF p0,
const Point3DF p1,
bool  normalize = false 
)

The constructor by two points.

Parameters
[in]p0- A point of a box corner with minimal coordinates.
[in]p1- A point of a box corner with maximal coordinates.
[in]normalize- Normalize itself.

Member Function Documentation

◆ IsEmpty()

bool VSN::BoxF::IsEmpty ( ) const

The check for emptiness.

A bounding box is empty if it doesn't contain any points of 3D-space

◆ Set() [1/2]

void VSN::BoxF::Set ( float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax,
bool  normalize = false 
)

Initialize by coordinates.

Parameters
[in]xmin,ymin,zmin- Coordinates of a box corner point with minimal coordinates.
[in]xmax,ymax,zmax- Coordinates of a box corner point with maximal coordinates.
[in]normalize- Normalize itself.

◆ Set() [2/2]

void VSN::BoxF::Set ( const Point3DF p0,
const Point3DF p1,
bool  normalize = false 
)

Initialize by two points.

Parameters
[in]p0- A point of a box corner with minimal coordinates.
[in]p1- A point of a box corner with maximal coordinates.
[in]normalize- Normalize itself.

◆ AddRect()

void VSN::BoxF::AddRect ( const RectF r,
const Matrix3DF placeFrom 
)

Add bounding box.

A bounding box is added in the local coordinate system of the initial box.

Parameters
[in]r- A bounding box.
[in]place- A local coordinate system.

◆ ProjectionRect()

void VSN::BoxF::ProjectionRect ( const Matrix3DF matrixInto,
RectF rect 
) const

A projection onto the placement.

Calculates a rectangle covering a projection of box onto the placement.

Parameters
[in]place- A local coordinate system.
[out]rect- A rectangle covering a required projection.

◆ GetLocation()

int VSN::BoxF::GetLocation ( const Matrix3DF placeFrom,
double  eps 
) const

Define the box position relative to the plane.

Define the box position relative to the plane XY of a local coordinate system, the Z axis of the local coordinate system is not taken into account here.

Parameters
[in]pl- A local coordinate system which defines a plane.
[in]eps- A metric tolerance.
Returns
0 - box intersects the XY plane of a local coordinate system,
1 - box is located over the XY plane of a local coordinate system,
-1 - box is located under the XY plane of a local coordinate system.

◆ Include()

void VSN::BoxF::Include ( float  x,
float  y,
float  z 
)

Enclose a point specified as XYZ.

Parameters
[in]x,y,z- Coordinates of a point which has to be included in the box.

◆ Union()

bool VSN::BoxF::Union ( const BoxF cube1,
const BoxF cube2 
)

A box of union of two boxes.

Parameters
[in]cube1,cube2- Input boxes.
Returns
Returns false if the result box is empty,
true otherwise.

◆ GetVertex()

void VSN::BoxF::GetVertex ( size_t  index,
Point3DF p 
) const

Get a box vertex by an index.

Parameters
[in]index- An initial index. 0 <= index <= 7.
[out]p- Required vertex.

◆ operator=()

void VSN::BoxF::operator= ( const BoxF )

Whether the box intersects the line or not.

A line is given by a point and vector.

Parameters
[in]eps- A metric tolerance.
Returns
Returns true if it intersects. Assign a value.

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