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

Background image state for showing filter image from current curve. More...

#include <BackgroundStateCurve.h>

Inheritance diagram for BackgroundStateCurve:
Inheritance graph
Collaboration diagram for BackgroundStateCurve:
Collaboration graph

Public Member Functions

 BackgroundStateCurve (BackgroundStateContext &context, GraphicsScene &scene)
 Single constructor.
virtual void begin ()
 Method that is called at the exact moment a state is entered. Typically called just after end for the previous state.
virtual void end ()
 Method that is called at the exact moment a state is exited. Typically called just before begin for the next state.
virtual void fitInView (GraphicsView &view)
 Zoom so background fills the window.
virtual void setCurveSelected (bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &colorFilter, const QString &curveSelected)
 Update the currently selected curve name.
virtual void setPixmap (bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &modelColorFilter, const QPixmap &pixmapOriginal, const QString &curveSelected)
 Update the image for this state, after the leaf class processes it appropriately.
virtual QString state () const
 State name for debugging.
virtual void updateColorFilter (bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &colorFilter, const QString &curveSelected)
 Apply color filter settings.
Public Member Functions inherited from BackgroundStateAbstractBase
 BackgroundStateAbstractBase (BackgroundStateContext &context, GraphicsScene &scene)
 Single constructor.
virtual ~BackgroundStateAbstractBase ()
BackgroundStateContextcontext ()
 Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses, without const.
const BackgroundStateContextcontext () const
 Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses, without const.
QImage image () const
 Image for the current state.
QGraphicsPixmapItem & imageItem () const
 Graphics image item for the current state.
GraphicsScenescene ()
 Reference to the GraphicsScene, without const.
const GraphicsScenescene () const
 Reference to the GraphicsScene, without const.

Additional Inherited Members

Protected Member Functions inherited from BackgroundStateAbstractBase
void setImageVisible (bool visible)
 Show/hide background image.
void setProcessedPixmap (const QPixmap &pixmap)
 Save the image for this state after it has been processed by the leaf class.

Detailed Description

Background image state for showing filter image from current curve.

Definition at line 13 of file BackgroundStateCurve.h.

Constructor & Destructor Documentation

◆ BackgroundStateCurve()

BackgroundStateCurve::BackgroundStateCurve ( BackgroundStateContext & context,
GraphicsScene & scene )

Single constructor.

Definition at line 18 of file BackgroundStateCurve.cpp.

19 :
21 scene)
22{
23}
BackgroundStateAbstractBase(BackgroundStateContext &context, GraphicsScene &scene)
Single constructor.
GraphicsScene & scene()
Reference to the GraphicsScene, without const.
BackgroundStateContext & context()
Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses,...

Member Function Documentation

◆ begin()

void BackgroundStateCurve::begin ( )
virtual

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

Implements BackgroundStateAbstractBase.

Definition at line 25 of file BackgroundStateCurve.cpp.

26{
27 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::begin";
28
29 setImageVisible (true);
30}
log4cpp::Category * mainCat
Definition Logger.cpp:14
void setImageVisible(bool visible)
Show/hide background image.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ end()

void BackgroundStateCurve::end ( )
virtual

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

Implements BackgroundStateAbstractBase.

Definition at line 32 of file BackgroundStateCurve.cpp.

33{
34 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::end";
35
36 setImageVisible (false);
37}

◆ fitInView()

void BackgroundStateCurve::fitInView ( GraphicsView & view)
virtual

Zoom so background fills the window.

Implements BackgroundStateAbstractBase.

Definition at line 39 of file BackgroundStateCurve.cpp.

40{
41 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::fitInView";
42
43 view.fitInView (imageItem ().boundingRect());
44}
QGraphicsPixmapItem & imageItem() const
Graphics image item for the current state.

◆ setCurveSelected()

void BackgroundStateCurve::setCurveSelected ( bool isGnuplot,
const Transformation & transformation,
const DocumentModelGridRemoval & modelGridRemoval,
const DocumentModelColorFilter & colorFilter,
const QString & curveSelected )
virtual

Update the currently selected curve name.

Implements BackgroundStateAbstractBase.

Definition at line 76 of file BackgroundStateCurve.cpp.

81{
82 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::setCurveSelected"
83 << " curve=" << curveSelected.toLatin1().data();
84
85 // Even if m_curveSelected equals curveSelected we update the image, since the transformation
86 // may have changed
87 processImageFromSavedInputs (isGnuplot,
88 transformation,
89 modelGridRemoval,
90 modelColorFilter,
91 curveSelected);
92}

◆ setPixmap()

void BackgroundStateCurve::setPixmap ( bool isGnuplot,
const Transformation & transformation,
const DocumentModelGridRemoval & modelGridRemoval,
const DocumentModelColorFilter & modelColorFilter,
const QPixmap & pixmap,
const QString & curveSelected )
virtual

Update the image for this state, after the leaf class processes it appropriately.

Implements BackgroundStateAbstractBase.

Definition at line 94 of file BackgroundStateCurve.cpp.

100{
101 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::setPixmap";
102
103 m_pixmapOriginal = pixmapOriginal;
104 processImageFromSavedInputs (isGnuplot,
105 transformation,
106 modelGridRemoval,
107 modelColorFilter,
108 curveSelected);
109}

◆ state()

QString BackgroundStateCurve::state ( ) const
virtual

State name for debugging.

Implements BackgroundStateAbstractBase.

Definition at line 111 of file BackgroundStateCurve.cpp.

112{
113 return "BackgroundStateCurve";
114}

◆ updateColorFilter()

void BackgroundStateCurve::updateColorFilter ( bool isGnuplot,
const Transformation & transformation,
const DocumentModelGridRemoval & modelGridRemoval,
const DocumentModelColorFilter & modelColorFilter,
const QString & curveSelected )
virtual

Apply color filter settings.

Implements BackgroundStateAbstractBase.

Definition at line 116 of file BackgroundStateCurve.cpp.

121{
122 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateCurve::updateColorFilter";
123
124 processImageFromSavedInputs (isGnuplot,
125 transformation,
126 modelGridRemoval,
127 modelColorFilter,
128 curveSelected);
129}

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