|
Open CASCADE Technology
6.7.1
|
Defines a non-persistent transformation in 3D space. <br>
This transformation is a general transformation.
It can be a Trsf from gp, an affinity, or you can define
your own transformation giving the matrix of transformation.
With a Gtrsf you can transform only a triplet of coordinates
XYZ. It is not possible to transform other geometric objects
because these transformations can change the nature of non-
elementary geometric objects.
The transformation GTrsf can be represented as follow :
V1 V2 V3 T XYZ XYZ
| a11 a12 a13 a14 | | x | | x'|
| a21 a22 a23 a24 | | y | | y'|
| a31 a32 a33 a34 | | z | = | z'|
| 0 0 0 1 | | 1 | | 1 |
where {V1, V2, V3} define the vectorial part of the
transformation and T defines the translation part of the
transformation.
Warning
A GTrsf transformation is only applicable to
coordinates. Be careful if you apply such a
transformation to all points of a geometric object, as
this can change the nature of the object and thus
render it incoherent!
Typically, a circle is transformed into an ellipse by an
affinity transformation. To avoid modifying the nature of
an object, use a gp_Trsf transformation instead, as
objects of this class respect the nature of geometric objects.
More...
#include <gp_GTrsf.hxx>
Public Member Functions | |
| gp_GTrsf () | |
| Returns the Identity transformation. More... | |
| gp_GTrsf (const gp_Trsf &T) | |
Converts the gp_Trsf transformation T into a <br> general transformation, i.e. Returns a GTrsf with | |
| gp_GTrsf (const gp_Mat &M, const gp_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 More... | |
| void | SetAffinity (const gp_Ax1 &A1, const Standard_Real Ratio) |
Changes this transformation into an affinity of ratio Ratio <br> with respect to the axis A1. | |
| void | SetAffinity (const gp_Ax2 &A2, const Standard_Real Ratio) |
Changes this transformation into an affinity of ratio Ratio <br> with respect to the plane defined by the origin, the "X Direction" and | |
| void | SetValue (const Standard_Integer Row, const Standard_Integer Col, const Standard_Real Value) |
Replaces the coefficient (Row, Col) of the matrix representing <br> this transformation by Value. Raises OutOfRange | |
| void | SetVectorialPart (const gp_Mat &Matrix) |
| Replaces the vectorial part of this transformation by Matrix. More... | |
| void | SetTranslationPart (const gp_XYZ &Coord) |
Replaces the translation part of <br> this transformation by the coordinates of the number triple Coord. | |
| void | SetTrsf (const gp_Trsf &T) |
| Assigns the vectorial and translation parts of T to this transformation. More... | |
| Standard_Boolean | IsNegative () const |
Returns true if the determinant of the vectorial part of <br> this transformation is negative. | |
| Standard_Boolean | IsSingular () const |
Returns true if this transformation is singular (and <br> therefore, cannot be inverted). | |
| gp_TrsfForm | Form () const |
Returns the nature of the transformation. It can be an <br> identity transformation, a rotation, a translation, a mirror | |
| void | 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(); More... | |
| const gp_XYZ & | TranslationPart () const |
| Returns the translation part of the GTrsf. More... | |
| const gp_Mat & | VectorialPart () const |
| Computes the vectorial part of the GTrsf. The returned Matrix is a 3*3 matrix. More... | |
| Standard_Real | Value (const Standard_Integer Row, const Standard_Integer Col) const |
Returns the coefficients of the global matrix of transformation. <br> Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 4 | |
| Standard_Real | operator() (const Standard_Integer Row, const Standard_Integer Col) const |
| void | Invert () |
| gp_GTrsf | Inverted () const |
| Computes the reverse transformation. Raises an exception if the matrix of the transformation is not inversible. More... | |
| void | Multiply (const gp_GTrsf &T) |
Computes the transformation composed from T and <me>. <br> In a C++ implementation you can also write Tcomposed = <me> * T. | |
| gp_GTrsf | Multiplied (const gp_GTrsf &T) const |
| Computes the transformation composed with <me> and T. <me> = T * <me> More... | |
| void | PreMultiply (const gp_GTrsf &T) |
| Computes the product of the transformation T and this transformation and assigns the result to this transformation. this = T * this More... | |
| void | Power (const Standard_Integer N) |
| gp_GTrsf | Powered (const Standard_Integer N) const |
| Computes: More... | |
| void | Transforms (gp_XYZ &Coord) const |
| void | Transforms (Standard_Real &X, Standard_Real &Y, Standard_Real &Z) const |
| Transforms a triplet XYZ with a GTrsf. More... | |
| gp_Trsf | Trsf () const |
| const gp_Mat & | _CSFDB_Getgp_GTrsfmatrix () const |
| const gp_XYZ & | _CSFDB_Getgp_GTrsfloc () const |
| gp_TrsfForm | _CSFDB_Getgp_GTrsfshape () const |
| void | _CSFDB_Setgp_GTrsfshape (const gp_TrsfForm p) |
| Standard_Real | _CSFDB_Getgp_GTrsfscale () const |
| void | _CSFDB_Setgp_GTrsfscale (const Standard_Real p) |
Defines a non-persistent transformation in 3D space. <br>
This transformation is a general transformation.
It can be a Trsf from gp, an affinity, or you can define
your own transformation giving the matrix of transformation.
With a Gtrsf you can transform only a triplet of coordinates
XYZ. It is not possible to transform other geometric objects
because these transformations can change the nature of non-
elementary geometric objects.
The transformation GTrsf can be represented as follow :
V1 V2 V3 T XYZ XYZ
| a11 a12 a13 a14 | | x | | x'|
| a21 a22 a23 a24 | | y | | y'|
| a31 a32 a33 a34 | | z | = | z'|
| 0 0 0 1 | | 1 | | 1 |
where {V1, V2, V3} define the vectorial part of the
transformation and T defines the translation part of the
transformation.
Warning
A GTrsf transformation is only applicable to
coordinates. Be careful if you apply such a
transformation to all points of a geometric object, as
this can change the nature of the object and thus
render it incoherent!
Typically, a circle is transformed into an ellipse by an
affinity transformation. To avoid modifying the nature of
an object, use a gp_Trsf transformation instead, as
objects of this class respect the nature of geometric objects.
| gp_GTrsf::gp_GTrsf | ( | ) |
Returns the Identity transformation.
| gp_GTrsf::gp_GTrsf | ( | const gp_Trsf & | T | ) |
Converts the gp_Trsf transformation T into a <br>
general transformation, i.e. Returns a GTrsf with
the same matrix of coefficients as the Trsf T.
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
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| gp_TrsfForm gp_GTrsf::Form | ( | ) | const |
Returns the nature of the transformation. It can be an <br>
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.
| void gp_GTrsf::Invert | ( | ) |
| gp_GTrsf gp_GTrsf::Inverted | ( | ) | const |
Computes the reverse transformation.
Raises an exception if the matrix of the transformation
is not inversible.
| Standard_Boolean gp_GTrsf::IsNegative | ( | ) | const |
Returns true if the determinant of the vectorial part of <br>
this transformation is negative.
| Standard_Boolean gp_GTrsf::IsSingular | ( | ) | const |
Returns true if this transformation is singular (and <br>
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 gp::Resolution().
Warning
If this transformation is singular, it cannot be inverted.
Computes the transformation composed with <me> and T.
<me> = T * <me>
| void gp_GTrsf::Multiply | ( | const gp_GTrsf & | T | ) |
Computes the transformation composed from T and <me>. <br>
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 *=
|
inline |
| void gp_GTrsf::Power | ( | const Standard_Integer | N | ) |
| gp_GTrsf gp_GTrsf::Powered | ( | const Standard_Integer | N | ) | const |
Computes:
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().
Raises an exception if N < 0 and if the matrix of the
transformation not inversible.
| void gp_GTrsf::PreMultiply | ( | const gp_GTrsf & | T | ) |
Computes the product of the transformation T and this
transformation and assigns the result to this transformation.
this = T * this
| void gp_GTrsf::SetAffinity | ( | const gp_Ax1 & | A1, |
| const Standard_Real | Ratio | ||
| ) |
Changes this transformation into an affinity of ratio Ratio <br>
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.
| void gp_GTrsf::SetAffinity | ( | const gp_Ax2 & | A2, |
| const Standard_Real | Ratio | ||
| ) |
Changes this transformation into an affinity of ratio Ratio <br>
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.
| void gp_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();
| void gp_GTrsf::SetTranslationPart | ( | const gp_XYZ & | Coord | ) |
Replaces the translation part of <br>
this transformation by the coordinates of the number triple Coord.
| void gp_GTrsf::SetTrsf | ( | const gp_Trsf & | T | ) |
Assigns the vectorial and translation parts of T to this transformation.
| void gp_GTrsf::SetValue | ( | const Standard_Integer | Row, |
| const Standard_Integer | Col, | ||
| const Standard_Real | Value | ||
| ) |
Replaces the coefficient (Row, Col) of the matrix representing <br>
this transformation by Value. Raises OutOfRange
if Row < 1 or Row > 3 or Col < 1 or Col > 4
| void gp_GTrsf::SetVectorialPart | ( | const gp_Mat & | Matrix | ) |
Replaces the vectorial part of this transformation by Matrix.
| void gp_GTrsf::Transforms | ( | gp_XYZ & | Coord | ) | const |
| void gp_GTrsf::Transforms | ( | Standard_Real & | X, |
| Standard_Real & | Y, | ||
| Standard_Real & | Z | ||
| ) | const |
Transforms a triplet XYZ with a GTrsf.
| const gp_XYZ& gp_GTrsf::TranslationPart | ( | ) | const |
Returns the translation part of the GTrsf.
| gp_Trsf gp_GTrsf::Trsf | ( | ) | const |
| Standard_Real gp_GTrsf::Value | ( | const Standard_Integer | Row, |
| const Standard_Integer | Col | ||
| ) | const |
Returns the coefficients of the global matrix of transformation. <br>
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 4
| const gp_Mat& gp_GTrsf::VectorialPart | ( | ) | const |
Computes the vectorial part of the GTrsf. The returned Matrix
is a 3*3 matrix.
1.8.5