Open CASCADE Technology 7.9.0
|
Defines a non-persistent transformation in 3D space. This transformation is a general transformation. It can be a gp_Trsf, an affinity, or you can define your own transformation giving the matrix of transformation. More...
#include <gp_GTrsf.hxx>
Public Member Functions | |
gp_GTrsf () | |
Returns the Identity transformation. | |
gp_GTrsf (const gp_Trsf &theT) | |
Converts the gp_Trsf transformation theT into a general transformation, i.e. Returns a GTrsf with the same matrix of coefficients as the Trsf theT. | |
gp_GTrsf (const gp_Mat &theM, const gp_XYZ &theV) | |
Creates a transformation based on the matrix theM and the vector theV where theM defines the vectorial part of the transformation, and V the translation part, or. | |
void | SetAffinity (const gp_Ax1 &theA1, const Standard_Real theRatio) |
Changes this transformation into an affinity of ratio theRatio with respect to the axis theA1. 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 theA1 or the plane A2, the vectors HP and HP' satisfy: HP' = theRatio * HP. | |
void | SetAffinity (const gp_Ax2 &theA2, const Standard_Real theRatio) |
Changes this transformation into an affinity of ratio theRatio with respect to the plane defined by the origin, the "X Direction" and the "Y Direction" of coordinate system theA2. 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 theA2, the vectors HP and HP' satisfy: HP' = theRatio * HP. | |
void | SetValue (const Standard_Integer theRow, const Standard_Integer theCol, const Standard_Real theValue) |
Replaces the coefficient (theRow, theCol) of the matrix representing this transformation by theValue. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 4. | |
void | SetVectorialPart (const gp_Mat &theMatrix) |
Replaces the vectorial part of this transformation by theMatrix. | |
void | SetTranslationPart (const gp_XYZ &theCoord) |
Replaces the translation part of this transformation by the coordinates of the number triple theCoord. | |
void | SetTrsf (const gp_Trsf &theT) |
Assigns the vectorial and translation parts of theT to this transformation. | |
Standard_Boolean | IsNegative () const |
Returns true if the determinant of the vectorial part of this transformation is negative. | |
Standard_Boolean | 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 gp::Resolution(). Warning If this transformation is singular, it cannot be inverted. | |
gp_TrsfForm | 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. | |
void | SetForm () |
verify and set the shape of the GTrsf Other or CompoundTrsf Ex : | |
const gp_XYZ & | TranslationPart () const |
Returns the translation part of the GTrsf. | |
const gp_Mat & | VectorialPart () const |
Computes the vectorial part of the GTrsf. The returned Matrix is a 3*3 matrix. | |
Standard_Real | Value (const Standard_Integer theRow, const Standard_Integer theCol) const |
Returns the coefficients of the global matrix of transformation. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 4. | |
Standard_Real | operator() (const Standard_Integer theRow, const Standard_Integer theCol) const |
void | Invert () |
gp_GTrsf | Inverted () const |
Computes the reverse transformation. Raises an exception if the matrix of the transformation is not inversible. | |
gp_GTrsf | Multiplied (const gp_GTrsf &theT) const |
Computes the transformation composed from theT and <me>. In a C++ implementation you can also write Tcomposed = <me> * theT. Example : | |
gp_GTrsf | operator* (const gp_GTrsf &theT) const |
void | Multiply (const gp_GTrsf &theT) |
Computes the transformation composed with <me> and theT. <me> = <me> * theT. | |
void | operator*= (const gp_GTrsf &theT) |
void | PreMultiply (const gp_GTrsf &theT) |
Computes the product of the transformation theT and this transformation and assigns the result to this transformation. this = theT * this. | |
void | Power (const Standard_Integer theN) |
gp_GTrsf | Powered (const Standard_Integer theN) const |
Computes: | |
void | Transforms (gp_XYZ &theCoord) const |
void | Transforms (Standard_Real &theX, Standard_Real &theY, Standard_Real &theZ) const |
Transforms a triplet XYZ with a GTrsf. | |
gp_Trsf | Trsf () const |
template<class T> | |
void | GetMat4 (NCollection_Mat4< T > &theMat) const |
Convert transformation to 4x4 matrix. | |
template<class T> | |
void | SetMat4 (const NCollection_Mat4< T > &theMat) |
Convert transformation from 4x4 matrix. | |
void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const |
Dumps the content of me into the stream. | |
Defines a non-persistent transformation in 3D space. This transformation is a general transformation. It can be a gp_Trsf, an affinity, or you can define your own transformation giving the matrix of transformation.
With a gp_GTrsf you can transform only a triplet of coordinates gp_XYZ. It is not possible to transform other geometric objects because these transformations can change the nature of non-elementary geometric objects. The transformation gp_GTrsf can be represented as follow:
where {V1, V2, V3} define the vectorial part of the transformation and T defines the translation part of the transformation. Warning A gp_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.
|
inline |
Returns the Identity transformation.
|
inline |
Converts the gp_Trsf transformation theT into a general transformation, i.e. Returns a GTrsf with the same matrix of coefficients as the Trsf theT.
Creates a transformation based on the matrix theM and the vector theV where theM defines the vectorial part of the transformation, and V the translation part, or.
void gp_GTrsf::DumpJson | ( | Standard_OStream & | theOStream, |
Standard_Integer | theDepth = -1 ) const |
Dumps the content of me into the stream.
|
inline |
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.
|
inline |
Convert transformation to 4x4 matrix.
void gp_GTrsf::Invert | ( | ) |
|
inline |
Computes the reverse transformation. Raises an exception if the matrix of the transformation is not inversible.
|
inline |
Returns true if the determinant of the vectorial part of this transformation is negative.
|
inline |
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 gp::Resolution(). Warning If this transformation is singular, it cannot be inverted.
Computes the transformation composed from theT and <me>. In a C++ implementation you can also write Tcomposed = <me> * theT. Example :
void gp_GTrsf::Multiply | ( | const gp_GTrsf & | theT | ) |
Computes the transformation composed with <me> and theT. <me> = <me> * theT.
|
inline |
|
inline |
void gp_GTrsf::Power | ( | const Standard_Integer | theN | ) |
|
inline |
Computes:
Raises an exception if N < 0 and if the matrix of the transformation not inversible.
void gp_GTrsf::PreMultiply | ( | const gp_GTrsf & | theT | ) |
Computes the product of the transformation theT and this transformation and assigns the result to this transformation. this = theT * this.
|
inline |
Changes this transformation into an affinity of ratio theRatio with respect to the axis theA1. 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 theA1 or the plane A2, the vectors HP and HP' satisfy: HP' = theRatio * HP.
|
inline |
Changes this transformation into an affinity of ratio theRatio with respect to the plane defined by the origin, the "X Direction" and the "Y Direction" of coordinate system theA2. 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 theA2, the vectors HP and HP' satisfy: HP' = theRatio * HP.
void gp_GTrsf::SetForm | ( | ) |
verify and set the shape of the GTrsf Other or CompoundTrsf Ex :
|
inline |
Convert transformation from 4x4 matrix.
void gp_GTrsf::SetTranslationPart | ( | const gp_XYZ & | theCoord | ) |
Replaces the translation part of this transformation by the coordinates of the number triple theCoord.
|
inline |
Assigns the vectorial and translation parts of theT to this transformation.
|
inline |
Replaces the coefficient (theRow, theCol) of the matrix representing this transformation by theValue. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 4.
|
inline |
Replaces the vectorial part of this transformation by theMatrix.
|
inline |
|
inline |
Transforms a triplet XYZ with a GTrsf.
|
inline |
Returns the translation part of the GTrsf.
|
inline |
|
inline |
Returns the coefficients of the global matrix of transformation. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 4.
|
inline |
Computes the vectorial part of the GTrsf. The returned Matrix is a 3*3 matrix.