OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Geom2d_Transformation Class Reference

    The class Transformation allows to create Translation, 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 follows: More...

    #include <Geom2d_Transformation.hxx>

    Inheritance diagram for Geom2d_Transformation:

    Public Member Functions

     Geom2d_Transformation ()
     Creates an identity transformation.
     Geom2d_Transformation (const gp_Trsf2d &T)
     Creates a persistent copy of T.
    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.
    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.
    void SetRotation (const gp_Pnt2d &P, const double Ang)
     Assigns to this transformation the geometric properties of a rotation at angle Ang (in radians) about point P.
    void SetScale (const gp_Pnt2d &P, const double S)
     Makes the transformation into a scale. P is the center of the scale and S is the scaling value.
    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".
    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.
    void SetTranslation (const gp_Vec2d &V)
     Makes the transformation into a translation. V is the vector of the translation.
    void SetTranslation (const gp_Pnt2d &P1, const gp_Pnt2d &P2)
     Makes the transformation into a translation from the point P1 to the point P2.
    void SetTrsf2d (const gp_Trsf2d &T)
     Makes the transformation into a transformation T from package gp.
    bool IsNegative () const
     Checks whether this transformation is an indirect transformation: returns true if the determinant of the matrix of the vectorial part of the transformation is less than 0.
    gp_TrsfForm Form () const
     Returns the nature of this transformation as a value of the gp_TrsfForm enumeration. Returns the nature of the transformation. It can be Identity, Rotation, Translation, PntMirror, Ax1Mirror, Scale, CompoundTrsf.
    double ScaleFactor () const
     Returns the scale value of the transformation.
    gp_Trsf2d Trsf2d () const
     Converts this transformation into a gp_Trsf2d transformation. Returns a non persistent copy of <me>. -C++: return const&.
    double Value (const int Row, const int Col) const
     Returns the coefficients of the global matrix of transformation. It is a 2 rows X 3 columns matrix.
    void Invert ()
     Computes the inverse of this transformation and assigns the result to this transformation.
    occ::handle< Geom2d_Transformation > Inverted () const
     Computes the inverse of this transformation and creates a new one. Raises ConstructionError if the transformation is singular. This means that the ScaleFactor is lower or equal to Resolution from package gp.
    occ::handle< Geom2d_Transformation > Multiplied (const occ::handle< Geom2d_Transformation > &Other) const
     Computes the transformation composed with Other and <me>. <me> * Other. Returns a new transformation.
    occ::handle< Geom2d_Transformation > operator* (const occ::handle< Geom2d_Transformation > &Other) const
    void Multiply (const occ::handle< Geom2d_Transformation > &Other)
     Computes the transformation composed with Other and <me> . <me> = <me> * Other.
    void operator*= (const occ::handle< Geom2d_Transformation > &Other)
    void Power (const int N)
     Raised if N < 0 and if the transformation is not inversible.
    occ::handle< Geom2d_Transformation > Powered (const int N) const
     Raised if N < 0 and if the transformation is not inversible.
    void PreMultiply (const occ::handle< Geom2d_Transformation > &Other)
     Computes the matrix of the transformation composed with <me> and Other. <me> = Other * <me>.
    void Transforms (double &X, double &Y) const
     Applies the transformation <me> to the triplet {X, Y}.
    occ::handle< Geom2d_Transformation > Copy () const
     Creates a new object, which is a copy of this transformation.
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transient & operator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool IsKind (const opencascade::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.
    bool IsKind (const char *const 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.
    Standard_Transient * This () const
     Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.
    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    Detailed Description

    The class Transformation allows to create Translation, 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 follows:

    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.

    • Geom2d_Transformation transformations provide the same kind of "geometric" services as gp_Trsf2d ones but have more complex data structures. The geometric objects provided by the Geom2d package use gp_Trsf2d transformations in the syntaxes Transform and Transformed.
    • Geom2d_Transformation transformations are used in a context where they can be shared by several objects contained inside a common data structure.

    Constructor & Destructor Documentation

    ◆ Geom2d_Transformation() [1/2]

    Geom2d_Transformation::Geom2d_Transformation ( )

    Creates an identity transformation.

    ◆ Geom2d_Transformation() [2/2]

    Geom2d_Transformation::Geom2d_Transformation ( const gp_Trsf2d & T)

    Creates a persistent copy of T.

    Member Function Documentation

    ◆ Copy()

    occ::handle< Geom2d_Transformation > Geom2d_Transformation::Copy ( ) const
    nodiscard

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

    ◆ Form()

    gp_TrsfForm Geom2d_Transformation::Form ( ) const

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

    ◆ Invert()

    void Geom2d_Transformation::Invert ( )

    Computes the inverse of this transformation and assigns the result to this transformation.

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

    ◆ Inverted()

    occ::handle< Geom2d_Transformation > Geom2d_Transformation::Inverted ( ) const
    nodiscard

    Computes the inverse of this transformation and creates a new one. Raises ConstructionError if the transformation is singular. This means that the ScaleFactor is lower or equal to Resolution from package gp.

    ◆ IsNegative()

    bool Geom2d_Transformation::IsNegative ( ) const

    Checks whether this transformation is an indirect transformation: returns true if the determinant of the matrix of the vectorial part of the transformation is less than 0.

    ◆ Multiplied()

    occ::handle< Geom2d_Transformation > Geom2d_Transformation::Multiplied ( const occ::handle< Geom2d_Transformation > & Other) const
    nodiscard

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

    ◆ Multiply()

    void Geom2d_Transformation::Multiply ( const occ::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()

    ◆ operator*()

    occ::handle< Geom2d_Transformation > Geom2d_Transformation::operator* ( const occ::handle< Geom2d_Transformation > & Other) const
    inlinenodiscard

    ◆ operator*=()

    void Geom2d_Transformation::operator*= ( const occ::handle< Geom2d_Transformation > & Other)
    inline

    ◆ Power()

    void Geom2d_Transformation::Power ( const int N)

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

    ◆ Powered()

    occ::handle< Geom2d_Transformation > Geom2d_Transformation::Powered ( const int N) const

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

    ◆ PreMultiply()

    void Geom2d_Transformation::PreMultiply ( const occ::handle< Geom2d_Transformation > & Other)

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

    ◆ ScaleFactor()

    double Geom2d_Transformation::ScaleFactor ( ) const

    Returns the scale value of the transformation.

    ◆ SetMirror() [1/2]

    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.

    ◆ SetMirror() [2/2]

    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.

    ◆ SetRotation()

    void Geom2d_Transformation::SetRotation ( const gp_Pnt2d & P,
    const double Ang )

    Assigns to this transformation the geometric properties of a rotation at angle Ang (in radians) about point P.

    ◆ SetScale()

    void Geom2d_Transformation::SetScale ( const gp_Pnt2d & P,
    const double S )

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

    ◆ SetTransformation() [1/2]

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

    ◆ SetTransformation() [2/2]

    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.

    ◆ SetTranslation() [1/2]

    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.

    ◆ SetTranslation() [2/2]

    void Geom2d_Transformation::SetTranslation ( const gp_Vec2d & V)

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

    ◆ SetTrsf2d()

    void Geom2d_Transformation::SetTrsf2d ( const gp_Trsf2d & T)

    Makes the transformation into a transformation T from package gp.

    ◆ Transforms()

    void Geom2d_Transformation::Transforms ( double & X,
    double & Y ) const

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

    ◆ Trsf2d()

    gp_Trsf2d Geom2d_Transformation::Trsf2d ( ) const

    Converts this transformation into a gp_Trsf2d transformation. Returns a non persistent copy of <me>. -C++: return const&.

    ◆ Value()

    double Geom2d_Transformation::Value ( const int Row,
    const int Col ) const

    Returns the coefficients of the global matrix of transformation. 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: