Mathematics CATMathBox2D

Usage: you must use this class as is. You should never derive it.


public class CATMathBox2D

Class representing a 2D box, parallel to the canonical axis.
Role:
The box is defined by two CATMathPoint, the first (XMin, YMin) called the low extremity, and the other one ((XMax, YMax)) called 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 .


Constructor and Destructor Index


o CATMathBox2D()
Constructs an empty CATMathBox2D.
o CATMathBox2D(CATMathBox2D&)
Copy Constructor.
o CATMathBox2D(double,double,double,double)
Constructs a CATMathBox2D from its extremities.
o CATMathBox2D(CATMathPoint2D&,CATMathPoint2D&,CATBoolean)
Constructs a CATMathBox2D from two CATMathPoint2D.

Method Index


o AddInside(CATMathBox2D&)
Replaces this CATMathBox2D by its union with another CATMathBox2D.
o AddInside(CATMathPoint2D&)
Modifies this CATMathBox2D by forcing a CATMathPoint to belong to the CATMathBox 2D.
o GetExtremities(double&,double&,double&,double&)
Retrieves the extremities of this CATMathBox2D.
o GetHigh(CATMathPoint2D&)
Retrieves the high extremity of this CATMathBox2D.
o GetLow(CATMathPoint2D&)
Retrieves the low extremity of this CATMathBox2D.
o Inflate(double)
Modifies this CATMathBox2D by adding a given thickness on each direction.
o IsContaining(CATMathPoint2D&)
Returns TRUE if this CATMathBox2D is containing a CATMathPoint2D.
o IsEmpty()
Tests whether this CATMathBox2D is empty.
o IsIntersecting(CATMathBox2D&,double)
Returns TRUE if this CATMathBox2D is intersecting an another one, with a given tolerance.
o IsIntersecting(CATMathPoint2D&,CATMathPoint2D&)
Returns TRUE if this CATMathBox2D is intersecting the segment [iP1,iP2].
o Project(CATMathPoint2D&)
Projects a CATMathPoint2D on this CATMathBox2D.
o SetExtremities(double,double,double,double)
Sets the extremities of this CATMathBox2D.
o SetHigh(CATMathPoint2D&)
Modifies the high extremity of this CATMathBox2D.
o SetLow(CATMathPoint2D&)
Modifies the low extremity of this CATMathBox2D.
o SetToEmpty()
Resets this CATMathBox2D to an empty one.
o SetToIntersection(CATMathBox2D&,CATMathBox2D&)
Replaces this CATMathBox2D with the intersection of two other CATMathBox2D.
o SetToIntersection(CATMathBox2D&,CATMathBox2D&,double)
Replaces this CATMathBox2D with the intersection of two other CATMathBox2D with a given tolerance.
o SetToUnion(CATMathBox2D&,CATMathBox2D&)
Replaces this CATMathBox2D with the union of two other CATMathBox2D.

Constructor and Destructor


o CATMathBox2D
public CATMathBox2D()
Constructs an empty CATMathBox2D.
o CATMathBox2D
public CATMathBox2D( const iBox)
Copy Constructor.
o CATMathBox2D
public CATMathBox2D( const iXMin,
const iXMax,
const iYMin,
const iYMax)
Constructs a CATMathBox2D from its extremities.
No verification is performed.
o CATMathBox2D
public CATMathBox2D( const iLowPoint,
const iHighPoint,
const iCheck=1)
Constructs a CATMathBox2D from two CATMathPoint2D.
Parameters:
iCheck
FALSE
The two CATMathPoint2D 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 CATMathPoint2D (default mode).

Methods


o AddInside
public AddInside( const iBoxToAdd)
Replaces this CATMathBox2D by its union with another CATMathBox2D.
o AddInside
public AddInside( const iPoint)
Modifies this CATMathBox2D by forcing a CATMathPoint to belong to the CATMathBox 2D.
o GetExtremities
public GetExtremities( ioXMin,
ioXMax,
ioYMin,
ioYMax)
Retrieves the extremities of this CATMathBox2D.
o GetHigh
public GetHigh( ioHighPoint)
Retrieves the high extremity of this CATMathBox2D.
o GetLow
public GetLow( ioLowPoint)
Retrieves the low extremity of this CATMathBox2D.
o Inflate
public Inflate( iThickness)
Modifies this CATMathBox2D by adding a given thickness on each direction.
Hence, the low extremity of the box becomes (XMin-iThickness, YMin-iThickness) and the high extremity becomes (XMax+iThickness, YMax+iThickness). An empty CATMathBox2D still remains empty.
o IsContaining
public IsContaining( const iPoint)
Returns TRUE if this CATMathBox2D is containing a CATMathPoint2D.
o IsEmpty
public IsEmpty()
Tests whether this CATMathBox2D is empty.
Returns:
TRUE if the CATMathBox2D is empty
o IsIntersecting
public IsIntersecting( const iBox,
iTolerance=0)
Returns TRUE if this CATMathBox2D is intersecting an another one, with a given 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 CATMathBox2D is intersecting the segment [iP1,iP2].
Note that if the intersection is a point or a line, the result is true.
o Project
public Project( ioPoint)
Projects a CATMathPoint2D on this CATMathBox2D.
Returns:
0
The CATMathPoint2D is not modified. It already is inside the CATMathBox2D, or the CATMathBox2D is empty.
1
The CATMathPoint2D is moved to the nearest point of the CATMathBox2D.
2
When the line is included in the plane
o SetExtremities
public SetExtremities( const iXMin,
const iXMax,
const iYMin,
const iYMax)
Sets the extremities of this CATMathBox2D.
No verification is done.
o SetHigh
public SetHigh( const iHighPoint)
Modifies the high extremity of this CATMathBox2D.
No verification is done.
o SetLow
public SetLow( const iLowPoint)
Modifies the low extremity of this CATMathBox2D.
No verification is done.
o SetToEmpty
public SetToEmpty()
Resets this CATMathBox2D to an empty one.
o SetToIntersection
public SetToIntersection( const iBox1,
const iBox2)
Replaces this CATMathBox2D with the intersection of two other CATMathBox2D.
It can lead to an empty CATMathBox2D.
o SetToIntersection
public SetToIntersection( const iBox1,
const iBox2,
iTolerance)
Replaces this CATMathBox2D with the intersection of two other CATMathBox2D with a given tolerance..
It can lead to an empty CATMathBox2D.
o SetToUnion
public SetToUnion( const iBox1,
const iBox2)
Replaces this CATMathBox2D with the union of two other CATMathBox2D.

This object is included in the file: CATMathBox2D.h
If needed, your Imakefile.mk should include the module: CATMathematics

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.