Engauge Digitizer
2
DigitizeState
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
"
8
#include "
DigitizeStateAbstractBase.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
23
DigitizeStateAbstractBase::DigitizeStateAbstractBase
(
DigitizeStateContext
&context) :
24
m_context (context)
25
{
26
}
27
28
DigitizeStateAbstractBase::~DigitizeStateAbstractBase
()
29
{
30
}
31
32
bool
DigitizeStateAbstractBase::canPasteProtected
(
const
Transformation
&transformation,
33
const
QSize &viewSize)
const
34
{
35
MimePointsDetector
mimePointsDetector;
36
37
return
mimePointsDetector.
isMimePointsData
(transformation,
38
viewSize);
39
}
40
41
DigitizeStateContext
&
DigitizeStateAbstractBase::context
()
42
{
43
return
m_context;
44
}
45
46
const
DigitizeStateContext
&
DigitizeStateAbstractBase::context
()
const
47
{
48
return
m_context;
49
}
50
51
void
DigitizeStateAbstractBase::setCursor
(
CmdMediator
*cmdMediator)
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
}
DigitizeStateAbstractBase.h
DigitizeStateAbstractBase::cursor
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
DigitizeStateAbstractBase::canPasteProtected
bool canPasteProtected(const Transformation &transformation, const QSize &viewSize) const
Protected version of canPaste method. Some, but not all, leaf classes use this method.
Definition:
DigitizeStateAbstractBase.cpp:32
QtToString.h
MainWindow.h
Document.h
MimePointsDetector::isMimePointsData
bool isMimePointsData(const Transformation &transforation, const QSize &screenSize) const
Returns true if text is acceptable mime data.
Definition:
MimePointsDetector.cpp:22
DigitizeStateAbstractBase::context
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
Definition:
DigitizeStateAbstractBase.cpp:41
CmdMediator.h
DigitizeStateContext.h
MimePointsDetector
Detect if text is acceptable for ingestion by MimePoints.
Definition:
MimePointsDetector.h:18
DigitizeStateAbstractBase::~DigitizeStateAbstractBase
virtual ~DigitizeStateAbstractBase()
Definition:
DigitizeStateAbstractBase.cpp:28
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition:
Transformation.h:31
MimePointsDetector.h
DigitizeStateAbstractBase::setCursor
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
Definition:
DigitizeStateAbstractBase.cpp:51
DigitizeStateContext
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
Definition:
DigitizeStateContext.h:27
MainWindowModel.h
Logger.h
mainCat
log4cpp::Category * mainCat
Definition:
Logger.cpp:14
CmdMediator
Command queue stack.
Definition:
CmdMediator.h:23
Transformation.h
DigitizeStateContext::view
QGraphicsView & view()
QGraphicsView for use by DigitizeStateAbstractBase subclasses.
Definition:
DigitizeStateContext.cpp:263
DigitizeStateAbstractBase::DigitizeStateAbstractBase
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
Definition:
DigitizeStateAbstractBase.cpp:23
LOG4CPP_DEBUG_S
#define LOG4CPP_DEBUG_S(logger)
Definition:
convenience.h:20
Generated on Sat Nov 30 2019 18:21:24 for Engauge Digitizer by
1.8.15