1 // Created on: 1993-03-24
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Geom2d_AxisPlacement_HeaderFile
18 #define _Geom2d_AxisPlacement_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <gp_Ax2d.hxx>
24 #include <Geom2d_Geometry.hxx>
25 #include <Standard_Real.hxx>
30 class Geom2d_Geometry;
33 class Geom2d_AxisPlacement;
34 DEFINE_STANDARD_HANDLE(Geom2d_AxisPlacement, Geom2d_Geometry)
36 //! Describes an axis in 2D space.
37 //! An axis is defined by:
38 //! - its origin, also termed the "Location point" of the axis,
39 //! - its unit vector, termed the "Direction" of the axis.
40 //! Note: Geom2d_AxisPlacement axes provide the
41 //! same kind of "geometric" services as gp_Ax2d axes
42 //! but have more complex data structures. The
43 //! geometric objects provided by the Geom2d package
44 //! use gp_Ax2d objects to include axes in their data
45 //! structures, or to define an axis of symmetry or axis of rotation.
46 //! Geom2d_AxisPlacement axes are used in a context
47 //! where they can be shared by several objects
48 //! contained inside a common data structure.
49 class Geom2d_AxisPlacement : public Geom2d_Geometry
55 //! Constructs an axis by conversion of the gp_Ax2d axis A.
56 Standard_EXPORT Geom2d_AxisPlacement(const gp_Ax2d& A);
58 //! Constructs an axis from a given origin P and unit vector V.
59 Standard_EXPORT Geom2d_AxisPlacement(const gp_Pnt2d& P, const gp_Dir2d& V);
61 Standard_EXPORT void Reverse();
63 //! Reverses the unit vector of this axis.
65 //! - Reverse assigns the result to this axis, while
66 //! - Reversed creates a new one.
67 Standard_EXPORT Handle(Geom2d_AxisPlacement) Reversed() const;
69 //! Changes the complete definition of the axis placement.
70 Standard_EXPORT void SetAxis (const gp_Ax2d& A);
73 //! Changes the "Direction" of the axis placement.
74 Standard_EXPORT void SetDirection (const gp_Dir2d& V);
77 //! Changes the "Location" point (origin) of the axis placement.
78 Standard_EXPORT void SetLocation (const gp_Pnt2d& P);
81 //! Computes the angle between the "Direction" of
82 //! two axis placement in radians.
83 //! The result is comprised between -Pi and Pi.
84 Standard_EXPORT Standard_Real Angle (const Handle(Geom2d_AxisPlacement)& Other) const;
86 //! Converts this axis into a gp_Ax2d axis.
87 Standard_EXPORT gp_Ax2d Ax2d() const;
89 //! Returns the "Direction" of <me>.
90 //! -C++: return const&
91 Standard_EXPORT gp_Dir2d Direction() const;
94 //! Returns the "Location" point (origin) of the axis placement.
95 //! -C++: return const&
96 Standard_EXPORT gp_Pnt2d Location() const;
98 //! Applies the transformation T to this axis.
99 Standard_EXPORT void Transform (const gp_Trsf2d& T);
101 //! Creates a new object which is a copy of this axis.
102 Standard_EXPORT Handle(Geom2d_Geometry) Copy() const;
107 DEFINE_STANDARD_RTTI(Geom2d_AxisPlacement,Geom2d_Geometry)
128 #endif // _Geom2d_AxisPlacement_HeaderFile