summaryrefslogtreecommitdiff
path: root/src/Geom/Geom_Geometry.cxx
blob: 4e23fb2aadf6e52b47d750f1ae70edb12db05e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// File:	Geom_Geometry.cxx
// Created:	Wed Mar 10 09:45:02 1993
// Author:	JCV
//		<fid@phylox>
// Copyright:	Matra Datavision 1993


//File Geom_Geometry.cxx, JCV 15/01/91
//JCV 09/07/92 portage sur C1


#include <Geom_Geometry.ixx>
#include <Standard_ConstructionError.hxx>

typedef Handle(Geom_Geometry) Handle(Geometry);
typedef Geom_Geometry         Geometry;
typedef gp_Pnt                Pnt;
typedef gp_Vec                Vec;
typedef gp_Ax1                Ax1;
typedef gp_Ax2                Ax2;
typedef gp_Trsf               Trsf;



Handle(Geom_Geometry) Geom_Geometry::Copy() const {

   Handle(Geom_Geometry) G;
   Standard_ConstructionError::Raise();
   return G;
}


void Geom_Geometry::Mirror (const gp_Pnt& P) {
   
  Trsf T;
  T.SetMirror (P);
  Transform (T);
}



void Geom_Geometry::Mirror (const gp_Ax1& A1) {

  Trsf T;
  T.SetMirror (A1);
  Transform (T);
}


void Geom_Geometry::Mirror (const gp_Ax2& A2) {

  Trsf T;
  T.SetMirror (A2);
  Transform (T);
}


void Geom_Geometry::Rotate (const gp_Ax1& A1, const Standard_Real Ang) {

  Trsf T;
  T.SetRotation (A1, Ang);
  Transform (T);
}


void Geom_Geometry::Scale (const gp_Pnt& P, const Standard_Real S) {

  Trsf T;
  T.SetScale (P, S);
  Transform (T);
}


void Geom_Geometry::Translate (const gp_Vec& V) {

  Trsf T;
  T.SetTranslation (V);
  Transform (T);
}


void Geom_Geometry::Translate (const gp_Pnt& P1, const gp_Pnt& P2) {

  Vec V (P1, P2);
  Translate (V);
}


Handle(Geometry) Geom_Geometry::Mirrored (const gp_Pnt& P) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G  = me->Copy();
  G->Mirror (P);
  return G;
}


Handle(Geometry) Geom_Geometry::Mirrored (const gp_Ax1& A1) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Mirror (A1);
  return G;
}


Handle(Geometry) Geom_Geometry::Mirrored (const gp_Ax2& A2) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Mirror (A2);
  return G;
}



Handle(Geometry) Geom_Geometry::Rotated (

const gp_Ax1& A1, 
const Standard_Real Ang
) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G  = me->Copy();
  G->Rotate (A1, Ang);
  return G;
}



Handle(Geometry) Geom_Geometry::Scaled (const gp_Pnt& P, const Standard_Real S) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G  = me->Copy();
  G->Scale (P, S);
  return G;
}



Handle(Geometry) Geom_Geometry::Transformed (const gp_Trsf& T) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G  = me->Copy();
  G->Transform (T);
  return G;
}



Handle(Geometry) Geom_Geometry::Translated (const gp_Vec& V) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G  = me->Copy();
  G->Translate (V);
  return G;
}


Handle(Geometry) Geom_Geometry::Translated (

const gp_Pnt& P1,
const gp_Pnt& P2
) const {

   Handle(Geometry) me = this;
   Handle(Geometry) G  = me->Copy();
   G->Translate (P1, P2);
   return G;
}