QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsmeshlayerproperties.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlayerproperties.cpp
3 --------------------------
4 begin : Jun 2018
5 copyright : (C) 2018 by Peter Petrik
6 email : zilolv at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include <limits>
19#include <typeinfo>
20
21#include "qgsapplication.h"
22#include "qgshelp.h"
23#include "qgslogger.h"
24#include "qgsmapcanvas.h"
27#include "qgsmeshlayer.h"
29#include "moc_qgsmeshlayerproperties.cpp"
31#include "qgsproject.h"
34#include "qgssettings.h"
36#include "qgsmetadatawidget.h"
38
39#include <QDesktopServices>
40#include <QFileDialog>
41#include <QMessageBox>
42
43QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent, Qt::WindowFlags fl )
44 : QgsLayerPropertiesDialog( lyr, canvas, QStringLiteral( "MeshLayerProperties" ), parent, fl )
45 , mMeshLayer( qobject_cast<QgsMeshLayer *>( lyr ) )
46{
47 Q_ASSERT( mMeshLayer );
48
49 setupUi( this );
50 mRendererMeshPropertiesWidget = new QgsRendererMeshPropertiesWidget( mMeshLayer, canvas, this );
51 mConfigWidgets << mRendererMeshPropertiesWidget;
52 mOptsPage_StyleContent->layout()->addWidget( mRendererMeshPropertiesWidget );
53
54 mSimplifyReductionFactorSpinBox->setClearValue( 10.0 );
55 mSimplifyMeshResolutionSpinBox->setClearValue( 5 );
56
57 mStaticDatasetWidget->setLayer( mMeshLayer );
58 mIsMapSettingsTemporal = mMeshLayer && canvas && canvas->mapSettings().isTemporal();
59
60 mTemporalProviderTimeUnitComboBox->addItem( tr( "Seconds" ), static_cast<int>( Qgis::TemporalUnit::Seconds ) );
61 mTemporalProviderTimeUnitComboBox->addItem( tr( "Minutes" ), static_cast<int>( Qgis::TemporalUnit::Minutes ) );
62 mTemporalProviderTimeUnitComboBox->addItem( tr( "Hours" ), static_cast<int>( Qgis::TemporalUnit::Hours ) );
63 mTemporalProviderTimeUnitComboBox->addItem( tr( "Days" ), static_cast<int>( Qgis::TemporalUnit::Days ) );
64
65 connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsMeshLayerProperties::changeCrs );
67
68 // QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
69 // switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
70 // and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
71 initOptionsBase( false );
72
73 connect( lyr->styleManager(), &QgsMapLayerStyleManager::currentStyleChanged, this, &QgsMeshLayerProperties::syncAndRepaint );
74
75 connect( this, &QDialog::accepted, this, &QgsMeshLayerProperties::apply );
76 connect( this, &QDialog::rejected, this, &QgsMeshLayerProperties::rollback );
77 connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsMeshLayerProperties::apply );
78
79 connect( mMeshLayer, &QgsMeshLayer::dataChanged, this, &QgsMeshLayerProperties::syncAndRepaint );
80 connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMeshLayerProperties::showHelp );
81
82 connect( mTemporalReloadButton, &QPushButton::clicked, this, &QgsMeshLayerProperties::reloadTemporalProperties );
83 connect( mTemporalDateTimeReference, &QDateTimeEdit::dateTimeChanged, this, &QgsMeshLayerProperties::onTimeReferenceChange );
86
87 mScaleRangeWidget->setMapCanvas( mCanvas );
88 chkUseScaleDependentRendering->setChecked( lyr->hasScaleBasedVisibility() );
89 mScaleRangeWidget->setScaleRange( lyr->minimumScale(), lyr->maximumScale() );
90
91 connect( mAlwaysTimeFromSourceCheckBox, &QCheckBox::stateChanged, this, [this] {
92 mTemporalDateTimeReference->setEnabled( !mAlwaysTimeFromSourceCheckBox->isChecked() );
93 if ( mAlwaysTimeFromSourceCheckBox->isChecked() )
94 reloadTemporalProperties();
95 } );
96
97 mComboBoxTemporalDatasetMatchingMethod->addItem( tr( "Find Closest Dataset Before Requested Time" ), QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetBeforeStartRangeTime );
98 mComboBoxTemporalDatasetMatchingMethod->addItem( tr( "Find Closest Dataset From Requested Time (After or Before)" ), QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetFromStartRangeTime );
99
100 QVBoxLayout *labelingLayout = nullptr;
101
102 if ( mMeshLayer->contains( QgsMesh::ElementType::Face ) )
103 {
104 // Create the Labeling dialog tab
105 labelingLayout = new QVBoxLayout( labelingFrame );
106 labelingLayout->setContentsMargins( 0, 0, 0, 0 );
107 mLabelingDialog = new QgsMeshLabelingWidget( mMeshLayer, mCanvas, labelingFrame );
108 mLabelingDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
109 labelingLayout->addWidget( mLabelingDialog );
110 labelingFrame->setLayout( labelingLayout );
111 }
112 else
113 {
114 mLabelingDialog = nullptr;
115 mOptsPage_Labels->setEnabled( false ); // disable labeling item
116 }
117
118 QVBoxLayout *metadataLayout = new QVBoxLayout( metadataFrame );
119 metadataLayout->setContentsMargins( 0, 0, 0, 0 );
120 metadataFrame->setContentsMargins( 0, 0, 0, 0 );
121 mMetadataWidget = new QgsMetadataWidget( this, mMeshLayer );
122 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
123 mMetadataWidget->setMapCanvas( mCanvas );
124 metadataLayout->addWidget( mMetadataWidget );
125 metadataFrame->setLayout( metadataLayout );
126 mOptsPage_Metadata->setContentsMargins( 0, 0, 0, 0 );
127 mBackupCrs = mMeshLayer->crs();
128
129 mTemporalDateTimeStart->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
130 mTemporalDateTimeEnd->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
131 mTemporalDateTimeReference->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
132
133 setMetadataWidget( mMetadataWidget, mOptsPage_Metadata );
134
135 // update based on lyr's current state
136 syncToLayer();
137
138 QgsSettings settings;
139 // if dialog hasn't been opened/closed yet, default to Styles tab, which is used most often
140 // this will be read by restoreOptionsBaseUi()
141 if ( !settings.contains( QStringLiteral( "/Windows/MeshLayerProperties/tab" ) ) )
142 {
143 settings.setValue( QStringLiteral( "Windows/MeshLayerProperties/tab" ), mOptStackedWidget->indexOf( mOptsPage_Style ) );
144 }
145
146 //Add help page references
147 mOptsPage_Information->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#information-properties" ) );
148 mOptsPage_Source->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#source-properties" ) );
149 mOptsPage_Style->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#symbology-properties" ) );
150 mOptsPage_Rendering->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#rendering-properties" ) );
151 mOptsPage_Temporal->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#temporal-properties" ) );
152 mOptsPage_Metadata->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#metadata-properties" ) );
153
154 mBtnStyle = new QPushButton( tr( "Style" ) );
155 QMenu *menuStyle = new QMenu( this );
156 menuStyle->addAction( tr( "Load Style…" ), this, &QgsMeshLayerProperties::loadStyleFromFile );
157 menuStyle->addAction( tr( "Save Style…" ), this, &QgsMeshLayerProperties::saveStyleToFile );
158 menuStyle->addSeparator();
159 menuStyle->addAction( tr( "Save as Default" ), this, &QgsMeshLayerProperties::saveStyleAsDefault );
160 menuStyle->addAction( tr( "Restore Default" ), this, &QgsMeshLayerProperties::loadDefaultStyle );
161 mBtnStyle->setMenu( menuStyle );
162 connect( menuStyle, &QMenu::aboutToShow, this, &QgsMeshLayerProperties::aboutToShowStyleMenu );
163
164 buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );
165
166 mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
167 QMenu *menuMetadata = new QMenu( this );
168 mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, &QgsMeshLayerProperties::loadMetadataFromFile );
169 mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, &QgsMeshLayerProperties::saveMetadataToFile );
170 mBtnMetadata->setMenu( menuMetadata );
171 buttonBox->addButton( mBtnMetadata, QDialogButtonBox::ResetRole );
172
173 initialize();
174}
175
177{
178 Q_ASSERT( mRendererMeshPropertiesWidget );
179
180 QgsDebugMsgLevel( QStringLiteral( "populate general information tab" ), 4 );
181 /*
182 * Information Tab
183 */
184 QString myStyle = QgsApplication::reportStyleSheet();
185 myStyle.append( QStringLiteral( "body { margin: 10px; }\n " ) );
186 mInformationTextBrowser->clear();
187 mInformationTextBrowser->document()->setDefaultStyleSheet( myStyle );
188 mInformationTextBrowser->setHtml( mMeshLayer->htmlMetadata() );
189 mInformationTextBrowser->setOpenLinks( false );
190 connect( mInformationTextBrowser, &QTextBrowser::anchorClicked, this, &QgsMeshLayerProperties::openUrl );
191
192 QgsDebugMsgLevel( QStringLiteral( "populate source tab" ), 4 );
193 /*
194 * Source Tab
195 */
196 mLayerOrigNameLineEd->setText( mMeshLayer->name() );
197 whileBlocking( mCrsSelector )->setCrs( mMeshLayer->crs() );
198
199 mDatasetGroupTreeWidget->syncToLayer( mMeshLayer );
200
201 QgsDebugMsgLevel( QStringLiteral( "populate config tab" ), 4 );
202 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
203 w->syncToLayer( mMeshLayer );
204
205 QgsDebugMsgLevel( QStringLiteral( "populate rendering tab" ), 4 );
206 if ( mMeshLayer->isEditable() )
207 mSimplifyMeshGroupBox->setEnabled( false );
208
209 QgsMeshSimplificationSettings simplifySettings = mMeshLayer->meshSimplificationSettings();
210 mSimplifyMeshGroupBox->setChecked( simplifySettings.isEnabled() );
211 mSimplifyReductionFactorSpinBox->setValue( simplifySettings.reductionFactor() );
212 mSimplifyMeshResolutionSpinBox->setValue( simplifySettings.meshResolution() );
213
214 QgsDebugMsgLevel( QStringLiteral( "populate temporal tab" ), 4 );
215 const QgsMeshLayerTemporalProperties *temporalProperties = qobject_cast<const QgsMeshLayerTemporalProperties *>( mMeshLayer->temporalProperties() );
216 whileBlocking( mTemporalDateTimeReference )->setDateTime( temporalProperties->referenceTime() );
217 const QgsDateTimeRange timeRange = temporalProperties->timeExtent();
218 mTemporalDateTimeStart->setDateTime( timeRange.begin() );
219 mTemporalDateTimeEnd->setDateTime( timeRange.end() );
220 if ( mMeshLayer->dataProvider() )
221 {
222 mTemporalProviderTimeUnitComboBox->setCurrentIndex(
223 mTemporalProviderTimeUnitComboBox->findData( static_cast<int>( mMeshLayer->dataProvider()->temporalCapabilities()->temporalUnit() ) )
224 );
225 }
226 mAlwaysTimeFromSourceCheckBox->setChecked( temporalProperties->alwaysLoadReferenceTimeFromSource() );
227 mComboBoxTemporalDatasetMatchingMethod->setCurrentIndex(
228 mComboBoxTemporalDatasetMatchingMethod->findData( temporalProperties->matchingMethod() )
229 );
230
231 mStaticDatasetWidget->syncToLayer();
232 mStaticDatasetGroupBox->setChecked( !mMeshLayer->temporalProperties()->isActive() );
233}
234
239
244
249
251{
252 Q_ASSERT( mRendererMeshPropertiesWidget );
253
254 QgsDebugMsgLevel( QStringLiteral( "processing general tab" ), 4 );
255 /*
256 * General Tab
257 */
258 mMeshLayer->setName( mLayerOrigNameLineEd->text() );
259
260 QgsDebugMsgLevel( QStringLiteral( "processing source tab" ), 4 );
261 /*
262 * Source Tab
263 */
264 mDatasetGroupTreeWidget->apply();
265
266 QgsDebugMsgLevel( QStringLiteral( "processing config tabs" ), 4 );
267
268 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
269 w->apply();
270
271 QgsDebugMsgLevel( QStringLiteral( "processing rendering tab" ), 4 );
272 /*
273 * Rendering Tab
274 */
275 QgsMeshSimplificationSettings simplifySettings;
276 simplifySettings.setEnabled( mSimplifyMeshGroupBox->isChecked() );
277 simplifySettings.setReductionFactor( mSimplifyReductionFactorSpinBox->value() );
278 simplifySettings.setMeshResolution( mSimplifyMeshResolutionSpinBox->value() );
279 bool needMeshUpdating = ( ( simplifySettings.isEnabled() != mMeshLayer->meshSimplificationSettings().isEnabled() ) || ( simplifySettings.reductionFactor() != mMeshLayer->meshSimplificationSettings().reductionFactor() ) );
280
281 mMeshLayer->setMeshSimplificationSettings( simplifySettings );
282
283 mMeshLayer->setScaleBasedVisibility( chkUseScaleDependentRendering->isChecked() );
284 mMeshLayer->setMinimumScale( mScaleRangeWidget->minimumScale() );
285 mMeshLayer->setMaximumScale( mScaleRangeWidget->maximumScale() );
286
287 QgsDebugMsgLevel( QStringLiteral( "processing labeling tab" ), 4 );
288 /*
289 * Labeling Tab
290 */
291 if ( mLabelingDialog )
292 {
293 mLabelingDialog->writeSettingsToLayer();
294 }
295
296 QgsDebugMsgLevel( QStringLiteral( "processing temporal tab" ), 4 );
297 /*
298 * Temporal Tab
299 */
300
301 mMeshLayer->setReferenceTime( mTemporalDateTimeReference->dateTime() );
302 if ( mMeshLayer->dataProvider() )
303 mMeshLayer->dataProvider()->setTemporalUnit(
304 static_cast<Qgis::TemporalUnit>( mTemporalProviderTimeUnitComboBox->currentData().toInt() )
305 );
306
307 mStaticDatasetWidget->apply();
308 bool needEmitRendererChanged = mMeshLayer->temporalProperties()->isActive() == mStaticDatasetGroupBox->isChecked();
309 mMeshLayer->temporalProperties()->setIsActive( !mStaticDatasetGroupBox->isChecked() );
311 mComboBoxTemporalDatasetMatchingMethod->currentData().toInt()
312 ) );
313 static_cast<QgsMeshLayerTemporalProperties *>(
314 mMeshLayer->temporalProperties()
315 )
316 ->setAlwaysLoadReferenceTimeFromSource( mAlwaysTimeFromSourceCheckBox->isChecked() );
317
318 mMetadataWidget->acceptMetadata();
319
320 mBackupCrs = mMeshLayer->crs();
321
322 if ( needMeshUpdating )
323 mMeshLayer->reload();
324
325 if ( needEmitRendererChanged )
326 emit mMeshLayer->rendererChanged();
327
328 //make sure the layer is redrawn
329 mMeshLayer->triggerRepaint();
330
331 // notify the project we've made a change
333
334 // Resync what have to be resync (widget that can be changed by other properties part)
335 mStaticDatasetWidget->syncToLayer();
336 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
337 w->syncToLayer( mMeshLayer );
338}
339
340void QgsMeshLayerProperties::changeCrs( const QgsCoordinateReferenceSystem &crs )
341{
342 QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mCanvas, tr( "Select Transformation" ) );
343 mMeshLayer->setCrs( crs );
344}
345
346void QgsMeshLayerProperties::syncAndRepaint()
347{
348 syncToLayer();
349 mMeshLayer->triggerRepaint();
350}
351
352void QgsMeshLayerProperties::showHelp()
353{
354 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( "helpPage" );
355
356 if ( helpPage.isValid() )
357 {
358 QgsHelp::openHelp( helpPage.toString() );
359 }
360 else
361 {
362 QgsHelp::openHelp( QStringLiteral( "working_with_mesh/mesh_properties.html" ) );
363 }
364}
365
366void QgsMeshLayerProperties::aboutToShowStyleMenu()
367{
368 QMenu *m = qobject_cast<QMenu *>( sender() );
369
371 // re-add style manager actions!
372 m->addSeparator();
374}
375
376void QgsMeshLayerProperties::reloadTemporalProperties()
377{
378 if ( !mMeshLayer->dataProvider() )
379 return;
380 QgsMeshDataProviderTemporalCapabilities *temporalCapabalities = mMeshLayer->dataProvider()->temporalCapabilities();
381 QgsDateTimeRange timeExtent;
382 QDateTime referenceTime = temporalCapabalities->referenceTime();
383 if ( referenceTime.isValid() )
384 {
385 timeExtent = temporalCapabalities->timeExtent();
386 whileBlocking( mTemporalDateTimeReference )->setDateTime( referenceTime );
387 }
388 else
389 // The reference time already here is used again to define the time extent
390 timeExtent = temporalCapabalities->timeExtent( mTemporalDateTimeReference->dateTime() );
391
392 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
393 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
394}
395
396void QgsMeshLayerProperties::onTimeReferenceChange()
397{
398 if ( !mMeshLayer->dataProvider() )
399 return;
400 const QgsDateTimeRange &timeExtent = mMeshLayer->dataProvider()->temporalCapabilities()->timeExtent( mTemporalDateTimeReference->dateTime() );
401 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
402 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
403}
404
406{
407 if ( mBackupCrs != mMeshLayer->crs() )
408 mMeshLayer->setCrs( mBackupCrs );
409
411}
TemporalUnit
Temporal units.
Definition qgis.h:4886
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...
This class represents a coordinate reference system (CRS).
static bool run(const QgsCoordinateReferenceSystem &sourceCrs=QgsCoordinateReferenceSystem(), const QgsCoordinateReferenceSystem &destinationCrs=QgsCoordinateReferenceSystem(), QWidget *parent=nullptr, QgsMapCanvas *mapCanvas=nullptr, const QString &windowTitle=QString())
Runs the dialog (if required) prompting for the desired transform to use from sourceCrs to destinatio...
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition qgshelp.cpp:39
Base class for "layer properties" dialogs, containing common utilities for handling functionality in ...
QPushButton * mBtnStyle
Style button.
void saveMetadataToFile()
Allows the user to save the layer's metadata as a file.
virtual void rollback()
Rolls back changes made to the layer.
void saveStyleAsDefault()
Saves the current layer style as the default for the layer.
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
void setMetadataWidget(QgsMetadataWidget *widget, QWidget *page)
Sets the metadata widget and page associated with the dialog.
void loadDefaultStyle()
Reloads the default style for the layer.
void saveStyleToFile()
Allows the user to save the layer's style to a file.
QgsMapCanvas * mCanvas
Associated map canvas.
void loadMetadataFromFile()
Allows the user to load layer metadata from a file.
void loadStyleFromFile()
Allows the user to load layer style from a file.
QPushButton * mBtnMetadata
Metadata button.
void initialize()
Initialize the dialog.
void openUrl(const QUrl &url)
Handles opening a url from the dialog.
Map canvas is a class for displaying all GIS data types on a canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
A panel widget that can be shown in the map style dock.
void removesExtraMenuSeparators(QMenu *m)
removes extra separators from the menu
void addStyleManagerActions(QMenu *m, QgsMapLayer *layer)
adds actions to the menu in accordance to the layer
static QgsMapLayerStyleGuiUtils * instance()
returns a singleton instance of this class
void currentStyleChanged(const QString &currentName)
Emitted when the current style has been changed.
Base class for all map layer types.
Definition qgsmaplayer.h:76
QString name
Definition qgsmaplayer.h:80
void setMinimumScale(double scale)
Sets the minimum map scale (i.e.
QgsCoordinateReferenceSystem crs
Definition qgsmaplayer.h:83
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
void setMaximumScale(double scale)
Sets the maximum map scale (i.e.
void rendererChanged()
Signal emitted when renderer is changed.
void setScaleBasedVisibility(bool enabled)
Sets whether scale based visibility is enabled for the layer.
bool hasScaleBasedVisibility() const
Returns whether scale based visibility is enabled for the layer.
void dataChanged()
Data of layer changed.
void setName(const QString &name)
Set the display name of the layer.
double minimumScale() const
Returns the minimum map scale (i.e.
QgsMapLayerStyleManager * styleManager() const
Gets access to the layer's style manager.
double maximumScale() const
Returns the maximum map scale (i.e.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
Class for handling properties relating to a mesh data provider's temporal capabilities.
QDateTime referenceTime() const
Returns the reference time.
QgsDateTimeRange timeExtent() const
Returns the time extent using the internal reference time and the first and last times available from...
Qgis::TemporalUnit temporalUnit() const
Returns the temporal unit used to read data by the data provider.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
@ FindClosestDatasetFromStartRangeTime
Finds the closest dataset which have its time before the requested start range time.
void setTemporalUnit(Qgis::TemporalUnit unit)
Sets the temporal unit of the provider and reload data if it changes.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
void datasetGroupsChanged()
Emitted when dataset groups changed (addition or removal)
Master widget for configuration of labeling of a mesh layer.
void writeSettingsToLayer()
save config to layer
Q_DECL_DEPRECATED void saveStyleAs() SIP_DEPRECATED
Saves a style when appriate button is pressed.
Q_DECL_DEPRECATED void saveDefaultStyle() SIP_DEPRECATED
Saves the default style when appropriate button is pressed.
Q_DECL_DEPRECATED void loadStyle() SIP_DEPRECATED
Loads a saved style when appropriate button is pressed.
QgsMeshLayerProperties(QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent=nullptr, Qt::WindowFlags=QgsGuiUtils::ModalDialogFlags)
Constructor.
Implementation of map layer temporal properties for mesh layers.
QDateTime referenceTime() const
Returns the reference time.
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod() const
Returns the method used to match dataset from temporal capabilities.
bool alwaysLoadReferenceTimeFromSource() const
Returns whether the time proporties are automatically reloaded from provider when project is opened o...
QgsDateTimeRange timeExtent() const
Returns the time extent.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void setMeshSimplificationSettings(const QgsMeshSimplificationSettings &meshSimplificationSettings)
Sets mesh simplification settings.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
void activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
void reload() override
Synchronises with changes in the datasource.
QString htmlMetadata() const override
Obtain a formatted HTML string containing assorted metadata for this layer.
QgsMeshSimplificationSettings meshSimplificationSettings() const
Returns mesh simplification settings.
bool isEditable() const override
Returns true if the layer can be edited.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
void setReferenceTime(const QDateTime &referenceTime)
Sets the reference time of the layer.
void setTemporalMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match the temporal dataset from a requested time, see activeVectorDatasetAtTi...
Represents an overview renderer settings.
void setMeshResolution(int meshResolution)
Sets the mesh resolution i.e., the minimum size (average) of triangles in pixels This value is used d...
void setEnabled(bool isEnabled)
Sets if the overview is active.
double reductionFactor() const
Returns the reduction factor used to build simplified mesh.
bool isEnabled() const
Returns if the overview is active.
int meshResolution() const
Returns the mesh resolution i.e., the minimum size (average) of triangles in pixels.
void setReductionFactor(double value)
Sets the reduction factor used to build simplified mesh.
void setScalarDatasetGroup(int index)
Sets the scalar dataset group.
void setVectorDatasetGroup(int index)
Sets the vector dataset group.
A wizard to edit metadata on a map layer.
void acceptMetadata()
Saves the metadata to the layer.
void setMapCanvas(QgsMapCanvas *canvas)
Sets a map canvas associated with the widget.
QStackedWidget * mOptStackedWidget
void initOptionsBase(bool restoreUi=true, const QString &title=QString())
Set up the base ui connections for vertical tabs.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void setDirty(bool b=true)
Flag the project as dirty (modified).
void crsChanged(const QgsCoordinateReferenceSystem &crs)
Emitted when the selected CRS is changed.
Widget for renderer properties of the mesh, contours (scalars) and vectors data associated with the m...
This class is a composition of two QSettings instances:
Definition qgssettings.h:64
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
bool isActive() const
Returns true if the temporal property is active.
void setIsActive(bool active)
Sets whether the temporal property is active.
bool isTemporal() const
Returns true if the object's temporal range is enabled, and the object will be filtered when renderin...
T begin() const
Returns the beginning of the range.
Definition qgsrange.h:444
T end() const
Returns the upper bound of the range.
Definition qgsrange.h:451
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:5970
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:39
const QgsCoordinateReferenceSystem & crs