52 #ifndef VABSTRACTSPLINE_H
53 #define VABSTRACTSPLINE_H
55 #include <qcompilerdetection.h>
56 #include <QDomElement>
57 #include <QGraphicsItem>
58 #include <QGraphicsPathItem>
59 #include <QMetaObject>
61 #include <QPainterPath>
68 #include "../../../visualization/line/visline.h"
69 #include "../vdrawtool.h"
70 #include "../vgeometry/vabstractcurve.h"
71 #include "../vgeometry/vgeometrydef.h"
72 #include "../vmisc/vabstractapplication.h"
73 #include "../vmisc/def.h"
74 #include "../vwidgets/vmaingraphicsscene.h"
75 #include "../vwidgets/vmaingraphicsview.h"
85 QGraphicsItem * parent =
nullptr);
88 virtual QPainterPath
shape() const Q_DECL_OVERRIDE;
89 virtual
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
90 virtual
int type() const Q_DECL_OVERRIDE {
return Type;}
94 virtual QString
getTagName() const Q_DECL_OVERRIDE;
106 QString
name() const;
108 virtual
void GroupVisibility(quint32
object,
bool visible) Q_DECL_OVERRIDE;
112 virtual
void Disable(
bool disable, const QString &draftBlockName) Q_DECL_OVERRIDE;
113 virtual
void piecesMode(
bool mode) Q_DECL_OVERRIDE;
114 virtual
void AllowHover(
bool enabled) Q_DECL_OVERRIDE;
116 virtual QString
makeToolTip() const Q_DECL_OVERRIDE;
140 virtual
void ShowTool(quint32
id,
bool enable) Q_DECL_OVERRIDE;
141 virtual
void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
142 virtual
void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
143 virtual QVariant
itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
145 virtual
void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
146 virtual
void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
150 virtual
void contextMenuEvent (QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
153 const QPointF &pos) const;
155 template <typename T>
158 template <typename T>
161 template <typename T>
164 template <typename T>
167 template <typename T>
177 template <typename T>
184 AddVisualization<T>();
189 if (T *visual = qobject_cast<T *>(
vis))
209 if (QGraphicsScene *sc = scene())
216 template <
typename T>
228 template <
typename T>
240 template <
typename T>
252 template <
typename T>
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
static void InitElArcToolConnections(VMainGraphicsScene *scene, T *tool)
virtual QPainterPath shape() const Q_DECL_OVERRIDE
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
mouseReleaseEvent handle mouse release events.
static void InitSplinePathToolConnections(VMainGraphicsScene *scene, T *tool)
void setLineColor(const QString &value)
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
void SetPenStyle(const QString &value)
virtual void ShowTool(quint32 id, bool enable) Q_DECL_OVERRIDE
ShowTool highlight tool.
virtual void piecesMode(bool mode) Q_DECL_OVERRIDE
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
void setEnabledPoint(bool enable)
setEnabledPoint disable control points.
virtual void RefreshGeometry()
RefreshGeometry refresh item on scene.
virtual void refreshCtrlPoints()
virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE
virtual ~VAbstractSpline() Q_DECL_EQ_DEFAULT
virtual QString getTagName() const Q_DECL_OVERRIDE
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
hoverEnterEvent handle hover enter events.
QString getLineColor() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE
void setLineWeight(const QString &value)
setLineWeight set line weight of the spline
virtual void FullUpdateFromFile() Q_DECL_OVERRIDE
FullUpdateFromFile update tool data form file.
static void InitSplineToolConnections(VMainGraphicsScene *scene, T *tool)
virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
hoverLeaveEvent handle hover leave events.
static void InitArcToolConnections(VMainGraphicsScene *scene, T *tool)
void ShowToolVisualization(bool show)
virtual void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE
keyReleaseEvent handle key release events.
virtual QString makeToolTip() const Q_DECL_OVERRIDE
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
itemChange hadle item change.
QVector< VControlPointSpline * > controlPoints
controlPoints list pointers of control points.
virtual void Disable(bool disable, const QString &draftBlockName) Q_DECL_OVERRIDE
QString GetPenStyle() const
VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent=nullptr)
void ShowHandles(bool show)
virtual void GroupVisibility(quint32 object, bool visible) Q_DECL_OVERRIDE
QString getLineWeight() const
getLineWeight return line weight of the spline
virtual int type() const Q_DECL_OVERRIDE
VSpline CorrectedSpline(const VSpline &spline, const SplinePointPosition &position, const QPointF &pos) const
The VContainer class container of all variables.
The VControlPointSpline class control spline point.
The VGObject class keep information graphical objects.
The VMainGraphicsScene class main scene.
void EnableSplinePathItemHover(bool enable)
void EnableArcItemHover(bool enable)
void EnableElArcItemHover(bool enable)
void EnableSplineItemSelection(bool enable)
void EnableArcItemSelection(bool enable)
void EnableElArcItemSelection(bool enable)
void EnableSplineItemHover(bool enable)
void EnableSplinePathItemSelection(bool enable)
static void NewSceneRect(QGraphicsScene *sc, QGraphicsView *view, QGraphicsItem *item=nullptr)
NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view.
VSpline class that implements the spline.