OpenLexocad  28.0
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 
26 
27 namespace Geom
28 {
55 class LX_GEOM_EXPORT Circ
56 {
57 public:
59  // //
60  // --------------------- BEGIN API --------------------- //
61  // //
62  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
63  // //
65 
67  Circ();
68 
72  Circ(const Geom::Ax2& A2, const double Radius);
73 
78  void setAxis(const Geom::Ax1& A1);
79 
81  void setLocation(const Geom::Pnt& P);
83  void setPosition(const Geom::Ax2& A2);
88  void setRadius(const double Radius);
90  double area() const;
91 
95  const Geom::Ax1& axis() const;
97  double length() const;
98 
102  const Geom::Pnt& location() const;
103 
106  const Geom::Ax2& position() const;
108  double radius() const;
109 
113  Geom::Ax1 xAxis() const;
114 
118  Geom::Ax1 yAxis() const;
119 
122  double distance(const Geom::Pnt& P) const;
123 
125  double squareDistance(const Geom::Pnt& P) const;
126 
130  bool contains(const Geom::Pnt& P, const double LinearTolerance) const;
131 
132  void mirror(const Geom::Pnt& P);
133 
137  Geom::Circ mirrored(const Geom::Pnt& P) const;
138 
139  void mirror(const Geom::Ax1& A1);
140 
144  Geom::Circ mirrored(const Geom::Ax1& A1) const;
145 
146  void mirror(const Geom::Ax2& A2);
147 
151  Geom::Circ mirrored(const Geom::Ax2& A2) const;
152 
153  void rotate(const Geom::Ax1& A1, const double Ang);
154 
157  Geom::Circ rotated(const Geom::Ax1& A1, const double Ang) const;
158 
159  void scale(const Geom::Pnt& P, const double S);
160 
166  Geom::Circ scaled(const Geom::Pnt& P, const double S) const;
167 
168  void transform(const Geom::Trsf& T);
169 
172 
173  void translate(const Geom::Vec& V);
174 
177  Geom::Circ translated(const Geom::Vec& V) const;
178 
179  void translate(const Geom::Pnt& P1, const Geom::Pnt& P2);
180 
182  Geom::Circ translated(const Geom::Pnt& P1, const Geom::Pnt& P2) const;
183 
185  // //
186  // ---------------------- END API ---------------------- //
187  // //
189 
190 private:
191  Geom::Ax2 _pos;
192  double _radius;
193 };
194 
195 } // namespace Geom
Geom::Circ::squareDistance
double squareDistance(const Geom::Pnt &P) const
Computes the square distance between <me> and the point P.
Geom::Circ::rotated
Geom::Circ rotated(const Geom::Ax1 &A1, const double Ang) const
Geom::Circ::rotate
void rotate(const Geom::Ax1 &A1, const double Ang)
Geom::Circ::radius
double radius() const
Returns the radius of this circle.
Geom::Circ::setLocation
void setLocation(const Geom::Pnt &P)
Changes the "Location" point (center) of the circle.
Geom::Circ::setPosition
void setPosition(const Geom::Ax2 &A2)
Changes the position of the circle.
Geom::Circ::yAxis
Geom::Ax1 yAxis() const
Geom::Circ::length
double length() const
Computes the circumference of the circle.
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Geom::Circ::translated
Geom::Circ translated(const Geom::Pnt &P1, const Geom::Pnt &P2) const
Translates a circle from the point P1 to the point P2.
Geom::Circ::contains
bool contains(const Geom::Pnt &P, const double LinearTolerance) const
Geom::Circ::location
const Geom::Pnt & location() const
Geom::Circ::axis
const Geom::Ax1 & axis() const
Geom::Ax1
Definition: Ax1.h:50
Geom::Circ::mirrored
Geom::Circ mirrored(const Geom::Pnt &P) const
Geom::Circ::setAxis
void setAxis(const Geom::Ax1 &A1)
Geom::Circ::mirror
void mirror(const Geom::Ax1 &A1)
Geom::Circ::translated
Geom::Circ translated(const Geom::Vec &V) const
Geom::Circ::scaled
Geom::Circ scaled(const Geom::Pnt &P, const double S) const
Geom::Circ::mirrored
Geom::Circ mirrored(const Geom::Ax1 &A1) const
Geom::Circ::mirrored
Geom::Circ mirrored(const Geom::Ax2 &A2) const
Geom::Circ::translate
void translate(const Geom::Pnt &P1, const Geom::Pnt &P2)
Geom::Circ
Definition: Circ.h:56
Geom::Circ::distance
double distance(const Geom::Pnt &P) const
Geom::Circ::Circ
Circ(const Geom::Ax2 &A2, const double Radius)
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Geom::Circ::area
double area() const
Computes the area of the circle.
Geom::Circ::mirror
void mirror(const Geom::Pnt &P)
Geom::Circ::translate
void translate(const Geom::Vec &V)
Geom::Circ::transform
void transform(const Geom::Trsf &T)
Geom::Circ::xAxis
Geom::Ax1 xAxis() const
Geom::Circ::mirror
void mirror(const Geom::Ax2 &A2)
Geom::Circ::transformed
Geom::Circ transformed(const Geom::Trsf &T) const
Transforms a circle with the transformation T from class Trsf.
Geom::Trsf
Definition: Trsf.h:58
Ax2.h
Geom::Circ::position
const Geom::Ax2 & position() const
Geom::Circ::Circ
Circ()
Creates an indefinite circle.
Geom::Circ::setRadius
void setRadius(const double Radius)
Geom::Circ::scale
void scale(const Geom::Pnt &P, const double S)
Geom
Definition: PropertyContainer.h:33