53 #include "../vgeometry/vabstractcurve.h"
54 #include "../vgeometry/varc.h"
55 #include "../vgeometry/vcubicbezier.h"
56 #include "../vgeometry/vcubicbezierpath.h"
57 #include "../vgeometry/vellipticalarc.h"
58 #include "../vgeometry/vgeometrydef.h"
59 #include "../vgeometry/vgobject.h"
60 #include "../vgeometry/vpointf.h"
61 #include "../vgeometry/vspline.h"
62 #include "../vgeometry/vsplinepath.h"
63 #include "../vmisc/vcommonsettings.h"
69 supportColor2(QColor(
qApp->Settings()->getSecondarySupportColor())),
70 supportColor3(QColor(
qApp->Settings()->getTertiarySupportColor())),
111 if (not
curves.isEmpty() &&
static_cast<quint32
>(
curves.size() - 1) >= i)
113 return curves.at(
static_cast<int>(i));
117 auto curve = InitItem<VCurvePathItem>(color,
this);
126 QT_WARNING_DISABLE_GCC(
"-Wswitch-default")
127 void
VisOperation::refreshMirroredObjects(const QPointF &firstPoint, const QPointF &secondPoint)
131 for (
int i = 0; i < objects.size(); ++i)
133 const quint32
id = objects.at(i);
137 Q_STATIC_ASSERT_X(
static_cast<int>(
GOType::Unknown) == 7,
"Not all objects were handled.");
139 switch(
static_cast<GOType>(obj->getType()))
146 VScaledEllipse *point = GetPoint(
static_cast<quint32
>(iPoint), supportColor2);
147 DrawPoint(point,
static_cast<QPointF
>(*p), supportColor2);
150 point = GetPoint(
static_cast<quint32
>(iPoint), supportColor);
154 DrawPoint(point,
static_cast<QPointF
>(p->Flip(QLineF(firstPoint, secondPoint))), supportColor);
160 iCurve = addFlippedCurve<VArc>(firstPoint, secondPoint,
id, iCurve);
165 iCurve = addFlippedCurve<VEllipticalArc>(firstPoint, secondPoint,
id, iCurve);
170 iCurve = addFlippedCurve<VSpline>(firstPoint, secondPoint,
id, iCurve);
175 iCurve = addFlippedCurve<VSplinePath>(firstPoint, secondPoint,
id, iCurve);
180 iCurve = addFlippedCurve<VCubicBezier>(firstPoint, secondPoint,
id, iCurve);
185 iCurve = addFlippedCurve<VCubicBezierPath>(firstPoint, secondPoint,
id, iCurve);
The VContainer class container of all variables.
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
The VMainGraphicsScene class main scene.
QPointF getScenePos() const
The VPointF class keep data of point.
virtual void AddOnScene() Q_DECL_OVERRIDE
void setObjects(QVector< quint32 > objects)
virtual void VisualMode(const quint32 &pointId=NULL_ID) Q_DECL_OVERRIDE
QVector< VScaledEllipse * > points
VCurvePathItem * GetCurve(quint32 i, const QColor &color)
VisOperation(const VContainer *data, QGraphicsItem *parent=nullptr)
VScaledEllipse * GetPoint(quint32 i, const QColor &color)
QVector< quint32 > objects
QVector< VCurvePathItem * > curves
static VScaledEllipse * GetPointItem(QVector< VScaledEllipse * > &points, quint32 i, const QColor &color, QGraphicsItem *parent)
virtual void RefreshGeometry()=0