Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
gp_Trsf2d Class Reference

Defines a non-persistent transformation in 2D space. The following transformations are implemented : More...

#include <gp_Trsf2d.hxx>

Public Member Functions

constexpr gp_Trsf2d () noexcept
 Returns identity transformation.
 
 gp_Trsf2d (const gp_Trsf &theT)
 Creates a 2d transformation in the XY plane from a 3d transformation .
 
void SetMirror (const gp_Pnt2d &theP) noexcept
 Changes the transformation into a symmetrical transformation. theP is the center of the symmetry.
 
void SetMirror (const gp_Ax2d &theA) noexcept
 Changes the transformation into a symmetrical transformation. theA is the center of the axial symmetry.
 
void SetRotation (const gp_Pnt2d &theP, const double theAng)
 Changes the transformation into a rotation. theP is the rotation's center and theAng is the angular value of the rotation in radian.
 
void SetScale (const gp_Pnt2d &theP, const double theS)
 Changes the transformation into a scale. theP is the center of the scale and theS is the scaling value.
 
void SetTransformation (const gp_Ax2d &theFromSystem1, const gp_Ax2d &theToSystem2)
 Changes a transformation allowing passage from the coordinate system "theFromSystem1" to the coordinate system "theToSystem2".
 
void SetTransformation (const gp_Ax2d &theToSystem)
 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 theToSystem.
 
void SetTranslation (const gp_Vec2d &theV)
 Changes the transformation into a translation. theV is the vector of the translation.
 
void SetTranslation (const gp_Pnt2d &theP1, const gp_Pnt2d &theP2)
 Makes the transformation into a translation from the point theP1 to the point theP2.
 
void SetTranslationPart (const gp_Vec2d &theV)
 Replaces the translation vector with theV.
 
void SetScaleFactor (const double theS)
 Modifies the scale factor.
 
constexpr bool IsNegative () const noexcept
 Returns true if the determinant of the vectorial part of this transformation is negative..
 
constexpr gp_TrsfForm Form () const noexcept
 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.
 
constexpr double ScaleFactor () const noexcept
 Returns the scale factor.
 
constexpr const gp_XYTranslationPart () const noexcept
 Returns the translation part of the transformation's matrix.
 
gp_Mat2d VectorialPart () const
 Returns the vectorial part of the transformation. It is a 2*2 matrix which includes the scale factor.
 
constexpr const gp_Mat2dHVectorialPart () const noexcept
 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.
 
double RotationPart () const
 Returns the angle corresponding to the rotational component of the transformation matrix (operation opposite to SetRotation()).
 
constexpr double Value (const int theRow, const int theCol) const
 Returns the coefficients of the transformation's matrix. It is a 2 rows * 3 columns matrix. Raises OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 3.
 
void Invert ()
 
gp_Trsf2d Inverted () const
 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.
 
gp_Trsf2d Multiplied (const gp_Trsf2d &theT) const
 
gp_Trsf2d operator* (const gp_Trsf2d &theT) const
 
void Multiply (const gp_Trsf2d &theT)
 Computes the transformation composed from <me> and theT. <me> = <me> * theT.
 
void operator*= (const gp_Trsf2d &theT)
 
void PreMultiply (const gp_Trsf2d &theT)
 Computes the transformation composed from <me> and theT. <me> = theT * <me>
 
void Power (const int theN)
 
gp_Trsf2d Powered (const int theN)
 Computes the following composition of transformations <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Inverse() *...........* <me>.Inverse().
 
constexpr void Transforms (double &theX, double &theY) const noexcept
 
constexpr void Transforms (gp_XY &theCoord) const noexcept
 Transforms a doublet XY with a Trsf2d.
 
void SetValues (const double a11, const double a12, const double a13, const double a21, const double a22, const double a23)
 Sets the coefficients of the transformation. The transformation of the point x,y is the point x',y' with :
 

Protected Member Functions

void Orthogonalize ()
 Makes orthogonalization of "matrix".
 

Detailed Description

Defines a non-persistent transformation in 2D space. The following transformations are implemented :

Constructor & Destructor Documentation

◆ gp_Trsf2d() [1/2]

constexpr gp_Trsf2d::gp_Trsf2d ( )
inlineconstexprnoexcept

Returns identity transformation.

◆ gp_Trsf2d() [2/2]

gp_Trsf2d::gp_Trsf2d ( const gp_Trsf & theT)
inline

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

Member Function Documentation

◆ Form()

constexpr gp_TrsfForm gp_Trsf2d::Form ( ) const
inlineconstexprnoexcept

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.

◆ HVectorialPart()

constexpr const gp_Mat2d & gp_Trsf2d::HVectorialPart ( ) const
inlineconstexprnoexcept

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.

◆ Invert()

void gp_Trsf2d::Invert ( )

◆ Inverted()

gp_Trsf2d gp_Trsf2d::Inverted ( ) const
inline

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.

◆ IsNegative()

constexpr bool gp_Trsf2d::IsNegative ( ) const
inlineconstexprnoexcept

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

◆ Multiplied()

gp_Trsf2d gp_Trsf2d::Multiplied ( const gp_Trsf2d & theT) const
inline

◆ Multiply()

void gp_Trsf2d::Multiply ( const gp_Trsf2d & theT)

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

◆ operator*()

gp_Trsf2d gp_Trsf2d::operator* ( const gp_Trsf2d & theT) const
inline

◆ operator*=()

void gp_Trsf2d::operator*= ( const gp_Trsf2d & theT)
inline

◆ Orthogonalize()

void gp_Trsf2d::Orthogonalize ( )
protected

Makes orthogonalization of "matrix".

◆ Power()

void gp_Trsf2d::Power ( const int theN)

◆ Powered()

gp_Trsf2d gp_Trsf2d::Powered ( const int theN)
inline

Computes the following composition of transformations <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Inverse() *...........* <me>.Inverse().

Raises if theN < 0 and if the matrix of the transformation not inversible.

◆ PreMultiply()

void gp_Trsf2d::PreMultiply ( const gp_Trsf2d & theT)

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

◆ RotationPart()

double gp_Trsf2d::RotationPart ( ) const

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

◆ ScaleFactor()

constexpr double gp_Trsf2d::ScaleFactor ( ) const
inlineconstexprnoexcept

Returns the scale factor.

◆ SetMirror() [1/2]

void gp_Trsf2d::SetMirror ( const gp_Ax2d & theA)
noexcept

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

◆ SetMirror() [2/2]

void gp_Trsf2d::SetMirror ( const gp_Pnt2d & theP)
inlinenoexcept

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

◆ SetRotation()

void gp_Trsf2d::SetRotation ( const gp_Pnt2d & theP,
const double theAng )
inline

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

◆ SetScale()

void gp_Trsf2d::SetScale ( const gp_Pnt2d & theP,
const double theS )
inline

Changes the transformation into a scale. theP is the center of the scale and theS is the scaling value.

◆ SetScaleFactor()

void gp_Trsf2d::SetScaleFactor ( const double theS)

Modifies the scale factor.

◆ SetTransformation() [1/2]

void gp_Trsf2d::SetTransformation ( const gp_Ax2d & theFromSystem1,
const gp_Ax2d & theToSystem2 )

Changes a transformation allowing passage from the coordinate system "theFromSystem1" to the coordinate system "theToSystem2".

◆ SetTransformation() [2/2]

void gp_Trsf2d::SetTransformation ( const gp_Ax2d & theToSystem)

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 theToSystem.

◆ SetTranslation() [1/2]

void gp_Trsf2d::SetTranslation ( const gp_Pnt2d & theP1,
const gp_Pnt2d & theP2 )
inline

Makes the transformation into a translation from the point theP1 to the point theP2.

◆ SetTranslation() [2/2]

void gp_Trsf2d::SetTranslation ( const gp_Vec2d & theV)
inline

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

◆ SetTranslationPart()

void gp_Trsf2d::SetTranslationPart ( const gp_Vec2d & theV)

Replaces the translation vector with theV.

◆ SetValues()

void gp_Trsf2d::SetValues ( const double a11,
const double a12,
const double a13,
const double a21,
const double a22,
const 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.

◆ Transforms() [1/2]

constexpr void gp_Trsf2d::Transforms ( double & theX,
double & theY ) const
inlineconstexprnoexcept

◆ Transforms() [2/2]

constexpr void gp_Trsf2d::Transforms ( gp_XY & theCoord) const
inlineconstexprnoexcept

Transforms a doublet XY with a Trsf2d.

◆ TranslationPart()

constexpr const gp_XY & gp_Trsf2d::TranslationPart ( ) const
inlineconstexprnoexcept

Returns the translation part of the transformation's matrix.

◆ Value()

constexpr double gp_Trsf2d::Value ( const int theRow,
const int theCol ) const
inlineconstexpr

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

◆ VectorialPart()

gp_Mat2d gp_Trsf2d::VectorialPart ( ) const

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


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