OpenLexocad  28.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 
26 namespace Geom
27 {
28 class Ax2;
29 class Trsf;
30 class Vec;
31 class Pnt;
32 
67 class LX_GEOM_EXPORT Ax3
68 {
69 public:
70  // Methods PUBLIC
71  //
72 
74  // //
75  // --------------------- BEGIN API --------------------- //
76  // //
77  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
78  // //
80 
82  Ax3();
83 
86  Ax3(const Geom::Ax2& A);
87 
92  Ax3(const Geom::Pnt& P, const Geom::Dir& N, const Geom::Dir& Vx);
93 
94 
97  Ax3(const Geom::Pnt& P, const Geom::Dir& V);
98 
100  void xReverse();
101 
103  void yReverse();
104 
106  void zReverse();
107 
120  void setAxis(const Geom::Ax1& A1);
121 
122 
132  void setDirection(const Geom::Dir& V);
133 
134 
136  void setLocation(const Geom::Pnt& P);
137 
138 
145  void setXDirection(const Geom::Dir& Vx);
146 
153  void setYDirection(const Geom::Dir& Vy);
154 
158  double angle(const Ax3& Other) const;
159 
162  const Geom::Ax1& axis() const;
163 
170  Geom::Ax2 axis2() const;
171 
173  const Geom::Dir& direction() const;
174 
176  const Geom::Pnt& location() const;
177 
179  const Geom::Dir& xDirection() const;
180 
182  const Geom::Dir& yDirection() const;
185  bool direct() const;
186 
194  bool isCoplanar(const Ax3& Other, const double LinearTolerance, const double AngularTolerance) const;
201  bool isCoplanar(const Geom::Ax1& A1, const double LinearTolerance, const double AngularTolerance) const;
202 
203 
204  void mirror(const Geom::Pnt& P);
205 
206 
214  Ax3 mirrored(const Geom::Pnt& P) const;
215 
216 
217  void mirror(const Geom::Ax1& A1);
218 
219 
227  Ax3 mirrored(const Geom::Ax1& A1) const;
228 
229 
230  void mirror(const Geom::Ax2& A2);
231 
232 
241  Ax3 mirrored(const Geom::Ax2& A2) const;
242 
243 
244  void rotate(const Geom::Ax1& A1, const double Ang);
245 
246 
250  Ax3 rotated(const Geom::Ax1& A1, const double Ang) const;
251 
252 
253  void scale(const Geom::Pnt& P, const double S);
254 
255 
263  Ax3 scaled(const Geom::Pnt& P, const double S) const;
264 
265 
266  void transform(const Geom::Trsf& T);
267 
268 
274  Ax3 transformed(const Geom::Trsf& T) const;
275 
276 
277  void translate(const Geom::Vec& V);
278 
279 
282  Ax3 translated(const Geom::Vec& V) const;
283 
284 
285  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
286 
287 
290  Ax3 translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
291 
293  // //
294  // ---------------------- END API ---------------------- //
295  // //
297 
298 
299 private:
300  Geom::Ax1 myaxis;
301  Geom::Dir vydir;
302  Geom::Dir vxdir;
303 };
304 
305 } // namespace Geom
Geom::Ax3::mirror
void mirror(const Geom::Ax2 &A2)
Geom::Ax3::direction
const Geom::Dir & direction() const
Returns the main direction of <me>.
Geom::Ax3::axis2
Geom::Ax2 axis2() const
Geom::Ax3::yDirection
const Geom::Dir & yDirection() const
Returns the "YDirection" of <me>.
Geom::Ax3::Ax3
Ax3()
Creates an indefinite coordinate system.
Ax1.h
Geom::Ax3
Definition: Ax3.h:68
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Geom::Ax3::setLocation
void setLocation(const Geom::Pnt &P)
Changes the "Location" point (origin) of <me>.
Geom::Ax3::isCoplanar
bool isCoplanar(const Geom::Ax1 &A1, const double LinearTolerance, const double AngularTolerance) const
Geom::Ax3::transform
void transform(const Geom::Trsf &T)
Geom::Ax3::Ax3
Ax3(const Geom::Pnt &P, const Geom::Dir &V)
Geom::Ax3::rotated
Ax3 rotated(const Geom::Ax1 &A1, const double Ang) const
Geom::Ax1
Definition: Ax1.h:50
Geom::Ax3::mirrored
Ax3 mirrored(const Geom::Pnt &P) const
Geom::Dir
Definition: Dir.h:45
Geom::Ax3::xDirection
const Geom::Dir & xDirection() const
Returns the "XDirection" of <me>.
Geom::Ax3::rotate
void rotate(const Geom::Ax1 &A1, const double Ang)
Geom::Ax3::isCoplanar
bool isCoplanar(const Ax3 &Other, const double LinearTolerance, const double AngularTolerance) const
Geom::Ax3::Ax3
Ax3(const Geom::Pnt &P, const Geom::Dir &N, const Geom::Dir &Vx)
Geom::Ax3::translate
void translate(const Geom::Vec &V)
Geom::Ax3::mirrored
Ax3 mirrored(const Geom::Ax2 &A2) const
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Geom::Ax3::mirror
void mirror(const Geom::Ax1 &A1)
Geom::Ax3::translate
void translate(const Geom::Pnt &P1, const Geom::Pnt &P2)
Geom::Ax3::setDirection
void setDirection(const Geom::Dir &V)
Geom::Ax3::direct
bool direct() const
Geom::Ax3::location
const Geom::Pnt & location() const
Returns the "Location" point (origin) of <me>.
Geom::Ax3::axis
const Geom::Ax1 & axis() const
Geom::Ax3::scaled
Ax3 scaled(const Geom::Pnt &P, const double S) const
Geom::Ax3::xReverse
void xReverse()
Reverses the X direction of <me>.
Geom::Ax3::mirror
void mirror(const Geom::Pnt &P)
Geom::Ax3::zReverse
void zReverse()
Reverses the Z direction of <me>.
Geom::Ax3::setXDirection
void setXDirection(const Geom::Dir &Vx)
Geom::Ax3::Ax3
Ax3(const Geom::Ax2 &A)
Geom::Ax3::yReverse
void yReverse()
Reverses the Y direction of <me>.
Geom::Ax3::transformed
Ax3 transformed(const Geom::Trsf &T) const
Geom::Ax3::setYDirection
void setYDirection(const Geom::Dir &Vy)
Geom::Ax3::scale
void scale(const Geom::Pnt &P, const double S)
Geom::Trsf
Definition: Trsf.h:58
Geom::Ax3::translated
Ax3 translated(const Geom::Vec &V) const
Geom::Ax3::angle
double angle(const Ax3 &Other) const
Geom::Ax3::translated
Ax3 translated(const Geom::Pnt &P1, const Geom::Pnt &P2) const
Geom
Definition: PropertyContainer.h:33
Geom::Ax3::setAxis
void setAxis(const Geom::Ax1 &A1)
Geom::Ax3::mirrored
Ax3 mirrored(const Geom::Ax1 &A1) const