OpenLexocad  28.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 
26 namespace Geom
27 {
28 class Lin;
29 
51 class LX_GEOM_EXPORT Pln
52 {
53 public:
55  // //
56  // --------------------- BEGIN API --------------------- //
57  // //
58  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
59  // //
61 
62  // Methods PUBLIC
63  //
65  Pln();
66 
73  Pln(const Geom::Ax3& A3);
74 
75 
78  Pln(const Geom::Pnt& P, const Geom::Dir& V);
79 
80 
84  Pln(const double A, const double B, const double C, const double D);
85 
88  void coefficients(double& A, double& B, double& C, double& D) const;
93  void setAxis(const Geom::Ax1& A1);
95  void setLocation(const Geom::Pnt& Loc);
97  void setPosition(const Geom::Ax3& A3);
100  void uReverse();
103  void vReverse();
105  bool direct() const;
107  const Geom::Ax1& axis() const;
109  const Geom::Pnt& location() const;
111  const Geom::Ax3& position() const;
113  double distance(const Geom::Pnt& P) const;
115  double signeddistance(const Geom::Pnt& P) const;
117  double distance(const Geom::Lin& L) const;
119  double distance(const Pln& Other) const;
120 
122  double squareDistance(const Geom::Pnt& P) const;
123 
125  double squareDistance(const Geom::Lin& L) const;
126 
128  double squareDistance(const Pln& Other) const;
130  Geom::Ax1 xAxis() const;
132  Geom::Ax1 yAxis() const;
141  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
150  bool contains(const Geom::Lin& L, const double LinearTolerance, const double AngularTolerance) const;
151 
152 
153  void mirror(const Geom::Pnt& P);
154 
155 
161  Pln mirrored(const Geom::Pnt& P) const;
162 
163 
164  void mirror(const Geom::Ax1& A1);
165 
174  Pln mirrored(const Geom::Ax1& A1) const;
175 
176 
177  void mirror(const Geom::Ax2& A2);
178 
187  Pln mirrored(const Geom::Ax2& A2) const;
188 
189  void rotate(const Geom::Ax1& A1, const double Ang);
190 
193  Pln rotated(const Geom::Ax1& A1, const double Ang) const;
194 
195  void scale(const Geom::Pnt& P, const double S);
196 
198  Pln scaled(const Geom::Pnt& P, const double S) const;
199 
200  void transform(const Geom::Trsf& T);
201 
207  Pln transformed(const Geom::Trsf& T) const;
208 
209  void translate(const Geom::Vec& V);
210 
213  Pln translated(const Geom::Vec& V) const;
214 
215  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
216 
218  Pln translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
219 
221  // //
222  // ---------------------- END API ---------------------- //
223  // //
225 
226 
227 private:
228  Geom::Ax3 pos;
229 };
230 
231 } // namespace Geom
Geom::Pln::contains
bool contains(const Geom::Pnt &P, const double LinearTolerance) const
Geom::Pln::Pln
Pln()
Creates an indefinite plane.
Geom::Pln::coefficients
void coefficients(double &A, double &B, double &C, double &D) const
Geom::Pln::transform
void transform(const Geom::Trsf &T)
Geom::Pln::position
const Geom::Ax3 & position() const
Returns the local coordinate system of the plane .
Geom::Pln::xAxis
Geom::Ax1 xAxis() const
Returns the X axis of the plane.
Geom::Pln::axis
const Geom::Ax1 & axis() const
Returns the plane's normal Axis.
Geom::Ax3
Definition: Ax3.h:68
Geom::Lin
Definition: Lin.h:49
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Geom::Pln::scale
void scale(const Geom::Pnt &P, const double S)
Geom::Pln::location
const Geom::Pnt & location() const
Returns the plane's location (origin).
Geom::Pln::distance
double distance(const Geom::Pnt &P) const
Computes the distance between <me> and the point.
Geom::Ax1
Definition: Ax1.h:50
Geom::Pln::vReverse
void vReverse()
Geom::Pln::contains
bool contains(const Geom::Lin &L, const double LinearTolerance, const double AngularTolerance) const
Geom::Pln::translate
void translate(const Geom::Pnt &P1, const Geom::Pnt &P2)
Geom::Dir
Definition: Dir.h:45
Geom::Pln::distance
double distance(const Pln &Other) const
Computes the distance between two planes.
Geom::Pln
Definition: Pln.h:52
Geom::Pln::rotate
void rotate(const Geom::Ax1 &A1, const double Ang)
Geom::Pln::mirror
void mirror(const Geom::Pnt &P)
Geom::Pln::Pln
Pln(const Geom::Ax3 &A3)
Geom::Pln::translate
void translate(const Geom::Vec &V)
Geom::Pln::yAxis
Geom::Ax1 yAxis() const
Returns the Y axis of the plane.
Geom::Pln::setAxis
void setAxis(const Geom::Ax1 &A1)
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Geom::Pln::distance
double distance(const Geom::Lin &L) const
Computes the distance between <me> and the line <L>.
Geom::Pln::signeddistance
double signeddistance(const Geom::Pnt &P) const
Computes the signed distance between <me> and the point.
Geom::Pln::squareDistance
double squareDistance(const Geom::Lin &L) const
Computes the square distance between <me> and the line <L>.
Geom::Pln::Pln
Pln(const double A, const double B, const double C, const double D)
Geom::Pln::translated
Pln translated(const Geom::Vec &V) const
Geom::Pln::uReverse
void uReverse()
Geom::Pln::scaled
Pln scaled(const Geom::Pnt &P, const double S) const
Scales a plane. S is the scaling value.
Geom::Pln::setLocation
void setLocation(const Geom::Pnt &Loc)
Changes the origin of the plane.
Geom::Pln::transformed
Pln transformed(const Geom::Trsf &T) const
Geom::Pln::mirror
void mirror(const Geom::Ax2 &A2)
Geom::Pln::squareDistance
double squareDistance(const Pln &Other) const
Computes the square distance between two planes.
Geom::Pln::Pln
Pln(const Geom::Pnt &P, const Geom::Dir &V)
Geom::Pln::squareDistance
double squareDistance(const Geom::Pnt &P) const
Computes the square distance between <me> and the point.
Geom::Trsf
Definition: Trsf.h:58
Geom::Pln::mirrored
Pln mirrored(const Geom::Ax2 &A2) const
Geom::Pln::mirror
void mirror(const Geom::Ax1 &A1)
Geom::Pln::direct
bool direct() const
returns true if the Ax3 is right handed.
Ax3.h
Geom::Pln::mirrored
Pln mirrored(const Geom::Ax1 &A1) const
Geom::Pln::setPosition
void setPosition(const Geom::Ax3 &A3)
Changes the local coordinate system of the plane.
Geom::Pln::rotated
Pln rotated(const Geom::Ax1 &A1, const double Ang) const
Geom::Pln::translated
Pln translated(const Geom::Pnt &P1, const Geom::Pnt &P2) const
Translates a plane from the point P1 to the point P2.
Geom
Definition: PropertyContainer.h:33
Geom::Pln::mirrored
Pln mirrored(const Geom::Pnt &P) const