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

Implements guideline behavior for GUIDELINE_STATE_DISCARDED. More...

#include <GuidelineStateDiscarded.h>

Inheritance diagram for GuidelineStateDiscarded:
Inheritance graph
Collaboration diagram for GuidelineStateDiscarded:
Collaboration graph

Public Member Functions

 GuidelineStateDiscarded (GuidelineStateContext &context)
 Single constructor.
virtual ~GuidelineStateDiscarded ()
virtual void begin ()
 Transition into state.
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 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 handleMouseRelease (const QPointF &posScene)
 At the end of dragging, clone the Guideline that owns the state machine where these states live.
virtual void handleState ()
virtual void handleTimeout ()
 Handle timeout from Appearing state.
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 QString stateName () const
 Name of state as a string for debugging only.
virtual void updateWithLatestTransformation ()
 Update given Transformation in GuidelineStateContext.
Public Member Functions inherited from GuidelineStateAbstractBase
 GuidelineStateAbstractBase (GuidelineStateContext &context)
 Single constructor.
virtual ~GuidelineStateAbstractBase ()

Additional Inherited Members

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_DISCARDED.

Definition at line 13 of file GuidelineStateDiscarded.h.

Constructor & Destructor Documentation

◆ GuidelineStateDiscarded()

GuidelineStateDiscarded::GuidelineStateDiscarded ( GuidelineStateContext & context)

Single constructor.

Definition at line 17 of file GuidelineStateDiscarded.cpp.

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

◆ ~GuidelineStateDiscarded()

GuidelineStateDiscarded::~GuidelineStateDiscarded ( )
virtual

Definition at line 22 of file GuidelineStateDiscarded.cpp.

23{
24}

Member Function Documentation

◆ begin()

void GuidelineStateDiscarded::begin ( )
virtual

Transition into state.

Implements GuidelineStateAbstractBase.

Definition at line 26 of file GuidelineStateDiscarded.cpp.

27{
28 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateDiscarded::begin"
29 << " identifier=" << context().guideline().identifier().toLatin1().data();
30
31 GuidelineFormat guidelineFormat (context().color());
32
36 context().guideline().setGraphicsItemPen (guidelineFormat.colorHidden (),
37 guidelineFormat.lineWidthNonHover ());
38}
log4cpp::Category * mainCat
Definition Logger.cpp:14
const int Z_VALUE_GUIDELINE_DISCARDED
Definition ZValues.cpp:13
virtual QString identifier() const =0
Unique identifier from QGraphicsItem.
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.
GuidelineAbstract & guideline()
Guideline that owns this context class.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ convertGraphCoordinateToScreenPoint()

QPointF GuidelineStateDiscarded::convertGraphCoordinateToScreenPoint ( double valueGraph) const
virtual

Convert single graph coordinate into screen point pair.

Implements GuidelineStateAbstractBase.

Definition at line 40 of file GuidelineStateDiscarded.cpp.

41{
42 LOG4CPP_ERROR_S ((*mainCat)) << "GuidelineStateDiscarded::convertGraphCoordinateToScreenPoint "
43 << "should not be called";
44
45 ENGAUGE_ASSERT (false);
46
47 return QPointF (0, 0); // No-harm value
48}
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
#define LOG4CPP_ERROR_S(logger)
Definition convenience.h:12

◆ convertScreenPointToGraphCoordinate()

double GuidelineStateDiscarded::convertScreenPointToGraphCoordinate ( const QPointF & posScreen) const
virtual

Convert screen point pair into single graph coordinate.

Implements GuidelineStateAbstractBase.

Definition at line 50 of file GuidelineStateDiscarded.cpp.

51{
52 LOG4CPP_ERROR_S ((*mainCat)) << "GuidelineStateDiscarded::convertScreenPointToGraphCoordinate";
53
54 ENGAUGE_ASSERT (false);
55
56 return 0.1; // No-harm value even if using log scale
57}

◆ doPaint()

bool GuidelineStateDiscarded::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 59 of file GuidelineStateDiscarded.cpp.

60{
61 return false;
62}

◆ end()

void GuidelineStateDiscarded::end ( )
virtual

Transition out of state.

Implements GuidelineStateAbstractBase.

Definition at line 64 of file GuidelineStateDiscarded.cpp.

65{
66 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateDiscarded::end";
67}

◆ handleActiveChange()

void GuidelineStateDiscarded::handleActiveChange ( bool active)
virtual

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

Implements GuidelineStateAbstractBase.

Definition at line 69 of file GuidelineStateDiscarded.cpp.

70{
71}

◆ handleGuidelineMode()

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

User toggled Guideline visibility and/or locked mode.

Implements GuidelineStateAbstractBase.

Definition at line 73 of file GuidelineStateDiscarded.cpp.

75{
76}

◆ handleHoverEnterEvent()

void GuidelineStateDiscarded::handleHoverEnterEvent ( )
virtual

If transparent then make visible when hover starts.

Implements GuidelineStateAbstractBase.

Definition at line 78 of file GuidelineStateDiscarded.cpp.

79{
80 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandle::handleHoverEnterEvent";
81
82 // Noop. Never called since hover only works when visible
83}
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ handleHoverLeaveEvent()

void GuidelineStateDiscarded::handleHoverLeaveEvent ( )
virtual

If previously transparent before hover enter then make transparent again.

Implements GuidelineStateAbstractBase.

Definition at line 85 of file GuidelineStateDiscarded.cpp.

86{
87 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandle::handleHoverEnterEvent";
88
89 // Noop. Never called since hover only works when visible
90}

◆ handleMousePress()

void GuidelineStateDiscarded::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 92 of file GuidelineStateDiscarded.cpp.

93{
94 // Noop
95}

◆ handleMouseRelease()

void GuidelineStateDiscarded::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 97 of file GuidelineStateDiscarded.cpp.

98{
99 // Noop
100}

◆ handleState()

void GuidelineStateDiscarded::handleState ( )
virtual

Definition at line 102 of file GuidelineStateDiscarded.cpp.

103{
104 // Noop
105}

◆ handleTimeout()

void GuidelineStateDiscarded::handleTimeout ( )
virtual

Handle timeout from Appearing state.

Implements GuidelineStateAbstractBase.

Definition at line 107 of file GuidelineStateDiscarded.cpp.

108{
109 // Noop
110}

◆ pointToEllipse()

EllipseParameters GuidelineStateDiscarded::pointToEllipse ( const QPointF & posScreen) const
virtual

Return ellipse representing constant range, that passes through the specified point.

Implements GuidelineStateAbstractBase.

Definition at line 112 of file GuidelineStateDiscarded.cpp.

113{
114 return EllipseParameters();
115}

◆ pointToLine()

QLineF GuidelineStateDiscarded::pointToLine ( const QPointF & posScreen) const
virtual

Return line parallel to an axis line, that passes through the specified point.

Implements GuidelineStateAbstractBase.

Definition at line 117 of file GuidelineStateDiscarded.cpp.

118{
119 return QLineF (0, 0, 0, 0);
120}

◆ stateName()

QString GuidelineStateDiscarded::stateName ( ) const
virtual

Name of state as a string for debugging only.

Implements GuidelineStateAbstractBase.

Definition at line 122 of file GuidelineStateDiscarded.cpp.

123{
125}
QString guidelineStateAsString(GuidelineState state)
@ GUIDELINE_STATE_DISCARDED

◆ updateWithLatestTransformation()

void GuidelineStateDiscarded::updateWithLatestTransformation ( )
virtual

Update given Transformation in GuidelineStateContext.

Implements GuidelineStateAbstractBase.

Definition at line 127 of file GuidelineStateDiscarded.cpp.

128{
129 // Noop
130}

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