42cf5bc1 |
1 | // Created on: 1993-03-24 |
2 | // Created by: JCV |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Geom2d_AxisPlacement_HeaderFile |
18 | #define _Geom2d_AxisPlacement_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <gp_Ax2d.hxx> |
24 | #include <Geom2d_Geometry.hxx> |
25 | #include <Standard_Real.hxx> |
26 | class gp_Ax2d; |
27 | class gp_Pnt2d; |
28 | class gp_Dir2d; |
29 | class gp_Trsf2d; |
30 | class Geom2d_Geometry; |
31 | |
32 | |
33 | class Geom2d_AxisPlacement; |
34 | DEFINE_STANDARD_HANDLE(Geom2d_AxisPlacement, Geom2d_Geometry) |
35 | |
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 |
50 | { |
51 | |
52 | public: |
53 | |
54 | |
55 | //! Constructs an axis by conversion of the gp_Ax2d axis A. |
56 | Standard_EXPORT Geom2d_AxisPlacement(const gp_Ax2d& A); |
57 | |
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); |
60 | |
61 | Standard_EXPORT void Reverse(); |
62 | |
63 | //! Reverses the unit vector of this axis. |
64 | //! Note: |
65 | //! - Reverse assigns the result to this axis, while |
66 | //! - Reversed creates a new one. |
67 | Standard_EXPORT Handle(Geom2d_AxisPlacement) Reversed() const; |
68 | |
69 | //! Changes the complete definition of the axis placement. |
70 | Standard_EXPORT void SetAxis (const gp_Ax2d& A); |
71 | |
72 | |
73 | //! Changes the "Direction" of the axis placement. |
74 | Standard_EXPORT void SetDirection (const gp_Dir2d& V); |
75 | |
76 | |
77 | //! Changes the "Location" point (origin) of the axis placement. |
78 | Standard_EXPORT void SetLocation (const gp_Pnt2d& P); |
79 | |
80 | |
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; |
85 | |
86 | //! Converts this axis into a gp_Ax2d axis. |
87 | Standard_EXPORT gp_Ax2d Ax2d() const; |
88 | |
89 | //! Returns the "Direction" of <me>. |
90 | //! -C++: return const& |
91 | Standard_EXPORT gp_Dir2d Direction() const; |
92 | |
93 | |
94 | //! Returns the "Location" point (origin) of the axis placement. |
95 | //! -C++: return const& |
96 | Standard_EXPORT gp_Pnt2d Location() const; |
97 | |
98 | //! Applies the transformation T to this axis. |
79104795 |
99 | Standard_EXPORT void Transform (const gp_Trsf2d& T) Standard_OVERRIDE; |
42cf5bc1 |
100 | |
101 | //! Creates a new object which is a copy of this axis. |
79104795 |
102 | Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; |
42cf5bc1 |
103 | |
104 | |
105 | |
106 | |
92efcf78 |
107 | DEFINE_STANDARD_RTTIEXT(Geom2d_AxisPlacement,Geom2d_Geometry) |
42cf5bc1 |
108 | |
109 | protected: |
110 | |
111 | |
112 | |
113 | |
114 | private: |
115 | |
116 | |
117 | gp_Ax2d axis; |
118 | |
119 | |
120 | }; |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | |
127 | |
128 | #endif // _Geom2d_AxisPlacement_HeaderFile |