All Frameworks Class Hierarchy This Framework Previous Next Indexes
Mathematics Class CATMathBox
CATMathBox
Usage: you must use this class as is. You should never derive it.
public class CATMathBox
Class representing a 3D box, parallel to the canonical axis.
Role:
The box is defined by two CATMathPoint, the first
(XMin, YMin, ZMin) called the low
extremity, and the other one ((XMax, YMax, ZMax)) the high extremity.
A box can be seen as a set. If one of the cooordinates of the low
extremity is greater
than the corresponding coordinate of the high extremity, the box is empty.
In other words, a box is not empty if XMin < XMax and
YMin < YMax and ZMin < ZMax.
Constructor and Destructor Index
- o
CATMathBox()
- Constructs an empty CATMathBox.
- o
CATMathBox(CATMathBox&)
- Copy Constructor.
- o
CATMathBox(CATMathPoint&,CATMathPoint&,CATBoolean)
- Constructs a CATMathBox from two CATMathPoint.
- o
CATMathBox(double,double,double,double,double,double)
- Constructs a CATMathBox from its extremities.
- o
~CATMathBox()
- Destructor.
Method Index
- o
AddInside(CATMathBox&)
- Replaces this CATMathBox by its union with another CATMathBox.
- o
AddInside(CATMathPoint&)
- Modifies this CATMathBox by forcing a CATMathPoint to belong to it.
- o
DistanceTo(CATMathPoint&)
- Returns the distance between this CATMathBox and a CATMathPoint.
- o
GetExtremities(double&,double&,double&,double&,double&,double&)
-
- o
GetHigh(CATMathPoint&)
-
- o
GetHighLimit(CATMathPoint&)
- Retrieves the high extremity of this CATMathBox.
- o
GetLimits(double&,double&,double&,double&,double&,double&)
- Retrieves the extremities of this CATMathBox.
- o
GetLow(CATMathPoint&)
-
- o
GetLowLimit(CATMathPoint&)
- Retrieves the low extremity of this CATMathBox.
- o
Inflate(double)
- Modifies this CATMathBox by adding a given thickness on each direction.
- o
IsContaining(CATMathBox&)
- Returns TRUE if this CATMathBox is completely containing an other
CATMathBox.
- o
IsContaining(CATMathPoint&,double)
- Returns TRUE if this CATMathBox defined at a given tolerance
is containing a CATMathPoint.
- o
IsEmpty()
- Tests if this CATMathBox is empty.
- o
IsIntersecting(CATMathBox&,double)
- Returns TRUE if this CATMathBox is intersecting an another one.
- o
IsIntersecting(CATMathLine&)
- Returns TRUE if this CATMathBox is intersecting a CATMathLine.
- o
IsIntersecting(CATMathPlane&)
- Returns TRUE if this CATMathBox is intersecting a CATMathPlane.
- o
IsIntersecting(CATMathPoint&,CATMathPoint&)
- Returns TRUE if this CATMathBox is intersecting the segment [iP1,iP2].
- o
IsIntersectingAlongDir(CATMathBox&,CATMathDirection&,double)
- Returns TRUE if the projection of this CATMathBox onto the plane perpendicular to the direction
The test takes into account a given tolerance (the result is equivalent
to inflating one of the box of iTol and to compute IsIntersectingAlongDir with
no tolerance.
- o
LocalScale(double)
- Modifies this CATMathBox by having it larger at the same place.
- o
SetExtremities(double,double,double,double,double,double)
- Sets the extremities of this CATMathBox.
- o
SetHigh(CATMathPoint&)
- Modifies the high extremity of this CATMathBox.
- o
SetLow(CATMathPoint&)
- Modifies the low extremity of this CATMathBox.
- o
SetToEmpty()
- Resets this CATMathBox to an empty one.
- o
SetToIntersection(CATMathBox&,CATMathBox&)
- Replaces this CATMathBox with the intersection of two other
CATMathBox.
- o
SetToUnion(CATMathBox&,CATMathBox&)
- Replaces this CATMathBox with the union of two
other CATMathBox.
- o
SquareDistanceTo(CATMathPoint&)
- Returns the square distance between this CATMathBox and a CATMathPoint.
- o
Volume()
- Returns the geometric volume included in this CATMathBox.
Constructor and Destructor
o CATMathBox
-
Constructs an empty CATMathBox.
o CATMathBox
-
Copy Constructor.
o CATMathBox
-
Constructs a CATMathBox from two CATMathPoint.
- Parameters:
-
- iCheck
-
- FALSE
- The two CATMathPoint are assumed to be the
lowest one and the highest one. This can create an empty box if it is not
the case.
- TRUE
- It creates the smallest box that contains
the two CATMathPoint (default mode).
o CATMathBox
public CATMathBox( | const double | iXMin, |
| const double | iXMax, |
| const double | iYMin, |
| const double | iYMax, |
| const double | iZMin, |
| const double | iZMax) |
-
Constructs a CATMathBox from its extremities.
No verification is performed.
o ~CATMathBox
-
Destructor.
Methods
o AddInside
-
Replaces this CATMathBox by its union with another CATMathBox.
o AddInside
-
Modifies this CATMathBox by forcing a CATMathPoint to belong to it.
o DistanceTo
-
Returns the distance between this CATMathBox and a CATMathPoint.
o GetExtremities
public void GetExtremities( | double& | ioXMin, |
| double& | ioXMax, |
| double& | ioYMin, |
| double& | ioYMax, |
| double& | ioZMin, |
| double& | ioZMax) const |
-
- Deprecated:
- V5R15 GetLimits
Retrieves the extremities of this CATMathBox.
Throws an error if the box is empty.
o GetHigh
-
- Deprecated:
- V5R15 GetHighLimit
Retrieves the high extremity of this CATMathBox.
Throws an error if the box is empty.
o GetHighLimit
-
Retrieves the high extremity of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o GetLimits
public HRESULT GetLimits( | double& | ioXMin, |
| double& | ioXMax, |
| double& | ioYMin, |
| double& | ioYMax, |
| double& | ioZMin, |
| double& | ioZMax) const |
-
Retrieves the extremities of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o GetLow
-
- Deprecated:
- V5R15 GetLowLimit
Retrieves the low extremity of this CATMathBox.
Throws an error if the box is empty.
o GetLowLimit
-
Retrieves the low extremity of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o Inflate
public void Inflate( | double | iThickness) |
-
Modifies this CATMathBox by adding a given thickness on each direction.
Hence, the low extremity of the box becomes
(XMin-iThickness, YMin-iThickness, ZMin-iThickness) and the high
extremity becomes
(XMax+iThickness, YMax+iThickness, ZMax+iThickness).
This method does not apply on an empty box, but no error is thrown in this case.
o IsContaining
-
Returns TRUE if this CATMathBox is completely containing an other
CATMathBox.
Note that the empty CATMathBox is contained by all CATMathBox and does
not contain any CATMathBox, even an empty one.
o IsContaining
-
Returns TRUE if this CATMathBox defined at a given tolerance
is containing a CATMathPoint.
The CATMathBox used is defined by:
[_XMin-iTol, _XMax+iTol] x [_YMin-iTol, _YMax+iTol] x
[_ZMin-iTol, _ZMax+iTol]
o IsEmpty
-
Tests if this CATMathBox is empty.
- Returns:
- TRUE if the CATMathBox is empty, FALSE otherwise.
o IsIntersecting
-
Returns TRUE if this CATMathBox is intersecting an another one.
The test takes a given tolerance into account (the result is equivalent
to inflating one of the box of iTol and to compute IsIntersecting with
no tolerance.
Note that if the intersection is a point or a line, the
result is true.
o IsIntersecting
-
Returns TRUE if this CATMathBox is intersecting a CATMathLine.
Note that if the intersection is a point or a line, the
result is true.
o IsIntersecting
-
Returns TRUE if this CATMathBox is intersecting a CATMathPlane.
Note that if the intersection is a point or a line, the
result is true.
o IsIntersecting
-
Returns TRUE if this CATMathBox is intersecting the segment [iP1,iP2].
Note that if the intersection is a point or a line, the
result is true.
o IsIntersectingAlongDir
-
Returns TRUE if the projection of this CATMathBox onto the plane perpendicular to the direction
The test takes into account a given tolerance (the result is equivalent
to inflating one of the box of iTol and to compute IsIntersectingAlongDir with
no tolerance.
o LocalScale
public void LocalScale( | double | iScaleRatio) |
-
Modifies this CATMathBox by having it larger at the same place.
The CATMathBox increases as follows:
Let f=(iScaleRatio-1)/2 be the multiplicative ratio on each
direction and
dX=XMax-XMin, dY=YMax-YMin, dZ=ZMax-ZMin be the lengths of the box in
each direction.
The low extremity of the box becomes
(XMin-dX*f, YMin-dY*f, ZMin-dZ*f) and the high
extremity becomes
(XMax+dX*f, YMax+dY*f, ZMax+dZ*f). In particular, if
the length of the box is null in one direction, it still
remains null after a local scale.
This method does not apply on an empty box, but no error is thrown in this case.
o SetExtremities
public void SetExtremities( | const double | iXMin, |
| const double | iXMax, |
| const double | iYMin, |
| const double | iYMax, |
| const double | iZMin, |
| const double | iZMax) |
-
Sets the extremities of this CATMathBox.
No verification is done.
o SetHigh
-
Modifies the high extremity of this CATMathBox.
No verification is performed.
o SetLow
-
Modifies the low extremity of this CATMathBox.
No verification is performed.
o SetToEmpty
public INLINE void SetToEmpty( | ) |
-
Resets this CATMathBox to an empty one.
o SetToIntersection
-
Replaces this CATMathBox with the intersection of two other
CATMathBox.
It can lead to an empty CATMathBox.
o SetToUnion
-
Replaces this CATMathBox with the union of two
other CATMathBox.
o SquareDistanceTo
-
Returns the square distance between this CATMathBox and a CATMathPoint.
o Volume
-
Returns the geometric volume included in this CATMathBox.
This object is included in the file: CATMathBox.h
If needed, your Imakefile.mk should include the module: CATMathematics