17#include <QGraphicsLineItem>
18#include <QGraphicsScene>
19#include <QGraphicsSceneMouseEvent>
89 if (m_guidelineVisible !=
nullptr) {
113 <<
" keeping identifier=" <<
identifier().toLatin1().data()
114 <<
" in " <<
stateName ().toLatin1().data();
116 if (m_guidelineVisible !=
nullptr) {
122 LOG4CPP_DEBUG_S ((*
mainCat)) <<
"GuidelineAbstract::sacrificeHandleAndVisibleGuidelines identifierDeleting="
123 << m_guidelineVisible->
identifier().toLatin1().data();
127 delete m_guidelineVisible;
128 m_guidelineVisible =
nullptr;
171 str << ((
graphicsItemFlags () & QGraphicsItem::ItemIsFocusable ) != 0 ?
"focusable" :
"unfocusable") <<
" ";
172 str << ((
graphicsItemFlags () & QGraphicsItem::ItemIsMovable ) != 0 ?
"movable" :
"unmovable") <<
" ";
173 str << ((
graphicsItemFlags () & QGraphicsItem::ItemIsSelectable) != 0 ?
"selectable" :
"unselectable") <<
" ";
const int INNER_RADIUS_MIN
GuidelineState
Set of possible Guideline states. See class Guideline for more information.
log4cpp::Category * mainCat
This class is a special case of the standard QGraphicsLineItem for guidelines, and serves as the base...
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.
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 bool getGraphicsItemAcceptHover() const =0
Return true if accepting hover events.
void handleGuidelineMode(bool visible, bool locked)
User toggled Guideline visibility and/or locked mode.
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.
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.
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.
void handleActiveChange(bool active)
DigitizeState change so active status may (or may not) be toggled.
QPointF posCursorGraph() const
Get method for current cursor coordinate when object was last created/dragged.
void handleHoverLeaveEvent()
If previously transparent before hover enter then make transparent again.
double convertScreenPointToGraphCoordinate(const QPointF &posScreen) const
Convert screen point pair into single graph coordinate.
QString stateName() const
State as a string for debugging only.
void handleMousePress(const QPointF &posScene)
At the start of dragging, convert the original Guideline into an invisible handle and visible slaved ...
void handleHoverEnterEvent()
If transparent then make visible when hover starts.
void handleGuidelineMode(bool visibile, bool locked)
User toggled Guideline visibility and/or locked mode.
void updateWithLatestTransformation()
Update given Transformation in GuidelineStateContext.
void handleMouseRelease(const QPointF &posScene)
At the end of dragging, clone the Guideline that owns the state machine where these states live.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)