OpenLexocad  28.0
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
Geom::Circ2d::IsDirect
bool IsDirect() const
Geom::Circ2d::Translated
Circ2d Translated(const Vec2d &V) const
Geom::Circ2d::Transformed
Circ2d Transformed(const Trsf2d &T) const
Transforms a circle with the transformation T from class Trsf2d.
Geom::Circ2d::SetAxis
void SetAxis(const Ax22d &A)
Changes the X axis of the circle.
Geom::Circ2d::Position
const Ax22d & Position() const
returns the position of the circle. Idem Axis(me).
Ax2d.h
Geom::Circ2d::Mirrored
Circ2d Mirrored(const Ax2d &A) const
Geom::Circ2d::Mirror
void Mirror(const Ax2d &A)
Geom::Circ2d::Rotated
Circ2d Rotated(const Pnt2d &P, const double Ang) const
Geom::Circ2d::Translated
Circ2d Translated(const Pnt2d &P1, const Pnt2d &P2) const
Translates a circle from the point P1 to the point P2.
Geom::Circ2d::Length
double Length() const
computes the circumference of the circle.
Geom::Circ2d::Transform
void Transform(const Trsf2d &T)
Geom::Circ2d
Definition: Circ2d.h:58
Geom::Circ2d::Axis
const Ax22d & Axis() const
returns the position of the circle.
Ax22d.h
Geom::Circ2d::SetRadius
void SetRadius(const double Radius)
Geom::Circ2d::Translate
void Translate(const Vec2d &V)
Geom::Circ2d::Rotate
void Rotate(const Pnt2d &P, const double Ang)
Geom::Circ2d::SquareDistance
double SquareDistance(const Pnt2d &P) const
Computes the square distance between <me> and the point P.
Geom::Circ2d::Location
const Pnt2d & Location() const
Returns the location point (center) of the circle.
Geom::Circ2d::XAxis
Ax2d XAxis() const
returns the X axis of the circle.
Geom::Circ2d::Contains
bool Contains(const Pnt2d &P, const double LinearTolerance) const
Geom::Circ2d::_CSFDB_GetCirc2dradius
double _CSFDB_GetCirc2dradius() const
Definition: Circ2d.h:178
Geom::Circ2d::_CSFDB_GetCirc2dpos
const Ax22d & _CSFDB_GetCirc2dpos() const
Definition: Circ2d.h:177
Geom::Circ2d::Radius
double Radius() const
Returns the radius value of the circle.
Geom::Vec2d
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:33
Geom::Circ2d::Translate
void Translate(const Pnt2d &P1, const Pnt2d &P2)
Geom::Circ2d::Mirror
void Mirror(const Pnt2d &P)
Geom::Circ2d::_CSFDB_SetCirc2dradius
void _CSFDB_SetCirc2dradius(const double p)
Definition: Circ2d.h:179
Geom::Ax2d
Definition: Ax2d.h:51
Geom::Circ2d::Area
double Area() const
Computes the area of the circle.
Geom::Circ2d::Distance
double Distance(const Pnt2d &P) const
Geom::Circ2d::SetYAxis
void SetYAxis(const Ax2d &A)
Changes the Y axis of the circle.
Geom::Circ2d::Scale
void Scale(const Pnt2d &P, const double S)
Geom::Circ2d::YAxis
Ax2d YAxis() const
Returns the Y axis of the circle. //! Reverses the direction of the circle.
Geom::Circ2d::SetXAxis
void SetXAxis(const Ax2d &A)
Changes the X axis of the circle.
Geom::Circ2d::Circ2d
Circ2d()
creates an indefinite circle.
Geom::Ax22d
Definition: Ax22d.h:51
Geom::Circ2d::Reversed
Circ2d Reversed() const
Geom::Circ2d::Coefficients
void Coefficients(double &A, double &B, double &C, double &D, double &E, double &F) const
Geom::Circ2d::Mirrored
Circ2d Mirrored(const Pnt2d &P) const
Geom::Circ2d::Circ2d
Circ2d(const Ax22d &Axis, const double Radius)
Geom::Pnt2d
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:34
Geom::Trsf2d
Definition: Trsf2d.h:47
Geom::Circ2d::Circ2d
Circ2d(const Ax2d &XAxis, const double Radius, const bool Sense=true)
Geom::Circ2d::Scaled
Circ2d Scaled(const Pnt2d &P, const double S) const
Geom
Definition: PropertyContainer.h:33
Geom::Circ2d::SetLocation
void SetLocation(const Pnt2d &P)
Changes the location point (center) of the circle.
Geom::Circ2d::Reverse
void Reverse()