OpenLexocad  27.1
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
Definition: Variant.h:60
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: 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