Seamly2D
Code documentation
VArc Class Reference

VArc class for anticlockwise arc. More...

#include <varc.h>

Inheritance diagram for VArc:
Collaboration diagram for VArc:

Public Member Functions

 VArc ()
 VArc default constructor. More...
 
 VArc (const VPointF &center, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1, qreal f2, const QString &formulaF2, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VArc (const VPointF &center, qreal radius, qreal f1, qreal f2)
 
 VArc (qreal length, const QString &formulaLength, const VPointF &center, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VArc (qreal length, const VPointF &center, qreal radius, qreal f1)
 
 VArc (const VArc &arc)
 VArc copy constructor. More...
 
VArc Rotate (const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
 
VArc Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VArc Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
virtual ~VArc () Q_DECL_OVERRIDE
 
VArcoperator= (const VArc &arc)
 operator = assignment operator More...
 
void Swap (VArc &arc) Q_DECL_NOTHROW
 VArc constructor. More...
 
QString GetFormulaRadius () const
 GetRadius return arc radius. More...
 
void SetFormulaRadius (const QString &formula, qreal value)
 
qreal GetRadius () const
 GetRadius return formula for radius. More...
 
virtual qreal GetLength () const Q_DECL_OVERRIDE
 GetLength return arc length. More...
 
QPointF GetP1 () const
 GetP1 return point associated with start angle. More...
 
QPointF GetP2 () const
 GetP2 return point associated with end angle. More...
 
virtual QVector< QPointF > getPoints () const Q_DECL_OVERRIDE
 GetPoints return list of points needed for drawing arc. More...
 
QVector< QLineF > getSegments () const
 
QPointF CutArc (qreal length, VArc &segment1, VArc &segment2) const
 CutArc cut arc into two segments. More...
 
QPointF CutArc (qreal length) const
 
- Public Member Functions inherited from VAbstractArc
 VAbstractArc (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractArc (const GOType &type, const VPointF &center, qreal f1, const QString &formulaF1, qreal f2, const QString &formulaF2, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VAbstractArc (const GOType &type, const VPointF &center, qreal f1, qreal f2, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VAbstractArc (const GOType &type, const QString &formulaLength, const VPointF &center, qreal f1, const QString &formulaF1, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VAbstractArc (const GOType &type, const VPointF &center, qreal f1, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VAbstractArc (const VAbstractArc &arc)
 
virtual ~VAbstractArc ()
 
VAbstractArcoperator= (const VAbstractArc &arc)
 
void Swap (VAbstractArc &arc) Q_DECL_NOTHROW
 
QString GetFormulaF1 () const
 
void SetFormulaF1 (const QString &formula, qreal value)
 
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE
 
QString GetFormulaF2 () const
 
void SetFormulaF2 (const QString &formula, qreal value)
 
virtual qreal GetEndAngle () const Q_DECL_OVERRIDE
 
virtual VPointF GetCenter () const
 
void SetCenter (const VPointF &point)
 
QString GetFormulaLength () const
 
void SetFormulaLength (const QString &formula, qreal value)
 
virtual void setId (const quint32 &id) Q_DECL_OVERRIDE
 setId set id object. More...
 
virtual QString NameForHistory (const QString &toolName) const Q_DECL_OVERRIDE
 
bool IsFlipped () const
 
qreal AngleArc () const
 
- Public Member Functions inherited from VAbstractCurve
 VAbstractCurve (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractCurve (const VAbstractCurve &curve)
 
virtual ~VAbstractCurve () Q_DECL_OVERRIDE
 
VAbstractCurveoperator= (const VAbstractCurve &curve)
 
void Swap (VAbstractCurve &curve) Q_DECL_NOTHROW
 
QVector< QPointF > GetSegmentPoints (const QPointF &begin, const QPointF &end, bool reverse=false) const
 
virtual QPainterPath GetPath () const
 
qreal GetLengthByPoint (const QPointF &point) const
 
virtual QVector< QPointF > IntersectLine (const QLineF &line) const
 IntersectLine return list of points for real intersection with line. More...
 
virtual bool IsIntersectLine (const QLineF &line) const
 
bool isPointOnCurve (const QPointF &p) const
 
quint32 GetDuplicate () const
 
void SetDuplicate (quint32 number)
 
QString getLineColor () const
 
void setLineColor (const QString &color)
 
QString GetPenStyle () const
 
void SetPenStyle (const QString &penStyle)
 
QString getLineWeight () const
 getLineWeight return weight of the lines More...
 
void setLineWeight (const QString &lineWeight)
 setLineWeight set weight of the lines More...
 
QPointF getFirstPoint ()
 
QPointF getLastPoint ()
 
virtual QVector< DirectionArrowDirectionArrows () const
 
- Public Member Functions inherited from VGObject
 VGObject ()
 VGObject default constructor. More...
 
 VGObject (const GOType &type, const quint32 &idObject=0, const Draw &mode=Draw::Calculation)
 VGObject constructor. More...
 
 VGObject (const VGObject &obj)
 VGObject copy constructor. More...
 
virtual ~VGObject ()
 
VGObjectoperator= (const VGObject &obj)
 operator = assignment operator. More...
 
void Swap (VGObject &obj) Q_DECL_NOTHROW
 
quint32 getIdObject () const
 getIdObject return parent id. More...
 
void setIdObject (const quint32 &value)
 setIdObject set parent id. More...
 
virtual QString name () const
 name return name graphical object. More...
 
void setName (const QString &name)
 setName set name graphical object. More...
 
Draw getMode () const
 getMode return mode creation. More...
 
void setMode (const Draw &value)
 setMode set mode creation. More...
 
GOType getType () const
 getType return object type. More...
 
void setType (const GOType &type)
 
quint32 id () const
 id return id object. More...
 
quint32 getIdTool () const
 

Protected Member Functions

virtual void CreateName () Q_DECL_OVERRIDE
 
virtual void FindF2 (qreal length) Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractArc
void SetFlipped (bool value)
 
void SetFormulaLength (const QString &formula)
 

Private Member Functions

qreal MaxLength () const
 

Private Attributes

QSharedDataPointer< VArcDatad
 

Additional Inherited Members

- Static Public Member Functions inherited from VAbstractCurve
static QVector< QPointF > GetSegmentPoints (const QVector< QPointF > &points, const QPointF &begin, const QPointF &end, bool reverse=false)
 
static bool isPointOnCurve (const QVector< QPointF > &points, const QPointF &p)
 
static qreal PathLength (const QVector< QPointF > &path)
 
static QVector< QPointF > CurveIntersectLine (const QVector< QPointF > &points, const QLineF &line)
 
static QPainterPath ShowDirection (const QVector< DirectionArrow > &arrows, qreal width)
 
- Static Public Member Functions inherited from VGObject
static QLineF BuildLine (const QPointF &p1, const qreal &length, const qreal &angle)
 
static QPointF BuildRay (const QPointF &firstPoint, const qreal &angle, const QRectF &scRect)
 
static QLineF BuildAxis (const QPointF &p, const qreal &angle, const QRectF &scRect)
 
static QLineF BuildAxis (const QPointF &p1, const QPointF &p2, const QRectF &scRect)
 
static int ContactPoints (const QPointF &p, const QPointF &center, qreal radius, QPointF &p1, QPointF &p2)
 
static QPointF LineIntersectRect (const QRectF &rec, const QLineF &line)
 LineIntersectRect find point intersection line and rect. More...
 
static int IntersectionCircles (const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2)
 
static qint32 LineIntersectCircle (const QPointF &center, qreal radius, const QLineF &line, QPointF &p1, QPointF &p2)
 LineIntersectCircle find point intersection line and circle. More...
 
static QPointF ClosestPoint (const QLineF &line, const QPointF &point)
 ClosestPoint find point projection of point onto line. More...
 
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k)
 
static void LineCoefficients (const QLineF &line, qreal *a, qreal *b, qreal *c)
 LineCoefficients coefficient for equation of segment. Segment equestion ax+by+c=0. More...
 
static bool IsPointOnLineSegment (const QPointF &t, const QPointF &p1, const QPointF &p2)
 IsPointOnLineSegment Check if the point is on the line segment. More...
 
static bool IsPointOnLineviaPDP (const QPointF &t, const QPointF &p1, const QPointF &p2)
 IsPointOnLineviaPDP use the perp dot product (PDP) way. More...
 
template<typename T >
static QVector< T > GetReversePoints (const QVector< T > &points)
 GetReversePoint return revers container of points. More...
 
static int GetLengthContour (const QVector< QPointF > &contour, const QVector< QPointF > &newPoints)
 GetLengthContour return length of contour. More...
 
- Static Public Attributes inherited from VAbstractCurve
static const qreal lengthCurveDirectionArrow = 14
 
- Static Public Attributes inherited from VGObject
static const double accuracyPointOnLine = (0.1555 / 25.4) * 96.0
 
- Static Protected Member Functions inherited from VGObject
static QTransform flipTransform (const QLineF &axis)
 

Detailed Description

VArc class for anticlockwise arc.

Definition at line 73 of file varc.h.

Constructor & Destructor Documentation

◆ VArc() [1/6]

VArc::VArc ( )

VArc default constructor.

Definition at line 68 of file varc.cpp.

References Arc.

Referenced by CutArc().

◆ VArc() [2/6]

VArc::VArc ( const VPointF center,
qreal  radius,
const QString &  formulaRadius,
qreal  f1,
const QString &  formulaF1,
qreal  f2,
const QString &  formulaF2,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

Definition at line 90 of file varc.cpp.

References Arc, and CreateName().

◆ VArc() [3/6]

VArc::VArc ( const VPointF center,
qreal  radius,
qreal  f1,
qreal  f2 
)

Definition at line 99 of file varc.cpp.

References Arc, Calculation, and CreateName().

◆ VArc() [4/6]

VArc::VArc ( qreal  length,
const QString &  formulaLength,
const VPointF center,
qreal  radius,
const QString &  formulaRadius,
qreal  f1,
const QString &  formulaF1,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

Definition at line 107 of file varc.cpp.

References Arc, CreateName(), and FindF2().

◆ VArc() [5/6]

VArc::VArc ( qreal  length,
const VPointF center,
qreal  radius,
qreal  f1 
)

Definition at line 117 of file varc.cpp.

References Arc, Calculation, CreateName(), and FindF2().

◆ VArc() [6/6]

VArc::VArc ( const VArc arc)

VArc copy constructor.

Parameters
arcarc

Definition at line 130 of file varc.cpp.

◆ ~VArc()

VArc::~VArc ( )
virtual

Definition at line 212 of file varc.cpp.

Member Function Documentation

◆ CreateName()

void VArc::CreateName ( )
protectedvirtual

◆ CutArc() [1/2]

QPointF VArc::CutArc ( qreal  length) const

Definition at line 406 of file varc.cpp.

References CutArc().

◆ CutArc() [2/2]

QPointF VArc::CutArc ( qreal  length,
VArc segment1,
VArc segment2 
) const

CutArc cut arc into two segments.

Parameters
lengthlength first arc segment.
segment1first arc segment.
segment2second arc segment.
Returns
point cutting

Definition at line 357 of file varc.cpp.

References d, VAbstractArc::GetCenter(), VAbstractArc::GetEndAngle(), VAbstractArc::GetFormulaF1(), VAbstractArc::GetFormulaF2(), VGObject::getIdObject(), GetLength(), VGObject::getMode(), GetP1(), VAbstractArc::GetStartAngle(), VAbstractArc::IsFlipped(), Mm, VAbstractArc::SetFlipped(), ToPixel(), and VArc().

Referenced by CutArc().

◆ FindF2()

void VArc::FindF2 ( qreal  length)
protectedvirtual

◆ Flip()

◆ GetFormulaRadius()

QString VArc::GetFormulaRadius ( ) const

GetRadius return arc radius.

Returns
radius.

Definition at line 465 of file varc.cpp.

References d.

◆ GetLength()

qreal VArc::GetLength ( ) const
virtual

GetLength return arc length.

Returns
length.

Implements VAbstractCurve.

Definition at line 220 of file varc.cpp.

References VAbstractArc::AngleArc(), d, and VAbstractArc::IsFlipped().

Referenced by CutArc().

◆ GetP1()

QPointF VArc::GetP1 ( ) const

GetP1 return point associated with start angle.

Returns
point.

Definition at line 236 of file varc.cpp.

References d, VAbstractArc::GetCenter(), and VAbstractArc::GetStartAngle().

Referenced by CutArc(), Flip(), getPoints(), Move(), and Rotate().

◆ GetP2()

QPointF VArc::GetP2 ( ) const

GetP2 return point associated with end angle.

Returns
точку point.

Definition at line 249 of file varc.cpp.

References d, VAbstractArc::GetCenter(), and VAbstractArc::GetEndAngle().

Referenced by Flip(), getPoints(), Move(), and Rotate().

◆ getPoints()

QVector< QPointF > VArc::getPoints ( ) const
virtual

GetPoints return list of points needed for drawing arc.

Returns
list of points

Implements VAbstractCurve.

Definition at line 262 of file varc.cpp.

References VAbstractArc::AngleArc(), VAbstractArc::GetCenter(), GetP1(), GetP2(), VSpline::getPoints(), GetRadius(), and VAbstractArc::IsFlipped().

Referenced by getSegments().

◆ GetRadius()

qreal VArc::GetRadius ( ) const

GetRadius return formula for radius.

Returns
string with formula.

Definition at line 482 of file varc.cpp.

References d.

Referenced by VToolPointFromArcAndTangent::FindPoint(), VToolPointOfIntersectionArcs::FindPoint(), VisToolPointFromArcAndTangent::FindRays(), Flip(), getPoints(), Move(), Rotate(), and VArcRadius::VArcRadius().

◆ getSegments()

QVector< QLineF > VArc::getSegments ( ) const

Definition at line 331 of file varc.cpp.

References getPoints().

Referenced by VPiece::createUNotch().

◆ MaxLength()

qreal VArc::MaxLength ( ) const
private

Definition at line 455 of file varc.cpp.

References d, and M_2PI.

Referenced by FindF2().

◆ Move()

◆ operator=()

VArc & VArc::operator= ( const VArc arc)

operator = assignment operator

Parameters
arcarc
Returns
arc

Definition at line 140 of file varc.cpp.

References d, and VAbstractArc::operator=().

◆ Rotate()

◆ SetFormulaRadius()

void VArc::SetFormulaRadius ( const QString &  formula,
qreal  value 
)

Definition at line 471 of file varc.cpp.

References d.

◆ Swap()

void VArc::Swap ( VArc arc)

VArc constructor.

Parameters
centercenter point.
radiusarc radius.
f1start angle (degree).
f2end angle (degree).

Definition at line 87 of file varc.cpp.

References VAbstractArc::Swap().

Member Data Documentation

◆ d

QSharedDataPointer<VArcData> VArc::d
private

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