VArc class for anticlockwise arc. More...
#include <varc.h>
Public Member Functions | |
VArc () | |
VArc default constructor. More... | |
VArc (const VPointF ¢er, 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 ¢er, qreal radius, qreal f1, qreal f2) | |
VArc (qreal length, const QString &formulaLength, const VPointF ¢er, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1, quint32 idObject=0, Draw mode=Draw::Calculation) | |
VArc (qreal length, const VPointF ¢er, 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 |
VArc & | operator= (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 ¢er, qreal f1, const QString &formulaF1, qreal f2, const QString &formulaF2, quint32 idObject=0, Draw mode=Draw::Calculation) | |
VAbstractArc (const GOType &type, const VPointF ¢er, qreal f1, qreal f2, quint32 idObject=0, Draw mode=Draw::Calculation) | |
VAbstractArc (const GOType &type, const QString &formulaLength, const VPointF ¢er, qreal f1, const QString &formulaF1, quint32 idObject=0, Draw mode=Draw::Calculation) | |
VAbstractArc (const GOType &type, const VPointF ¢er, qreal f1, quint32 idObject=0, Draw mode=Draw::Calculation) | |
VAbstractArc (const VAbstractArc &arc) | |
virtual | ~VAbstractArc () |
VAbstractArc & | operator= (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 |
VAbstractCurve & | operator= (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< DirectionArrow > | DirectionArrows () 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 () |
VGObject & | operator= (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< VArcData > | d |
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 ¢er, 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 ¢er, 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) |
VArc::VArc | ( | ) |
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::VArc | ( | const VPointF & | center, |
qreal | radius, | ||
qreal | f1, | ||
qreal | f2 | ||
) |
Definition at line 99 of file varc.cpp.
References Arc, Calculation, and CreateName().
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::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::VArc | ( | const VArc & | arc | ) |
|
protectedvirtual |
Implements VAbstractCurve.
Definition at line 414 of file varc.cpp.
References ARC_, VAbstractArc::GetCenter(), VAbstractCurve::GetDuplicate(), VGObject::id(), VGObject::name(), NULL_ID, and VGObject::setName().
Referenced by VArc().
QPointF VArc::CutArc | ( | qreal | length | ) | const |
CutArc cut arc into two segments.
length | length first arc segment. |
segment1 | first arc segment. |
segment2 | second arc segment. |
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().
|
protectedvirtual |
Implements VAbstractArc.
Definition at line 432 of file varc.cpp.
References d, VAbstractArc::GetStartAngle(), VAbstractArc::IsFlipped(), MaxLength(), VAbstractArc::SetFlipped(), and VAbstractArc::SetFormulaF2().
Referenced by VArc().
VArc VArc::Flip | ( | const QLineF & | axis, |
const QString & | prefix = QString() |
||
) | const |
Definition at line 172 of file varc.cpp.
References VPointF::Flip(), VPointF::FlipPF(), VAbstractArc::GetCenter(), VAbstractCurve::getLineColor(), VAbstractCurve::getLineWeight(), GetP1(), GetP2(), VAbstractCurve::GetPenStyle(), GetRadius(), VAbstractArc::IsFlipped(), VGObject::name(), VAbstractArc::SetFlipped(), VAbstractCurve::setLineColor(), VAbstractCurve::setLineWeight(), VGObject::setName(), and VAbstractCurve::SetPenStyle().
QString VArc::GetFormulaRadius | ( | ) | const |
|
virtual |
GetLength return arc length.
Implements VAbstractCurve.
Definition at line 220 of file varc.cpp.
References VAbstractArc::AngleArc(), d, and VAbstractArc::IsFlipped().
Referenced by CutArc().
QPointF VArc::GetP1 | ( | ) | const |
GetP1 return point associated with start angle.
Definition at line 236 of file varc.cpp.
References d, VAbstractArc::GetCenter(), and VAbstractArc::GetStartAngle().
Referenced by CutArc(), Flip(), getPoints(), Move(), and Rotate().
QPointF VArc::GetP2 | ( | ) | const |
GetP2 return point associated with end angle.
Definition at line 249 of file varc.cpp.
References d, VAbstractArc::GetCenter(), and VAbstractArc::GetEndAngle().
Referenced by Flip(), getPoints(), Move(), and Rotate().
|
virtual |
GetPoints return list of points needed for drawing arc.
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().
qreal VArc::GetRadius | ( | ) | const |
GetRadius return formula for radius.
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().
QVector< QLineF > VArc::getSegments | ( | ) | const |
Definition at line 331 of file varc.cpp.
References getPoints().
Referenced by VPiece::createUNotch().
|
private |
VArc VArc::Move | ( | qreal | length, |
qreal | angle, | ||
const QString & | prefix = QString() |
||
) | const |
Definition at line 192 of file varc.cpp.
References VAbstractArc::GetCenter(), VAbstractCurve::getLineColor(), VAbstractCurve::getLineWeight(), GetP1(), GetP2(), VAbstractCurve::GetPenStyle(), GetRadius(), VAbstractArc::IsFlipped(), VPointF::Move(), VPointF::MovePF(), VGObject::name(), VAbstractArc::SetFlipped(), VAbstractCurve::setLineColor(), VAbstractCurve::setLineWeight(), VGObject::setName(), and VAbstractCurve::SetPenStyle().
operator = assignment operator
arc | arc |
Definition at line 140 of file varc.cpp.
References d, and VAbstractArc::operator=().
VArc VArc::Rotate | ( | const QPointF & | originPoint, |
qreal | degrees, | ||
const QString & | prefix = QString() |
||
) | const |
Definition at line 152 of file varc.cpp.
References VAbstractArc::GetCenter(), VAbstractCurve::getLineColor(), VAbstractCurve::getLineWeight(), GetP1(), GetP2(), VAbstractCurve::GetPenStyle(), GetRadius(), VAbstractArc::IsFlipped(), VGObject::name(), VPointF::Rotate(), VPointF::RotatePF(), VAbstractArc::SetFlipped(), VAbstractCurve::setLineColor(), VAbstractCurve::setLineWeight(), VGObject::setName(), and VAbstractCurve::SetPenStyle().
void VArc::SetFormulaRadius | ( | const QString & | formula, |
qreal | value | ||
) |
void VArc::Swap | ( | VArc & | arc | ) |
VArc constructor.
center | center point. |
radius | arc radius. |
f1 | start angle (degree). |
f2 | end angle (degree). |
Definition at line 87 of file varc.cpp.
References VAbstractArc::Swap().
|
private |
Definition at line 119 of file varc.h.
Referenced by CutArc(), FindF2(), GetFormulaRadius(), GetLength(), GetP1(), GetP2(), GetRadius(), MaxLength(), operator=(), and SetFormulaRadius().