OpenLexocad  27.0
Pln.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/Ax3.h>
25 #include <Geom/GeomEnums.h>
26 #include <Geom/geom_defines.h>
27 
28 namespace Geom
29 {
30 class Lin;
31 class Ax1;
32 class Ax2;
33 class Trsf;
34 class Vec;
35 class Pnt;
36 class Dir;
37 
60 {
61 public:
63  // //
64  // --------------------- BEGIN API --------------------- //
65  // //
66  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
67  // //
69 
70  // Methods PUBLIC
71  //
73  Pln();
74 
81  Pln(const Geom::Ax3& A3);
82 
83 
86  Pln(const Geom::Pnt& P, const Geom::Dir& V);
87 
88 
92  Pln(const double A, const double B, const double C, const double D);
93 
96  void coefficients(double& A, double& B, double& C, double& D) const;
101  void setAxis(const Geom::Ax1& A1);
103  void setLocation(const Geom::Pnt& Loc);
105  void setPosition(const Geom::Ax3& A3);
108  void uReverse();
111  void vReverse();
113  bool direct() const;
115  const Geom::Ax1& axis() const;
117  const Geom::Pnt& location() const;
119  const Geom::Ax3& position() const;
121  double distance(const Geom::Pnt& P) const;
123  double signeddistance(const Geom::Pnt& P) const;
125  double distance(const Geom::Lin& L) const;
127  double distance(const Pln& Other) const;
128 
130  double squareDistance(const Geom::Pnt& P) const;
131 
133  double squareDistance(const Geom::Lin& L) const;
134 
136  double squareDistance(const Pln& Other) const;
138  Geom::Ax1 xAxis() const;
140  Geom::Ax1 yAxis() const;
149  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
158  bool contains(const Geom::Lin& L, const double LinearTolerance, const double AngularTolerance) const;
159 
160 
161  void mirror(const Geom::Pnt& P);
162 
163 
169  Pln mirrored(const Geom::Pnt& P) const;
170 
171 
172  void mirror(const Geom::Ax1& A1);
173 
182  Pln mirrored(const Geom::Ax1& A1) const;
183 
184 
185  void mirror(const Geom::Ax2& A2);
186 
195  Pln mirrored(const Geom::Ax2& A2) const;
196 
197  void rotate(const Geom::Ax1& A1, const double Ang);
198 
201  Pln rotated(const Geom::Ax1& A1, const double Ang) const;
202 
203  void scale(const Geom::Pnt& P, const double S);
204 
206  Pln scaled(const Geom::Pnt& P, const double S) const;
207 
208  void transform(const Geom::Trsf& T);
209 
215  Pln transformed(const Geom::Trsf& T) const;
216 
217  void translate(const Geom::Vec& V);
218 
221  Pln translated(const Geom::Vec& V) const;
222 
223  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
224 
226  Pln translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
227 
229  // //
230  // ---------------------- END API ---------------------- //
231  // //
233 
234 
235 private:
236  Geom::Ax3 pos;
237 };
238 
239 } // namespace Geom
Definition: Rotation.h:5
Definition: Pln.h:59
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
#define GEOM_EXPORT
Definition: geom_defines.h:8
Definition: Ax2.h:69
Definition: Lin.h:50
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