OpenLexocad  27.1
Circ.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/Ax2.h>
25 namespace Geom
26 {
53 class LX_GEOM_EXPORT Circ
54 {
55 public:
57  // //
58  // --------------------- BEGIN API --------------------- //
59  // //
60  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
61  // //
63 
65  Circ();
66 
70  Circ(const Geom::Ax2& A2, const double Radius);
71 
76  void setAxis(const Geom::Ax1& A1);
77 
79  void setLocation(const Geom::Pnt& P);
81  void setPosition(const Geom::Ax2& A2);
86  void setRadius(const double Radius);
88  double area() const;
89 
93  const Geom::Ax1& axis() const;
95  double length() const;
96 
100  const Geom::Pnt& location() const;
101 
104  const Geom::Ax2& position() const;
106  double radius() const;
107 
111  Geom::Ax1 xAxis() const;
112 
116  Geom::Ax1 yAxis() const;
117 
120  double distance(const Geom::Pnt& P) const;
121 
123  double squareDistance(const Geom::Pnt& P) const;
124 
128  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
129 
130  void mirror(const Geom::Pnt& P);
131 
135  Geom::Circ mirrored(const Geom::Pnt& P) const;
136 
137  void mirror(const Geom::Ax1& A1);
138 
142  Geom::Circ mirrored(const Geom::Ax1& A1) const;
143 
144  void mirror(const Geom::Ax2& A2);
145 
149  Geom::Circ mirrored(const Geom::Ax2& A2) const;
150 
151  void rotate(const Geom::Ax1& A1, const double Ang);
152 
155  Geom::Circ rotated(const Geom::Ax1& A1, const double Ang) const;
156 
157  void scale(const Geom::Pnt& P, const double S);
158 
164  Geom::Circ scaled(const Geom::Pnt& P, const double S) const;
165 
166  void transform(const Geom::Trsf& T);
167 
169  Geom::Circ transformed(const Geom::Trsf& T) const;
170 
171  void translate(const Geom::Vec& V);
172 
175  Geom::Circ translated(const Geom::Vec& V) const;
176 
177  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
178 
180  Geom::Circ translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
181 
183  // //
184  // ---------------------- END API ---------------------- //
185  // //
187 
188 private:
189  Geom::Ax2 _pos;
190  double _radius;
191 };
192 
193 } // namespace Geom
Definition: Circ.h:53
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: Trsf.h:57
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