OpenLexocad  27.0
Ax2.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/GeomEnums.h>
27 #include <Geom/geom_defines.h>
28 
29 namespace Geom
30 {
31 class Ax2;
32 class Pnt;
33 class Trsf;
34 class Vec;
35 
36 } // namespace Geom
37 
38 namespace Geom
39 {
68 
70 {
71 public:
73  // //
74  // --------------------- BEGIN API --------------------- //
75  // //
76  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
77  // //
79 
80  // Methods PUBLIC
81  //
83  Ax2();
84 
91  Ax2(const Geom::Pnt& P, const Geom::Dir& N, const Geom::Dir& Vx);
92 
93 
97  Ax2(const Geom::Pnt& P, const Geom::Dir& V);
98 
99  Ax2(const Geom::Pnt& aP, const Geom::Dir& aZDir, const Geom::Dir& aYDir, const Geom::Dir& aXDir);
100 
109  void setAxis(const Geom::Ax1& A1);
110 
111 
119  void setDirection(const Geom::Dir& V);
120 
121 
123  void setLocation(const Geom::Pnt& P);
124 
125 
133  void setXDirection(const Geom::Dir& Vx);
134 
135 
144  void setYDirection(const Geom::Dir& Vy);
145 
146 
150  double angle(const Ax2& Other) const;
151 
154  const Geom::Ax1& axis() const;
155 
157  const Geom::Dir& direction() const;
158 
160  const Geom::Pnt& location() const;
161 
163  const Geom::Dir& xDirection() const;
164 
166  const Geom::Dir& yDirection() const;
167 
168 
169  bool isCoplanar(const Ax2& Other, const double LinearTolerance, const double AngularTolerance) const;
170 
176  bool isCoplanar(const Geom::Ax1& A1, const double LinearTolerance, const double AngularTolerance) const;
177 
178 
194  void mirror(const Geom::Pnt& P);
195 
196 
212  Ax2 mirrored(const Geom::Pnt& P) const;
213 
214 
230  void mirror(const Geom::Ax1& A1);
231 
232 
248  Ax2 mirrored(const Geom::Ax1& A1) const;
249 
250 
267  void mirror(const Ax2& A2);
268 
269 
286  Ax2 mirrored(const Ax2& A2) const;
287 
288  void rotate(const Geom::Ax1& A1, const double Ang);
289 
293  Ax2 rotated(const Geom::Ax1& A1, const double Ang) const;
294 
295  void scale(const Geom::Pnt& P, const double S);
296 
304  Ax2 scaled(const Geom::Pnt& P, const double S) const;
305 
306  void transform(const Geom::Trsf& T);
307 
313  Ax2 transformed(const Geom::Trsf& T) const;
314 
315  void translate(const Geom::Vec& V);
316 
319  Ax2 translated(const Geom::Vec& V) const;
320 
321  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
322 
325  Ax2 translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
326 
328  // //
329  // ---------------------- END API ---------------------- //
330  // //
332 
333 
334  bool isEqual(const Ax2& Other, const double tolerance) const;
335 
336 
337 private:
338  Geom::Ax1 myaxis;
339  Geom::Dir vydir;
340  Geom::Dir vxdir;
341 };
342 
343 } // 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: Ax1.h:52
Defines a non-persistent vector in 3D space.
Definition: Vec.h:45