OpenLexocad  27.1
Geom::GTrsf Class Reference

#include <GTrsf.h>

Public Member Functions

 GTrsf ()
 Returns the Identity transformation.
More...
 
 GTrsf (const Geom::Trsf &T)
 
 GTrsf (const Geom::Mat &M, const Geom::XYZ &V)
 
void SetAffinity (const Geom::Ax1 &A1, const double Ratio)
 
void SetAffinity (const Geom::Ax2 &A2, const double Ratio)
 
void SetValue (const int Row, const int Col, const double Value)
 
void SetVectorialPart (const Geom::Mat &Matrix)
 Replaces the vectorial part of this transformation by Matrix.
More...
 
void SetTranslationPart (const Geom::XYZ &Coord)
 
void SetTrsf (const Geom::Trsf &T)
 Assigns the vectorial and translation parts of T to this transformation.
More...
 
unsigned int IsNegative () const
 
unsigned int IsSingular () const
 
Geom::Trsf::FormEnum Form () const
 
void SetForm ()
 
const Geom::XYZTranslationPart () const
 Returns the translation part of the GTrsf.
More...
 
const Geom::MatVectorialPart () const
 
double Value (const int Row, const int Col) const
 
double operator() (const int Row, const int Col) const
 
void Invert ()
 
Geom::GTrsf Inverted () const
 
void Multiply (const Geom::GTrsf &T)
 
Geom::GTrsf Multiplied (const Geom::GTrsf &T) const
 
void PreMultiply (const Geom::GTrsf &T)
 
void Power (const int N)
 
Geom::GTrsf Powered (const int N) const
 
void Transforms (Geom::XYZ &Coord) const
 
void Transforms (double &X, double &Y, double &Z) const
 Transforms a triplet XYZ with a GTrsf.
More...
 
Geom::Trsf Trsf (bool aAllowOtherFormInConstruction=false) const
 

Constructor & Destructor Documentation

◆ GTrsf() [1/3]

Geom::GTrsf::GTrsf ( )

Returns the Identity transformation.

◆ GTrsf() [2/3]

Geom::GTrsf::GTrsf ( const Geom::Trsf T)

Converts the Geom::Trsf transformation T into a
general transformation, i.e. Returns a GTrsf with
the same matrix of coefficients as the Trsf T.

◆ GTrsf() [3/3]

Geom::GTrsf::GTrsf ( const Geom::Mat M,
const Geom::XYZ V 
)

Creates a transformation based on the matrix M and the
vector V where M defines the vectorial part of
the transformation, and V the translation part, or

Member Function Documentation

◆ Form()

Geom::Trsf::FormEnum Geom::GTrsf::Form ( ) const

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

◆ Invert()

void Geom::GTrsf::Invert ( )

◆ Inverted()

Geom::GTrsf Geom::GTrsf::Inverted ( ) const

Computes the reverse transformation.
Raises an exception if the matrix of the transformation
is not inversible.

◆ IsNegative()

unsigned int Geom::GTrsf::IsNegative ( ) const

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

◆ IsSingular()

unsigned int Geom::GTrsf::IsSingular ( ) const

Returns true if this transformation is singular (and
therefore, cannot be inverted).
Note: The Gauss LU decomposition is used to invert the
transformation matrix. Consequently, the transformation
is considered as singular if the largest pivot found is less
than or equal to Geom::Precision::linear_Resolution().
Warning
If this transformation is singular, it cannot be inverted.

◆ Multiplied()

Geom::GTrsf Geom::GTrsf::Multiplied ( const Geom::GTrsf T) const

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

◆ Multiply()

void Geom::GTrsf::Multiply ( const Geom::GTrsf T)

Computes the transformation composed from T and <me>.
In a C++ implementation you can also write Tcomposed = <me> * T.
Example :
GTrsf T1, T2, Tcomp; ...............
//composition :
Tcomp = T2.Multiplied(T1); // or (Tcomp = T2 * T1)
// transformation of a point
XYZ P(10.,3.,4.);
XYZ P1(P);
Tcomp.Transforms(P1); //using Tcomp
XYZ P2(P);
T1.Transforms(P2); //using T1 then T2
T2.Transforms(P2); // P1 = P2 !!!
C++: alias operator *=

◆ operator()()

double Geom::GTrsf::operator() ( const int  Row,
const int  Col 
) const
inline

◆ Power()

void Geom::GTrsf::Power ( const int  N)

◆ Powered()

Geom::GTrsf Geom::GTrsf::Powered ( const int  N) const

Computes:

  • the product of this transformation multiplied by itself
    N times, if N is positive, or

the product of the inverse of this transformation
multiplied by itself |N| times, if N is negative.
If N equals zero, the result is equal to the Identity
transformation.
I.e.: <me> * <me> * .......* <me>, N time.
if N =0 <me> = Identity
if N < 0 <me> = <me>.Inverse() *...........* <me>.Inverse().

◆ PreMultiply()

void Geom::GTrsf::PreMultiply ( const Geom::GTrsf T)

Computes the product of the transformation T and this
transformation and assigns the result to this transformation.
this = T * this

◆ SetAffinity() [1/2]

void Geom::GTrsf::SetAffinity ( const Geom::Ax1 A1,
const double  Ratio 
)

Changes this transformation into an affinity of ratio Ratio
with respect to the axis A1.
Note: an affinity is a point-by-point transformation that
transforms any point P into a point P' such that if H is
the orthogonal projection of P on the axis A1 or the
plane A2, the vectors HP and HP' satisfy:
HP' = Ratio * HP.

◆ SetAffinity() [2/2]

void Geom::GTrsf::SetAffinity ( const Geom::Ax2 A2,
const double  Ratio 
)

Changes this transformation into an affinity of ratio Ratio
with respect to the plane defined by the origin, the "X Direction" and
the "Y Direction" of coordinate system A2.
Note: an affinity is a point-by-point transformation that
transforms any point P into a point P' such that if H is
the orthogonal projection of P on the axis A1 or the
plane A2, the vectors HP and HP' satisfy:
HP' = Ratio * HP.

◆ SetForm()

void Geom::GTrsf::SetForm ( )

verify and set the shape of the GTrsf Other or CompoundTrsf
Ex :
myGTrsf.SetValue(row1,col1,val1);
myGTrsf.SetValue(row2,col2,val2);
...
myGTrsf.SetForm();

◆ SetTranslationPart()

void Geom::GTrsf::SetTranslationPart ( const Geom::XYZ Coord)

Replaces the translation part of
this transformation by the coordinates of the number triple Coord.

◆ SetTrsf()

void Geom::GTrsf::SetTrsf ( const Geom::Trsf T)

Assigns the vectorial and translation parts of T to this transformation.

◆ SetValue()

void Geom::GTrsf::SetValue ( const int  Row,
const int  Col,
const double  Value 
)

Replaces the coefficient (Row, Col) of the matrix representing
this transformation by Value. Raises OutOfRange
if Row < 1 or Row > 3 or Col < 1 or Col > 4

◆ SetVectorialPart()

void Geom::GTrsf::SetVectorialPart ( const Geom::Mat Matrix)

Replaces the vectorial part of this transformation by Matrix.

◆ Transforms() [1/2]

void Geom::GTrsf::Transforms ( Geom::XYZ Coord) const

◆ Transforms() [2/2]

void Geom::GTrsf::Transforms ( double &  X,
double &  Y,
double &  Z 
) const

Transforms a triplet XYZ with a GTrsf.

◆ TranslationPart()

const Geom::XYZ& Geom::GTrsf::TranslationPart ( ) const

Returns the translation part of the GTrsf.

◆ Trsf()

Geom::Trsf Geom::GTrsf::Trsf ( bool  aAllowOtherFormInConstruction = false) const

◆ Value()

double Geom::GTrsf::Value ( const int  Row,
const int  Col 
) const

Returns the coefficients of the global matrix of transformation.
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 4

◆ VectorialPart()

const Geom::Mat& Geom::GTrsf::VectorialPart ( ) const

Computes the vectorial part of the GTrsf. The returned Matrix
is a 3*3 matrix.


The documentation for this class was generated from the following file: