OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    gp_Ax2 Class Reference

    Describes a right-handed coordinate system in 3D space. A coordinate system is defined by: More...

    #include <gp_Ax2.hxx>

    Public Member Functions

    constexpr gp_Ax2 () noexcept
     Creates an object corresponding to the reference coordinate system (OXYZ).
     gp_Ax2 (const gp_Pnt &P, const gp_Dir &N, const gp_Dir &Vx)
     Creates an axis placement with an origin P such that:
    constexpr gp_Ax2 (const gp_Pnt &theP, const gp_Dir::D theN, const gp_Dir::D theVx) noexcept
     Creates an axis placement with standard directions.
     gp_Ax2 (const gp_Pnt &P, const gp_Dir &V)
     Creates a coordinate system with an origin P, where V gives the "main Direction" (here, "X Direction" and "Y Direction" are defined automatically).
    constexpr gp_Ax2 (const gp_Pnt &theP, const gp_Dir::D theV) noexcept
     Creates a coordinate system with an origin P and standard main direction.
    constexpr gp_Ax2 (const gp_Dir::D theV) noexcept
     Creates a coordinate system at the origin with the given standard main direction. Replaces gp::XOY(), gp::YOZ(), gp::ZOX() static functions.
    void SetAxis (const gp_Ax1 &A1)
     Assigns the origin and "main Direction" of the axis A1 to this coordinate system, then recomputes its "X Direction" and "Y Direction". Note: The new "X Direction" is computed as follows: new "X Direction" = V1 ^(previous "X Direction" ^ V) where V is the "Direction" of A1. Exceptions Standard_ConstructionError if A1 is parallel to the "X Direction" of this coordinate system.
    void SetDirection (const gp_Dir &V)
     Changes the "main Direction" of this coordinate system, then recomputes its "X Direction" and "Y Direction". Note: the new "X Direction" is computed as follows: new "X Direction" = V ^ (previous "X Direction" ^ V) Exceptions Standard_ConstructionError if V is parallel to the "X Direction" of this coordinate system.
    constexpr void SetLocation (const gp_Pnt &theP) noexcept
     Changes the "Location" point (origin) of <me>.
    void SetXDirection (const gp_Dir &theVx)
     Changes the "Xdirection" of <me>. The main direction "Direction" is not modified, the "Ydirection" is modified. If <Vx> is not normal to the main direction then <XDirection> is computed as follows XDirection = Direction ^ (Vx ^ Direction). Exceptions Standard_ConstructionError if Vx or Vy is parallel to the "main Direction" of this coordinate system.
    void SetYDirection (const gp_Dir &theVy)
     Changes the "Ydirection" of <me>. The main direction is not modified but the "Xdirection" is changed. If <Vy> is not normal to the main direction then "YDirection" is computed as follows YDirection = Direction ^ (<Vy> ^ Direction). Exceptions Standard_ConstructionError if Vx or Vy is parallel to the "main Direction" of this coordinate system.
    double Angle (const gp_Ax2 &theOther) const
     Computes the angular value, in radians, between the main direction of <me> and the main direction of <theOther>. Returns the angle between 0 and PI in radians.
    constexpr const gp_Ax1Axis () const noexcept
     Returns the main axis of <me>. It is the "Location" point and the main "Direction".
    constexpr const gp_DirDirection () const noexcept
     Returns the main direction of <me>.
    constexpr const gp_PntLocation () const noexcept
     Returns the "Location" point (origin) of <me>.
    constexpr const gp_DirXDirection () const noexcept
     Returns the "XDirection" of <me>.
    constexpr const gp_DirYDirection () const noexcept
     Returns the "YDirection" of <me>.
    bool IsCoplanar (const gp_Ax2 &Other, const double LinearTolerance, const double AngularTolerance) const
    bool IsCoplanar (const gp_Ax1 &A1, const double LinearTolerance, const double AngularTolerance) const
     Returns True if: . the distance between <me> and the "Location" point of A1 is lower of equal to LinearTolerance and . the main direction of <me> and the direction of A1 are normal. Note: the tolerance criterion for angular equality is given by AngularTolerance.
    void Mirror (const gp_Pnt &P) noexcept
     Performs a symmetrical transformation of this coordinate system with respect to:
    gp_Ax2 Mirrored (const gp_Pnt &P) const noexcept
     Performs a symmetrical transformation of this coordinate system with respect to:
    void Mirror (const gp_Ax1 &A1)
     Performs a symmetrical transformation of this coordinate system with respect to:
    gp_Ax2 Mirrored (const gp_Ax1 &A1) const
     Performs a symmetrical transformation of this coordinate system with respect to:
    void Mirror (const gp_Ax2 &A2)
     Performs a symmetrical transformation of this coordinate system with respect to:
    gp_Ax2 Mirrored (const gp_Ax2 &A2) const
     Performs a symmetrical transformation of this coordinate system with respect to:
    void Rotate (const gp_Ax1 &theA1, const double theAng)
    gp_Ax2 Rotated (const gp_Ax1 &theA1, const double theAng) const
     Rotates an axis placement. <theA1> is the axis of the rotation. theAng is the angular value of the rotation in radians.
    constexpr void Scale (const gp_Pnt &theP, const double theS) noexcept
    constexpr gp_Ax2 Scaled (const gp_Pnt &theP, const double theS) const noexcept
     Applies a scaling transformation on the axis placement. The "Location" point of the axisplacement is modified. Warnings: If the scale is negative: . the main direction of the axis placement is not changed. . The "XDirection" and the "YDirection" are reversed. So the axis placement stay right handed.
    void Transform (const gp_Trsf &theT)
    gp_Ax2 Transformed (const gp_Trsf &theT) const
     Transforms an axis placement with a Trsf. The "Location" point, the "XDirection" and the "YDirection" are transformed with theT. The resulting main "Direction" of <me> is the cross product between the "XDirection" and the "YDirection" after transformation.
    constexpr void Translate (const gp_Vec &theV) noexcept
    constexpr gp_Ax2 Translated (const gp_Vec &theV) const noexcept
     Translates an axis plaxement in the direction of the vector <theV>. The magnitude of the translation is the vector's magnitude.
    constexpr void Translate (const gp_Pnt &theP1, const gp_Pnt &theP2) noexcept
    constexpr gp_Ax2 Translated (const gp_Pnt &theP1, const gp_Pnt &theP2) const noexcept
     Translates an axis placement from the point <theP1> to the point <theP2>.
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.
    bool InitFromJson (const Standard_SStream &theSStream, int &theStreamPos)
     Inits the content of me from the stream.

    Static Protected Member Functions

    static constexpr gp_Dir::D getPerpendicularXDir (const gp_Dir::D theMainDir) noexcept
     Helper to compute perpendicular X direction for standard main directions.
    static constexpr gp_Dir::D getPerpendicularYDir (const gp_Dir::D theMainDir) noexcept
     Helper to compute Y direction (main x X) for standard directions.
    static constexpr gp_Dir::D crossStandardDir (const gp_Dir::D theA, const gp_Dir::D theB) noexcept
     Helper to compute cross product of two standard directions (right-handed: A x B).

    Detailed Description

    Describes a right-handed coordinate system in 3D space. A coordinate system is defined by:

    • its origin (also referred to as its "Location point"), and
    • three orthogonal unit vectors, termed respectively the "X Direction", the "Y Direction" and the "Direction" (also referred to as the "main Direction"). The "Direction" of the coordinate system is called its "main Direction" because whenever this unit vector is modified, the "X Direction" and the "Y Direction" are recomputed. However, when we modify either the "X Direction" or the "Y Direction", "Direction" is not modified. The "main Direction" is also the "Z Direction". Since an Ax2 coordinate system is right-handed, its "main Direction" is always equal to the cross product of its "X Direction" and "Y Direction". (To define a left-handed coordinate system, use gp_Ax3.) A coordinate system is used:
    • to describe geometric entities, in particular to position them. The local coordinate system of a geometric entity serves the same purpose as the STEP function "axis placement two axes", or
    • to define geometric transformations. Note: we refer to the "X Axis", "Y Axis" and "Z Axis", respectively, as to axes having:
    • the origin of the coordinate system as their origin, and
    • the unit vectors "X Direction", "Y Direction" and "main Direction", respectively, as their unit vectors. The "Z Axis" is also the "main Axis".

    Constructor & Destructor Documentation

    ◆ gp_Ax2() [1/6]

    gp_Ax2::gp_Ax2 ( )
    inlineconstexprnoexcept

    Creates an object corresponding to the reference coordinate system (OXYZ).

    ◆ gp_Ax2() [2/6]

    gp_Ax2::gp_Ax2 ( const gp_Pnt & P,
    const gp_Dir & N,
    const gp_Dir & Vx )
    inline

    Creates an axis placement with an origin P such that:

    • N is the Direction, and
    • the "X Direction" is normal to N, in the plane defined by the vectors (N, Vx): "X Direction" = (N ^ Vx) ^ N, Exception: raises ConstructionError if N and Vx are parallel (same or opposite orientation).

    ◆ gp_Ax2() [3/6]

    gp_Ax2::gp_Ax2 ( const gp_Pnt & theP,
    const gp_Dir::D theN,
    const gp_Dir::D theVx )
    inlineconstexprnoexcept

    Creates an axis placement with standard directions.

    ◆ gp_Ax2() [4/6]

    gp_Ax2::gp_Ax2 ( const gp_Pnt & P,
    const gp_Dir & V )

    Creates a coordinate system with an origin P, where V gives the "main Direction" (here, "X Direction" and "Y Direction" are defined automatically).

    ◆ gp_Ax2() [5/6]

    gp_Ax2::gp_Ax2 ( const gp_Pnt & theP,
    const gp_Dir::D theV )
    inlineconstexprnoexcept

    Creates a coordinate system with an origin P and standard main direction.

    ◆ gp_Ax2() [6/6]

    gp_Ax2::gp_Ax2 ( const gp_Dir::D theV)
    inlineexplicitconstexprnoexcept

    Creates a coordinate system at the origin with the given standard main direction. Replaces gp::XOY(), gp::YOZ(), gp::ZOX() static functions.

    Member Function Documentation

    ◆ Angle()

    double gp_Ax2::Angle ( const gp_Ax2 & theOther) const
    inline

    Computes the angular value, in radians, between the main direction of <me> and the main direction of <theOther>. Returns the angle between 0 and PI in radians.

    ◆ Axis()

    const gp_Ax1 & gp_Ax2::Axis ( ) const
    inlineconstexprnoexcept

    Returns the main axis of <me>. It is the "Location" point and the main "Direction".

    ◆ crossStandardDir()

    gp_Dir::D gp_Ax2::crossStandardDir ( const gp_Dir::D theA,
    const gp_Dir::D theB )
    inlinestaticconstexprprotectednoexcept

    Helper to compute cross product of two standard directions (right-handed: A x B).

    ◆ Direction()

    const gp_Dir & gp_Ax2::Direction ( ) const
    inlineconstexprnoexcept

    Returns the main direction of <me>.

    ◆ DumpJson()

    void gp_Ax2::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const

    Dumps the content of me into the stream.

    ◆ getPerpendicularXDir()

    gp_Dir::D gp_Ax2::getPerpendicularXDir ( const gp_Dir::D theMainDir)
    inlinestaticconstexprprotectednoexcept

    Helper to compute perpendicular X direction for standard main directions.

    ◆ getPerpendicularYDir()

    gp_Dir::D gp_Ax2::getPerpendicularYDir ( const gp_Dir::D theMainDir)
    inlinestaticconstexprprotectednoexcept

    Helper to compute Y direction (main x X) for standard directions.

    ◆ InitFromJson()

    bool gp_Ax2::InitFromJson ( const Standard_SStream & theSStream,
    int & theStreamPos )

    Inits the content of me from the stream.

    ◆ IsCoplanar() [1/2]

    bool gp_Ax2::IsCoplanar ( const gp_Ax1 & A1,
    const double LinearTolerance,
    const double AngularTolerance ) const
    inline

    Returns True if: . the distance between <me> and the "Location" point of A1 is lower of equal to LinearTolerance and . the main direction of <me> and the direction of A1 are normal. Note: the tolerance criterion for angular equality is given by AngularTolerance.

    ◆ IsCoplanar() [2/2]

    bool gp_Ax2::IsCoplanar ( const gp_Ax2 & Other,
    const double LinearTolerance,
    const double AngularTolerance ) const
    inline

    ◆ Location()

    const gp_Pnt & gp_Ax2::Location ( ) const
    inlineconstexprnoexcept

    Returns the "Location" point (origin) of <me>.

    ◆ Mirror() [1/3]

    void gp_Ax2::Mirror ( const gp_Ax1 & A1)

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the axis A1, and assigns the result to this coordinate system. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Mirror() [2/3]

    void gp_Ax2::Mirror ( const gp_Ax2 & A2)

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the plane defined by the origin, "X Direction" and "Y Direction" of coordinate system A2 and assigns the result to this coordinate system. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Mirror() [3/3]

    void gp_Ax2::Mirror ( const gp_Pnt & P)
    noexcept

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the point P, and assigns the result to this coordinate system. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Mirrored() [1/3]

    gp_Ax2 gp_Ax2::Mirrored ( const gp_Ax1 & A1) const
    nodiscard

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the axis A1, and creates a new one. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Mirrored() [2/3]

    gp_Ax2 gp_Ax2::Mirrored ( const gp_Ax2 & A2) const
    nodiscard

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the plane defined by the origin, "X Direction" and "Y Direction" of coordinate system A2 and creates a new one. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Mirrored() [3/3]

    gp_Ax2 gp_Ax2::Mirrored ( const gp_Pnt & P) const
    nodiscardnoexcept

    Performs a symmetrical transformation of this coordinate system with respect to:

    • the point P, and creates a new one. Warning This transformation is always performed on the origin. In case of a reflection with respect to a point:
    • the main direction of the coordinate system is not changed, and
    • the "X Direction" and the "Y Direction" are simply reversed In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction" and the "Y Direction", then
    • the "main Direction" is recomputed as the cross product "X Direction" ^ "Y Direction". This maintains the right-handed property of the coordinate system.

    ◆ Rotate()

    void gp_Ax2::Rotate ( const gp_Ax1 & theA1,
    const double theAng )
    inline

    ◆ Rotated()

    gp_Ax2 gp_Ax2::Rotated ( const gp_Ax1 & theA1,
    const double theAng ) const
    inlinenodiscard

    Rotates an axis placement. <theA1> is the axis of the rotation. theAng is the angular value of the rotation in radians.

    ◆ Scale()

    void gp_Ax2::Scale ( const gp_Pnt & theP,
    const double theS )
    inlineconstexprnoexcept

    ◆ Scaled()

    gp_Ax2 gp_Ax2::Scaled ( const gp_Pnt & theP,
    const double theS ) const
    inlinenodiscardconstexprnoexcept

    Applies a scaling transformation on the axis placement. The "Location" point of the axisplacement is modified. Warnings: If the scale is negative: . the main direction of the axis placement is not changed. . The "XDirection" and the "YDirection" are reversed. So the axis placement stay right handed.

    ◆ SetAxis()

    void gp_Ax2::SetAxis ( const gp_Ax1 & A1)
    inline

    Assigns the origin and "main Direction" of the axis A1 to this coordinate system, then recomputes its "X Direction" and "Y Direction". Note: The new "X Direction" is computed as follows: new "X Direction" = V1 ^(previous "X Direction" ^ V) where V is the "Direction" of A1. Exceptions Standard_ConstructionError if A1 is parallel to the "X Direction" of this coordinate system.

    ◆ SetDirection()

    void gp_Ax2::SetDirection ( const gp_Dir & V)
    inline

    Changes the "main Direction" of this coordinate system, then recomputes its "X Direction" and "Y Direction". Note: the new "X Direction" is computed as follows: new "X Direction" = V ^ (previous "X Direction" ^ V) Exceptions Standard_ConstructionError if V is parallel to the "X Direction" of this coordinate system.

    ◆ SetLocation()

    void gp_Ax2::SetLocation ( const gp_Pnt & theP)
    inlineconstexprnoexcept

    Changes the "Location" point (origin) of <me>.

    ◆ SetXDirection()

    void gp_Ax2::SetXDirection ( const gp_Dir & theVx)
    inline

    Changes the "Xdirection" of <me>. The main direction "Direction" is not modified, the "Ydirection" is modified. If <Vx> is not normal to the main direction then <XDirection> is computed as follows XDirection = Direction ^ (Vx ^ Direction). Exceptions Standard_ConstructionError if Vx or Vy is parallel to the "main Direction" of this coordinate system.

    ◆ SetYDirection()

    void gp_Ax2::SetYDirection ( const gp_Dir & theVy)
    inline

    Changes the "Ydirection" of <me>. The main direction is not modified but the "Xdirection" is changed. If <Vy> is not normal to the main direction then "YDirection" is computed as follows YDirection = Direction ^ (<Vy> ^ Direction). Exceptions Standard_ConstructionError if Vx or Vy is parallel to the "main Direction" of this coordinate system.

    ◆ Transform()

    void gp_Ax2::Transform ( const gp_Trsf & theT)
    inline

    ◆ Transformed()

    gp_Ax2 gp_Ax2::Transformed ( const gp_Trsf & theT) const
    inlinenodiscard

    Transforms an axis placement with a Trsf. The "Location" point, the "XDirection" and the "YDirection" are transformed with theT. The resulting main "Direction" of <me> is the cross product between the "XDirection" and the "YDirection" after transformation.

    ◆ Translate() [1/2]

    void gp_Ax2::Translate ( const gp_Pnt & theP1,
    const gp_Pnt & theP2 )
    inlineconstexprnoexcept

    ◆ Translate() [2/2]

    void gp_Ax2::Translate ( const gp_Vec & theV)
    inlineconstexprnoexcept

    ◆ Translated() [1/2]

    gp_Ax2 gp_Ax2::Translated ( const gp_Pnt & theP1,
    const gp_Pnt & theP2 ) const
    inlinenodiscardconstexprnoexcept

    Translates an axis placement from the point <theP1> to the point <theP2>.

    ◆ Translated() [2/2]

    gp_Ax2 gp_Ax2::Translated ( const gp_Vec & theV) const
    inlinenodiscardconstexprnoexcept

    Translates an axis plaxement in the direction of the vector <theV>. The magnitude of the translation is the vector's magnitude.

    ◆ XDirection()

    const gp_Dir & gp_Ax2::XDirection ( ) const
    inlineconstexprnoexcept

    Returns the "XDirection" of <me>.

    ◆ YDirection()

    const gp_Dir & gp_Ax2::YDirection ( ) const
    inlineconstexprnoexcept

    Returns the "YDirection" of <me>.


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