53 #include "../vgeometry/vabstractcurve.h"
54 #include "../vgeometry/varc.h"
55 #include "../vgeometry/vellipticalarc.h"
56 #include "../vgeometry/vcubicbezier.h"
57 #include "../vgeometry/vcubicbezierpath.h"
58 #include "../vgeometry/vgobject.h"
59 #include "../vgeometry/vpointf.h"
60 #include "../vgeometry/vspline.h"
61 #include "../vgeometry/vsplinepath.h"
66 QGraphicsItem *parent)
83 for (
int i = 0; i <
source.size(); ++i)
86 const quint32 objectId = item.
id;
90 Q_STATIC_ASSERT_X(
static_cast<int>(
GOType::Unknown) == 7,
"Not all objects were handled.");
93 QT_WARNING_DISABLE_GCC(
"-Wswitch-default")
94 switch(
static_cast<GOType>(obj->getType()))
100 dest.append(createArc<VArc>(
id, objectId, fPoint, sPoint,
suffix,
data));
103 dest.append(createArc<VEllipticalArc>(
id, objectId, fPoint, sPoint,
suffix,
data));
106 dest.append(createCurve<VSpline>(
id, objectId, fPoint, sPoint,
suffix,
data));
109 dest.append(createCurveWithSegments<VSplinePath>(
id, objectId, fPoint, sPoint,
suffix,
data));
112 dest.append(createCurve<VCubicBezier>(
id, objectId, fPoint, sPoint,
suffix,
data));
115 dest.append(createCurveWithSegments<VCubicBezierPath>(
id, objectId, fPoint, sPoint,
suffix,
data));
129 for (
int i = 0; i <
source.size(); ++i)
132 const quint32 objectId = item.
id;
136 Q_STATIC_ASSERT_X(
static_cast<int>(
GOType::Unknown) == 7,
"Not all objects were handled.");
139 QT_WARNING_DISABLE_GCC(
"-Wswitch-default")
140 switch(
static_cast<GOType>(obj->getType()))
150 updateArc<VArc>(
id, objectId, fPoint, sPoint,
suffix,
data, dest.at(i).id);
153 updateArc<VEllipticalArc>(
id, objectId, fPoint, sPoint,
suffix,
data, dest.at(i).id);
156 updateCurve<VSpline>(
id, objectId, fPoint, sPoint,
suffix,
data, dest.at(i).id);
159 updateCurveWithSegments<VSplinePath>(
id, objectId, fPoint, sPoint,
suffix,
data, dest.at(i).id);
162 updateCurve<VCubicBezier>(
id, objectId, fPoint, sPoint,
suffix,
data, dest.at(i).id);
165 updateCurveWithSegments<VCubicBezierPath>(
id, objectId, fPoint, sPoint,
suffix,
data,
185 const QPointF &secondPoint,
const QString &suffix,
VContainer *data)
188 VPointF rotated = point->Flip(QLineF(firstPoint, secondPoint),
suffix);
189 rotated.setIdObject(idTool);
192 item.
mx = rotated.mx();
193 item.
my = rotated.my();
200 template <
class Item>
202 const QPointF &secondPoint,
const QString &suffix,
VContainer *data)
211 const QPointF &secondPoint,
const QString &suffix,
VContainer *data,
215 VPointF rotated = point->Flip(QLineF(firstPoint, secondPoint),
suffix);
216 rotated.setIdObject(idTool);
217 rotated.setMx(item.
mx);
218 rotated.setMy(item.
my);
224 template <
class Item>
226 const QString &suffix,
VContainer *data, quint32
id)
228 updateItem<Item>(idTool, idItem, firstPoint, secondPoint,
suffix,
data,
id);
static void createDestination(Source typeCreation, quint32 &id, QVector< DestinationItem > &dest, const QVector< SourceItem > &source, const QPointF &fPoint, const QPointF &sPoint, const QString &suffix, VAbstractPattern *doc, VContainer *data, const Document &parse)
static DestinationItem createArc(quint32 idTool, quint32 idItem, const QPointF &firstPoint, const QPointF &secondPoint, const QString &suffix, VContainer *data)
static void updatePoint(quint32 idTool, quint32 idItem, const QPointF &firstPoint, const QPointF &secondPoint, const QString &suffix, VContainer *data, const DestinationItem &item)
static DestinationItem createPoint(quint32 idTool, quint32 idItem, const QPointF &firstPoint, const QPointF &secondPoint, const QString &suffix, VContainer *data)
static void updateArc(quint32 idTool, quint32 idItem, const QPointF &firstPoint, const QPointF &secondPoint, const QString &suffix, VContainer *data, quint32 id)
VAbstractMirror(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, const QVector< SourceItem > &source, const QVector< DestinationItem > &destination, QGraphicsItem *parent=nullptr)
QVector< SourceItem > source
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0
The VContainer class container of all variables.
void AddArc(const QSharedPointer< VAbstractCurve > &arc, const quint32 &id, const quint32 &parentId=null_id)
static quint32 getNextId()
getNextId generate next unique id
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
quint32 AddGObject(VGObject *obj)
AddGObject add new GObject to container.
void UpdateGObject(quint32 id, T *obj)
UpdateGObject update GObject by id.
The VPointF class keep data of point.