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 | |
25e59720 |
28 | IMPLEMENT_STANDARD_RTTIEXT(Geom_Geometry,Standard_Transient) |
92efcf78 |
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; |
9775fa61 |
40 | throw Standard_ConstructionError(); |
7fd59977 |
41 | } |
42 | |
43 | |
44 | void Geom_Geometry::Mirror (const gp_Pnt& P) { |
45 | |
46 | Trsf T; |
47 | T.SetMirror (P); |
48 | Transform (T); |
49 | } |
50 | |
51 | |
52 | |
53 | void Geom_Geometry::Mirror (const gp_Ax1& A1) { |
54 | |
55 | Trsf T; |
56 | T.SetMirror (A1); |
57 | Transform (T); |
58 | } |
59 | |
60 | |
61 | void Geom_Geometry::Mirror (const gp_Ax2& A2) { |
62 | |
63 | Trsf T; |
64 | T.SetMirror (A2); |
65 | Transform (T); |
66 | } |
67 | |
68 | |
69 | void Geom_Geometry::Rotate (const gp_Ax1& A1, const Standard_Real Ang) { |
70 | |
71 | Trsf T; |
72 | T.SetRotation (A1, Ang); |
73 | Transform (T); |
74 | } |
75 | |
76 | |
77 | void Geom_Geometry::Scale (const gp_Pnt& P, const Standard_Real S) { |
78 | |
79 | Trsf T; |
80 | T.SetScale (P, S); |
81 | Transform (T); |
82 | } |
83 | |
84 | |
85 | void Geom_Geometry::Translate (const gp_Vec& V) { |
86 | |
87 | Trsf T; |
88 | T.SetTranslation (V); |
89 | Transform (T); |
90 | } |
91 | |
92 | |
93 | void Geom_Geometry::Translate (const gp_Pnt& P1, const gp_Pnt& P2) { |
94 | |
95 | Vec V (P1, P2); |
96 | Translate (V); |
97 | } |
98 | |
99 | |
c04c30b3 |
100 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Pnt& P) const |
101 | { |
102 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
103 | G->Mirror (P); |
104 | return G; |
105 | } |
106 | |
107 | |
c04c30b3 |
108 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax1& A1) const |
109 | { |
110 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
111 | G->Mirror (A1); |
112 | return G; |
113 | } |
114 | |
115 | |
c04c30b3 |
116 | Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax2& A2) const |
117 | { |
118 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
119 | G->Mirror (A2); |
120 | return G; |
121 | } |
122 | |
123 | |
124 | |
c04c30b3 |
125 | Handle(Geom_Geometry) Geom_Geometry::Rotated (const gp_Ax1& A1, const Standard_Real Ang) const |
126 | { |
127 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
128 | G->Rotate (A1, Ang); |
129 | return G; |
130 | } |
131 | |
132 | |
133 | |
c04c30b3 |
134 | Handle(Geom_Geometry) Geom_Geometry::Scaled (const gp_Pnt& P, const Standard_Real S) const |
135 | { |
136 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
137 | G->Scale (P, S); |
138 | return G; |
139 | } |
140 | |
141 | |
142 | |
c04c30b3 |
143 | Handle(Geom_Geometry) Geom_Geometry::Transformed (const gp_Trsf& T) const |
144 | { |
145 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
146 | G->Transform (T); |
147 | return G; |
148 | } |
149 | |
150 | |
151 | |
c04c30b3 |
152 | Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Vec& V) const |
153 | { |
154 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
155 | G->Translate (V); |
156 | return G; |
157 | } |
158 | |
159 | |
c04c30b3 |
160 | Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Pnt& P1, const gp_Pnt& P2) const |
161 | { |
162 | Handle(Geom_Geometry) G = Copy(); |
7fd59977 |
163 | G->Translate (P1, P2); |
164 | return G; |
165 | } |
166 | |
167 | |
bc73b006 |
168 | void Geom_Geometry::DumpJson (Standard_OStream& theOStream, Standard_Integer) const |
169 | { |
170 | OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) |
171 | } |