QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgspointcloudlayersaveasdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudlayersaveasdialog.h
3 Dialog to select destination, type and crs to save as pointcloud layers
4 -------------------
5 begin : July 2022
6 copyright : (C) 2022 by Stefanos Natsis
7 email : uclaros at gmail dot com
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18#ifndef QGSPOINTCLOUDLAYERSAVEASDIALOG_H
19#define QGSPOINTCLOUDLAYERSAVEASDIALOG_H
20
21#include "ui_qgspointcloudlayersaveasdialogbase.h"
22
23#include "qgis_gui.h"
24#include "qgsfields.h"
25#include "qgshelp.h"
27#include "qgsvectorfilewriter.h"
28
29#include <QDialog>
30
31#define SIP_NO_FILE
32
34
41class GUI_EXPORT QgsPointCloudLayerSaveAsDialog : public QDialog, private Ui::QgsPointCloudLayerSaveAsDialogBase
42{
43 Q_OBJECT
44
45 public:
49 QgsPointCloudLayerSaveAsDialog( QgsPointCloudLayer *layer, QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() );
50
56
60 QString filename() const;
61
65 QString layername() const;
66
71
75 void setMapCanvas( QgsMapCanvas *canvas );
76
82 bool addToCanvas() const;
83
89 void setAddToCanvas( bool checked );
90
95 bool hasFilterExtent() const;
96
102
106 bool hasFilterLayer() const;
107
111 QgsMapLayer *filterLayer() const;
112
116 bool filterLayerSelectedOnly() const;
117
122 bool hasAttributes() const;
123
127 QStringList attributes() const;
128
133 bool hasZRange() const;
134
139 QgsDoubleRange zRange() const;
140
145 bool hasPointsLimit() const;
146
151 int pointsLimit() const;
152
155
156 private slots:
157
158 void mFormatComboBox_currentIndexChanged( int idx );
159 void mFilterGeometryGroupBoxCheckToggled( bool checked );
160 void mMinimumZSpinBoxValueChanged( const double value );
161 void mMaximumZSpinBoxValueChanged( const double value );
162 void mFilterGeometryLayerChanged( QgsMapLayer *layer );
163 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
164 void showHelp();
165 void accept() override;
166 void mSelectAllAttributes_clicked();
167 void mDeselectAllAttributes_clicked();
168
169 private:
170 void setup();
171
175 static QString getTranslatedNameForFormat( QgsPointCloudLayerExporter::ExportFormat format );
176
180 static QString getFilterForFormat( QgsPointCloudLayerExporter::ExportFormat format );
181
182 QgsCoordinateReferenceSystem mSelectedCrs;
183
184 QgsRectangle mLayerExtent;
186 QgsPointCloudLayer *mLayer = nullptr;
187 QgsMapCanvas *mMapCanvas = nullptr;
189 QString mDefaultOutputLayerNameFromInputLayerName;
190 QString mLastUsedFilename;
191 bool mWasAddToCanvasForced = false;
192};
193
194#endif // QGSPOINTCLOUDLAYERSAVEASDIALOG_H
Represents a coordinate reference system (CRS).
QgsRange which stores a range of double values.
Definition qgsrange.h:233
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:80
ExportFormat
Supported export formats for point clouds.
void setMapCanvas(QgsMapCanvas *canvas)
Sets a map canvas to associate with the dialog.
QgsPointCloudLayerSaveAsDialog(QgsPointCloudLayer *layer, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
Construct a new QgsPointCloudLayerSaveAsDialog.
QString filename() const
Returns the target filename.
bool hasPointsLimit() const
Determines if limiting the number of exported points is enabled.
bool hasFilterLayer() const
Determines if points will be spatially filtered by a layer's features.
QgsRectangle filterExtent() const
Determines the extent to be exported.
bool hasZRange() const
Determines if filtering by Z values is activated.
QgsCoordinateReferenceSystem crsObject() const
Returns the CRS chosen for export.
bool hasAttributes() const
Determines if attributes will be exported as fields.
QgsDoubleRange zRange() const
Determines the Z range of points to be exported.
QgsPointCloudLayerExporter::ExportFormat exportFormat() const
The format in which the export should be written.
bool hasFilterExtent() const
Determines if filtering the export by an extent is activated.
int pointsLimit() const
Determines the limit to the total number of points.
bool filterLayerSelectedOnly() const
Determines if only the selected features from the filterLayer will be used for spatial filtering.
QString layername() const
Returns the target layer name.
void setAddToCanvas(bool checked)
Sets whether the "add to canvas" checkbox should be checked.
bool addToCanvas() const
Returns true if the "add to canvas" checkbox is checked.
QgsMapLayer * filterLayer() const
Returns the layer responsible for spatially filtering points.
QStringList attributes() const
Returns a list of attributes which are selected for saving.
QgsVectorFileWriter::ActionOnExistingFile creationActionOnExistingFile() const
Returns creation action.
Represents a map layer supporting display of point clouds.
A rectangle specified with double values.
ActionOnExistingFile
Enumeration to describe how to handle existing files.
@ CreateOrOverwriteFile
Create or overwrite file.