b311480e |
1 | // Created on: 1993-03-10 |
2 | // Created by: JCV |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
7fd59977 |
17 | //JCV 09/07/92 portage sur C1 |
18 | |
42cf5bc1 |
19 | #include <Geom_Geometry.hxx> |
20 | #include <gp_Ax1.hxx> |
21 | #include <gp_Ax2.hxx> |
22 | #include <gp_Pnt.hxx> |
23 | #include <gp_Trsf.hxx> |
24 | #include <gp_Vec.hxx> |
7fd59977 |
25 | #include <Standard_ConstructionError.hxx> |
42cf5bc1 |
26 | #include <Standard_Type.hxx> |
7fd59977 |
27 | |
92efcf78 |
28 | IMPLEMENT_STANDARD_RTTIEXT(Geom_Geometry,MMgt_TShared) |
29 | |
7fd59977 |
30 | typedef Geom_Geometry Geometry; |
31 | typedef gp_Pnt Pnt; |
32 | typedef gp_Vec Vec; |
33 | typedef gp_Ax1 Ax1; |
34 | typedef gp_Ax2 Ax2; |
35 | typedef gp_Trsf Trsf; |
36 | |
7fd59977 |
37 | Handle(Geom_Geometry) Geom_Geometry::Copy() const { |
38 | |
39 | Handle(Geom_Geometry) G; |
40 | Standard_ConstructionError::Raise(); |
41 | return G; |
42 | } |
43 | |
44 | |
45 | void Geom_Geometry::Mirror (const gp_Pnt& P) { |
46 | |
47 | Trsf T; |
48 | T.SetMirror (P); |
49 | Transform (T); |
50 | } |
51 | |
52 | |
53 | |
54 | void Geom_Geometry::Mirror (const gp_Ax1& A1) { |
55 | |
56 | Trsf T; |
57 | T.SetMirror (A1); |
58 | Transform (T); |
59 | } |
60 | |
61 | |
62 | void Geom_Geometry::Mirror (const gp_Ax2& A2) { |
63 | |
64 | Trsf T; |
65 | T.SetMirror (A2); |
66 | Transform (T); |
67 | } |
68 | |
69 | |
70 | void Geom_Geometry::Rotate (const gp_Ax1& A1, const Standard_Real Ang) { |
71 | |
72 | Trsf T; |
73 | T.SetRotation (A1, Ang); |
74 | Transform (T); |
75 | } |
76 | |
77 | |
78 | void Geom_Geometry::Scale (const gp_Pnt& P, const Standard_Real S) { |
79 | |
80 | Trsf T; |
81 | T.SetScale (P, S); |
82 | Transform (T); |
83 | } |
84 | |
85 | |
86 | void Geom_Geometry::Translate (const gp_Vec& V) { |
87 | |
88 | Trsf T; |
89 | T.SetTranslation (V); |
90 | Transform (T); |
91 | } |
92 | |
93 | |
94 | void Geom_Geometry::Translate (const gp_Pnt& P1, const gp_Pnt& P2) { |
95 | |
96 | Vec V (P1, P2); |
97 | Translate (V); |
98 | } |
99 | |
100 | |
c04c30b3 |
101 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Pnt& P) const |
102 | { |
103 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
104 | G->Mirror (P); |
105 | return G; |
106 | } |
107 | |
108 | |
c04c30b3 |
109 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax1& A1) const |
110 | { |
111 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
112 | G->Mirror (A1); |
113 | return G; |
114 | } |
115 | |
116 | |
c04c30b3 |
117 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax2& A2) const |
118 | { |
119 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
120 | G->Mirror (A2); |
121 | return G; |
122 | } |
123 | |
124 | |
125 | |
c04c30b3 |
126 | Handle(Geom_Geometry) Geom_Geometry::Rotated (const gp_Ax1& A1, const Standard_Real Ang) const |
127 | { |
128 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
129 | G->Rotate (A1, Ang); |
130 | return G; |
131 | } |
132 | |
133 | |
134 | |
c04c30b3 |
135 | Handle(Geom_Geometry) Geom_Geometry::Scaled (const gp_Pnt& P, const Standard_Real S) const |
136 | { |
137 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
138 | G->Scale (P, S); |
139 | return G; |
140 | } |
141 | |
142 | |
143 | |
c04c30b3 |
144 | Handle(Geom_Geometry) Geom_Geometry::Transformed (const gp_Trsf& T) const |
145 | { |
146 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
147 | G->Transform (T); |
148 | return G; |
149 | } |
150 | |
151 | |
152 | |
c04c30b3 |
153 | Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Vec& V) const |
154 | { |
155 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
156 | G->Translate (V); |
157 | return G; |
158 | } |
159 | |
160 | |
c04c30b3 |
161 | Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Pnt& P1, const gp_Pnt& P2) const |
162 | { |
163 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
164 | G->Translate (P1, P2); |
165 | return G; |
166 | } |
167 | |
168 | |