Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
9 #include "DigitizeStateContext.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 
24  m_context (context)
25 {
26 }
27 
29 {
30 }
31 
33  const QSize &viewSize) const
34 {
35  MimePointsDetector mimePointsDetector;
36 
37  return mimePointsDetector.isMimePointsData (transformation,
38  viewSize);
39 }
40 
42 {
43  return m_context;
44 }
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 }
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
Detect if text is acceptable for ingestion by MimePoints.
bool canPasteProtected(const Transformation &transformation, const QSize &viewSize) const
Protected version of canPaste method. Some, but not all, leaf classes use this method.
Affine transformation between screen and graph coordinates, based on digitized axis points...
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...
bool isMimePointsData(const Transformation &transforation, const QSize &screenSize) const
Returns true if text is acceptable mime data.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Command queue stack.
Definition: CmdMediator.h:23
QGraphicsView & view()
QGraphicsView for use by DigitizeStateAbstractBase subclasses.
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20