7#ifndef GUIDELINE_ABSTRACT_H
8#define GUIDELINE_ABSTRACT_H
12#include <QGraphicsItem>
19class QStyleOptionGraphicsItem;
125 QGraphicsScene &
scene ();
138 double lineWidth) = 0;
198 QGraphicsScene &m_scene;
GuidelineState
Set of possible Guideline states. See class Guideline for more information.
void sacrificeHandleAndVisibleGuidelines(const QPointF &posScene, GuidelineState guidelineStateForReplacement)
Replace visible and handle Guidelines after click and drag.
virtual QString identifier() const =0
Unique identifier from QGraphicsItem.
QGraphicsScene & scene()
GraphicsScene that owns this class.
void handleMousePressEvent(const QPointF &posScene)
Forward press event to state machine.
virtual void updateGeometry(const QPointF &posScreen)=0
Update the geometry so it passes through the specified point in screen coordinates.
void setContext(GuidelineStateContext *context)
Create state machine after virtual methods of child classes have been defined.
QPointF posCursorGraph() const
Get position in graph coordinates.
virtual void updateGeometry(double valueGraph)=0
Update the geometry so it passes through the specified coordinate value in graph coordinates.
void handleMouseMoveEvent(const QPointF &posScene)
Forward movements to visible Guideline.
void updateWithLatestTransformation()
Update given Transformation in GuidelineStateContext. This is called after a command has been execute...
void bindGuidelineVisibleToInvisible(GuidelineAbstract *guidelineVisible)
Bind a newly-created visible Guideline to this Guideline, and make this one invisible.
virtual void setGraphicsItemVisible(bool visible)=0
Wrapper for QGraphicsItem::setVisible.
virtual bool getGraphicsItemAcceptHover() const =0
Return true if accepting hover events.
void handleGuidelineMode(bool visible, bool locked)
User toggled Guideline visibility and/or locked mode.
virtual void setGraphicsItemLine(const QLineF &line)=0
Wrapper for QGraphicsLineItem::setLine.
void slotHandleMoved(QPointF posScreen)
Slot for signal from cloned deployed Guideline from handle Guideline.
void signalHandleMoved(QPointF)
Signal for cloned deployed Guideline from handle Guideline.
void handleMouseReleaseEvent(const QPointF &posScene)
Cleanup after being dragged.
virtual void removeFromScene(QGraphicsScene *scene)=0
Make graphics item remove itself from the scene.
void handleActiveChange(bool active)
DigitizeState change so active status may (or may not) be toggled.
virtual QGraphicsItem::GraphicsItemFlags graphicsItemFlags() const =0
Wraps QGraphicsItem::flags.
QString stateDump() const
Dump of state as a string for debugging only. Context like the QGraphicsItem flags is included.
virtual void setGraphicsItemAcceptHoverEvents(bool accept)=0
Wrapper for QGraphicsItem::setAcceptHoverEvents.
void updateActive(bool active)
Update active versus inactive state.
GuidelineStateContext * context()
State machine context owned by this class.
void handleHoverEnterEvent()
Highlight this Guideline upon hover enter.
virtual bool getGraphicsItemSelected() const =0
Wrapper for QGraphicsItem::isSelected.
void handleHoverLeaveEvent()
Unset highlighting triggered by hover enter.
virtual void setGraphicsItemZValue(double z)=0
Wrapper for QGraphicsItem::setZValue.
virtual void updateColor()=0
Force a color update.
virtual void setGraphicsItemPen(const QColor &color, double lineWidth)=0
Wrapper for QGraphicsItem::setPen.
virtual void setGraphicsItemFlags(QGraphicsItem::GraphicsItemFlags flags)=0
Wrapper for QGraphicsItem::setFlags.
GuidelineAbstract(QGraphicsScene &scene)
Single constructor.
void signalGuidelineDragged(QString, double, bool, GuidelineState)
Signal indicating end of Guideline drag.
QString stateName() const
Current state name for debugging and unit test only.
Context class for state machine that belongs to the Guideline class.