Mathematics 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(double,double,double,double,double,double)
- Constructs a CATMathBox from its extremities.
- o
CATMathBox(CATMathPoint&,CATMathPoint&,CATBoolean)
- Constructs a CATMathBox from two CATMathPoint.
- 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
GetBoxCenter(CATMathPoint&)
- Retrieves the center of this CATMathBox.
- 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(CATMathLine&)
- Returns TRUE if this CATMathBox is intersecting a CATMathLine.
- o
IsIntersecting(CATMathPlane&)
- Returns TRUE if this CATMathBox is intersecting a CATMathPlane.
- o
IsIntersecting(CATMathBox&,double)
- Returns TRUE if this CATMathBox is intersecting an another one.
- 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
SquareMaxDistanceTo(CATMathPoint&)
- Returns the square of the maximal 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
public CATMathBox( | const | iBoxToCopy) |
-
Copy Constructor.
o CATMathBox
public CATMathBox( | const | iXMin, |
| const | iXMax, |
| const | iYMin, |
| const | iYMax, |
| const | iZMin, |
| const | iZMax) |
-
Constructs a CATMathBox from its extremities.
No verification is performed.
o CATMathBox
public CATMathBox( | const | iLowExtremity, |
| const | iHighExtremity, |
| const | iCheck | =TRUE) |
-
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
-
Destructor.
Methods
o AddInside
public AddInside( | const | iBoxToAdd) |
-
Replaces this CATMathBox by its union with another CATMathBox.
o AddInside
public AddInside( | const | iPointToAdd) |
-
Modifies this CATMathBox by forcing a CATMathPoint to belong to it.
o DistanceTo
public DistanceTo( | const | iPoint) |
-
Returns the distance between this CATMathBox and a CATMathPoint.
o GetBoxCenter
public GetBoxCenter( | | ioCenterPoint) |
-
Retrieves the center of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o GetExtremities
public GetExtremities( | | ioXMin, |
| | ioXMax, |
| | ioYMin, |
| | ioYMax, |
| | ioZMin, |
| | ioZMax) |
-
- Deprecated:
- V5R15 GetLimits
Retrieves the extremities of this CATMathBox.
Throws an error if the box is empty.
o GetHigh
public GetHigh( | | ioHighPoint) |
-
- Deprecated:
- V5R15 GetHighLimit
Retrieves the high extremity of this CATMathBox.
Throws an error if the box is empty.
o GetHighLimit
public GetHighLimit( | | ioHighPoint) |
-
Retrieves the high extremity of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o GetLimits
public GetLimits( | | ioXMin, |
| | ioXMax, |
| | ioYMin, |
| | ioYMax, |
| | ioZMin, |
| | ioZMax) |
-
Retrieves the extremities of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o GetLow
public GetLow( | | ioLowPoint) |
-
- Deprecated:
- V5R15 GetLowLimit
Retrieves the low extremity of this CATMathBox.
Throws an error if the box is empty.
o GetLowLimit
public GetLowLimit( | | ioLowPoint) |
-
Retrieves the low extremity of this CATMathBox.
- Returns:
- E_FAIL if the box is empty, S_OK otherwise.
o Inflate
public Inflate( | | 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
public IsContaining( | const | iOtherBox) |
-
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
public IsContaining( | const | iPoint, |
| | iTol | =0.) |
-
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
public IsIntersecting( | const | iLine) |
-
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
public IsIntersecting( | const | iPlane) |
-
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
public IsIntersecting( | const | iBox, |
| | iTol | =0.) |
-
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
public IsIntersecting( | const | iP1, |
| const | iP2) |
-
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
public IsIntersectingAlongDir( | | iBox, |
| const | iDir, |
| | iTol | =0.) |
-
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 LocalScale( | | 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 SetExtremities( | const | iXMin, |
| const | iXMax, |
| const | iYMin, |
| const | iYMax, |
| const | iZMin, |
| const | iZMax) |
-
Sets the extremities of this CATMathBox.
No verification is done.
o SetHigh
public SetHigh( | const | iHighPoint) |
-
Modifies the high extremity of this CATMathBox.
No verification is performed.
o SetLow
public SetLow( | const | iLowPoint) |
-
Modifies the low extremity of this CATMathBox.
No verification is performed.
o SetToEmpty
-
Resets this CATMathBox to an empty one.
o SetToIntersection
public SetToIntersection( | const | iBox1, |
| const | iBox2) |
-
Replaces this CATMathBox with the intersection of two other
CATMathBox.
It can lead to an empty CATMathBox.
o SetToUnion
public SetToUnion( | const | iBox1, |
| const | iBox2) |
-
Replaces this CATMathBox with the union of two
other CATMathBox.
o SquareDistanceTo
public SquareDistanceTo( | const | iPoint) |
-
Returns the square distance between this CATMathBox and a CATMathPoint.
o SquareMaxDistanceTo
public SquareMaxDistanceTo( | const | iPoint) |
-
Returns the square of the maximal distance between this CATMathBox and a CATMathPoint.
For a point inside the box, the maximal distance is the distance between it and the furthest point of the box from it.
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
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.