Engauge Digitizer 2
Loading...
Searching...
No Matches
GuidelineStateHandleAbstract Class Reference

State for an invisible handle which was previously a deployed Guideline but morphed into an invisible handle that the user is dragging. More...

#include <GuidelineStateHandleAbstract.h>

Inheritance diagram for GuidelineStateHandleAbstract:
Inheritance graph
Collaboration diagram for GuidelineStateHandleAbstract:
Collaboration graph

Public Member Functions

 GuidelineStateHandleAbstract (GuidelineStateContext &context)
 Single constructor.
virtual ~GuidelineStateHandleAbstract ()
virtual bool doPaint () const
 Allow/skip painting of the owner Guideline.
virtual void handleActiveChange (bool active)
 DigitizeState change so active status may (or may not) be toggled.
virtual void handleGuidelineMode (bool visible, bool locked)
 User toggled Guideline visibility and/or locked mode.
virtual void handleHoverEnterEvent ()
 If transparent then make visible when hover starts.
virtual void handleHoverLeaveEvent ()
 If previously transparent before hover enter then make transparent again.
virtual void handleMousePress (const QPointF &posScene)
 At the start of dragging, convert the Guideline into an invisible handle and visible slaved deployed Guideline.
virtual void handleTimeout ()
 Handle timeout from Appearing state.
virtual void updateWithLatestTransformation ()
 Update given Transformation in GuidelineStateContext.
Public Member Functions inherited from GuidelineStateAbstractBase
 GuidelineStateAbstractBase (GuidelineStateContext &context)
 Single constructor.
virtual ~GuidelineStateAbstractBase ()
virtual void begin ()=0
 Transition into state.
virtual QPointF convertGraphCoordinateToScreenPoint (double valueGraph) const =0
 Convert single graph coordinate into screen point pair.
virtual double convertScreenPointToGraphCoordinate (const QPointF &posScreen) const =0
 Convert screen point pair into single graph coordinate.
virtual void end ()=0
 Transition out of state.
virtual void handleMouseRelease (const QPointF &posScene)=0
 At the end of dragging, clone the Guideline that owns the state machine where these states live.
virtual EllipseParameters pointToEllipse (const QPointF &posScreen) const =0
 Return ellipse representing constant range, that passes through the specified point.
virtual QLineF pointToLine (const QPointF &posScreen) const =0
 Return line parallel to an axis line, that passes through the specified point.
virtual QString stateName () const =0
 Name of state as a string for debugging only.

Protected Member Functions

void beginCommon ()
Protected Member Functions inherited from GuidelineStateAbstractBase
GuidelineStateContextcontext () const
 Context in charge of the state classes.
void handleMousePressCommon (const QPointF &posAbsolute, GuidelineState stateHandle, GuidelineState stateDeployed)
 Common mouse press handling.
QRectF sceneRect () const
 Scene rectangle in screen coordinates (=pixels)

Detailed Description

State for an invisible handle which was previously a deployed Guideline but morphed into an invisible handle that the user is dragging.

At the end of the drag this reappears. Since the Guideline in this state is invisible we do not have to worry about rotating this to be parallel with an axis. A visible deployed Guideline is dragged along with this handle. We have total freedom to rotated and/or move (and in the range isocontour case even bend) the slaved deployed Guideline during the dragging

Definition at line 19 of file GuidelineStateHandleAbstract.h.

Constructor & Destructor Documentation

◆ GuidelineStateHandleAbstract()

GuidelineStateHandleAbstract::GuidelineStateHandleAbstract ( GuidelineStateContext & context)

Single constructor.

Definition at line 17 of file GuidelineStateHandleAbstract.cpp.

17 :
19{
20}
GuidelineStateContext & context() const
Context in charge of the state classes.
GuidelineStateAbstractBase(GuidelineStateContext &context)
Single constructor.

◆ ~GuidelineStateHandleAbstract()

GuidelineStateHandleAbstract::~GuidelineStateHandleAbstract ( )
virtual

Definition at line 22 of file GuidelineStateHandleAbstract.cpp.

23{
24}

Member Function Documentation

◆ beginCommon()

void GuidelineStateHandleAbstract::beginCommon ( )
protected

Definition at line 26 of file GuidelineStateHandleAbstract.cpp.

27{
30 // ItemIsSelectable is overkill, and in special cases adds ugly selected dashes
31 context().guideline().setGraphicsItemFlags (QGraphicsItem::ItemIsFocusable |
32 QGraphicsItem::ItemIsMovable);
34 context().guideline().setGraphicsItemPen (QColor (Qt::transparent),
35 context().modelGuideline ().lineWidthInactive ());
36}
const int Z_VALUE_GUIDELINE_HANDLE
Definition ZValues.cpp:14
virtual void setGraphicsItemVisible(bool visible)=0
Wrapper for QGraphicsItem::setVisible.
virtual void setGraphicsItemAcceptHoverEvents(bool accept)=0
Wrapper for QGraphicsItem::setAcceptHoverEvents.
virtual void setGraphicsItemZValue(double z)=0
Wrapper for QGraphicsItem::setZValue.
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 & guideline()
Guideline that owns this context class.

◆ doPaint()

bool GuidelineStateHandleAbstract::doPaint ( ) const
virtual

Allow/skip painting of the owner Guideline.

This prevents display of selection markings on otherwise-invisible handle Guideline

Implements GuidelineStateAbstractBase.

Definition at line 38 of file GuidelineStateHandleAbstract.cpp.

39{
40 return true;
41}

◆ handleActiveChange()

void GuidelineStateHandleAbstract::handleActiveChange ( bool active)
virtual

DigitizeState change so active status may (or may not) be toggled.

Implements GuidelineStateAbstractBase.

Definition at line 43 of file GuidelineStateHandleAbstract.cpp.

44{
45 // Noop
46}

◆ handleGuidelineMode()

void GuidelineStateHandleAbstract::handleGuidelineMode ( bool visibility,
bool locked )
virtual

User toggled Guideline visibility and/or locked mode.

Implements GuidelineStateAbstractBase.

Definition at line 48 of file GuidelineStateHandleAbstract.cpp.

50{
51 // Noop
52}

◆ handleHoverEnterEvent()

void GuidelineStateHandleAbstract::handleHoverEnterEvent ( )
virtual

If transparent then make visible when hover starts.

Implements GuidelineStateAbstractBase.

Definition at line 54 of file GuidelineStateHandleAbstract.cpp.

55{
56 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleHoverEnterEvent";
57
58 // Noop
59}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ handleHoverLeaveEvent()

void GuidelineStateHandleAbstract::handleHoverLeaveEvent ( )
virtual

If previously transparent before hover enter then make transparent again.

Implements GuidelineStateAbstractBase.

Definition at line 61 of file GuidelineStateHandleAbstract.cpp.

62{
63 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleHoverEnterEvent";
64
65 // Noop
66}

◆ handleMousePress()

void GuidelineStateHandleAbstract::handleMousePress ( const QPointF & posScene)
virtual

At the start of dragging, convert the Guideline into an invisible handle and visible slaved deployed Guideline.

Implements GuidelineStateAbstractBase.

Definition at line 68 of file GuidelineStateHandleAbstract.cpp.

69{
70 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleMousePress";
71
72 // Noop
73}

◆ handleTimeout()

void GuidelineStateHandleAbstract::handleTimeout ( )
virtual

Handle timeout from Appearing state.

Implements GuidelineStateAbstractBase.

Definition at line 75 of file GuidelineStateHandleAbstract.cpp.

76{
77 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleTimeout";
78
79 // Noop
80}

◆ updateWithLatestTransformation()

void GuidelineStateHandleAbstract::updateWithLatestTransformation ( )
virtual

Update given Transformation in GuidelineStateContext.

Implements GuidelineStateAbstractBase.

Definition at line 82 of file GuidelineStateHandleAbstract.cpp.

83{
84 // Noop
85}

The documentation for this class was generated from the following files: