Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
NonPdf
NonPdfCropping.h
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
#ifndef NON_PDF_CROPPING_H
8
#define NON_PDF_CROPPING_H
9
10
#include <QRect>
11
#include <QSize>
12
13
class
NonPdfFrameHandle
;
14
class
QGraphicsRectItem;
15
class
QGraphicsScene;
16
class
QPointF;
17
class
ViewPreview
;
18
22
class
NonPdfCropping
23
{
24
public
:
26
NonPdfCropping
(QGraphicsScene &scene,
27
ViewPreview
&view);
28
~NonPdfCropping
();
29
31
QRectF
frameRect
()
const
;
32
34
void
moveBL
(
const
QPointF &newPos,
35
const
QPointF &oldPos);
36
38
void
moveBR
(
const
QPointF &newPos,
39
const
QPointF &oldPos);
40
42
void
moveTL
(
const
QPointF &newPos,
43
const
QPointF &oldPos);
44
46
void
moveTR
(
const
QPointF &newPos,
47
const
QPointF &oldPos);
48
49
static
const
int
NON_PDF_CROPPING_BOTTOM
= 1;
50
static
const
int
NON_PDF_CROPPING_LEFT
= 2;
51
static
const
int
NON_PDF_CROPPING_RIGHT
= 4;
52
static
const
int
NON_PDF_CROPPING_TOP
= 8;
53
55
QSize
windowSize
()
const
;
56
57
private
:
58
NonPdfCropping
();
59
60
void
createWidgets (QGraphicsScene &scene);
61
void
disableEventsWhileMovingAutomatically();
62
void
enableEventsWhileMovingAutomatically();
63
QRectF rectFromTLAndBR ()
const
;
64
void
updateBox();
65
66
ViewPreview
&m_view;
67
68
// Box
69
QGraphicsRectItem *m_box;
70
71
// Handles
72
NonPdfFrameHandle
*m_handleTL;
73
NonPdfFrameHandle
*m_handleTR;
74
NonPdfFrameHandle
*m_handleBR;
75
NonPdfFrameHandle
*m_handleBL;
76
77
};
78
79
#endif
// NON_PDF_CROPPING_H
NonPdfCropping::~NonPdfCropping
~NonPdfCropping()
Definition
NonPdfCropping.cpp:31
NonPdfCropping::moveBL
void moveBL(const QPointF &newPos, const QPointF &oldPos)
Bottom left corner handle was moved.
Definition
NonPdfCropping.cpp:95
NonPdfCropping::NON_PDF_CROPPING_BOTTOM
static const int NON_PDF_CROPPING_BOTTOM
Bit flag when handle is aligned with bottom edge at reference point.
Definition
NonPdfCropping.h:49
NonPdfCropping::moveBR
void moveBR(const QPointF &newPos, const QPointF &oldPos)
Bottom right corner handle was moved.
Definition
NonPdfCropping.cpp:113
NonPdfCropping::windowSize
QSize windowSize() const
Size of window in scene coordinates.
Definition
NonPdfCropping.cpp:178
NonPdfCropping::NON_PDF_CROPPING_RIGHT
static const int NON_PDF_CROPPING_RIGHT
Bit flag when handle is aligned with right edge at reference point.
Definition
NonPdfCropping.h:51
NonPdfCropping::frameRect
QRectF frameRect() const
Frame rectangle selected by user.
Definition
NonPdfCropping.cpp:81
NonPdfCropping::moveTR
void moveTR(const QPointF &newPos, const QPointF &oldPos)
Top right corner handle was moved.
Definition
NonPdfCropping.cpp:149
NonPdfCropping::NON_PDF_CROPPING_LEFT
static const int NON_PDF_CROPPING_LEFT
Bit flag when handle is aligned with left edge at reference point.
Definition
NonPdfCropping.h:50
NonPdfCropping::moveTL
void moveTL(const QPointF &newPos, const QPointF &oldPos)
Top left corner handle was moved.
Definition
NonPdfCropping.cpp:131
NonPdfCropping::NonPdfCropping
NonPdfCropping(QGraphicsScene &scene, ViewPreview &view)
Single constructor.
Definition
NonPdfCropping.cpp:20
NonPdfCropping::NON_PDF_CROPPING_TOP
static const int NON_PDF_CROPPING_TOP
Bit flag when handle is aligned with top edge at reference point.
Definition
NonPdfCropping.h:52
NonPdfFrameHandle
This class acts as a single handle for the NonPdfCropping class.
Definition
NonPdfFrameHandle.h:20
ViewPreview
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition
ViewPreview.h:15
Generated on
for Engauge Digitizer by
1.17.0