42cf5bc1 |
1 | // Created on: 1993-03-09 |
2 | // Created by: JVC |
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 _Geom_Geometry_HeaderFile |
18 | #define _Geom_Geometry_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
25e59720 |
23 | #include <Standard_Transient.hxx> |
42cf5bc1 |
24 | #include <Standard_Real.hxx> |
25 | class Standard_ConstructionError; |
26 | class gp_Pnt; |
27 | class gp_Ax1; |
28 | class gp_Ax2; |
29 | class gp_Vec; |
30 | class gp_Trsf; |
31 | |
32 | |
33 | class Geom_Geometry; |
25e59720 |
34 | DEFINE_STANDARD_HANDLE(Geom_Geometry, Standard_Transient) |
42cf5bc1 |
35 | |
36 | //! The abstract class Geometry for 3D space is the root |
37 | //! class of all geometric objects from the Geom |
38 | //! package. It describes the common behavior of these objects when: |
39 | //! - applying geometric transformations to objects, and |
40 | //! - constructing objects by geometric transformation (including copying). |
41 | //! Warning |
42 | //! Only transformations which do not modify the nature |
43 | //! of the geometry can be applied to Geom objects: this |
44 | //! is the case with translations, rotations, symmetries |
45 | //! and scales; this is also the case with gp_Trsf |
46 | //! composite transformations which are used to define |
47 | //! the geometric transformations applied using the |
48 | //! Transform or Transformed functions. |
49 | //! Note: Geometry defines the "prototype" of the |
50 | //! abstract method Transform which is defined for each |
51 | //! concrete type of derived object. All other |
52 | //! transformations are implemented using the Transform method. |
25e59720 |
53 | class Geom_Geometry : public Standard_Transient |
42cf5bc1 |
54 | { |
55 | |
56 | public: |
57 | |
58 | |
59 | |
60 | //! Performs the symmetrical transformation of a Geometry |
61 | //! with respect to the point P which is the center of the |
62 | //! symmetry. |
63 | Standard_EXPORT void Mirror (const gp_Pnt& P); |
64 | |
65 | |
66 | //! Performs the symmetrical transformation of a Geometry |
67 | //! with respect to an axis placement which is the axis of the |
68 | //! symmetry. |
69 | Standard_EXPORT void Mirror (const gp_Ax1& A1); |
70 | |
71 | |
72 | //! Performs the symmetrical transformation of a Geometry |
73 | //! with respect to a plane. The axis placement A2 locates |
74 | //! the plane of the symmetry : (Location, XDirection, YDirection). |
75 | Standard_EXPORT void Mirror (const gp_Ax2& A2); |
76 | |
77 | |
78 | //! Rotates a Geometry. A1 is the axis of the rotation. |
79 | //! Ang is the angular value of the rotation in radians. |
80 | Standard_EXPORT void Rotate (const gp_Ax1& A1, const Standard_Real Ang); |
81 | |
82 | |
83 | //! Scales a Geometry. S is the scaling value. |
84 | Standard_EXPORT void Scale (const gp_Pnt& P, const Standard_Real S); |
85 | |
86 | |
87 | //! Translates a Geometry. V is the vector of the tanslation. |
88 | Standard_EXPORT void Translate (const gp_Vec& V); |
89 | |
90 | |
91 | //! Translates a Geometry from the point P1 to the point P2. |
92 | Standard_EXPORT void Translate (const gp_Pnt& P1, const gp_Pnt& P2); |
93 | |
94 | |
95 | //! Transformation of a geometric object. This tansformation |
96 | //! can be a translation, a rotation, a symmetry, a scaling |
97 | //! or a complex transformation obtained by combination of |
98 | //! the previous elementaries transformations. |
99 | //! (see class Transformation of the package Geom). |
100 | Standard_EXPORT virtual void Transform (const gp_Trsf& T) = 0; |
101 | |
102 | Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Pnt& P) const; |
103 | |
104 | Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax1& A1) const; |
105 | |
106 | Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax2& A2) const; |
107 | |
108 | Standard_EXPORT Handle(Geom_Geometry) Rotated (const gp_Ax1& A1, const Standard_Real Ang) const; |
109 | |
110 | Standard_EXPORT Handle(Geom_Geometry) Scaled (const gp_Pnt& P, const Standard_Real S) const; |
111 | |
112 | Standard_EXPORT Handle(Geom_Geometry) Transformed (const gp_Trsf& T) const; |
113 | |
114 | Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Vec& V) const; |
115 | |
116 | Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Pnt& P1, const gp_Pnt& P2) const; |
117 | |
118 | //! Creates a new object which is a copy of this geometric object. |
119 | Standard_EXPORT virtual Handle(Geom_Geometry) Copy() const = 0; |
120 | |
121 | |
122 | |
123 | |
25e59720 |
124 | DEFINE_STANDARD_RTTIEXT(Geom_Geometry,Standard_Transient) |
42cf5bc1 |
125 | |
126 | protected: |
127 | |
128 | |
129 | |
130 | |
131 | private: |
132 | |
133 | |
134 | |
135 | |
136 | }; |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | |
144 | #endif // _Geom_Geometry_HeaderFile |