Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
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. More...
 
virtual void begin ()
 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 ()
 Method that is called at the exact moment a state is exited. Typically called just before begin for the next state. More...
 
virtual void fitInView (GraphicsView &view)
 Zoom so background fills the window. More...
 
virtual void setCurveSelected (bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &colorFilter, const QString &curveSelected)
 Update the currently selected curve name. More...
 
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. More...
 
virtual QString state () const
 State name for debugging. More...
 
virtual void updateColorFilter (bool isGnuplot, const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const DocumentModelColorFilter &colorFilter, const QString &curveSelected)
 Apply color filter settings. More...
 
- Public Member Functions inherited from BackgroundStateAbstractBase
 BackgroundStateAbstractBase (BackgroundStateContext &context, GraphicsScene &scene)
 Single constructor. More...
 
virtual ~BackgroundStateAbstractBase ()
 
BackgroundStateContextcontext ()
 Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses, without const. More...
 
const BackgroundStateContextcontext () const
 Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses, without const. More...
 
QImage image () const
 Image for the current state. More...
 
QGraphicsPixmapItem & imageItem () const
 Graphics image item for the current state. More...
 
GraphicsScenescene ()
 Reference to the GraphicsScene, without const. More...
 
const GraphicsScenescene () const
 Reference to the GraphicsScene, without const. More...
 

Additional Inherited Members

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

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 ( BackgroundStateContext context,
GraphicsScene scene 
)

Single constructor.

Definition at line 18 of file BackgroundStateCurve.cpp.

19  :
21  scene)
22 {
23 }
Background image state machine state base class.

Member Function Documentation

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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
void setImageVisible(bool visible)
Show/hide background image.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
void setImageVisible(bool visible)
Show/hide background image.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
QString BackgroundStateCurve::state ( ) const
virtual

State name for debugging.

Implements BackgroundStateAbstractBase.

Definition at line 111 of file BackgroundStateCurve.cpp.

112 {
113  return "BackgroundStateCurve";
114 }
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 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

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