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_Geometry_HeaderFile |
18 | #define _Geom2d_Geometry_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <MMgt_TShared.hxx> |
24 | #include <Standard_Real.hxx> |
25 | class Standard_ConstructionError; |
26 | class gp_Pnt2d; |
27 | class gp_Ax2d; |
28 | class gp_Vec2d; |
29 | class gp_Trsf2d; |
30 | |
31 | |
32 | class Geom2d_Geometry; |
33 | DEFINE_STANDARD_HANDLE(Geom2d_Geometry, MMgt_TShared) |
34 | |
35 | |
36 | //! The general abstract class Geometry in 2D space describes |
37 | //! the common behaviour of all the geometric entities. |
38 | //! |
39 | //! All the objects derived from this class can be move with a |
40 | //! geometric transformation. Only the transformations which |
41 | //! doesn't modify the nature of the geometry are available in |
42 | //! this package. |
43 | //! The method Transform which defines a general transformation |
44 | //! is deferred. The other specifics transformations used the |
45 | //! method Transform. |
46 | //! All the following transformations modify the object itself. |
47 | //! Warning |
48 | //! Only transformations which do not modify the nature |
49 | //! of the geometry can be applied to Geom2d objects: |
50 | //! this is the case with translations, rotations, |
51 | //! symmetries and scales; this is also the case with |
52 | //! gp_Trsf2d composite transformations which are |
53 | //! used to define the geometric transformations applied |
54 | //! using the Transform or Transformed functions. |
55 | //! Note: Geometry defines the "prototype" of the |
56 | //! abstract method Transform which is defined for each |
57 | //! concrete type of derived object. All other |
58 | //! transformations are implemented using the Transform method. |
59 | class Geom2d_Geometry : public MMgt_TShared |
60 | { |
61 | |
62 | public: |
63 | |
64 | |
65 | //! Performs the symmetrical transformation of a Geometry |
66 | //! with respect to the point P which is the center of the |
67 | //! symmetry and assigns the result to this geometric object. |
68 | Standard_EXPORT void Mirror (const gp_Pnt2d& P); |
69 | |
70 | //! Performs the symmetrical transformation of a Geometry |
71 | //! with respect to an axis placement which is the axis of the symmetry. |
72 | Standard_EXPORT void Mirror (const gp_Ax2d& A); |
73 | |
74 | //! Rotates a Geometry. P is the center of the rotation. |
75 | //! Ang is the angular value of the rotation in radians. |
76 | Standard_EXPORT void Rotate (const gp_Pnt2d& P, const Standard_Real Ang); |
77 | |
78 | //! Scales a Geometry. S is the scaling value. |
79 | Standard_EXPORT void Scale (const gp_Pnt2d& P, const Standard_Real S); |
80 | |
81 | //! Translates a Geometry. V is the vector of the tanslation. |
82 | Standard_EXPORT void Translate (const gp_Vec2d& V); |
83 | |
84 | //! Translates a Geometry from the point P1 to the point P2. |
85 | Standard_EXPORT void Translate (const gp_Pnt2d& P1, const gp_Pnt2d& P2); |
86 | |
87 | //! Transformation of a geometric object. This tansformation |
88 | //! can be a translation, a rotation, a symmetry, a scaling |
89 | //! or a complex transformation obtained by combination of |
90 | //! the previous elementaries transformations. |
91 | //! (see class Transformation of the package Geom2d). |
92 | //! The following transformations have the same properties |
93 | //! as the previous ones but they don't modified the object |
94 | //! itself. A copy of the object is returned. |
95 | Standard_EXPORT virtual void Transform (const gp_Trsf2d& T) = 0; |
96 | |
97 | Standard_EXPORT Handle(Geom2d_Geometry) Mirrored (const gp_Pnt2d& P) const; |
98 | |
99 | Standard_EXPORT Handle(Geom2d_Geometry) Mirrored (const gp_Ax2d& A) const; |
100 | |
101 | Standard_EXPORT Handle(Geom2d_Geometry) Rotated (const gp_Pnt2d& P, const Standard_Real Ang) const; |
102 | |
103 | Standard_EXPORT Handle(Geom2d_Geometry) Scaled (const gp_Pnt2d& P, const Standard_Real S) const; |
104 | |
105 | Standard_EXPORT Handle(Geom2d_Geometry) Transformed (const gp_Trsf2d& T) const; |
106 | |
107 | Standard_EXPORT Handle(Geom2d_Geometry) Translated (const gp_Vec2d& V) const; |
108 | |
109 | Standard_EXPORT Handle(Geom2d_Geometry) Translated (const gp_Pnt2d& P1, const gp_Pnt2d& P2) const; |
110 | |
111 | Standard_EXPORT virtual Handle(Geom2d_Geometry) Copy() const = 0; |
112 | |
113 | |
114 | |
115 | |
116 | DEFINE_STANDARD_RTTI(Geom2d_Geometry,MMgt_TShared) |
117 | |
118 | protected: |
119 | |
120 | |
121 | |
122 | |
123 | private: |
124 | |
125 | |
126 | |
127 | |
128 | }; |
129 | |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | #endif // _Geom2d_Geometry_HeaderFile |