Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::Circle Class Reference

Set of all points at a fixed distance from the center. More...

#include <circle.h>

Inheritance diagram for Geom::Circle:

Public Member Functions

 Circle ()
 
 Circle (Coord cx, Coord cy, Coord r)
 
 Circle (Point const &center, Coord r)
 
 Circle (Coord A, Coord B, Coord C, Coord D)
 
Point center () const
 
Coord center (Dim2 d) const
 
Coord radius () const
 
Coord area () const
 
bool isDegenerate () const
 
void setCenter (Point const &p)
 
void setRadius (Coord c)
 
Rect boundsFast () const
 
Rect boundsExact () const
 
Point initialPoint () const
 
Point finalPoint () const
 
Point pointAt (Coord t) const
 
Coord valueAt (Coord t, Dim2 d) const
 
Coord timeAt (Point const &p) const
 
Coord nearestTime (Point const &p) const
 
bool contains (Point const &p) const
 
bool contains (Rect const &other) const
 
bool contains (Circle const &other) const
 
bool intersects (Line const &l) const
 
bool intersects (LineSegment const &l) const
 
bool intersects (Circle const &other) const
 
std::vector< ShapeIntersectionintersect (Line const &other) const
 
std::vector< ShapeIntersectionintersect (LineSegment const &other) const
 
std::vector< ShapeIntersectionintersect (Circle const &other) const
 
void setCoefficients (Coord A, Coord B, Coord C, Coord D)
 
void coefficients (Coord &A, Coord &B, Coord &C, Coord &D) const
 
std::vector< Coordcoefficients () const
 
Zoom unitCircleTransform () const
 
Zoom inverseUnitCircleTransform () const
 
EllipticalArcarc (Point const &initial, Point const &inner, Point const &final) const
 
D2< SBasistoSBasis () const
 
Circleoperator*= (Translate const &t)
 
Circleoperator*= (Rotate const &)
 
Circleoperator*= (Zoom const &z)
 
bool operator== (Circle const &other) const
 
void fit (std::vector< Point > const &points)
 Fit the circle to the passed points using the least squares method.
 

Private Attributes

Point _center
 
Coord _radius
 

Detailed Description

Set of all points at a fixed distance from the center.

Definition at line 49 of file circle.h.

Constructor & Destructor Documentation

◆ Circle() [1/4]

Geom::Circle::Circle ( )
inline

Definition at line 60 of file circle.h.

◆ Circle() [2/4]

Geom::Circle::Circle ( Coord  cx,
Coord  cy,
Coord  r 
)
inline

Definition at line 61 of file circle.h.

◆ Circle() [3/4]

Geom::Circle::Circle ( Point const &  center,
Coord  r 
)
inline

Definition at line 64 of file circle.h.

◆ Circle() [4/4]

Geom::Circle::Circle ( Coord  A,
Coord  B,
Coord  C,
Coord  D 
)
inline

Definition at line 68 of file circle.h.

References D, and setCoefficients().

Member Function Documentation

◆ arc()

EllipticalArc * Geom::Circle::arc ( Point const &  initial,
Point const &  inner,
Point const &  final 
) const
Parameters
innera point whose angle with the circle center is inside the angle that the arc spans

Definition at line 254 of file circle.cpp.

References _center, _radius, Geom::Ellipse::arc(), inner(), Geom::X, and Geom::Y.

Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().

◆ area()

Coord Geom::Circle::area ( ) const
inline

Definition at line 78 of file circle.h.

References _radius.

◆ boundsExact()

Rect Geom::Circle::boundsExact ( ) const
inline

Definition at line 85 of file circle.h.

References boundsFast().

◆ boundsFast()

Rect Geom::Circle::boundsFast ( ) const

Definition at line 42 of file circle.cpp.

References _center, and _radius.

Referenced by boundsExact().

◆ center() [1/2]

Point Geom::Circle::center ( ) const
inline

Definition at line 75 of file circle.h.

References _center.

Referenced by Geom::are_near(), Geom::PathSink::feed(), and wrap_circle().

◆ center() [2/2]

Coord Geom::Circle::center ( Dim2  d) const
inline

Definition at line 76 of file circle.h.

References _center.

◆ coefficients() [1/2]

std::vector< Coord > Geom::Circle::coefficients ( ) const

Definition at line 80 of file circle.cpp.

References c, and coefficients().

Referenced by coefficients().

◆ coefficients() [2/2]

void Geom::Circle::coefficients ( Coord A,
Coord B,
Coord C,
Coord D 
) const

Definition at line 72 of file circle.cpp.

References _center, _radius, D, Geom::X, and Geom::Y.

Referenced by TEST().

◆ contains() [1/3]

bool Geom::Circle::contains ( Circle const &  other) const

Definition at line 137 of file circle.cpp.

References _center, _radius, and Geom::distance().

◆ contains() [2/3]

bool Geom::Circle::contains ( Point const &  p) const
inline

Definition at line 94 of file circle.h.

References _center, _radius, and Geom::distance().

Referenced by contains(), and intersect().

◆ contains() [3/3]

bool Geom::Circle::contains ( Rect const &  other) const

Definition at line 129 of file circle.cpp.

References contains(), and Geom::GenericRect< C >::corner().

◆ finalPoint()

Point Geom::Circle::finalPoint ( ) const
inline

Definition at line 88 of file circle.h.

References initialPoint().

◆ fit()

void Geom::Circle::fit ( std::vector< Point > const &  points)

Fit the circle to the passed points using the least squares method.

Parameters
pointsSamples at the perimeter of the circle

Definition at line 282 of file circle.cpp.

References _center, _radius, Geom::distance(), and Geom::NL::LFMCircle::instance().

Referenced by tighten(), and wrap_circle().

◆ initialPoint()

Point Geom::Circle::initialPoint ( ) const

Definition at line 104 of file circle.cpp.

References _center, _radius, and Geom::X.

Referenced by finalPoint().

◆ intersect() [1/3]

std::vector< ShapeIntersection > Geom::Circle::intersect ( Circle const &  other) const

◆ intersect() [2/3]

◆ intersect() [3/3]

std::vector< ShapeIntersection > Geom::Circle::intersect ( LineSegment const &  other) const

Definition at line 198 of file circle.cpp.

References Geom::filter_line_segment_intersections(), intersect(), and result.

◆ intersects() [1/3]

bool Geom::Circle::intersects ( Circle const &  other) const

Definition at line 155 of file circle.cpp.

References _center, _radius, and Geom::distance().

◆ intersects() [2/3]

bool Geom::Circle::intersects ( Line const &  l) const

◆ intersects() [3/3]

bool Geom::Circle::intersects ( LineSegment const &  l) const

◆ inverseUnitCircleTransform()

Zoom Geom::Circle::inverseUnitCircleTransform ( ) const

Definition at line 94 of file circle.cpp.

References _center, and _radius.

◆ isDegenerate()

bool Geom::Circle::isDegenerate ( ) const
inline

Definition at line 79 of file circle.h.

References _radius.

◆ nearestTime()

Coord Geom::Circle::nearestTime ( Point const &  p) const

Definition at line 125 of file circle.cpp.

References timeAt().

◆ operator*=() [1/3]

Circle & Geom::Circle::operator*= ( Rotate const &  )
inline

Definition at line 124 of file circle.h.

◆ operator*=() [2/3]

Circle & Geom::Circle::operator*= ( Translate const &  t)
inline

Definition at line 120 of file circle.h.

References _center.

◆ operator*=() [3/3]

Circle & Geom::Circle::operator*= ( Zoom const &  z)
inline

Definition at line 127 of file circle.h.

References _center, _radius, and Geom::Zoom::scale().

◆ operator==()

bool Geom::Circle::operator== ( Circle const &  other) const

Definition at line 261 of file circle.cpp.

References _center, and _radius.

◆ pointAt()

Point Geom::Circle::pointAt ( Coord  t) const

Definition at line 111 of file circle.cpp.

References _center, and _radius.

◆ radius()

Coord Geom::Circle::radius ( ) const
inline

Definition at line 77 of file circle.h.

References _radius.

Referenced by Geom::are_near(), Geom::PathSink::feed(), intersect(), and wrap_circle().

◆ setCenter()

void Geom::Circle::setCenter ( Point const &  p)
inline

Definition at line 81 of file circle.h.

References _center.

◆ setCoefficients()

void Geom::Circle::setCoefficients ( Coord  A,
Coord  B,
Coord  C,
Coord  D 
)

Definition at line 49 of file circle.cpp.

References _center, _radius, c, D, Geom::X, and Geom::Y.

Referenced by Circle(), TEST(), and wrap_circle().

◆ setRadius()

void Geom::Circle::setRadius ( Coord  c)
inline

Definition at line 82 of file circle.h.

References _radius, and c.

◆ timeAt()

Coord Geom::Circle::timeAt ( Point const &  p) const

Definition at line 120 of file circle.cpp.

References _center, and Geom::atan2().

Referenced by intersect(), intersect(), and nearestTime().

◆ toSBasis()

D2< SBasis > Geom::Circle::toSBasis ( ) const

Definition at line 268 of file circle.cpp.

References _center, _radius, Geom::cos(), and Geom::sin().

Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint().

◆ unitCircleTransform()

Zoom Geom::Circle::unitCircleTransform ( ) const

Definition at line 88 of file circle.cpp.

References _center, and _radius.

◆ valueAt()

Coord Geom::Circle::valueAt ( Coord  t,
Dim2  d 
) const

Definition at line 115 of file circle.cpp.

References _center, _radius, delta, and Geom::X.

Member Data Documentation

◆ _center

◆ _radius


The documentation for this class was generated from the following files: