Seamly2D
Code documentation
VEllipticalArc Class Reference

#include <vellipticalarc.h>

Inheritance diagram for VEllipticalArc:
Collaboration diagram for VEllipticalArc:

Public Member Functions

 VEllipticalArc ()
 VEllipticalArc default constructor. More...
 
 VEllipticalArc (const VPointF &center, qreal radius1, qreal radius2, const QString &formulaRadius1, const QString &formulaRadius2, qreal f1, const QString &formulaF1, qreal f2, const QString &formulaF2, qreal rotationAngle, const QString &formulaRotationAngle, quint32 idObject=0, Draw mode=Draw::Calculation)
 VEllipticalArc constructor. More...
 
 VEllipticalArc (const VPointF &center, qreal radius1, qreal radius2, qreal f1, qreal f2, qreal rotationAngle)
 
 VEllipticalArc (qreal length, const QString &formulaLength, const VPointF &center, qreal radius1, qreal radius2, const QString &formulaRadius1, const QString &formulaRadius2, qreal f1, const QString &formulaF1, qreal rotationAngle, const QString &formulaRotationAngle, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VEllipticalArc (qreal length, const VPointF &center, qreal radius1, qreal radius2, qreal f1, qreal rotationAngle)
 
 VEllipticalArc (const VEllipticalArc &arc)
 VEllipticalArc copy constructor. More...
 
VEllipticalArc Rotate (QPointF originPoint, qreal degrees, const QString &prefix=QString()) const
 
VEllipticalArc Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VEllipticalArc Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
virtual ~VEllipticalArc () Q_DECL_OVERRIDE
 
VEllipticalArcoperator= (const VEllipticalArc &arc)
 operator = assignment operator More...
 
void Swap (VEllipticalArc &arc) Q_DECL_NOTHROW
 
QString GetFormulaRotationAngle () const
 GetFormulaRotationAngle return formula for rotation angle. More...
 
void SetFormulaRotationAngle (const QString &formula, qreal value)
 
qreal GetRotationAngle () const
 GetRotationAngle return rotation angle. More...
 
QString GetFormulaRadius1 () const
 GetFormulaRadius1 return formula for major radius. More...
 
void SetFormulaRadius1 (const QString &formula, qreal value)
 
qreal GetRadius1 () const
 GetRadius1 return elliptical arc major radius. More...
 
QString GetFormulaRadius2 () const
 GetFormulaRadius2 return formula for minor radius. More...
 
void SetFormulaRadius2 (const QString &formula, qreal value)
 
qreal GetRadius2 () const
 GetRadius2 return elliptical arc minor 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...
 
QTransform getTransform () const
 
void setTransform (const QTransform &matrix, bool combine=false)
 
virtual VPointF GetCenter () const Q_DECL_OVERRIDE
 
virtual QVector< QPointF > getPoints () const Q_DECL_OVERRIDE
 GetPoints return list of points needed for drawing arc. More...
 
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE
 
virtual qreal GetEndAngle () const Q_DECL_OVERRIDE
 
QPointF CutArc (const qreal &length, VEllipticalArc &arc1, VEllipticalArc &arc2) const
 CutArc cut arc into two arcs. More...
 
QPointF CutArc (const 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)
 
QString GetFormulaF2 () const
 
void SetFormulaF2 (const QString &formula, qreal value)
 
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
 

Static Public Member Functions

static qreal normalizeAngle (qreal angle)
 
- 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...
 

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
 
QPointF getPoint (qreal angle) const
 GetPoint return point associated with angle. More...
 
qreal getRealEndAngle () const
 

Private Attributes

QSharedDataPointer< VEllipticalArcDatad
 

Additional Inherited Members

- 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

Definition at line 47 of file vellipticalarc.h.

Constructor & Destructor Documentation

◆ VEllipticalArc() [1/6]

VEllipticalArc::VEllipticalArc ( )

VEllipticalArc default constructor.

Definition at line 54 of file vellipticalarc.cpp.

References EllipticalArc.

Referenced by CutArc().

◆ VEllipticalArc() [2/6]

VEllipticalArc::VEllipticalArc ( const VPointF center,
qreal  radius1,
qreal  radius2,
const QString &  formulaRadius1,
const QString &  formulaRadius2,
qreal  f1,
const QString &  formulaF1,
qreal  f2,
const QString &  formulaF2,
qreal  rotationAngle,
const QString &  formulaRotationAngle,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

VEllipticalArc constructor.

Parameters
centercenter point.
radius1arc major radius.
radius2arc minor radius.
f1start angle (degree).
f2end angle (degree).

Definition at line 67 of file vellipticalarc.cpp.

References CreateName(), and EllipticalArc.

◆ VEllipticalArc() [3/6]

VEllipticalArc::VEllipticalArc ( const VPointF center,
qreal  radius1,
qreal  radius2,
qreal  f1,
qreal  f2,
qreal  rotationAngle 
)

Definition at line 78 of file vellipticalarc.cpp.

References Calculation, CreateName(), and EllipticalArc.

◆ VEllipticalArc() [4/6]

VEllipticalArc::VEllipticalArc ( qreal  length,
const QString &  formulaLength,
const VPointF center,
qreal  radius1,
qreal  radius2,
const QString &  formulaRadius1,
const QString &  formulaRadius2,
qreal  f1,
const QString &  formulaF1,
qreal  rotationAngle,
const QString &  formulaRotationAngle,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

Definition at line 87 of file vellipticalarc.cpp.

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

◆ VEllipticalArc() [5/6]

VEllipticalArc::VEllipticalArc ( qreal  length,
const VPointF center,
qreal  radius1,
qreal  radius2,
qreal  f1,
qreal  rotationAngle 
)

Definition at line 99 of file vellipticalarc.cpp.

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

◆ VEllipticalArc() [6/6]

VEllipticalArc::VEllipticalArc ( const VEllipticalArc arc)

VEllipticalArc copy constructor.

Parameters
arcarc

Definition at line 113 of file vellipticalarc.cpp.

◆ ~VEllipticalArc()

VEllipticalArc::~VEllipticalArc ( )
virtual

Definition at line 193 of file vellipticalarc.cpp.

Member Function Documentation

◆ CreateName()

void VEllipticalArc::CreateName ( )
protectedvirtual

◆ CutArc() [1/2]

QPointF VEllipticalArc::CutArc ( const qreal &  length) const

Definition at line 399 of file vellipticalarc.cpp.

References CutArc().

◆ CutArc() [2/2]

QPointF VEllipticalArc::CutArc ( const qreal &  length,
VEllipticalArc arc1,
VEllipticalArc arc2 
) const

CutArc cut arc into two arcs.

Parameters
lengthlength first arc.
arc1first arc.
arc2second arc.
Returns
point cutting

Definition at line 356 of file vellipticalarc.cpp.

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

Referenced by CutArc().

◆ FindF2()

void VEllipticalArc::FindF2 ( qreal  length)
protectedvirtual

◆ Flip()

◆ GetCenter()

VPointF VEllipticalArc::GetCenter ( ) const
virtual

◆ GetEndAngle()

qreal VEllipticalArc::GetEndAngle ( ) const
virtual

Reimplemented from VAbstractArc.

Definition at line 343 of file vellipticalarc.cpp.

References GetCenter(), GetP2(), and GetRotationAngle().

Referenced by CutArc().

◆ GetFormulaRadius1()

QString VEllipticalArc::GetFormulaRadius1 ( ) const

GetFormulaRadius1 return formula for major radius.

Returns
radius.

Definition at line 489 of file vellipticalarc.cpp.

References d.

◆ GetFormulaRadius2()

QString VEllipticalArc::GetFormulaRadius2 ( ) const

GetFormulaRadius2 return formula for minor radius.

Returns
radius.

Definition at line 499 of file vellipticalarc.cpp.

References d.

◆ GetFormulaRotationAngle()

QString VEllipticalArc::GetFormulaRotationAngle ( ) const

GetFormulaRotationAngle return formula for rotation angle.

Returns
rotationAngle.

Definition at line 509 of file vellipticalarc.cpp.

References d.

Referenced by CutArc().

◆ GetLength()

qreal VEllipticalArc::GetLength ( ) const
virtual

GetLength return arc length.

Returns
length.

Implements VAbstractCurve.

Definition at line 201 of file vellipticalarc.cpp.

References getPoints(), VAbstractArc::IsFlipped(), and VAbstractCurve::PathLength().

Referenced by CutArc(), and FindF2().

◆ GetP1()

QPointF VEllipticalArc::GetP1 ( ) const

GetP1 return point associated with start angle.

Returns
point.

Definition at line 218 of file vellipticalarc.cpp.

References getPoint(), VAbstractArc::GetStartAngle(), and getTransform().

Referenced by CutArc(), getPoints(), and GetStartAngle().

◆ GetP2()

QPointF VEllipticalArc::GetP2 ( ) const

GetP2 return point associated with end angle.

Returns
point.

Definition at line 228 of file vellipticalarc.cpp.

References VAbstractArc::GetEndAngle(), getPoint(), and getTransform().

Referenced by GetEndAngle(), and getPoints().

◆ getPoint()

QPointF VEllipticalArc::getPoint ( qreal  angle) const
private

GetPoint return point associated with angle.

Returns
point.

Definition at line 262 of file vellipticalarc.cpp.

References VAbstractArc::GetCenter(), GetCenter(), GetRadius1(), GetRadius2(), GetRotationAngle(), SCASSERT, VPointF::toQPointF(), and VFuzzyComparePossibleNulls().

Referenced by GetP1(), and GetP2().

◆ getPoints()

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

GetPoints return list of points needed for drawing arc.

Returns
list of points

Implements VAbstractCurve.

Definition at line 293 of file vellipticalarc.cpp.

References d, VAbstractArc::GetCenter(), GetP1(), GetP2(), getRealEndAngle(), GetRotationAngle(), VAbstractArc::GetStartAngle(), VPointF::toQPointF(), and VFuzzyComparePoints().

Referenced by GetLength().

◆ GetRadius1()

qreal VEllipticalArc::GetRadius1 ( ) const

GetRadius1 return elliptical arc major radius.

Returns
string with formula.

Definition at line 540 of file vellipticalarc.cpp.

References d.

Referenced by Flip(), getPoint(), Move(), Rotate(), and VArcRadius::VArcRadius().

◆ GetRadius2()

qreal VEllipticalArc::GetRadius2 ( ) const

GetRadius2 return elliptical arc minor radius.

Returns
string with formula.

Definition at line 550 of file vellipticalarc.cpp.

References d.

Referenced by Flip(), getPoint(), Move(), Rotate(), and VArcRadius::VArcRadius().

◆ getRealEndAngle()

qreal VEllipticalArc::getRealEndAngle ( ) const
private

Definition at line 566 of file vellipticalarc.cpp.

References d, VAbstractArc::GetEndAngle(), normalizeAngle(), and VFuzzyComparePossibleNulls().

Referenced by getPoints().

◆ GetRotationAngle()

qreal VEllipticalArc::GetRotationAngle ( ) const

GetRotationAngle return rotation angle.

Returns
rotationAngle.

Definition at line 560 of file vellipticalarc.cpp.

References d.

Referenced by Flip(), GetEndAngle(), getPoint(), getPoints(), GetStartAngle(), Move(), and Rotate().

◆ GetStartAngle()

qreal VEllipticalArc::GetStartAngle ( ) const
virtual

Reimplemented from VAbstractArc.

Definition at line 337 of file vellipticalarc.cpp.

References GetCenter(), GetP1(), and GetRotationAngle().

Referenced by CutArc(), and FindF2().

◆ getTransform()

QTransform VEllipticalArc::getTransform ( ) const

Definition at line 234 of file vellipticalarc.cpp.

References d.

Referenced by GetP1(), and GetP2().

◆ MaxLength()

qreal VEllipticalArc::MaxLength ( ) const
private

Definition at line 477 of file vellipticalarc.cpp.

References d.

Referenced by FindF2().

◆ Move()

◆ normalizeAngle()

qreal VEllipticalArc::normalizeAngle ( qreal  angle)
inlinestatic

Definition at line 128 of file vellipticalarc.h.

Referenced by getRealEndAngle().

◆ operator=()

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

operator = assignment operator

Parameters
arcarc
Returns
arc

Definition at line 123 of file vellipticalarc.cpp.

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

◆ Rotate()

◆ SetFormulaRadius1()

void VEllipticalArc::SetFormulaRadius1 ( const QString &  formula,
qreal  value 
)

Definition at line 515 of file vellipticalarc.cpp.

References d.

◆ SetFormulaRadius2()

void VEllipticalArc::SetFormulaRadius2 ( const QString &  formula,
qreal  value 
)

Definition at line 522 of file vellipticalarc.cpp.

References d.

◆ SetFormulaRotationAngle()

void VEllipticalArc::SetFormulaRotationAngle ( const QString &  formula,
qreal  value 
)

Definition at line 529 of file vellipticalarc.cpp.

References d.

◆ setTransform()

void VEllipticalArc::setTransform ( const QTransform &  matrix,
bool  combine = false 
)

Definition at line 240 of file vellipticalarc.cpp.

References d.

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

◆ Swap()

void VEllipticalArc::Swap ( VEllipticalArc arc)

Definition at line 47 of file vellipticalarc.cpp.

References VAbstractArc::Swap().

Member Data Documentation

◆ d


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