OpenLexocad  27.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 #include <Geom/GeomEnums.h>
26 #include <Geom/geom_defines.h>
27 
28 namespace Geom
29 {
30 class Ax2;
31 class Trsf;
32 class Vec;
33 class Pnt;
34 class Trsf;
35 
51 {
52 public:
54  // //
55  // --------------------- BEGIN API --------------------- //
56  // //
57  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
58  // //
60 
61 
62  // Methods PUBLIC
63  //
65  Lin();
67  Lin(const Geom::Ax1& A1);
68 
72  Lin(const Geom::Pnt& P, const Geom::Dir& V);
73 
74  void reverse();
79  Lin reversed() const;
81  void setDirection(const Geom::Dir& V);
83  void setLocation(const Geom::Pnt& P);
84 
88  void setPosition(const Geom::Ax1& A1);
90  const Geom::Dir& direction() const;
91 
93  const Geom::Pnt& location() const;
94 
97  const Geom::Ax1& position() const;
99  double angle(const Lin& Other) const;
103  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
105  double distance(const Geom::Pnt& P) const;
106 
108  double distance(const Lin& Other) const;
109 
111  double squareDistance(const Geom::Pnt& P) const;
113  double squareDistance(const Lin& Other) const;
114 
120  Lin normal(const Geom::Pnt& P) const;
121 
122 
123  void mirror(const Geom::Pnt& P);
124 
125 
129  Lin mirrored(const Geom::Pnt& P) const;
130 
131 
132  void mirror(const Geom::Ax1& A1);
133 
134 
138  Lin mirrored(const Geom::Ax1& A1) const;
139 
140 
141  void mirror(const Geom::Ax2& A2);
142 
143 
148  Lin mirrored(const Geom::Ax2& A2) const;
149 
150  void rotate(const Geom::Ax1& A1, const double Ang);
151 
154  Lin rotated(const Geom::Ax1& A1, const double Ang) const;
155 
156  void scale(const Geom::Pnt& P, const double S);
157 
161  Lin scaled(const Geom::Pnt& P, const double S) const;
162 
163  void transform(const Geom::Trsf& T);
164 
166  Lin transformed(const Geom::Trsf& T) const;
167 
168  void translate(const Geom::Vec& V);
169 
172  Lin translated(const Geom::Vec& V) const;
173 
174  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
175 
177  Lin translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
178 
180  // //
181  // ---------------------- END API ---------------------- //
182  // //
184 
185 private:
186  Geom::Ax1 pos;
187 };
188 
189 } // namespace Geom
Definition: Rotation.h:5
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: Ax1.h:52
Defines a non-persistent vector in 3D space.
Definition: Vec.h:45