0024023: Revamp the OCCT Handle -- general
[occt.git] / src / Geom / Geom_Geometry.cxx
CommitLineData
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
19
20#include <Geom_Geometry.ixx>
21#include <Standard_ConstructionError.hxx>
22
7fd59977 23typedef Geom_Geometry Geometry;
24typedef gp_Pnt Pnt;
25typedef gp_Vec Vec;
26typedef gp_Ax1 Ax1;
27typedef gp_Ax2 Ax2;
28typedef gp_Trsf Trsf;
29
7fd59977 30Handle(Geom_Geometry) Geom_Geometry::Copy() const {
31
32 Handle(Geom_Geometry) G;
33 Standard_ConstructionError::Raise();
34 return G;
35}
36
37
38void Geom_Geometry::Mirror (const gp_Pnt& P) {
39
40 Trsf T;
41 T.SetMirror (P);
42 Transform (T);
43}
44
45
46
47void Geom_Geometry::Mirror (const gp_Ax1& A1) {
48
49 Trsf T;
50 T.SetMirror (A1);
51 Transform (T);
52}
53
54
55void Geom_Geometry::Mirror (const gp_Ax2& A2) {
56
57 Trsf T;
58 T.SetMirror (A2);
59 Transform (T);
60}
61
62
63void Geom_Geometry::Rotate (const gp_Ax1& A1, const Standard_Real Ang) {
64
65 Trsf T;
66 T.SetRotation (A1, Ang);
67 Transform (T);
68}
69
70
71void Geom_Geometry::Scale (const gp_Pnt& P, const Standard_Real S) {
72
73 Trsf T;
74 T.SetScale (P, S);
75 Transform (T);
76}
77
78
79void Geom_Geometry::Translate (const gp_Vec& V) {
80
81 Trsf T;
82 T.SetTranslation (V);
83 Transform (T);
84}
85
86
87void Geom_Geometry::Translate (const gp_Pnt& P1, const gp_Pnt& P2) {
88
89 Vec V (P1, P2);
90 Translate (V);
91}
92
93
c04c30b3 94Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Pnt& P) const
95{
96 Handle(Geom_Geometry) G = Copy();
7fd59977 97 G->Mirror (P);
98 return G;
99}
100
101
c04c30b3 102Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax1& A1) const
103{
104 Handle(Geom_Geometry) G = Copy();
7fd59977 105 G->Mirror (A1);
106 return G;
107}
108
109
c04c30b3 110Handle(Geom_Geometry) Geom_Geometry::Mirrored (const gp_Ax2& A2) const
111{
112 Handle(Geom_Geometry) G = Copy();
7fd59977 113 G->Mirror (A2);
114 return G;
115}
116
117
118
c04c30b3 119Handle(Geom_Geometry) Geom_Geometry::Rotated (const gp_Ax1& A1, const Standard_Real Ang) const
120{
121 Handle(Geom_Geometry) G = Copy();
7fd59977 122 G->Rotate (A1, Ang);
123 return G;
124}
125
126
127
c04c30b3 128Handle(Geom_Geometry) Geom_Geometry::Scaled (const gp_Pnt& P, const Standard_Real S) const
129{
130 Handle(Geom_Geometry) G = Copy();
7fd59977 131 G->Scale (P, S);
132 return G;
133}
134
135
136
c04c30b3 137Handle(Geom_Geometry) Geom_Geometry::Transformed (const gp_Trsf& T) const
138{
139 Handle(Geom_Geometry) G = Copy();
7fd59977 140 G->Transform (T);
141 return G;
142}
143
144
145
c04c30b3 146Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Vec& V) const
147{
148 Handle(Geom_Geometry) G = Copy();
7fd59977 149 G->Translate (V);
150 return G;
151}
152
153
c04c30b3 154Handle(Geom_Geometry) Geom_Geometry::Translated (const gp_Pnt& P1, const gp_Pnt& P2) const
155{
156 Handle(Geom_Geometry) G = Copy();
7fd59977 157 G->Translate (P1, P2);
158 return G;
159}
160
161