OpenLexocad  27.1
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 
26 namespace Geom
27 {
28 class Lin;
29 class Ax1;
30 class Ax2;
31 class Trsf;
32 class Vec;
33 class Pnt;
34 class Dir;
35 
57 class LX_GEOM_EXPORT Pln
58 {
59 public:
61  // //
62  // --------------------- BEGIN API --------------------- //
63  // //
64  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
65  // //
67 
68  // Methods PUBLIC
69  //
71  Pln();
72 
79  Pln(const Geom::Ax3& A3);
80 
81 
84  Pln(const Geom::Pnt& P, const Geom::Dir& V);
85 
86 
90  Pln(const double A, const double B, const double C, const double D);
91 
94  void coefficients(double& A, double& B, double& C, double& D) const;
99  void setAxis(const Geom::Ax1& A1);
101  void setLocation(const Geom::Pnt& Loc);
103  void setPosition(const Geom::Ax3& A3);
106  void uReverse();
109  void vReverse();
111  bool direct() const;
113  const Geom::Ax1& axis() const;
115  const Geom::Pnt& location() const;
117  const Geom::Ax3& position() const;
119  double distance(const Geom::Pnt& P) const;
121  double signeddistance(const Geom::Pnt& P) const;
123  double distance(const Geom::Lin& L) const;
125  double distance(const Pln& Other) const;
126 
128  double squareDistance(const Geom::Pnt& P) const;
129 
131  double squareDistance(const Geom::Lin& L) const;
132 
134  double squareDistance(const Pln& Other) const;
136  Geom::Ax1 xAxis() const;
138  Geom::Ax1 yAxis() const;
147  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
156  bool contains(const Geom::Lin& L, const double LinearTolerance, const double AngularTolerance) const;
157 
158 
159  void mirror(const Geom::Pnt& P);
160 
161 
167  Pln mirrored(const Geom::Pnt& P) const;
168 
169 
170  void mirror(const Geom::Ax1& A1);
171 
180  Pln mirrored(const Geom::Ax1& A1) const;
181 
182 
183  void mirror(const Geom::Ax2& A2);
184 
193  Pln mirrored(const Geom::Ax2& A2) const;
194 
195  void rotate(const Geom::Ax1& A1, const double Ang);
196 
199  Pln rotated(const Geom::Ax1& A1, const double Ang) const;
200 
201  void scale(const Geom::Pnt& P, const double S);
202 
204  Pln scaled(const Geom::Pnt& P, const double S) const;
205 
206  void transform(const Geom::Trsf& T);
207 
213  Pln transformed(const Geom::Trsf& T) const;
214 
215  void translate(const Geom::Vec& V);
216 
219  Pln translated(const Geom::Vec& V) const;
220 
221  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
222 
224  Pln translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
225 
227  // //
228  // ---------------------- END API ---------------------- //
229  // //
231 
232 
233 private:
234  Geom::Ax3 pos;
235 };
236 
237 } // namespace Geom
Definition: Variant.h:60
Definition: Pln.h:57
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:43
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
Definition: Ax2.h:67
Definition: Lin.h:48
Definition: Trsf.h:57
Definition: Dir.h:45
Definition: Ax3.h:69
Definition: Ax1.h:50
Defines a non-persistent vector in 3D space.
Definition: Vec.h:44
double distance(const Geom::Vec &v1, const Geom::Vec &v2)
Returns the distance between two points.
Definition: Vec.h:345