Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
Geom2d_Transformation Class Reference

The class Transformation allows to create Translation, <br>

Rotation, Symmetry, Scaling and complex transformations
obtained by combination of the previous elementary
transformations.
The Transformation class can also be used to
construct complex transformations by combining
these elementary transformations.
However, these transformations can never change
the type of an object. For example, the projection
transformation can change a circle into an ellipse,
and therefore change the real type of the object.
Such a transformation is forbidden in this
environment and cannot be a Geom2d_Transformation.
The transformation can be represented as follow :

V1 V2 T
| a11 a12 a14 | | x | | x'|
| a21 a22 a24 | | 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.
More...

#include <Geom2d_Transformation.hxx>

Inheritance diagram for Geom2d_Transformation:
Inheritance graph
[legend]

Public Member Functions

 Geom2d_Transformation ()
 Creates an identity transformation.
More...
 
 Geom2d_Transformation (const gp_Trsf2d &T)
 Creates a persistent copy of T.
More...
 
void SetMirror (const gp_Pnt2d &P)
 Makes the transformation into a symmetrical transformation
with respect to a point P.
P is the center of the symmetry.
More...
 
void SetMirror (const gp_Ax2d &A)
 Makes the transformation into a symmetrical transformation
with respect to an axis A.
A is the center of the axial symmetry.
More...
 
void SetRotation (const gp_Pnt2d &P, const Standard_Real Ang)
 
 Assigns to this transformation the geometric <br>

properties of a rotation at angle Ang (in radians) about point P.
More...

 
void SetScale (const gp_Pnt2d &P, const Standard_Real S)
 Makes the transformation into a scale. P is the center of
the scale and S is the scaling value.
More...
 
void SetTransformation (const gp_Ax2d &FromSystem1, const gp_Ax2d &ToSystem2)
 Makes a transformation allowing passage from the coordinate
system "FromSystem1" to the coordinate system "ToSystem2".
More...
 
void SetTransformation (const gp_Ax2d &ToSystem)
 Makes 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.
More...
 
void SetTranslation (const gp_Vec2d &V)
 Makes the transformation into a translation.
V is the vector of the translation.
More...
 
void SetTranslation (const gp_Pnt2d &P1, const gp_Pnt2d &P2)
 Makes the transformation into a translation from the point
P1 to the point P2.
More...
 
void SetTrsf2d (const gp_Trsf2d &T)
 Makes the transformation into a transformation T from
package gp.
More...
 
Standard_Boolean IsNegative () const
 
 Checks whether this transformation is an indirect <br>

transformation: returns true if the determinant of the
matrix of the vectorial part of the transformation is less than 0.
More...

 
gp_TrsfForm Form () const
 
  Returns the nature of this transformation as a value <br>

of the gp_TrsfForm enumeration.
Returns the nature of the transformation. It can be
Identity, Rotation, Translation, PntMirror, Ax1Mirror,
Scale, CompoundTrsf
More...

 
Standard_Real ScaleFactor () const
 Returns the scale value of the transformation.
More...
 
gp_Trsf2d Trsf2d () const
 
 Converts this transformation into a gp_Trsf2d transformation. <br>

Returns a non persistent copy of <me>.
-C++: return const&
More...

 
Standard_Real Value (const Standard_Integer Row, const Standard_Integer Col) const
 Returns the coefficients of the global matrix of tranformation.
It is a 2 rows X 3 columns matrix.
Raised if Row < 1 or Row > 2 or Col < 1 or Col > 2
Computes the reverse transformation.
More...
 
void Invert ()
 
 Computes the inverse of this transformation. <br>

and assigns the result to this transformatio
Raised if the the transformation is singular. This means that
the ScaleFactor is lower or equal to Resolution from
package gp.
More...

 
Handle_Geom2d_Transformation Inverted () const
 
Computes the inverse of this transformation and creates a new one. <br>

Raises ConstructionError if the the transformation is singular. This means that
the ScaleFactor is lower or equal to Resolution from package gp.
More...

 
Handle_Geom2d_Transformation Multiplied (const Handle< Geom2d_Transformation > &Other) const
 Computes the transformation composed with Other and <me>.
<me> * Other.
Returns a new transformation
More...
 
Handle_Geom2d_Transformation operator* (const Handle< Geom2d_Transformation > &Other) const
 
void Multiply (const Handle< Geom2d_Transformation > &Other)
 Computes the transformation composed with Other and <me> .
<me> = <me> * Other.
Computes the following composition of transformations
if N > 0 <me> * <me> * .......* <me>.
if N = 0 Identity
if N < 0 <me>.Invert() * .........* <me>.Invert()
More...
 
void operator*= (const Handle< Geom2d_Transformation > &Other)
 
void Power (const Standard_Integer N)
 Raised if N < 0 and if the transformation is not inversible
More...
 
Handle_Geom2d_Transformation Powered (const Standard_Integer N) const
 Raised if N < 0 and if the transformation is not inversible
More...
 
void PreMultiply (const Handle< Geom2d_Transformation > &Other)
 Computes the matrix of the transformation composed with
<me> and Other. <me> = Other * <me>
More...
 
void Transforms (Standard_Real &X, Standard_Real &Y) const
 Applies the transformation <me> to the triplet {X, Y}.
More...
 
Handle_Geom2d_Transformation Copy () const
 Creates a new object, which is a copy of this transformation.
More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void ShallowDump (Standard_OStream &) const
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Detailed Description

The class Transformation allows to create Translation, <br>

Rotation, Symmetry, Scaling and complex transformations
obtained by combination of the previous elementary
transformations.
The Transformation class can also be used to
construct complex transformations by combining
these elementary transformations.
However, these transformations can never change
the type of an object. For example, the projection
transformation can change a circle into an ellipse,
and therefore change the real type of the object.
Such a transformation is forbidden in this
environment and cannot be a Geom2d_Transformation.
The transformation can be represented as follow :

V1 V2 T
| a11 a12 a14 | | x | | x'|
| a21 a22 a24 | | 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.

Constructor & Destructor Documentation

Geom2d_Transformation::Geom2d_Transformation ( )

Creates an identity transformation.

Geom2d_Transformation::Geom2d_Transformation ( const gp_Trsf2d T)

Creates a persistent copy of T.

Member Function Documentation

Handle_Geom2d_Transformation Geom2d_Transformation::Copy ( ) const

Creates a new object, which is a copy of this transformation.

gp_TrsfForm Geom2d_Transformation::Form ( ) const

  Returns the nature of this transformation as a value <br>

of the gp_TrsfForm enumeration.
Returns the nature of the transformation. It can be
Identity, Rotation, Translation, PntMirror, Ax1Mirror,
Scale, CompoundTrsf

void Geom2d_Transformation::Invert ( )

 Computes the inverse of this transformation. <br>

and assigns the result to this transformatio
Raised if the the transformation is singular. This means that
the ScaleFactor is lower or equal to Resolution from
package gp.

Handle_Geom2d_Transformation Geom2d_Transformation::Inverted ( ) const

Computes the inverse of this transformation and creates a new one. <br>

Raises ConstructionError if the the transformation is singular. This means that
the ScaleFactor is lower or equal to Resolution from package gp.

Standard_Boolean Geom2d_Transformation::IsNegative ( ) const

 Checks whether this transformation is an indirect <br>

transformation: returns true if the determinant of the
matrix of the vectorial part of the transformation is less than 0.

Handle_Geom2d_Transformation Geom2d_Transformation::Multiplied ( const Handle< Geom2d_Transformation > &  Other) const

Computes the transformation composed with Other and <me>.
<me> * Other.
Returns a new transformation

void Geom2d_Transformation::Multiply ( const Handle< Geom2d_Transformation > &  Other)

Computes the transformation composed with Other and <me> .
<me> = <me> * Other.
Computes the following composition of transformations
if N > 0 <me> * <me> * .......* <me>.
if N = 0 Identity
if N < 0 <me>.Invert() * .........* <me>.Invert()

Handle_Geom2d_Transformation Geom2d_Transformation::operator* ( const Handle< Geom2d_Transformation > &  Other) const
inline
void Geom2d_Transformation::operator*= ( const Handle< Geom2d_Transformation > &  Other)
inline
void Geom2d_Transformation::Power ( const Standard_Integer  N)

Raised if N < 0 and if the transformation is not inversible

Handle_Geom2d_Transformation Geom2d_Transformation::Powered ( const Standard_Integer  N) const

Raised if N < 0 and if the transformation is not inversible

void Geom2d_Transformation::PreMultiply ( const Handle< Geom2d_Transformation > &  Other)

Computes the matrix of the transformation composed with
<me> and Other. <me> = Other * <me>

Standard_Real Geom2d_Transformation::ScaleFactor ( ) const

Returns the scale value of the transformation.

void Geom2d_Transformation::SetMirror ( const gp_Pnt2d P)

Makes the transformation into a symmetrical transformation
with respect to a point P.
P is the center of the symmetry.

void Geom2d_Transformation::SetMirror ( const gp_Ax2d A)

Makes the transformation into a symmetrical transformation
with respect to an axis A.
A is the center of the axial symmetry.

void Geom2d_Transformation::SetRotation ( const gp_Pnt2d P,
const Standard_Real  Ang 
)

 Assigns to this transformation the geometric <br>

properties of a rotation at angle Ang (in radians) about point P.

void Geom2d_Transformation::SetScale ( const gp_Pnt2d P,
const Standard_Real  S 
)

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

void Geom2d_Transformation::SetTransformation ( const gp_Ax2d FromSystem1,
const gp_Ax2d ToSystem2 
)

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

void Geom2d_Transformation::SetTransformation ( const gp_Ax2d ToSystem)

Makes 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 Geom2d_Transformation::SetTranslation ( const gp_Vec2d V)

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

void Geom2d_Transformation::SetTranslation ( const gp_Pnt2d P1,
const gp_Pnt2d P2 
)

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

void Geom2d_Transformation::SetTrsf2d ( const gp_Trsf2d T)

Makes the transformation into a transformation T from
package gp.

void Geom2d_Transformation::Transforms ( Standard_Real X,
Standard_Real Y 
) const

Applies the transformation <me> to the triplet {X, Y}.

gp_Trsf2d Geom2d_Transformation::Trsf2d ( ) const

 Converts this transformation into a gp_Trsf2d transformation. <br>

Returns a non persistent copy of <me>.
-C++: return const&

Standard_Real Geom2d_Transformation::Value ( const Standard_Integer  Row,
const Standard_Integer  Col 
) const

Returns the coefficients of the global matrix of tranformation.
It is a 2 rows X 3 columns matrix.
Raised if Row < 1 or Row > 2 or Col < 1 or Col > 2
Computes the reverse transformation.


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