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

Class to show transformation since transformation is defined. More...

#include <TransformationStateDefined.h>

Inheritance diagram for TransformationStateDefined:
Inheritance graph
Collaboration diagram for TransformationStateDefined:
Collaboration graph

Public Member Functions

 TransformationStateDefined (TransformationStateContext &context, QGraphicsScene &scene)
 Single constructor.
virtual void begin (bool isGnuplot, CmdMediator &cmdMediator, const Transformation &transformation, const QString &selectedGraphCurve)
 Method that is called at the exact moment a state is entered. Typically called just after end for the previous state.
virtual void end (CmdMediator &cmdMediator, const Transformation &transformation)
 Method that is called at the exact moment a state is exited. Typically called just before begin for the next state.
virtual void updateAxesChecker (CmdMediator &cmdMediator, const Transformation &transformation)
 Apply the new DocumentModelAxesChecker.
Public Member Functions inherited from TransformationStateAbstractBase
 TransformationStateAbstractBase (TransformationStateContext &context)
 Single constructor.
virtual ~TransformationStateAbstractBase ()

Additional Inherited Members

Protected Member Functions inherited from TransformationStateAbstractBase
TransformationStateContextcontext ()
 Reference to the TransformationStateContext that contains all the TransformationStateAbstractBase subclasses, without const.

Detailed Description

Class to show transformation since transformation is defined.

Definition at line 18 of file TransformationStateDefined.h.

Constructor & Destructor Documentation

◆ TransformationStateDefined()

TransformationStateDefined::TransformationStateDefined ( TransformationStateContext & context,
QGraphicsScene & scene )

Single constructor.

Definition at line 24 of file TransformationStateDefined.cpp.

25 :
27 m_axesChecker (new Checker (scene)),
28 m_timer (new QTimer)
29{
30 m_timer->setSingleShot (true);
31 connect (m_timer, SIGNAL (timeout()), this, SLOT (slotTimeout()));
32}
TransformationStateContext & context()
Reference to the TransformationStateContext that contains all the TransformationStateAbstractBase sub...
TransformationStateAbstractBase(TransformationStateContext &context)
Single constructor.

Member Function Documentation

◆ begin()

void TransformationStateDefined::begin ( bool isGnuplot,
CmdMediator & cmdMediator,
const Transformation & transformation,
const QString & selectedGraphCurve )
virtual

Method that is called at the exact moment a state is entered. Typically called just after end for the previous state.

Implements TransformationStateAbstractBase.

Definition at line 34 of file TransformationStateDefined.cpp.

38{
39 LOG4CPP_INFO_S ((*mainCat)) << "TransformationStateDefined::begin";
40
41 if (!cmdMediator.document().modelGridDisplay().stable()) {
42
43 // Initialize or update the grid display settings since they are not stable yet
44 initializeModelGridDisplay (cmdMediator,
45 transformation);
46
47 }
48
49 if (!cmdMediator.document().modelGridRemoval().stable()) {
50
51 // Initialize or update the grid removal settings since they are not stable yet
52 initializeModelGridRemoval (isGnuplot,
53 cmdMediator,
54 transformation,
55 selectedGraphCurve);
56
57 }
58
59 updateAxesChecker (cmdMediator,
60 transformation);
61}
log4cpp::Category * mainCat
Definition Logger.cpp:14
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
bool stable() const
Get method for stable flag.
bool stable() const
Get method for stable flag.
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
Definition Document.cpp:749
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
Definition Document.cpp:742
virtual void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ end()

void TransformationStateDefined::end ( CmdMediator & cmdMediator,
const Transformation & transformation )
virtual

Method that is called at the exact moment a state is exited. Typically called just before begin for the next state.

Implements TransformationStateAbstractBase.

Definition at line 63 of file TransformationStateDefined.cpp.

65{
66 LOG4CPP_INFO_S ((*mainCat)) << "TransformationStateDefined::end";
67
68 m_axesChecker->setVisible (false);
69}

◆ updateAxesChecker()

void TransformationStateDefined::updateAxesChecker ( CmdMediator & cmdMediator,
const Transformation & transformation )
virtual

Apply the new DocumentModelAxesChecker.

Implements TransformationStateAbstractBase.

Definition at line 136 of file TransformationStateDefined.cpp.

138{
139 CallbackAxesCheckerFromAxesPoints ftor;
140 Functor2wRet<const QString &, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
142 cmdMediator.iterateThroughCurvePointsAxes (ftorWithCallback);
143
144 m_axesChecker->prepareForDisplay (ftor.points(),
146 cmdMediator.document().modelAxesChecker(),
147 cmdMediator.document().modelCoords(),
148 transformation,
149 cmdMediator.document().documentAxesPointsRequired());
150 m_axesChecker->setVisible (true);
151 startTimer (cmdMediator.document().modelAxesChecker());
152}
const QString AXIS_CURVE_NAME
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Points points() const
Return the collected points as a polygon, in screen coordinates.
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
int pointRadius(const QString &curveName) const
Get method for curve point radius.
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
Definition Document.cpp:693
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition Document.cpp:707
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Definition Document.cpp:714
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition Document.cpp:369

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