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

Implements guideline behavior for GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_EDITAPPEARING. More...

#include <GuidelineStateDeployedConstantXSelectEditAppearing.h>

Inheritance diagram for GuidelineStateDeployedConstantXSelectEditAppearing:
Inheritance graph
Collaboration diagram for GuidelineStateDeployedConstantXSelectEditAppearing:
Collaboration graph

Public Member Functions

 GuidelineStateDeployedConstantXSelectEditAppearing (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateDeployedConstantXSelectEditAppearing ()
 
virtual void begin ()
 Transition into state.
 
virtual bool doPaint () const
 Allow/skip painting of the owner Guideline.
 
virtual void end ()
 Transition out of state.
 
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 QString stateName () const
 Name of state as a string for debugging only.
 
- Public Member Functions inherited from GuidelineStateDeployedConstantXAbstract
 GuidelineStateDeployedConstantXAbstract (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateDeployedConstantXAbstract ()
 
virtual QPointF convertGraphCoordinateToScreenPoint (double valueGraph) const
 Convert single graph coordinate into screen point pair.
 
virtual double convertScreenPointToGraphCoordinate (const QPointF &posScreen) const
 Convert screen point pair into single graph coordinate.
 
virtual EllipseParameters pointToEllipse (const QPointF &posScreen) const
 Return ellipse representing constant range, that passes through the specified point.
 
virtual QLineF pointToLine (const QPointF &posScreen) const
 Return line parallel to an axis line, that passes through the specified point.
 
virtual void updateWithLatestTransformation ()
 Update given Transformation in GuidelineStateContext.
 
- Public Member Functions inherited from GuidelineStateDeployedAbstract
 GuidelineStateDeployedAbstract (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateDeployedAbstract ()
 
virtual void handleMouseRelease (const QPointF &posScene)
 At the end of dragging, clone the Guideline that owns the state machine where these states live.
 
- Public Member Functions inherited from GuidelineStateAbstractBase
 GuidelineStateAbstractBase (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateAbstractBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from GuidelineStateDeployedAbstract
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

Implements guideline behavior for GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_EDITAPPEARING.

This acts just like GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_EDIT but is drawn much bigger, then transitions to the other state after a timeout

Definition at line 17 of file GuidelineStateDeployedConstantXSelectEditAppearing.h.

Constructor & Destructor Documentation

◆ GuidelineStateDeployedConstantXSelectEditAppearing()

GuidelineStateDeployedConstantXSelectEditAppearing::GuidelineStateDeployedConstantXSelectEditAppearing ( GuidelineStateContext & context)

Single constructor.

Definition at line 18 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

18 :
20 m_timer (nullptr)
21{
22 m_timer = new QTimer ();
23 m_timer->setSingleShot (true);
24}
const int INNER_RADIUS_MIN
GuidelineStateContext & context() const
Context in charge of the state classes.
Compute geometry for deployed constant x Guideline.

◆ ~GuidelineStateDeployedConstantXSelectEditAppearing()

GuidelineStateDeployedConstantXSelectEditAppearing::~GuidelineStateDeployedConstantXSelectEditAppearing ( )
virtual

Definition at line 26 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

27{
28}

Member Function Documentation

◆ begin()

void GuidelineStateDeployedConstantXSelectEditAppearing::begin ( )
virtual

Transition into state.

Implements GuidelineStateAbstractBase.

Definition at line 30 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

31{
32 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateDeployedConstantXSelectEditAppearing::begin"
33 << " identifier=" << context().guideline().identifier().toLatin1().data();
34
36 false);
37
38 context().guideline().setGraphicsItemVisible (true); // Stop hover and painting (doPoint only stops painting)
39
40 // (Re)connect to timer
41 QObject::connect (m_timer, SIGNAL (timeout ()), &context(), SLOT (slotTimeout ()));
42 m_timer->start (APPEARING_TIMEOUT);
43}
const int APPEARING_TIMEOUT
Milliseconds before transition from Appearing state to Active state.
log4cpp::Category * mainCat
Definition Logger.cpp:14
virtual QString identifier() const =0
Unique identifier from QGraphicsItem.
virtual void setGraphicsItemVisible(bool visible)=0
Wrapper for QGraphicsItem::setVisible.
GuidelineAbstract & guideline()
Guideline that owns this context class.
void beginCommon(GuidelineFormat::HoverOption hoverOption, bool locked)
Initialization common to all states.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ doPaint()

bool GuidelineStateDeployedConstantXSelectEditAppearing::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 45 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

46{
47 return true;
48}

◆ end()

void GuidelineStateDeployedConstantXSelectEditAppearing::end ( )
virtual

Transition out of state.

Reimplemented from GuidelineStateDeployedAbstract.

Definition at line 50 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

51{
52 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateDeployedConstantXSelectEditAppearing::end";
53
54 // Cancel timer if active so it does not interrupt the next state
55 QObject::disconnect (m_timer, SIGNAL (timeout ()), &context(), SLOT (slotTimeout ()));
56}

◆ handleActiveChange()

void GuidelineStateDeployedConstantXSelectEditAppearing::handleActiveChange ( bool active)
virtual

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

Implements GuidelineStateAbstractBase.

Definition at line 58 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

59{
60 if (!active) {
62 }
63}
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_X_UNSELECT_EDIT
void requestStateTransition(GuidelineState guidelineState)
Request a state transition.

◆ handleGuidelineMode()

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

User toggled Guideline visibility and/or locked mode.

Implements GuidelineStateAbstractBase.

Definition at line 65 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

67{
68 // Currently visible and not locked
69 if (visible && locked) {
71 } else if (!visible) {
73 }
74}
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_HIDE
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_LOCK

◆ handleHoverEnterEvent()

void GuidelineStateDeployedConstantXSelectEditAppearing::handleHoverEnterEvent ( )
virtual

If transparent then make visible when hover starts.

Implements GuidelineStateAbstractBase.

Definition at line 76 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

◆ handleHoverLeaveEvent()

void GuidelineStateDeployedConstantXSelectEditAppearing::handleHoverLeaveEvent ( )
virtual

If previously transparent before hover enter then make transparent again.

Implements GuidelineStateAbstractBase.

Definition at line 81 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

82{
83}

◆ handleMousePress()

void GuidelineStateDeployedConstantXSelectEditAppearing::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 85 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

86{
90}
@ GUIDELINE_STATE_HANDLE_X
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_EDIT
void handleMousePressCommon(const QPointF &posAbsolute, GuidelineState stateHandle, GuidelineState stateDeployed)
Common mouse press handling.

◆ handleTimeout()

void GuidelineStateDeployedConstantXSelectEditAppearing::handleTimeout ( )
virtual

Handle timeout from Appearing state.

Reimplemented from GuidelineStateDeployedAbstract.

Definition at line 92 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

◆ stateName()

QString GuidelineStateDeployedConstantXSelectEditAppearing::stateName ( ) const
virtual

Name of state as a string for debugging only.

Implements GuidelineStateAbstractBase.

Definition at line 97 of file GuidelineStateDeployedConstantXSelectEditAppearing.cpp.

98{
100}
QString guidelineStateAsString(GuidelineState state)
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_X_SELECT_EDIT_APPEARING

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