OpenLexocad  27.1
Circ2d.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/Ax22d.h>
25 #include <Geom/Ax2d.h>
26 
27 namespace Geom
28 {
29 class Pnt2d;
30 class Trsf2d;
31 class Vec2d;
32 
57 class LX_GEOM_EXPORT Circ2d
58 {
59 public:
61  Circ2d();
62 
66  Circ2d(const Ax2d& XAxis, const double Radius, const bool Sense = true);
67 
73  Circ2d(const Ax22d& Axis, const double Radius);
75  void SetLocation(const Pnt2d& P);
77  void SetXAxis(const Ax2d& A);
79  void SetAxis(const Ax22d& A);
81  void SetYAxis(const Ax2d& A);
87  void SetRadius(const double Radius);
89  double Area() const;
90 
94  void Coefficients(double& A, double& B, double& C, double& D, double& E, double& F) const;
99  bool Contains(const Pnt2d& P, const double LinearTolerance) const;
100 
103  double Distance(const Pnt2d& P) const;
104 
106  double SquareDistance(const Pnt2d& P) const;
108  double Length() const;
110  const Pnt2d& Location() const;
112  double Radius() const;
114  const Ax22d& Axis() const;
116  const Ax22d& Position() const;
118  Ax2d XAxis() const;
120  Ax2d YAxis() const;
125  void Reverse();
130  Circ2d Reversed() const;
133  bool IsDirect() const;
134 
135  void Mirror(const Pnt2d& P);
136 
139  Circ2d Mirrored(const Pnt2d& P) const;
140 
141  void Mirror(const Ax2d& A);
142 
145  Circ2d Mirrored(const Ax2d& A) const;
146 
147  void Rotate(const Pnt2d& P, const double Ang);
148 
151  Circ2d Rotated(const Pnt2d& P, const double Ang) const;
152 
153  void Scale(const Pnt2d& P, const double S);
154 
160  Circ2d Scaled(const Pnt2d& P, const double S) const;
161 
162  void Transform(const Trsf2d& T);
163 
165  Circ2d Transformed(const Trsf2d& T) const;
166 
167  void Translate(const Vec2d& V);
168 
171  Circ2d Translated(const Vec2d& V) const;
172 
173  void Translate(const Pnt2d& P1, const Pnt2d& P2);
174 
176  Circ2d Translated(const Pnt2d& P1, const Pnt2d& P2) const;
177  const Ax22d& _CSFDB_GetCirc2dpos() const { return pos; }
178  double _CSFDB_GetCirc2dradius() const { return radius; }
179  void _CSFDB_SetCirc2dradius(const double p) { radius = p; }
180 
181 
182 
183 protected:
184 private:
185  Ax22d pos;
186  double radius;
187 };
188 
189 } // namespace Geom
void _CSFDB_SetCirc2dradius(const double p)
Definition: Circ2d.h:179
Definition: Variant.h:60
Definition: Circ2d.h:57
Definition: Ax2d.h:48
const Ax22d & _CSFDB_GetCirc2dpos() const
Definition: Circ2d.h:177
_Precision Distance(const Vector3< _Precision > &v1, const Vector3< _Precision > &v2)
Returns the distance between two points.
Definition: Vector3D.h:220
double _CSFDB_GetCirc2dradius() const
Definition: Circ2d.h:178
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:34
Definition: Trsf2d.h:46
Definition: Ax22d.h:50
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:33