OpenLexocad  27.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 
25 #include <Geom/Dir.h>
26 #include <Geom/GeomEnums.h>
27 #include <Geom/Pnt.h>
28 #include <Geom/geom_defines.h>
29 
30 namespace Geom
31 {
32 class Ax1;
33 class Ax2;
34 class Trsf;
35 class Vec;
36 } // namespace Geom
37 
38 namespace Geom
39 {
53 {
54 public:
56  // //
57  // --------------------- BEGIN API --------------------- //
58  // //
59  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
60  // //
62 
63  // Methods PUBLIC
64  //
66  Ax1();
67 
69  Ax1(const Geom::Pnt& P, const Geom::Dir& V);
71  void setDirection(const Geom::Dir& V);
73  void setLocation(const Geom::Pnt& P);
75  const Geom::Dir& direction() const;
77  const Geom::Pnt& location() const;
78 
79 
87  bool isCoaxial(const Ax1& Other, const double AngularTolerance, const double LinearTolerance) const;
88 
93  bool isNormal(const Ax1& Other, const double AngularTolerance) const;
94 
99  bool isOpposite(const Ax1& Other, const double AngularTolerance) const;
100 
106  bool isParallel(const Ax1& Other, const double AngularTolerance) const;
107 
111  double angle(const Ax1& Other) const;
114  void reverse();
116  Ax1 reversed() const;
117 
118 
122  void mirror(const Geom::Pnt& P);
123 
127  Ax1 mirrored(const Geom::Pnt& P) const;
128 
129 
133  void mirror(const Ax1& A1);
134 
135 
139  Ax1 mirrored(const Ax1& A1) const;
140 
141 
146  void mirror(const Geom::Ax2& A2);
147 
148 
153  Ax1 mirrored(const Geom::Ax2& A2) const;
156  void rotate(const Ax1& A1, const double Ang);
159  Ax1 rotated(const Ax1& A1, const double Ang) const;
160 
164  void scale(const Geom::Pnt& P, const double S);
165 
169  Ax1 scaled(const Geom::Pnt& P, const double S) const;
172  void transform(const Geom::Trsf& T);
173 
177  Ax1 transformed(const Geom::Trsf& T) const;
178 
181  void translate(const Geom::Vec& V);
182 
185  Ax1 translated(const Geom::Vec& V) const;
186 
190  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
191 
195  Ax1 translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
196 
198  // //
199  // ---------------------- END API ---------------------- //
200  // //
202 
203 private:
204  Geom::Pnt loc;
205  Geom::Dir vdir;
206 };
207 
208 } // 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