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 17 of file TransformationStateDefined.h.

Constructor & Destructor Documentation

◆ TransformationStateDefined()

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

Single constructor.

Definition at line 23 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()));

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 33 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);

◆ 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 62 of file TransformationStateDefined.cpp.

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

◆ updateAxesChecker()

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

Apply the new DocumentModelAxesChecker.

Implements TransformationStateAbstractBase.

Definition at line 135 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());

The documentation for this class was generated from the following files:
Document::documentAxesPointsRequired
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition: Document.cpp:363
AXIS_CURVE_NAME
const QString AXIS_CURVE_NAME
DocumentModelGridDisplay::stable
bool stable() const
Get method for stable flag.
Definition: DocumentModelGridDisplay.cpp:267
Document::modelGridRemoval
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
Definition: Document.cpp:737
Checker
Box shape that is drawn through the three axis points, to temporarily (usually) or permanently (rarel...
Definition: Checker.h:32
TransformationStateAbstractBase
Base class for all transformation states. This serves as an interface to TransformationStateContext.
Definition: TransformationStateAbstractBase.h:24
Checker::prepareForDisplay
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
CallbackAxesCheckerFromAxesPoints::callback
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Definition: CallbackAxesCheckerFromAxesPoints.cpp:14
CurveStyles::pointRadius
int pointRadius(const QString &curveName) const
Get method for curve point radius.
Definition: CurveStyles.cpp:165
Document::modelGridDisplay
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
Definition: Document.cpp:730
CmdMediator::document
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:72
CallbackAxesCheckerFromAxesPoints
Callback for positioning the axes indicator according to the axes points.
Definition: CallbackAxesCheckerFromAxesPoints.h:16
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
CallbackAxesCheckerFromAxesPoints::points
Points points() const
Return the collected points as a polygon, in screen coordinates.
Definition: CallbackAxesCheckerFromAxesPoints.cpp:22
CmdMediator::iterateThroughCurvePointsAxes
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
Definition: CmdMediator.cpp:87
DocumentModelGridRemoval::stable
bool stable() const
Get method for stable flag.
Definition: DocumentModelGridRemoval.cpp:319
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Document::modelCoords
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition: Document.cpp:695
TransformationStateAbstractBase::context
TransformationStateContext & context()
Reference to the TransformationStateContext that contains all the TransformationStateAbstractBase sub...
Definition: TransformationStateAbstractBase.cpp:19
Document::modelAxesChecker
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
Definition: Document.cpp:681
Document::modelCurveStyles
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Definition: Document.cpp:702
TransformationStateDefined::updateAxesChecker
virtual void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.
Definition: TransformationStateDefined.cpp:135
Checker::setVisible
void setVisible(bool visible)
Show/hide this axes checker.
Definition: Checker.cpp:247