AnyCAD Rapid SDK  2020
The Rapid CAD SDK
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GTrsf2d Class Reference

Public Member Functions

synchronized void delete ()
 
 GTrsf2d ()
 
 GTrsf2d (GTrsf T)
 
void SetMirror (GPnt2d P)
 
void SetMirror (GAx2d A)
 
void SetRotation (GPnt2d P, double Ang)
 
void SetScale (GPnt2d P, double S)
 
void SetTransformation (GAx2d FromSystem1, GAx2d ToSystem2)
 
void SetTransformation (GAx2d ToSystem)
 
void SetTranslation (GVec2d V)
 
void SetTranslation (GPnt2d P1, GPnt2d P2)
 
void SetTranslationPart (GVec2d V)
 
void SetScaleFactor (double S)
 
boolean IsNegative ()
 
GTrsfForm Form ()
 
double ScaleFactor ()
 
GXY TranslationPart ()
 
GMat2d VectorialPart ()
 
GMat2d HVectorialPart ()
 
double RotationPart ()
 
double Value (int Row, int Col)
 
void Invert ()
 
GTrsf2d Inverted ()
 
GTrsf2d Multiplied (GTrsf2d T)
 
void Multiply (GTrsf2d T)
 
void PreMultiply (GTrsf2d T)
 
void Power (int N)
 
GTrsf2d Powered (int N)
 
void Transforms (double[] X, double[] Y)
 
void Transforms (GXY Coord)
 
void SetValues (double a11, double a12, double a13, double a21, double a22, double a23)
 

Protected Member Functions

 GTrsf2d (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (GTrsf2d obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Defines a non-persistent transformation in 2D space. The following transformations are implemented : . Translation, Rotation, Scale . Symmetry with respect to a point and a line. Complex transformations can be obtained by combining the previous elementary transformations using the method Multiply. The transformations can be represented as follow : V1 V2 T XY XY | a11 a12 a13 | | x | | x'| | a21 a22 a23 | | y | | y'| | 0 0 1 | | 1 | | 1 | where {V1, V2} defines the vectorial part of the transformation and T defines the translation part of the transformation. This transformation never change the nature of the objects.

Constructor & Destructor Documentation

GTrsf2d.GTrsf2d ( )

Returns identity transformation.

GTrsf2d.GTrsf2d ( GTrsf  T)

Creates a 2d transformation in the XY plane from a 3d transformation .

Member Function Documentation

GTrsfForm GTrsf2d.Form ( )

Returns the nature of the transformation. It can be an identity transformation, a rotation, a translation, a mirror (relative to a point or an axis), a scaling transformation, or a compound transformation.

GMat2d GTrsf2d.HVectorialPart ( )

Returns the homogeneous vectorial part of the transformation. It is a 2*2 matrix which doesn't include the scale factor. The coefficients of this matrix must be multiplied by the scale factor to obtain the coefficients of the transformation.

GTrsf2d GTrsf2d.Inverted ( )

Computes the reverse transformation. Raises an exception if the matrix of the transformation is not inversible, it means that the scale factor is lower or equal to Resolution from package gp.

boolean GTrsf2d.IsNegative ( )

Returns true if the determinant of the vectorial part of this transformation is negative..

void GTrsf2d.Multiply ( GTrsf2d  T)

Computes the transformation composed from <me> and T. <me> = <me> * T

GTrsf2d GTrsf2d.Powered ( int  N)

Computes the following composition of transformations <me> * <me> * .......* <me>, N time. if N = 0 <me> = Identity if N < 0 <me> = <me>.Inverse() *...........* <me>.Inverse(). Raises if N < 0 and if the matrix of the transformation not inversible.

void GTrsf2d.PreMultiply ( GTrsf2d  T)

Computes the transformation composed from <me> and T. <me> = T * <me>

double GTrsf2d.RotationPart ( )

Returns the angle corresponding to the rotational component of the transformation matrix (operation opposite to SetRotation()).

double GTrsf2d.ScaleFactor ( )

Returns the scale factor.

void GTrsf2d.SetMirror ( GPnt2d  P)

Changes the transformation into a symmetrical transformation. P is the center of the symmetry.

void GTrsf2d.SetMirror ( GAx2d  A)

Changes the transformation into a symmetrical transformation. A is the center of the axial symmetry.

void GTrsf2d.SetRotation ( GPnt2d  P,
double  Ang 
)

Changes the transformation into a rotation. P is the rotation's center and Ang is the angular value of the rotation in radian.

void GTrsf2d.SetScale ( GPnt2d  P,
double  S 
)

Changes the transformation into a scale. P is the center of the scale and S is the scaling value.

void GTrsf2d.SetScaleFactor ( double  S)

Modifies the scale factor.

void GTrsf2d.SetTransformation ( GAx2d  FromSystem1,
GAx2d  ToSystem2 
)

Changes a transformation allowing passage from the coordinate system "FromSystem1" to the coordinate system "ToSystem2".

void GTrsf2d.SetTransformation ( GAx2d  ToSystem)

Changes the transformation allowing passage from the basic coordinate system {P(0.,0.,0.), VX (1.,0.,0.), VY (0.,1.,0.)} to the local coordinate system defined with the Ax2d ToSystem.

void GTrsf2d.SetTranslation ( GVec2d  V)

Changes the transformation into a translation. V is the vector of the translation.

void GTrsf2d.SetTranslation ( GPnt2d  P1,
GPnt2d  P2 
)

Makes the transformation into a translation from the point P1 to the point P2.

void GTrsf2d.SetTranslationPart ( GVec2d  V)

Replaces the translation vector with V.

void GTrsf2d.SetValues ( double  a11,
double  a12,
double  a13,
double  a21,
double  a22,
double  a23 
)

Sets the coefficients of the transformation. The transformation of the point x,y is the point x',y' with : x' = a11 x + a12 y + a13 y' = a21 x + a22 y + a23 The method Value(i,j) will return aij. Raises ConstructionError if the determinant of the aij is null. If the matrix as not a uniform scale it will be orthogonalized before future using.

void GTrsf2d.Transforms ( GXY  Coord)

Transforms a doublet XY with a Trsf2d

GXY GTrsf2d.TranslationPart ( )

Returns the translation part of the transformation's matrix

double GTrsf2d.Value ( int  Row,
int  Col 
)

Returns the coefficients of the transformation's matrix. It is a 2 rows * 3 columns matrix. Raises OutOfRange if Row < 1 or Row > 2 or Col < 1 or Col > 3

GMat2d GTrsf2d.VectorialPart ( )

Returns the vectorial part of the transformation. It is a 2*2 matrix which includes the scale factor.