Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
GuidelineStateDeployedAbstract Class Reference

Abstract class for deployed states. More...

#include <GuidelineStateDeployedAbstract.h>

Inheritance diagram for GuidelineStateDeployedAbstract:
Inheritance graph
Collaboration diagram for GuidelineStateDeployedAbstract:
Collaboration graph

Public Member Functions

 GuidelineStateDeployedAbstract (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateDeployedAbstract ()
 
virtual void end ()
 Transition out of state.
 
virtual void handleMouseRelease (const QPointF &posScene)
 At the end of dragging, clone the Guideline that owns the state machine where these states live.
 
virtual void handleTimeout ()
 Handle timeout from Appearing state.
 
- 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 bool doPaint () const =0
 Allow/skip painting of the owner Guideline.
 
virtual void handleActiveChange (bool active)=0
 DigitizeState change so active status may (or may not) be toggled.
 
virtual void handleGuidelineMode (bool visibility, bool locked)=0
 User toggled Guideline visibility and/or locked mode.
 
virtual void handleHoverEnterEvent ()=0
 If transparent then make visible when hover starts.
 
virtual void handleHoverLeaveEvent ()=0
 If previously transparent before hover enter then make transparent again.
 
virtual void handleMousePress (const QPointF &posScene)=0
 At the start of dragging, convert the Guideline into an invisible handle and visible slaved deployed Guideline.
 
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.
 
virtual void updateWithLatestTransformation ()=0
 Update given Transformation in GuidelineStateContext.
 

Protected Member Functions

void beginCommon (GuidelineFormat::HoverOption hoverOption, bool locked)
 Initialization common to all states.
 
- 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

Abstract class for deployed states.

Definition at line 15 of file GuidelineStateDeployedAbstract.h.

Constructor & Destructor Documentation

◆ GuidelineStateDeployedAbstract()

GuidelineStateDeployedAbstract::GuidelineStateDeployedAbstract ( GuidelineStateContext & context)

Single constructor.

Definition at line 17 of file GuidelineStateDeployedAbstract.cpp.

17 :
19{
20}
This class maintains deployed horizontal/vertical state behaviors for the Guideline class.
GuidelineStateContext & context() const
Context in charge of the state classes.

◆ ~GuidelineStateDeployedAbstract()

GuidelineStateDeployedAbstract::~GuidelineStateDeployedAbstract ( )
virtual

Definition at line 22 of file GuidelineStateDeployedAbstract.cpp.

23{
24}

Member Function Documentation

◆ beginCommon()

void GuidelineStateDeployedAbstract::beginCommon ( GuidelineFormat::HoverOption hoverOption,
bool locked )
protected

Initialization common to all states.

Definition at line 26 of file GuidelineStateDeployedAbstract.cpp.

28{
30
33
34 if (locked) {
35
36 // Prevent interaction. ItemIsSelectable is overkill, and in special cases adds ugly selected dashes
37 QGraphicsItem::GraphicsItemFlags flags = context().guideline ().graphicsItemFlags();
42
43 context().guideline().setGraphicsItemPen (guidelineFormat.colorDeployedNonHover (),
44 guidelineFormat.lineWidthNonHover ());
45
46 } else {
47
48 // Give feedback when user hovers
49 context().guideline().setGraphicsItemFlags (QGraphicsItem::ItemIsFocusable |
50 QGraphicsItem::ItemIsMovable);
52
54 guidelineFormat.colorDeployedHover () :
55 guidelineFormat.colorDeployedNonHover (),
56 hoverOption == GuidelineFormat::HOVER_ON ?
57 guidelineFormat.lineWidthHover () :
58 guidelineFormat.lineWidthNonHover ());
59 }
60}
const int INNER_RADIUS_MIN
const int Z_VALUE_GUIDELINE_DEPLOYED
Definition ZValues.cpp:12
virtual void setGraphicsItemVisible(bool visible)=0
Wrapper for QGraphicsItem::setVisible.
virtual QGraphicsItem::GraphicsItemFlags graphicsItemFlags() const =0
Wraps QGraphicsItem::flags.
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.
This class centralizes the formatting information (color, line width, alpha) for the Guidelines.
GuidelineAbstract & guideline()
Guideline that owns this context class.

◆ end()

void GuidelineStateDeployedAbstract::end ( )
virtual

Transition out of state.

Implements GuidelineStateAbstractBase.

Reimplemented in GuidelineStateDeployedConstantRSelectEdit, GuidelineStateDeployedConstantRSelectEditAppearing, GuidelineStateDeployedConstantRSelectEditHover, GuidelineStateDeployedConstantRSelectHide, GuidelineStateDeployedConstantRSelectLock, GuidelineStateDeployedConstantRUnselectEdit, GuidelineStateDeployedConstantRUnselectHide, GuidelineStateDeployedConstantRUnselectLock, GuidelineStateDeployedConstantTSelectEdit, GuidelineStateDeployedConstantTSelectEditAppearing, GuidelineStateDeployedConstantTSelectEditHover, GuidelineStateDeployedConstantTSelectHide, GuidelineStateDeployedConstantTSelectLock, GuidelineStateDeployedConstantTUnselectEdit, GuidelineStateDeployedConstantTUnselectHide, GuidelineStateDeployedConstantTUnselectLock, GuidelineStateDeployedConstantXSelectEdit, GuidelineStateDeployedConstantXSelectEditAppearing, GuidelineStateDeployedConstantXSelectEditHover, GuidelineStateDeployedConstantXSelectHide, GuidelineStateDeployedConstantXSelectLock, GuidelineStateDeployedConstantXUnselectEdit, GuidelineStateDeployedConstantXUnselectHide, GuidelineStateDeployedConstantXUnselectLock, GuidelineStateDeployedConstantYSelectEdit, GuidelineStateDeployedConstantYSelectEditAppearing, GuidelineStateDeployedConstantYSelectEditHover, GuidelineStateDeployedConstantYSelectHide, GuidelineStateDeployedConstantYSelectLock, GuidelineStateDeployedConstantYUnselectEdit, GuidelineStateDeployedConstantYUnselectHide, and GuidelineStateDeployedConstantYUnselectLock.

Definition at line 62 of file GuidelineStateDeployedAbstract.cpp.

63{
64 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateDeployedAbstract::end";
65}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ handleMouseRelease()

void GuidelineStateDeployedAbstract::handleMouseRelease ( const QPointF & posScene)
virtual

At the end of dragging, clone the Guideline that owns the state machine where these states live.

Implements GuidelineStateAbstractBase.

Definition at line 67 of file GuidelineStateDeployedAbstract.cpp.

68{
69 // Noop
70}

◆ handleTimeout()

void GuidelineStateDeployedAbstract::handleTimeout ( )
virtual

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