OpenLexocad
27.0
|
#include <Bnd_Box.h>
Public Member Functions | |
Bnd_Box () | |
void | SetWhole () |
void | SetVoid () |
Sets this bounding box so that it is empty. All points are outside a void box. More... | |
void | Set (const Geom::Pnt &P) |
void | Set (const Geom::Pnt &P, const Geom::Dir &D) |
void | Update (const double aXmin, const double aYmin, const double aZmin, const double aXmax, const double aYmax, const double aZmax) |
void | Update (const double X, const double Y, const double Z) |
Adds a point of coordinates (X,Y,Z) to this bounding box. More... | |
void | SetGap (const double Tol) |
Returns the gap of this bounding box. More... | |
void | Enlarge (const double Tol) |
void | Get (double &aXmin, double &aYmin, double &aZmin, double &aXmax, double &aYmax, double &aZmax) const |
const double | GetXmin () const |
const double | GetYmin () const |
const double | GetZmin () const |
const double | GetXmax () const |
const double | GetYmax () const |
const double | GetZmax () const |
const double | GetXsize () const |
const double | GetYsize () const |
const double | GetZsize () const |
const Geom::Pnt | GetMin () const |
const Geom::Pnt | GetMax () const |
const Geom::Pnt | GetCenter () const |
void | GetSize (double &length, double &width, double &height) const |
void | OpenXmin () |
void | OpenXmax () |
void | OpenYmin () |
void | OpenYmax () |
void | OpenZmin () |
void | OpenZmax () |
unsigned int | IsOpenXmin () const |
Returns true if this bounding box is open in the Xmin direction. More... | |
unsigned int | IsOpenXmax () const |
Returns true if this bounding box is open in the Xmax direction. More... | |
unsigned int | IsOpenYmin () const |
Returns true if this bounding box is open in the Ymix direction. More... | |
unsigned int | IsOpenYmax () const |
Returns true if this bounding box is open in the Ymax direction. More... | |
unsigned int | IsOpenZmin () const |
Returns true if this bounding box is open in the Zmin direction. More... | |
unsigned int | IsOpenZmax () const |
Returns true if this bounding box is open in the Zmax direction. More... | |
unsigned int | IsWhole () const |
Returns true if this bounding box is infinite in all 6 directions (WholeSpace flag). More... | |
unsigned int | IsVoid () const |
Returns true if this bounding box is empty (Void flag). More... | |
Geom::Bnd_Box | Transformed (const Geom::Trsf &T) const |
true if xmax-xmin < tol. More... | |
void | Add (const Bnd_Box &Other) |
Adds the box <Other> to <me>. More... | |
void | Add (const Geom::Pnt &P) |
Adds a Pnt to the box. More... | |
void | Add (const Geom::Pnt &P, const Geom::Dir &D) |
Extends <me> from the Pnt. More... | |
void | Add (const Geom::Dir &D) |
unsigned int | IsOut (const Geom::Pnt &P) const |
Returns True if the Pnt is out the box. More... | |
unsigned int | IsOut (const Geom::Lin &L) const |
Returns False if the line intersects the box. More... | |
unsigned int | IsOut (const Geom::Pln &P) const |
Returns False if the plane intersects the box. More... | |
unsigned int | IsOut (const Geom::Bnd_Box &Other) const |
Returns False if the <Box> intersects or is inside <me>. More... | |
unsigned int | IsOut (const Geom::Bnd_Box &Other, const Geom::Trsf &T) const |
unsigned int | IsOut (const Geom::Trsf &T1, const Geom::Bnd_Box &Other, const Geom::Trsf &T2) const |
unsigned int | IsOut (const Geom::Pnt &P1, const Geom::Pnt &P2, const Geom::Dir &D) const |
Geom::Vec | GetMinDifference (const Geom::Bnd_Box &Other) const |
Computes the minimum distance between two boxes. More... | |
Describes a bounding box in 3D space.
A bounding box is parallel to the axes of the coordinates
system. If it is finite, it is defined by the three intervals:
Geom::Bnd_Box::Bnd_Box | ( | ) |
Creates an empty Box.
The constructed box is qualified Void. Its gap is null.
void Geom::Bnd_Box::Add | ( | const Bnd_Box & | Other | ) |
Adds the box <Other> to <me>.
Extends <me> from the Pnt.
in the direction <D>.
void Geom::Bnd_Box::Add | ( | const Geom::Dir & | D | ) |
Extends the Box in the given Direction, i.e. adds
an half-line. The box may become infinite in
1,2 or 3 directions.
void Geom::Bnd_Box::Enlarge | ( | const double | Tol | ) |
Enlarges the box with a tolerance value.
(minvalues-abs(<tol>) and maxvalues+abs(<tol>))
This means that the minimum values of its X, Y and Z
intervals of definition, when they are finite, are reduced by
the absolute value of Tol, while the maximum values are
increased by the same amount.
void Geom::Bnd_Box::Get | ( | double & | aXmin, |
double & | aYmin, | ||
double & | aZmin, | ||
double & | aXmax, | ||
double & | aYmax, | ||
double & | aZmax | ||
) | const |
Returns the bounds of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const Geom::Pnt Geom::Bnd_Box::GetCenter | ( | ) | const |
Returns the center of this bounding box.
If this bounding box is infinite (i.e. "open"), returned value
may be equal to +/- Precision::Infinite().
if IsVoid()
const Geom::Pnt Geom::Bnd_Box::GetMax | ( | ) | const |
Returns the max bound of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned value
may be equal to +/- Precision::Infinite().
if IsVoid()
const Geom::Pnt Geom::Bnd_Box::GetMin | ( | ) | const |
Returns the min bound of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned value
may be equal to +/- Precision::Infinite().
if IsVoid()
Geom::Vec Geom::Bnd_Box::GetMinDifference | ( | const Geom::Bnd_Box & | Other | ) | const |
Computes the minimum distance between two boxes.
Computes the squared diagonal of me.
void Geom::Bnd_Box::GetSize | ( | double & | length, |
double & | width, | ||
double & | height | ||
) | const |
Returns the size of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned value
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetXmax | ( | ) | const |
Returns the X max of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetXmin | ( | ) | const |
Returns the X min of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetXsize | ( | ) | const |
Returns the X size of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetYmax | ( | ) | const |
Returns the Y max of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetYmin | ( | ) | const |
Returns the Y min of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetYsize | ( | ) | const |
Returns the Y size of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetZmax | ( | ) | const |
Returns the Z max of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetZmin | ( | ) | const |
Returns the Z min of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
const double Geom::Bnd_Box::GetZsize | ( | ) | const |
Returns the Z size of this bounding box. The gap is included.
If this bounding box is infinite (i.e. "open"), returned values
may be equal to +/- Precision::Infinite().
if IsVoid()
unsigned int Geom::Bnd_Box::IsOpenXmax | ( | ) | const |
Returns true if this bounding box is open in the Xmax direction.
unsigned int Geom::Bnd_Box::IsOpenXmin | ( | ) | const |
Returns true if this bounding box is open in the Xmin direction.
unsigned int Geom::Bnd_Box::IsOpenYmax | ( | ) | const |
Returns true if this bounding box is open in the Ymax direction.
unsigned int Geom::Bnd_Box::IsOpenYmin | ( | ) | const |
Returns true if this bounding box is open in the Ymix direction.
unsigned int Geom::Bnd_Box::IsOpenZmax | ( | ) | const |
Returns true if this bounding box is open in the Zmax direction.
unsigned int Geom::Bnd_Box::IsOpenZmin | ( | ) | const |
Returns true if this bounding box is open in the Zmin direction.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Pnt & | P | ) | const |
Returns True if the Pnt is out the box.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Lin & | L | ) | const |
Returns False if the line intersects the box.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Pln & | P | ) | const |
Returns False if the plane intersects the box.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Bnd_Box & | Other | ) | const |
Returns False if the <Box> intersects or is inside <me>.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Bnd_Box & | Other, |
const Geom::Trsf & | T | ||
) | const |
Returns False if the transformed <Box> intersects
or is inside <me>.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Trsf & | T1, |
const Geom::Bnd_Box & | Other, | ||
const Geom::Trsf & | T2 | ||
) | const |
Returns False if the transformed <Box> intersects
or is inside the transformed box <me>.
unsigned int Geom::Bnd_Box::IsOut | ( | const Geom::Pnt & | P1, |
const Geom::Pnt & | P2, | ||
const Geom::Dir & | D | ||
) | const |
Returns False if the flat band lying between two parallel
lines represented by their reference points <P1>, <P2> and
direction <D> intersects the box.
unsigned int Geom::Bnd_Box::IsVoid | ( | ) | const |
Returns true if this bounding box is empty (Void flag).
unsigned int Geom::Bnd_Box::IsWhole | ( | ) | const |
Returns true if this bounding box is infinite in all 6 directions (WholeSpace flag).
void Geom::Bnd_Box::OpenXmax | ( | ) |
The Box will be infinitely long in the Xmax
direction.
void Geom::Bnd_Box::OpenXmin | ( | ) |
The Box will be infinitely long in the Xmin
direction.
void Geom::Bnd_Box::OpenYmax | ( | ) |
The Box will be infinitely long in the Ymax
direction.
void Geom::Bnd_Box::OpenYmin | ( | ) |
The Box will be infinitely long in the Ymin
direction.
void Geom::Bnd_Box::OpenZmax | ( | ) |
The Box will be infinitely long in the Zmax
direction.
void Geom::Bnd_Box::OpenZmin | ( | ) |
The Box will be infinitely long in the Zmin
direction.
void Geom::Bnd_Box::Set | ( | const Geom::Pnt & | P | ) |
Sets this bounding box so that it bounds
Sets this bounding box so that it bounds
the half-line defined by point P and direction D, i.e. all
points M defined by M=P+u*D, where u is greater than
or equal to 0, are inside the bounding volume. This
involves first setting this box to be void and then adding the half-line.
void Geom::Bnd_Box::SetGap | ( | const double | Tol | ) |
Returns the gap of this bounding box.
Set the gap of this bounding box to abs(Tol).
void Geom::Bnd_Box::SetVoid | ( | ) |
Sets this bounding box so that it is empty. All points are outside a void box.
void Geom::Bnd_Box::SetWhole | ( | ) |
Sets this bounding box so that it covers the whole of 3D space.
It is infinitely long in all directions.
Geom::Bnd_Box Geom::Bnd_Box::Transformed | ( | const Geom::Trsf & | T | ) | const |
true if xmax-xmin < tol.
true if ymax-ymin < tol.
true if zmax-zmin < tol.
Returns true if IsXThin, IsYThin and IsZThin are all true,
i.e. if the box is thin in all three dimensions.
Returns a bounding box which is the result of applying the
transformation T to this bounding box.
Warning
Applying a geometric transformation (for example, a
rotation) to a bounding box generally increases its
dimensions. This is not optimal for algorithms which use it.
void Geom::Bnd_Box::Update | ( | const double | aXmin, |
const double | aYmin, | ||
const double | aZmin, | ||
const double | aXmax, | ||
const double | aYmax, | ||
const double | aZmax | ||
) |
Enlarges this bounding box, if required, so that it
contains at least:
void Geom::Bnd_Box::Update | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Adds a point of coordinates (X,Y,Z) to this bounding box.