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

Compute geometry for deployed constant range Guideline. More...

#include <GuidelineStateDeployedConstantRAbstract.h>

Inheritance diagram for GuidelineStateDeployedConstantRAbstract:
Inheritance graph
Collaboration diagram for GuidelineStateDeployedConstantRAbstract:
Collaboration graph

Public Member Functions

 GuidelineStateDeployedConstantRAbstract (GuidelineStateContext &context)
 Single constructor.
 
virtual ~GuidelineStateDeployedConstantRAbstract ()
 
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 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 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 QString stateName () const =0
 Name of state as a string for debugging only.
 

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

Compute geometry for deployed constant range Guideline.

Definition at line 13 of file GuidelineStateDeployedConstantRAbstract.h.

Constructor & Destructor Documentation

◆ GuidelineStateDeployedConstantRAbstract()

GuidelineStateDeployedConstantRAbstract::GuidelineStateDeployedConstantRAbstract ( GuidelineStateContext & context)

Single constructor.

Definition at line 16 of file GuidelineStateDeployedConstantRAbstract.cpp.

16 :
18{
19}
GuidelineStateContext & context() const
Context in charge of the state classes.
GuidelineStateDeployedAbstract(GuidelineStateContext &context)
Single constructor.

◆ ~GuidelineStateDeployedConstantRAbstract()

GuidelineStateDeployedConstantRAbstract::~GuidelineStateDeployedConstantRAbstract ( )
virtual

Definition at line 21 of file GuidelineStateDeployedConstantRAbstract.cpp.

22{
23}

Member Function Documentation

◆ convertGraphCoordinateToScreenPoint()

QPointF GuidelineStateDeployedConstantRAbstract::convertGraphCoordinateToScreenPoint ( double valueGraph) const
virtual

Convert single graph coordinate into screen point pair.

Implements GuidelineStateAbstractBase.

Definition at line 25 of file GuidelineStateDeployedConstantRAbstract.cpp.

26{
27 const double ARBITRARY_THETA = 0; // Value that is legal in all cases
28 QPointF posScreen;
31 posScreen);
32
33 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateDeployedConstantRAbstract::convertGraphCoordinateToScreenPoint"
34 << " pos=(" << posScreen.x() << ", " << posScreen.y() << ")";
35
36 return posScreen;
37}
const int INNER_RADIUS_MIN
log4cpp::Category * mainCat
Definition Logger.cpp:14
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 GuidelineStateDeployedConstantRAbstract::convertScreenPointToGraphCoordinate ( const QPointF & posScreen) const
virtual

Convert screen point pair into single graph coordinate.

Implements GuidelineStateAbstractBase.

Definition at line 39 of file GuidelineStateDeployedConstantRAbstract.cpp.

40{
41 QPointF posGraph;
43 posGraph);
44
45 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateDeployedConstantRAbstract::convertScreenPointToGraphCoordinate"
46 << " pos=(" << posGraph.x() << ", " << posGraph.y() << ")";
47
48 return posGraph.y();
49}
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.

◆ pointToEllipse()

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

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

Implements GuidelineStateAbstractBase.

Definition at line 51 of file GuidelineStateDeployedConstantRAbstract.cpp.

52{
54
55 return projector.fromPosScreen (context().transformation(),
56 sceneRect (),
57 posScreen);
58}
Project a point along the tangential direction in graph coordinates to produce a curve along the cons...
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 GuidelineStateDeployedConstantRAbstract::pointToLine ( const QPointF & posScreen) const
virtual

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

Implements GuidelineStateAbstractBase.

Definition at line 60 of file GuidelineStateDeployedConstantRAbstract.cpp.

61{
62 // pointToEllipse applies in this state
63 return QLineF (0, 0, 0, 0);
64}

◆ updateWithLatestTransformation()

void GuidelineStateDeployedConstantRAbstract::updateWithLatestTransformation ( )
virtual

Update given Transformation in GuidelineStateContext.

Implements GuidelineStateAbstractBase.

Definition at line 66 of file GuidelineStateDeployedConstantRAbstract.cpp.

67{
68 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateDeployedConstantRAbstract::updateWithLatestTransformation";
69
70 if (!context().transformation().transformIsDefined()) {
71 // Discard this Guideline immediately if the transformation transitions to undefined
73 } else {
74
75 QPointF posScreen;
77 posScreen);
78
80 ellipse->updateGeometry (posScreen);
81 }
82}
@ GUIDELINE_STATE_DISCARDED
Ellipse version of GuidelineAbstract.
virtual void updateGeometry(double valueGraph)
Update the geometry so it passes through the specified coordinate value in graph coordinates.
GuidelineAbstract & guideline()
Guideline that owns this context class.
void requestStateTransition(GuidelineState guidelineState)
Request a state transition.

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