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

GuidelineStateHandleAbstract instantiated for radius R guideline. More...

#include <GuidelineStateHandleR.h>

Inheritance diagram for GuidelineStateHandleR:
Inheritance graph
Collaboration diagram for GuidelineStateHandleR:
Collaboration graph

Public Member Functions

 GuidelineStateHandleR (GuidelineStateContext &context)
 Single constructor.
virtual ~GuidelineStateHandleR ()
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 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 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.
Public Member Functions inherited from GuidelineStateHandleAbstract
 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 ()

Additional Inherited Members

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

GuidelineStateHandleAbstract instantiated for radius R guideline.

Definition at line 13 of file GuidelineStateHandleR.h.

Constructor & Destructor Documentation

◆ GuidelineStateHandleR()

GuidelineStateHandleR::GuidelineStateHandleR ( GuidelineStateContext & context)

Single constructor.

Definition at line 17 of file GuidelineStateHandleR.cpp.

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

◆ ~GuidelineStateHandleR()

GuidelineStateHandleR::~GuidelineStateHandleR ( )
virtual

Definition at line 22 of file GuidelineStateHandleR.cpp.

23{
24}

Member Function Documentation

◆ begin()

void GuidelineStateHandleR::begin ( )
virtual

Transition into state.

Implements GuidelineStateAbstractBase.

Definition at line 26 of file GuidelineStateHandleR.cpp.

27{
28 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateHandleR::begin"
29 << " identifier=" << context().guideline().identifier().toLatin1().data();
30
31 beginCommon ();
32}
log4cpp::Category * mainCat
Definition Logger.cpp:14
virtual QString identifier() const =0
Unique identifier from QGraphicsItem.
GuidelineAbstract & guideline()
Guideline that owns this context class.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ convertGraphCoordinateToScreenPoint()

QPointF GuidelineStateHandleR::convertGraphCoordinateToScreenPoint ( double valueGraph) const
virtual

Convert single graph coordinate into screen point pair.

Implements GuidelineStateAbstractBase.

Definition at line 34 of file GuidelineStateHandleR.cpp.

35{
36 const double ARBITRARY_THETA = 1; // Value that is legal in all cases including log
37 QPointF posScreen;
38 context().transformation().transformRawGraphToScreen (QPointF (ARBITRARY_THETA,
39 valueGraph),
40 posScreen);
41
42 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleR::convertGraphCoordinateToScreenPoint"
43 << " pos=(" << posScreen.x() << ", " << posScreen.y() << ")";
44
45 return posScreen;
46}
Transformation transformation() const
Return copy of transformation owned by MainWindow.
void transformRawGraphToScreen(const QPointF &pointRaw, QPointF &pointScreen) const
Transform from raw graph coordinates to linear cartesian graph coordinates, then to screen coordinate...
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ convertScreenPointToGraphCoordinate()

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

Convert screen point pair into single graph coordinate.

Implements GuidelineStateAbstractBase.

Definition at line 48 of file GuidelineStateHandleR.cpp.

49{
50 QPointF posGraph;
52 posGraph);
53
54 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleR::convertScreenPointToGraphCoordinate"
55 << " pos=(" << posGraph.x() << ", " << posGraph.y() << ")";
56
57 return posGraph.y();
58}
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.

◆ end()

void GuidelineStateHandleR::end ( )
virtual

Transition out of state.

Implements GuidelineStateAbstractBase.

Definition at line 60 of file GuidelineStateHandleR.cpp.

61{
62 LOG4CPP_INFO_S ((*mainCat)) << "GuidelineStateHandleR::end";
63}

◆ handleMouseRelease()

void GuidelineStateHandleR::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 65 of file GuidelineStateHandleR.cpp.

66{
67 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleR::handleMouseRelease";
68
72}
@ GUIDELINE_STATE_DISCARDED
@ GUIDELINE_STATE_DEPLOYED_CONSTANT_R_SELECT_EDIT
void sacrificeHandleAndVisibleGuidelines(const QPointF &posScene, GuidelineState guidelineStateForReplacement)
Replace visible and handle Guidelines after click and drag.
void requestStateTransition(GuidelineState guidelineState)
Request a state transition.

◆ pointToEllipse()

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

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

Implements GuidelineStateAbstractBase.

Definition at line 74 of file GuidelineStateHandleR.cpp.

75{
76 GuidelineProjectorConstantR projector;
77
78 return projector.fromPosScreen (context().transformation(),
79 sceneRect (),
80 posScreen);
81}
EllipseParameters fromPosScreen(const Transformation &transformation, const QRectF &sceneRect, const QPointF &posScreen)
Return line through point in screen coordinates.
QRectF sceneRect() const
Scene rectangle in screen coordinates (=pixels)

◆ pointToLine()

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

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

Implements GuidelineStateAbstractBase.

Definition at line 83 of file GuidelineStateHandleR.cpp.

84{
85 // pointToEllipse applies in this state
86 return QLineF (0, 0, 0, 0);
87}

◆ stateName()

QString GuidelineStateHandleR::stateName ( ) const
virtual

Name of state as a string for debugging only.

Implements GuidelineStateAbstractBase.

Definition at line 89 of file GuidelineStateHandleR.cpp.

90{
92}
QString guidelineStateAsString(GuidelineState state)
@ GUIDELINE_STATE_HANDLE_R

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