OpenLexocad  28.0
Lin.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/Ax1.h>
25 
26 namespace Geom
27 {
28 class Ax2;
29 class Trsf;
30 class Vec;
31 class Pnt;
32 class Trsf;
33 
48 class LX_GEOM_EXPORT Lin
49 {
50 public:
52  // //
53  // --------------------- BEGIN API --------------------- //
54  // //
55  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
56  // //
58 
59 
60  // Methods PUBLIC
61  //
63  Lin();
65  Lin(const Geom::Ax1& A1);
66 
70  Lin(const Geom::Pnt& P, const Geom::Dir& V);
71 
72  void reverse();
77  Lin reversed() const;
79  void setDirection(const Geom::Dir& V);
81  void setLocation(const Geom::Pnt& P);
82 
86  void setPosition(const Geom::Ax1& A1);
88  const Geom::Dir& direction() const;
89 
91  const Geom::Pnt& location() const;
92 
95  const Geom::Ax1& position() const;
97  double angle(const Lin& Other) const;
101  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
103  double distance(const Geom::Pnt& P) const;
104 
106  double distance(const Lin& Other) const;
107 
109  double squareDistance(const Geom::Pnt& P) const;
111  double squareDistance(const Lin& Other) const;
112 
118  Lin normal(const Geom::Pnt& P) const;
119 
120 
121  void mirror(const Geom::Pnt& P);
122 
123 
127  Lin mirrored(const Geom::Pnt& P) const;
128 
129 
130  void mirror(const Geom::Ax1& A1);
131 
132 
136  Lin mirrored(const Geom::Ax1& A1) const;
137 
138 
139  void mirror(const Geom::Ax2& A2);
140 
141 
146  Lin mirrored(const Geom::Ax2& A2) const;
147 
148  void rotate(const Geom::Ax1& A1, const double Ang);
149 
152  Lin rotated(const Geom::Ax1& A1, const double Ang) const;
153 
154  void scale(const Geom::Pnt& P, const double S);
155 
159  Lin scaled(const Geom::Pnt& P, const double S) const;
160 
161  void transform(const Geom::Trsf& T);
162 
164  Lin transformed(const Geom::Trsf& T) const;
165 
166  void translate(const Geom::Vec& V);
167 
170  Lin translated(const Geom::Vec& V) const;
171 
172  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
173 
175  Lin translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
176 
178  // //
179  // ---------------------- END API ---------------------- //
180  // //
182 
183 private:
184  Geom::Ax1 pos;
185 };
186 
187 } // namespace Geom
Geom::Lin::setLocation
void setLocation(const Geom::Pnt &P)
Changes the location point (origin) of the line.
Geom::Lin::squareDistance
double squareDistance(const Geom::Pnt &P) const
Computes the square distance between <me> and the point P.
Geom::Lin::mirror
void mirror(const Geom::Pnt &P)
Geom::Lin::scaled
Lin scaled(const Geom::Pnt &P, const double S) const
Geom::Lin::reverse
void reverse()
Geom::Lin::contains
bool contains(const Geom::Pnt &P, const double LinearTolerance) const
Geom::Lin::distance
double distance(const Lin &Other) const
Computes the distance between two lines.
Geom::Lin::rotate
void rotate(const Geom::Ax1 &A1, const double Ang)
Geom::Lin::translated
Lin translated(const Geom::Pnt &P1, const Geom::Pnt &P2) const
Translates a line from the point P1 to the point P2.
Ax1.h
Geom::Lin
Definition: Lin.h:49
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Geom::Lin::direction
const Geom::Dir & direction() const
Returns the direction of the line.
Geom::Lin::setPosition
void setPosition(const Geom::Ax1 &A1)
Geom::Lin::Lin
Lin()
Creates an indefinite Line.
Geom::Ax1
Definition: Ax1.h:50
Geom::Lin::mirror
void mirror(const Geom::Ax2 &A2)
Geom::Lin::Lin
Lin(const Geom::Pnt &P, const Geom::Dir &V)
Geom::Lin::reversed
Lin reversed() const
Geom::Dir
Definition: Dir.h:45
Geom::Lin::normal
Lin normal(const Geom::Pnt &P) const
Geom::Lin::translate
void translate(const Geom::Pnt &P1, const Geom::Pnt &P2)
Geom::Lin::Lin
Lin(const Geom::Ax1 &A1)
Creates a line defined by axis A1.
Geom::Lin::angle
double angle(const Lin &Other) const
Computes the angle between two lines in radians.
Geom::Lin::mirrored
Lin mirrored(const Geom::Ax2 &A2) const
Geom::Lin::rotated
Lin rotated(const Geom::Ax1 &A1, const double Ang) const
Geom::Lin::position
const Geom::Ax1 & position() const
Geom::Lin::translate
void translate(const Geom::Vec &V)
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Geom::Lin::mirror
void mirror(const Geom::Ax1 &A1)
Geom::Lin::mirrored
Lin mirrored(const Geom::Ax1 &A1) const
Geom::Lin::squareDistance
double squareDistance(const Lin &Other) const
Computes the square distance between two lines.
Geom::Lin::setDirection
void setDirection(const Geom::Dir &V)
Changes the direction of the line.
Geom::Lin::transform
void transform(const Geom::Trsf &T)
Geom::Trsf
Definition: Trsf.h:58
Geom::Lin::mirrored
Lin mirrored(const Geom::Pnt &P) const
Geom::Lin::transformed
Lin transformed(const Geom::Trsf &T) const
Transforms a line with the transformation T from class Trsf.
Geom::Lin::translated
Lin translated(const Geom::Vec &V) const
Geom::Lin::location
const Geom::Pnt & location() const
Returns the location point (origin) of the line.
Geom::Lin::scale
void scale(const Geom::Pnt &P, const double S)
Geom::Lin::distance
double distance(const Geom::Pnt &P) const
Computes the distance between <me> and the point P.
Geom
Definition: PropertyContainer.h:33