Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Pdf
PdfCropping.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 PDF_CROPPING_H
8
#define PDF_CROPPING_H
9
10
#include <QRect>
11
#include <QSize>
12
13
class
PdfFrameHandle
;
14
class
QGraphicsRectItem;
15
class
QGraphicsScene;
16
class
QPointF;
17
class
ViewPreview
;
18
24
class
PdfCropping
25
{
26
public
:
28
PdfCropping
(QGraphicsScene &scene,
29
ViewPreview
&view);
30
32
QRectF
frameRect
()
const
;
33
35
void
moveBL
(
const
QPointF &newPos,
36
const
QPointF &oldPos);
37
39
void
moveBR
(
const
QPointF &newPos,
40
const
QPointF &oldPos);
41
43
void
moveTL
(
const
QPointF &newPos,
44
const
QPointF &oldPos);
45
47
void
moveTR
(
const
QPointF &newPos,
48
const
QPointF &oldPos);
49
50
static
const
int
PDF_CROPPING_BOTTOM
= 1;
51
static
const
int
PDF_CROPPING_LEFT
= 2;
52
static
const
int
PDF_CROPPING_RIGHT
= 4;
53
static
const
int
PDF_CROPPING_TOP
= 8;
54
56
QSize
windowSize
()
const
;
57
58
private
:
59
PdfCropping
();
60
61
void
createWidgets (QGraphicsScene &scene);
62
void
disableEventsWhileMovingAutomatically();
63
void
enableEventsWhileMovingAutomatically();
64
QRectF rectFromTLAndBR ()
const
;
65
void
updateBox();
66
67
ViewPreview
&m_view;
68
69
// Box
70
QGraphicsRectItem *m_box;
71
72
// Handles
73
PdfFrameHandle
*m_handleTL;
74
PdfFrameHandle
*m_handleTR;
75
PdfFrameHandle
*m_handleBR;
76
PdfFrameHandle
*m_handleBL;
77
78
};
79
80
#endif
// PDF_CROPPING_H
PdfCropping::moveBL
void moveBL(const QPointF &newPos, const QPointF &oldPos)
Bottom left corner handle was moved.
Definition
PdfCropping.cpp:83
PdfCropping::PDF_CROPPING_LEFT
static const int PDF_CROPPING_LEFT
Bit flag when handle is aligned with left edge at reference point.
Definition
PdfCropping.h:51
PdfCropping::PdfCropping
PdfCropping(QGraphicsScene &scene, ViewPreview &view)
Single constructor.
Definition
PdfCropping.cpp:20
PdfCropping::PDF_CROPPING_BOTTOM
static const int PDF_CROPPING_BOTTOM
Bit flag when handle is aligned with bottom edge at reference point.
Definition
PdfCropping.h:50
PdfCropping::windowSize
QSize windowSize() const
Size of window in scene coordinates.
Definition
PdfCropping.cpp:166
PdfCropping::PDF_CROPPING_TOP
static const int PDF_CROPPING_TOP
Bit flag when handle is aligned with top edge at reference point.
Definition
PdfCropping.h:53
PdfCropping::moveTL
void moveTL(const QPointF &newPos, const QPointF &oldPos)
Top left corner handle was moved.
Definition
PdfCropping.cpp:119
PdfCropping::moveTR
void moveTR(const QPointF &newPos, const QPointF &oldPos)
Top right corner handle was moved.
Definition
PdfCropping.cpp:137
PdfCropping::moveBR
void moveBR(const QPointF &newPos, const QPointF &oldPos)
Bottom right corner handle was moved.
Definition
PdfCropping.cpp:101
PdfCropping::frameRect
QRectF frameRect() const
Frame rectangle selected by user.
Definition
PdfCropping.cpp:69
PdfCropping::PDF_CROPPING_RIGHT
static const int PDF_CROPPING_RIGHT
Bit flag when handle is aligned with right edge at reference point.
Definition
PdfCropping.h:52
PdfFrameHandle
This class acts as a single handle for the PdfCropping class.
Definition
PdfFrameHandle.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