OpenLexocad  27.0
Ax3.h
Go to the documentation of this file.
1 //
3 // Copyright(C) 2013-2016 OpenCascade [www.opencascade.org]
4 //
5 // This library is free software; you can redistribute it and / or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street,
18 // Fifth Floor, Boston, MA 02110 - 1301 USA
19 //
21 
22 #pragma once
23 
24 #include <Geom/Ax1.h>
25 #include <Geom/Dir.h>
26 #include <Geom/geom_defines.h>
27 
28 namespace Geom
29 {
30 class Ax2;
31 class Ax3;
32 class Trsf;
33 class Vec;
34 class Pnt;
35 
71 {
72 public:
73  // Methods PUBLIC
74  //
75 
77  // //
78  // --------------------- BEGIN API --------------------- //
79  // //
80  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
81  // //
83 
85  Ax3();
86 
89  Ax3(const Geom::Ax2& A);
90 
95  Ax3(const Geom::Pnt& P, const Geom::Dir& N, const Geom::Dir& Vx);
96 
97 
100  Ax3(const Geom::Pnt& P, const Geom::Dir& V);
101 
103  void xReverse();
104 
106  void yReverse();
107 
109  void zReverse();
110 
123  void setAxis(const Geom::Ax1& A1);
124 
125 
135  void setDirection(const Geom::Dir& V);
136 
137 
139  void setLocation(const Geom::Pnt& P);
140 
141 
148  void setXDirection(const Geom::Dir& Vx);
149 
156  void setYDirection(const Geom::Dir& Vy);
157 
161  double angle(const Ax3& Other) const;
162 
165  const Geom::Ax1& axis() const;
166 
173  Geom::Ax2 axis2() const;
174 
176  const Geom::Dir& direction() const;
177 
179  const Geom::Pnt& location() const;
180 
182  const Geom::Dir& xDirection() const;
183 
185  const Geom::Dir& yDirection() const;
188  bool direct() const;
189 
197  bool isCoplanar(const Ax3& Other, const double LinearTolerance, const double AngularTolerance) const;
204  bool isCoplanar(const Geom::Ax1& A1, const double LinearTolerance, const double AngularTolerance) const;
205 
206 
207  void mirror(const Geom::Pnt& P);
208 
209 
217  Ax3 mirrored(const Geom::Pnt& P) const;
218 
219 
220  void mirror(const Geom::Ax1& A1);
221 
222 
230  Ax3 mirrored(const Geom::Ax1& A1) const;
231 
232 
233  void mirror(const Geom::Ax2& A2);
234 
235 
244  Ax3 mirrored(const Geom::Ax2& A2) const;
245 
246 
247  void rotate(const Geom::Ax1& A1, const double Ang);
248 
249 
253  Ax3 rotated(const Geom::Ax1& A1, const double Ang) const;
254 
255 
256  void scale(const Geom::Pnt& P, const double S);
257 
258 
266  Ax3 scaled(const Geom::Pnt& P, const double S) const;
267 
268 
269  void transform(const Geom::Trsf& T);
270 
271 
277  Ax3 transformed(const Geom::Trsf& T) const;
278 
279 
280  void translate(const Geom::Vec& V);
281 
282 
285  Ax3 translated(const Geom::Vec& V) const;
286 
287 
288  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
289 
290 
293  Ax3 translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
294 
296  // //
297  // ---------------------- END API ---------------------- //
298  // //
300 
301 
302 private:
303  Geom::Ax1 myaxis;
304  Geom::Dir vydir;
305  Geom::Dir vxdir;
306 };
307 
308 } // namespace Geom
Definition: Rotation.h:5
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
#define GEOM_EXPORT
Definition: geom_defines.h:8
Definition: Ax2.h:69
Definition: Trsf.h:58
Definition: Dir.h:46
Definition: Ax3.h:70
Definition: Ax1.h:52
Defines a non-persistent vector in 3D space.
Definition: Vec.h:45