Engauge Digitizer 2
Loading...
Searching...
No Matches
BackgroundStateNone.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
11#include "GraphicsScene.h"
12#include "GraphicsView.h"
13#include "Logger.h"
14#include <QPixmap>
15
22
24{
25 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::begin";
26
27 setImageVisible (true);
28}
29
31{
32 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::end";
33
34 setImageVisible (false);
35}
36
38{
39 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::fitInView";
40
41 view.fitInView (imageItem ().boundingRect());
42}
43
44void BackgroundStateNone::setCurveSelected (bool /* isGnuplot */,
45 const Transformation & /* transformation */,
46 const DocumentModelGridRemoval & /* modelGridRemoval */,
47 const DocumentModelColorFilter & /* modelColorFilter */,
48 const QString & /* curveSelected */)
49{
50 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::setCurveSelected";
51}
52
53void BackgroundStateNone::setPixmap (bool /* isGnuplot */,
54 const Transformation & /* transformation */,
55 const DocumentModelGridRemoval & /* modelGridRemoval */,
56 const DocumentModelColorFilter & /* modelColorFilter */,
57 const QPixmap &pixmapOriginal,
58 const QString & /* curveSelected */)
59{
60 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::setPixmap";
61
62 // Empty background
63 QPixmap pixmapNone (pixmapOriginal);
64 pixmapNone.fill (Qt::white);
65 setProcessedPixmap (pixmapNone);
66
67}
68
70{
71 return "BackgroundStateNone";
72}
73
74void BackgroundStateNone::updateColorFilter (bool /* isGnuplot */,
75 const Transformation & /* transformation */,
76 const DocumentModelGridRemoval & /* modelGridRemoval */,
77 const DocumentModelColorFilter & /* modelColorFilter */,
78 const QString & /* curveSelected */)
79{
80 LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::updateColorFilter";
81}
log4cpp::Category * mainCat
Definition Logger.cpp:14
BackgroundStateAbstractBase(BackgroundStateContext &context, GraphicsScene &scene)
Single constructor.
QGraphicsPixmapItem & imageItem() const
Graphics image item for the current state.
GraphicsScene & scene()
Reference to the GraphicsScene, without const.
BackgroundStateContext & context()
Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses,...
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.
Context class that manages the background image state machine.
virtual void begin()
Method that is called at the exact moment a state is entered. Typically called just after end for the...
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.
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 &pixmap, const QString &curveSelected)
Update the image for this state, after the leaf class processes it appropriately.
BackgroundStateNone(BackgroundStateContext &context, GraphicsScene &scene)
Single constructor.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void fitInView(GraphicsView &view)
Zoom so background fills the window.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval.
Add point and line handling to generic QGraphicsScene.
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
Affine transformation between screen and graph coordinates, based on digitized axis points.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18