QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsextentgroupbox.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsextentgroupbox.h
3
---------------------
4
begin : March 2014
5
copyright : (C) 2014 by Martin Dobias
6
email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSEXTENTGROUPBOX_H
17
#define QGSEXTENTGROUPBOX_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgscollapsiblegroupbox.h
"
22
#include "
qgscoordinatereferencesystem.h
"
23
#include "
qgsrectangle.h
"
24
25
class
QgsCoordinateReferenceSystem
;
26
class
QgsMapLayer
;
27
class
QgsExtentWidget
;
28
class
QgsMapCanvas
;
29
43
class
GUI_EXPORT
QgsExtentGroupBox
:
public
QgsCollapsibleGroupBox
44
{
45
Q_OBJECT
46
Q_PROPERTY( QString
titleBase
READ
titleBase
WRITE
setTitleBase
)
47
48
public
:
49
// TODO QGIS 5.0 -- use QgsExtentWidget enum instead
50
52
enum
ExtentState
53
{
54
OriginalExtent
,
55
CurrentExtent
,
56
UserExtent
,
57
ProjectLayerExtent
,
58
DrawOnCanvas
,
59
};
60
64
explicit
QgsExtentGroupBox
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
65
71
void
setOriginalExtent(
const
QgsRectangle
&originalExtent,
const
QgsCoordinateReferenceSystem
&originalCrs );
72
78
QgsRectangle
originalExtent()
const
;
79
85
QgsCoordinateReferenceSystem
originalCrs()
const
;
86
93
void
setCurrentExtent(
const
QgsRectangle
¤tExtent,
const
QgsCoordinateReferenceSystem
¤tCrs );
94
101
QgsRectangle
currentExtent()
const
;
102
109
QgsCoordinateReferenceSystem
currentCrs()
const
;
110
116
void
setOutputCrs(
const
QgsCoordinateReferenceSystem
&outputCrs );
117
122
QgsRectangle
outputExtent()
const
;
123
128
QgsCoordinateReferenceSystem
outputCrs()
const
;
129
133
QgsExtentGroupBox::ExtentState
extentState()
const
;
134
139
void
setTitleBase(
const
QString &title );
140
145
QString titleBase()
const
;
146
152
void
setMapCanvas(
QgsMapCanvas
*canvas,
bool
drawOnCanvasOption =
true
);
153
158
QSize ratio()
const
;
159
160
public
slots:
161
165
void
setOutputExtentFromOriginal();
166
170
void
setOutputExtentFromCurrent();
171
175
void
setOutputExtentFromUser(
const
QgsRectangle
&extent,
const
QgsCoordinateReferenceSystem
&crs );
176
180
void
setOutputExtentFromLayer(
const
QgsMapLayer
*layer );
181
185
void
setOutputExtentFromDrawOnCanvas();
186
192
void
setRatio( QSize ratio );
193
194
signals:
195
199
void
extentChanged
(
const
QgsRectangle
&r );
200
205
void
extentLayerChanged
(
QgsMapLayer
*layer );
206
207
private
slots:
208
209
void
groupBoxClicked();
210
211
void
widgetExtentChanged();
212
213
void
validationChanged(
bool
valid );
214
215
private
:
216
void
updateTitle();
217
218
QgsExtentWidget
*mWidget =
nullptr
;
219
221
QString mTitleBase;
222
};
223
224
#endif
// QGSEXTENTGROUPBOX_H
QgsCollapsibleGroupBox::QgsCollapsibleGroupBox
QgsCollapsibleGroupBox(QWidget *parent=nullptr, QgsSettings *settings=nullptr)
Definition
qgscollapsiblegroupbox.cpp:490
QgsCoordinateReferenceSystem
Represents a coordinate reference system (CRS).
Definition
qgscoordinatereferencesystem.h:216
QgsExtentGroupBox
Collapsible group box for configuration of extent, typically for a save operation.
Definition
qgsextentgroupbox.h:44
QgsExtentGroupBox::ExtentState
ExtentState
Available states for the current extent selection in the widget.
Definition
qgsextentgroupbox.h:53
QgsExtentGroupBox::UserExtent
@ UserExtent
Extent manually entered/modified by the user.
Definition
qgsextentgroupbox.h:56
QgsExtentGroupBox::CurrentExtent
@ CurrentExtent
Map canvas extent.
Definition
qgsextentgroupbox.h:55
QgsExtentGroupBox::ProjectLayerExtent
@ ProjectLayerExtent
Extent taken from a layer within the project.
Definition
qgsextentgroupbox.h:57
QgsExtentGroupBox::DrawOnCanvas
@ DrawOnCanvas
Extent taken from a rectangled drawn onto the map canvas.
Definition
qgsextentgroupbox.h:58
QgsExtentGroupBox::OriginalExtent
@ OriginalExtent
Layer's extent.
Definition
qgsextentgroupbox.h:54
QgsExtentGroupBox::QgsExtentGroupBox
QgsExtentGroupBox(QWidget *parent=nullptr)
Constructor for QgsExtentGroupBox.
Definition
qgsextentgroupbox.cpp:27
QgsExtentGroupBox::extentLayerChanged
void extentLayerChanged(QgsMapLayer *layer)
Emitted when the extent layer is changed.
QgsExtentGroupBox::extentChanged
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.
QgsExtentGroupBox::titleBase
QString titleBase
Definition
qgsextentgroupbox.h:46
QgsExtentGroupBox::setTitleBase
void setTitleBase(const QString &title)
Sets the base part of title of the group box (will be appended with extent state).
Definition
qgsextentgroupbox.cpp:190
QgsExtentWidget
A widget for configuration of a map extent.
Definition
qgsextentwidget.h:51
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgscollapsiblegroupbox.h
qgscoordinatereferencesystem.h
qgsrectangle.h
Generated on
for QGIS API Documentation by
1.17.0