Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateAbstractBase.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
7#include "CmdMediator.h"
10#include "Document.h"
11#include "Logger.h"
12#include "MainWindow.h"
13#include "MainWindowModel.h"
14#include "MimePointsDetector.h"
15#include <QCursor>
16#include <QGraphicsScene>
17#include <QImage>
18#include <QSize>
19#include <QTimer>
20#include "QtToString.h"
21#include "Transformation.h"
22
27
31
33 const QSize &viewSize) const
34{
35 MimePointsDetector mimePointsDetector;
36
37 return mimePointsDetector.isMimePointsData (transformation,
38 viewSize);
39}
40
45
47{
48 return m_context;
49}
50
52{
53 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateAbstractBase::setCursor";
54
55 // Note that we are setting the QGraphicsView cursor and NOT the QApplication override cursor
56 m_context.view ().setCursor (cursor (cmdMediator));
57}
log4cpp::Category * mainCat
Definition Logger.cpp:14
Command queue stack.
Definition CmdMediator.h:24
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
bool canPasteProtected(const Transformation &transformation, const QSize &viewSize) const
Protected version of canPaste method. Some, but not all, leaf classes use this method.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
QGraphicsView & view()
QGraphicsView for use by DigitizeStateAbstractBase subclasses.
Detect if text is acceptable for ingestion by MimePoints.
bool isMimePointsData(const Transformation &transforation, const QSize &screenSize) const
Returns true if text is acceptable mime data.
Affine transformation between screen and graph coordinates, based on digitized axis points.
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20