C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
#include <vsn_box.h>
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... | |
BoxF & | operator|= (const Point3DF &) |
Enclose a point. | |
BoxF & | operator|= (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. | |
.
VSN::BoxF::BoxF | ( | float | xmin, |
float | ymin, | ||
float | zmin, | ||
float | xmax, | ||
float | ymax, | ||
float | zmax, | ||
bool | normalize = false |
||
) |
The constructor by coordinates.
[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. |
The constructor by two points.
[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. |
bool VSN::BoxF::IsEmpty | ( | ) | const |
The check for emptiness.
A bounding box is empty if it doesn't contain any points of 3D-space
void VSN::BoxF::Set | ( | float | xmin, |
float | ymin, | ||
float | zmin, | ||
float | xmax, | ||
float | ymax, | ||
float | zmax, | ||
bool | normalize = false |
||
) |
Initialize by coordinates.
[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. |
Initialize by two points.
[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. |
Add bounding box.
A bounding box is added in the local coordinate system of the initial box.
[in] | r | - A bounding box. |
[in] | place | - A local coordinate system. |
A projection onto the placement.
Calculates a rectangle covering a projection of box onto the placement.
[in] | place | - A local coordinate system. |
[out] | rect | - A rectangle covering a required projection. |
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.
[in] | pl | - A local coordinate system which defines a plane. |
[in] | eps | - A metric tolerance. |
void VSN::BoxF::Include | ( | float | x, |
float | y, | ||
float | z | ||
) |
Enclose a point specified as XYZ.
[in] | x,y,z | - Coordinates of a point which has to be included in the box. |
A box of union of two boxes.
[in] | cube1,cube2 | - Input boxes. |
Get a box vertex by an index.
[in] | index | - An initial index. 0 <= index <= 7. |
[out] | p | - Required vertex. |
Whether the box intersects the line or not.
A line is given by a point and vector.
[in] | eps | - A metric tolerance. |