QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
20#include "qgis_sip.h"
21
23#include "qgsrectangle.h"
24#include "qgis_gui.h"
25
26#include <memory>
27
29class QgsMapLayer;
30class QgsExtentWidget;
31class QgsMapCanvas;
32
47{
48 Q_OBJECT
49 Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
50
51 public:
52 // TODO QGIS 4.0 -- use QgsExtentWidget enum instead
53
63
67 explicit QgsExtentGroupBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
68
74 void setOriginalExtent( const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs );
75
81 QgsRectangle originalExtent() const;
82
88 QgsCoordinateReferenceSystem originalCrs() const;
89
96 void setCurrentExtent( const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs );
97
104 QgsRectangle currentExtent() const;
105
112 QgsCoordinateReferenceSystem currentCrs() const;
113
119 void setOutputCrs( const QgsCoordinateReferenceSystem &outputCrs );
120
125 QgsRectangle outputExtent() const;
126
132
136 QgsExtentGroupBox::ExtentState extentState() const;
137
142 void setTitleBase( const QString &title );
143
148 QString titleBase() const;
149
155 void setMapCanvas( QgsMapCanvas *canvas, bool drawOnCanvasOption = true );
156
161 QSize ratio() const;
162
163 public slots:
164
168 void setOutputExtentFromOriginal();
169
173 void setOutputExtentFromCurrent();
174
178 void setOutputExtentFromUser( const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs );
179
183 void setOutputExtentFromLayer( const QgsMapLayer *layer );
184
188 void setOutputExtentFromDrawOnCanvas();
189
195 void setRatio( QSize ratio );
196
197 signals:
198
202 void extentChanged( const QgsRectangle &r );
203
204 private slots:
205
206 void groupBoxClicked();
207
208 void widgetExtentChanged();
209
210 void validationChanged( bool valid );
211
212 private:
213 void updateTitle();
214
215 QgsExtentWidget *mWidget = nullptr;
216
218 QString mTitleBase;
219};
220
221#endif // QGSEXTENTGROUPBOX_H
A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
This class represents a coordinate reference system (CRS).
Collapsible group box for configuration of extent, typically for a save operation.
ExtentState
Available states for the current extent selection in the widget.
@ UserExtent
Extent manually entered/modified by the user.
@ CurrentExtent
Map canvas extent.
@ ProjectLayerExtent
Extent taken from a layer within the project.
@ DrawOnCanvas
Extent taken from a rectangled drawn onto the map canvas.
@ OriginalExtent
Layer's extent.
void extentChanged(const QgsRectangle &r)
Emitted when the widget's extent is changed.
A widget for configuration of a map extent.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:76
A rectangle specified with double values.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
const QgsCoordinateReferenceSystem & outputCrs
const QgsCoordinateReferenceSystem & crs