0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / Geom / Geom_Geometry.cxx
1 // Created on: 1993-03-10
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 //JCV 09/07/92 portage sur C1
18
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>
25 #include <Standard_ConstructionError.hxx>
26 #include <Standard_Type.hxx>
27
28 IMPLEMENT_STANDARD_RTTIEXT(Geom_Geometry,Standard_Transient)
29
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
37 Handle(Geom_Geometry) Geom_Geometry::Copy() const {
38
39    Handle(Geom_Geometry) G;
40    throw Standard_ConstructionError();
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
100 Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Pnt& P) const
101 {
102   Handle(Geom_Geometry) G  = Copy();
103   G->Mirror (P);
104   return G;
105 }
106
107
108 Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax1& A1) const
109 {
110   Handle(Geom_Geometry) G = Copy();
111   G->Mirror (A1);
112   return G;
113 }
114
115
116 Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax2& A2) const
117 {
118   Handle(Geom_Geometry) G = Copy();
119   G->Mirror (A2);
120   return G;
121 }
122
123
124
125 Handle(Geom_Geometry) Geom_Geometry::Rotated (const gp_Ax1& A1, const Standard_Real Ang) const
126 {
127   Handle(Geom_Geometry) G = Copy();
128   G->Rotate (A1, Ang);
129   return G;
130 }
131
132
133
134 Handle(Geom_Geometry) Geom_Geometry::Scaled (const gp_Pnt& P, const Standard_Real S) const
135 {
136   Handle(Geom_Geometry) G = Copy();
137   G->Scale (P, S);
138   return G;
139 }
140
141
142
143 Handle(Geom_Geometry) Geom_Geometry::Transformed (const gp_Trsf& T) const
144 {
145   Handle(Geom_Geometry) G = Copy();
146   G->Transform (T);
147   return G;
148 }
149
150
151
152 Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Vec& V) const
153 {
154   Handle(Geom_Geometry) G = Copy();
155   G->Translate (V);
156   return G;
157 }
158
159
160 Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Pnt& P1, const gp_Pnt& P2) const
161 {
162    Handle(Geom_Geometry) G = Copy();
163    G->Translate (P1, P2);
164    return G;
165 }
166
167
168 void Geom_Geometry::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
169 {
170   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
171 }