All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

Mathematics Class CATMathLine2D

CATMathLine2D
 

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


public class CATMathLine2D

Class representing an untrimmed 2D mathematical line.

It is composed of an Origin (CATMathPoint2D), and a normalized vector Direction (CATMathDirection2D).


Constructor and Destructor Index


o CATMathLine2D()
Constructs a CATMathLine2D, passing through (0,0), with (1,0) direction.
o CATMathLine2D(CATMathLine2D&)
Copy constructor.
o CATMathLine2D(CATMathPoint2D&,CATMathPoint2D&)
o CATMathLine2D(CATMathPoint2D&,CATMathVector2D&)

Method Index


o DistanceTo(CATMathPoint2D&)
Returns the distance between this CATMathLine2D and a CATMathPoint2D.
o Dump(ostream*)
Dumps this CATMathLine2D.
o EvalPoint(double)
Returns the CATMathPoint2D of this CATMathLine2D corresponding to a given parameter.
o EvalPoint(double,CATMathPoint2D&)
Returns the CATMathPoint2D of this CATMathLine2D corresponding to a given parameter.
o GetDirection()
Retrieves the (normalized) direction of this CATMathLine2D.
o GetDirection(CATMathVector2D&)
Retrieves the (normalized) direction of this CATMathLine2D.
o GetOrigin()
Returns the origin of this CATMathVector2D.
o GetOrigin(CATMathPoint2D&)
Returns the origin of this CATMathVector2D.
o GetScale()
Returns the scale of this CATMathLine2D.
o Intersect(CATMathLine2D&,double&,double&)
Intersects this CATMathLine2D with another one.
o Project(CATMathPoint2D&,CATMathPoint2D&)
Retrieves the projection of a CATMathPoint2D on this CATMathLine2D.
o Project(CATMathPoint2D&,double&)
Retrieves the projection of a CATMathPoint2D on this CATMathLine2D.
o Set(CATMathPoint2D&,CATMathPoint2D&)
Set from two CATMathPoint2D.
o Set(CATMathPoint2D&,CATMathVector2D&)
Set from a CATMathPoint2D and a CATMathVector2D.
o SetDirection(CATMathDirection2D&)
Modifies the direction of this CATMathLine2D.
o SetDirection(CATMathVector2D&)
o SetOrigin(CATMathPoint2D&)
Modifies the origin of this CATMathLine2D.
o SetScale(double)
Modifies the scale of this CATMathLine2D.
o SetVector(CATMathVector2D&)
Modifies the direction of this CATMathLine2D.

Constructor and Destructor


o CATMathLine2D
public CATMathLine2D()
Constructs a CATMathLine2D, passing through (0,0), with (1,0) direction.
o CATMathLine2D
public CATMathLine2D( const CATMathLine2D& iLineToCopy)
Copy constructor.
o CATMathLine2D
public CATMathLine2D( const CATMathPoint2D& iOrigin,
const CATMathPoint2D& iSecondPoint)
Deprecated:
V5R15 Set Constructs from two CATMathPoint2D.
Throws an error if the two points are confused.
o CATMathLine2D
public CATMathLine2D( const CATMathPoint2D& iOrigin,
const CATMathVector2D& iVector)
Deprecated:
V5R15 Set Constructs from a CATMathPoint2D and a CATMathVector2D.
Throws an error if the vector is null.

Methods


o DistanceTo
public double DistanceTo( const CATMathPoint2D& iPoint) const
Returns the distance between this CATMathLine2D and a CATMathPoint2D.
o Dump
public void Dump(ostream* iStream=0L) const
Dumps this CATMathLine2D.
This writes the following lines on the ostream:
 Origin    = ( OriginFirstCoord , OriginSecondCoord )
 Direction = ( DirFirstCoord    , DirSecondCoord )
 
Parameters:
iStream
A pointer to the output. If 0L, the method dumps the coordinates on the cout output.
o EvalPoint
public CATMathPoint2D EvalPoint( const double iParam) const
Returns the CATMathPoint2D of this CATMathLine2D corresponding to a given parameter. The signature which returns a CATMathPoint2D as an output argument should be preferably used.
o EvalPoint
public void EvalPoint( const double iParam,
CATMathPoint2D& ioResult) const
Returns the CATMathPoint2D of this CATMathLine2D corresponding to a given parameter.
o GetDirection
public CATMathDirection2D GetDirection()const
Retrieves the (normalized) direction of this CATMathLine2D. The signature which returns a CATMathDirection2D as an output argument should be preferably used.
o GetDirection
public void GetDirection(CATMathVector2D& ioNormalizedVector) const
Retrieves the (normalized) direction of this CATMathLine2D.
o GetOrigin
public CATMathPoint2D GetOrigin()const
Returns the origin of this CATMathVector2D. The signature which returns a CATMathPoint2D as an output argument should be preferably used.
o GetOrigin
public void GetOrigin(CATMathPoint2D& ioOrigin)const
Returns the origin of this CATMathVector2D.
o GetScale
public double GetScale()const
Returns the scale of this CATMathLine2D.
o Intersect
public int Intersect( const CATMathLine2D& iOtherLine,
double& ioParamOnOtherLine,
double& ioParamOnThis) const
Intersects this CATMathLine2D with another one.
Parameters:
ioParamOnOtherLine
Parameter of the intersection point on iLine.
ioParamOnThis
Parameter of the intersection point on this CATMathLine2D.
Returns:
0
if there is no intersection
1
if there is an intersection
2
if they are identical
o Project
public void Project( const CATMathPoint2D& iPoint,
CATMathPoint2D& ioResult) const
Retrieves the projection of a CATMathPoint2D on this CATMathLine2D.
Parameters:
iPoint
The point to project.
ioResult
The projected point as a CATMathPoint2D.
o Project
public void Project( const CATMathPoint2D& iPoint,
double& ioParamOnLine) const
Retrieves the projection of a CATMathPoint2D on this CATMathLine2D.
Parameters:
iPoint
The point to project.
ioParamOnLine
The parameter of the projected point on this CATMathLine2D.
o Set
public HRESULT Set( const CATMathPoint2D& iOrigin,
const CATMathPoint2D& iSecondPoint)
Set from two CATMathPoint2D.
Returns:
E_FAIL if the two points are confused, S_OK otherwise.
o Set
public HRESULT Set( const CATMathPoint2D& iOrigin,
const CATMathVector2D& iVector)
Set from a CATMathPoint2D and a CATMathVector2D.
Returns:
E_FAIL if the vector is null, S_OK otherwise.
o SetDirection
public void SetDirection( const CATMathDirection2D& iDirection)
Modifies the direction of this CATMathLine2D. The SetVector method should be preferably used.
o SetDirection
public CATBoolean SetDirection( const CATMathVector2D& iVector)
Deprecated:
V5R15 SetVector Modifies the direction of this CATMathLine2D.
Throws an error if the vector is null.
Returns:
FALSE if the new direction is null, TRUE otherwise.
o SetOrigin
public void SetOrigin( const CATMathPoint2D& iOrigin)
Modifies the origin of this CATMathLine2D.
o SetScale
public CATBoolean SetScale( const double iScale)
Modifies the scale of this CATMathLine2D.
Parameters:
iScale.The
new scale.
Returns:
FALSE if the new scale is null, TRUE otherwise.
o SetVector
public HRESULT SetVector( const CATMathVector2D& iVector)
Modifies the direction of this CATMathLine2D.
and the Length of this CATMathLine2D.
Returns:
E_FAIL if the new direction is null, S_OK otherwise.

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

Copyright © 2003, Dassault Systèmes. All rights reserved.