54 #include <QDomElement>
56 #include <QSharedPointer>
57 #include <QStaticStringData>
58 #include <QStringData>
59 #include <QStringDataPtr>
63 #include "../../../dialogs/tools/dialogtool.h"
64 #include "../../../dialogs/tools/dialogcubicbezier.h"
65 #include "../../../visualization/visualization.h"
66 #include "../../../visualization/path/vistoolcubicbezier.h"
67 #include "../ifc/exception/vexception.h"
68 #include "../vgeometry/../ifc/ifcdef.h"
69 #include "../vgeometry/vabstractcurve.h"
70 #include "../vgeometry/vcubicbezier.h"
71 #include "../vgeometry/vgobject.h"
72 #include "../vgeometry/vpointf.h"
73 #include "../vmisc/vabstractapplication.h"
74 #include "../vpatterndb/vcontainer.h"
75 #include "../vwidgets/vmaingraphicsscene.h"
76 #include "../../vabstracttool.h"
77 #include "../vdrawtool.h"
84 const Source &typeCreation, QGraphicsItem *parent)
89 this->setFlag(QGraphicsItem::ItemIsFocusable,
true);
98 auto dialogTool = qobject_cast<DialogCubicBezier*>(
m_dialog);
101 dialogTool->SetSpline(*spl);
103 dialogTool->setPenStyle(spl->GetPenStyle());
104 dialogTool->setLineWeight(spl->getLineWeight());
116 spline->setLineColor(dialogTool->getLineColor());
117 spline->SetPenStyle(dialogTool->getPenStyle());
118 spline->setLineWeight(dialogTool->getLineWeight());
124 spl->m_dialog = dialogTool;
132 const Source &typeCreation)
154 scene->addItem(_spl);
198 return *spline.data();
206 *spline.data() = spl;
213 ShowToolVisualization<VisToolCubicBezier>(show);
223 ContextMenu<DialogCubicBezier>(event);
246 auto dialogTool = qobject_cast<DialogCubicBezier*>(
m_dialog);
262 auto spl = qSharedPointerDynamicCast<VCubicBezier>(obj);
270 if (not
vis.isNull())
272 auto visual = qobject_cast<VisToolCubicBezier *>(
vis);
276 visual->setObject1Id(spl->GetP1().id());
277 visual->setObject2Id(spl->GetP2().id());
278 visual->setObject3Id(spl->GetP3().id());
279 visual->setObject4Id(spl->GetP4().id());
283 visual->RefreshGeometry();
291 this->setPath(spl->GetPath());
void setLineColor(const QString &color)
void setLineWeight(const QString &lineWeight)
setLineWeight set weight of the lines
quint32 GetDuplicate() const
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0
virtual void IncrementReferens(quint32 id) const =0
static void AddTool(quint32 id, VDataTool *tool)
AddTool add tool to list tools.
virtual void DecrementReferens(quint32 id) const =0
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
static void InitSplineToolConnections(VMainGraphicsScene *scene, T *tool)
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
void AddSpline(const QSharedPointer< VAbstractBezier > &curve, quint32 id, quint32 parentId=null_id)
quint32 AddGObject(VGObject *obj)
AddGObject add new GObject to container.
void UpdateGObject(quint32 id, T *obj)
UpdateGObject update GObject by id.
virtual VPointF GetP1() const Q_DECL_OVERRIDE
virtual VPointF GetP3() const Q_DECL_OVERRIDE
virtual VPointF GetP2() const Q_DECL_OVERRIDE
virtual VPointF GetP4() const Q_DECL_OVERRIDE
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
virtual QString name() const
name return name graphical object.
quint32 id() const
id return id object.
quint32 getIdTool() const
The VMainGraphicsScene class main scene.
const QString AttrDuplicate
const QString AttrLineWeight
const QString AttrPenStyle
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.