OpenLexocad  28.0
Ax1.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/Dir.h>
25 #include <Geom/Pnt.h>
26 
27 
28 namespace Geom
29 {
30 class Ax2;
31 class Trsf;
32 class Vec;
33 } // namespace Geom
34 
35 namespace Geom
36 {
49 class LX_GEOM_EXPORT Ax1
50 {
51 public:
53  // //
54  // --------------------- BEGIN API --------------------- //
55  // //
56  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
57  // //
59 
60  // Methods PUBLIC
61  //
63  Ax1() = default;
64 
66  Ax1(const Geom::Pnt& P, const Geom::Dir& V);
68  void setDirection(const Geom::Dir& V);
70  void setLocation(const Geom::Pnt& P);
72  const Geom::Dir& direction() const;
74  const Geom::Pnt& location() const;
75 
76 
84  bool isCoaxial(const Ax1& Other, const double AngularTolerance, const double LinearTolerance) const;
85 
90  bool isNormal(const Ax1& Other, const double AngularTolerance) const;
91 
96  bool isOpposite(const Ax1& Other, const double AngularTolerance) const;
97 
103  bool isParallel(const Ax1& Other, const double AngularTolerance) const;
104 
108  double angle(const Ax1& Other) const;
111  void reverse();
113  Ax1 reversed() const;
114 
115 
119  void mirror(const Geom::Pnt& P);
120 
124  Ax1 mirrored(const Geom::Pnt& P) const;
125 
126 
130  void mirror(const Ax1& A1);
131 
132 
136  Ax1 mirrored(const Ax1& A1) const;
137 
138 
143  void mirror(const Geom::Ax2& A2);
144 
145 
150  Ax1 mirrored(const Geom::Ax2& A2) const;
153  void rotate(const Ax1& A1, const double Ang);
156  Ax1 rotated(const Ax1& A1, const double Ang) const;
157 
161  void scale(const Geom::Pnt& P, const double S);
162 
166  Ax1 scaled(const Geom::Pnt& P, const double S) const;
169  void transform(const Geom::Trsf& T);
170 
174  Ax1 transformed(const Geom::Trsf& T) const;
175 
178  void translate(const Geom::Vec& V);
179 
182  Ax1 translated(const Geom::Vec& V) const;
183 
187  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
188 
192  Ax1 translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
193 
195  // //
196  // ---------------------- END API ---------------------- //
197  // //
199 
200 private:
201  Geom::Pnt loc;
202  Geom::Dir vdir;
203 };
204 
205 } // namespace Geom
Geom::Ax1::isNormal
bool isNormal(const Ax1 &Other, const double AngularTolerance) const
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Geom::Ax1::translated
Ax1 translated(const Geom::Vec &V) const
Geom::Ax1::isCoaxial
bool isCoaxial(const Ax1 &Other, const double AngularTolerance, const double LinearTolerance) const
Geom::Ax1::direction
const Geom::Dir & direction() const
Returns the direction of <me>.
Geom::Ax1::setLocation
void setLocation(const Geom::Pnt &P)
Assigns P as the origin of this axis.
Geom::Ax1::transformed
Ax1 transformed(const Geom::Trsf &T) const
Geom::Ax1
Definition: Ax1.h:50
Geom::Ax1::mirror
void mirror(const Ax1 &A1)
Geom::Ax1::Ax1
Ax1(const Geom::Pnt &P, const Geom::Dir &V)
P is the location point and V is the direction of <me>.
Geom::Dir
Definition: Dir.h:45
Geom::Ax1::location
const Geom::Pnt & location() const
Returns the location point of <me>.
Geom::Ax1::rotate
void rotate(const Ax1 &A1, const double Ang)
Geom::Ax1::isParallel
bool isParallel(const Ax1 &Other, const double AngularTolerance) const
Geom::Ax1::reverse
void reverse()
Geom::Ax1::Ax1
Ax1()=default
Creates a undefined Ax1.
Geom::Ax1::mirrored
Ax1 mirrored(const Ax1 &A1) const
Geom::Ax1::scaled
Ax1 scaled(const Geom::Pnt &P, const double S) const
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Geom::Ax1::reversed
Ax1 reversed() const
Reverses the unit vector of this axis and creates a new one.
Geom::Ax1::translated
Ax1 translated(const Geom::Pnt &P1, const Geom::Pnt &P2) const
Pnt.h
Geom::Ax1::scale
void scale(const Geom::Pnt &P, const double S)
Geom::Ax1::transform
void transform(const Geom::Trsf &T)
Geom::Ax1::mirrored
Ax1 mirrored(const Geom::Pnt &P) const
Geom::Ax1::isOpposite
bool isOpposite(const Ax1 &Other, const double AngularTolerance) const
Geom::Ax1::mirrored
Ax1 mirrored(const Geom::Ax2 &A2) const
Geom::Ax1::translate
void translate(const Geom::Pnt &P1, const Geom::Pnt &P2)
Geom::Ax1::rotated
Ax1 rotated(const Ax1 &A1, const double Ang) const
Geom::Ax1::angle
double angle(const Ax1 &Other) const
Geom::Ax1::setDirection
void setDirection(const Geom::Dir &V)
Assigns V as the "Direction" of this axis.
Geom::Ax1::mirror
void mirror(const Geom::Ax2 &A2)
Geom::Trsf
Definition: Trsf.h:58
Dir.h
Geom::Ax1::mirror
void mirror(const Geom::Pnt &P)
Geom::Ax1::translate
void translate(const Geom::Vec &V)
Geom
Definition: PropertyContainer.h:33