Engauge Digitizer  2
Public Member Functions | List of all members
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. More...
 
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. More...
 
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. More...
 
virtual void updateAxesChecker (CmdMediator &cmdMediator, const Transformation &transformation)
 Apply the new DocumentModelAxesChecker. More...
 
- Public Member Functions inherited from TransformationStateAbstractBase
 TransformationStateAbstractBase (TransformationStateContext &context)
 Single constructor. More...
 
virtual ~TransformationStateAbstractBase ()
 

Additional Inherited Members

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

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 }
Base class for all transformation states. This serves as an interface to TransformationStateContext.
Box shape that is drawn through the three axis points, to temporarily (usually) or permanently (rarel...
Definition: Checker.h:33
TransformationStateContext & context()
Reference to the TransformationStateContext that contains all the TransformationStateAbstractBase sub...

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 }
bool stable() const
Get method for stable flag.
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
Definition: Document.cpp:737
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:72
bool stable() const
Get method for stable flag.
virtual void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
Definition: Document.cpp:730
log4cpp::Category * mainCat
Definition: Logger.cpp:14

◆ 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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void setVisible(bool visible)
Show/hide this axes checker.
Definition: Checker.cpp:247

◆ 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 {
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 }
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition: Document.cpp:363
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:72
void prepareForDisplay(const QPolygonF &polygon, int pointRadius, const DocumentModelAxesChecker &modelAxesChecker, const DocumentModelCoords &modelCoords, DocumentAxesPointsRequired documentAxesPointsRequired)
Create the polygon from current information, including pixel coordinates, just prior to display.
Definition: Checker.cpp:135
Points points() const
Return the collected points as a polygon, in screen coordinates.
int pointRadius(const QString &curveName) const
Get method for curve point radius.
Callback for positioning the axes indicator according to the axes points.
void setVisible(bool visible)
Show/hide this axes checker.
Definition: Checker.cpp:247
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
Definition: CmdMediator.cpp:87
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Definition: Document.cpp:702
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition: Document.cpp:695
const QString AXIS_CURVE_NAME
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
Definition: Document.cpp:681

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