QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
19
20#include <limits>
21#include <typeinfo>
22
23#include "qgsapplication.h"
25#include "qgshelp.h"
26#include "qgslogger.h"
27#include "qgsmapcanvas.h"
28#include "qgsmaplayerlegend.h"
32#include "qgsmeshlayer.h"
35#include "qgsmetadatawidget.h"
36#include "qgsproject.h"
38#include "qgssettings.h"
39
40#include <QDesktopServices>
41#include <QFileDialog>
42#include <QMessageBox>
43
44#include "moc_qgsmeshlayerproperties.cpp"
45
46QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent, Qt::WindowFlags fl )
47 : QgsLayerPropertiesDialog( lyr, canvas, QStringLiteral( "MeshLayerProperties" ), parent, fl )
48 , mMeshLayer( qobject_cast<QgsMeshLayer *>( lyr ) )
49{
50 Q_ASSERT( mMeshLayer );
51
52 setupUi( this );
53 mRendererMeshPropertiesWidget = new QgsRendererMeshPropertiesWidget( mMeshLayer, canvas, this );
54 mConfigWidgets << mRendererMeshPropertiesWidget;
55 mOptsPage_StyleContent->layout()->addWidget( mRendererMeshPropertiesWidget );
56
57 mSimplifyReductionFactorSpinBox->setClearValue( 10.0 );
58 mSimplifyMeshResolutionSpinBox->setClearValue( 5 );
59
60 mStaticDatasetWidget->setLayer( mMeshLayer );
61 mIsMapSettingsTemporal = mMeshLayer && canvas && canvas->mapSettings().isTemporal();
62
63 mTemporalProviderTimeUnitComboBox->addItem( tr( "Seconds" ), static_cast<int>( Qgis::TemporalUnit::Seconds ) );
64 mTemporalProviderTimeUnitComboBox->addItem( tr( "Minutes" ), static_cast<int>( Qgis::TemporalUnit::Minutes ) );
65 mTemporalProviderTimeUnitComboBox->addItem( tr( "Hours" ), static_cast<int>( Qgis::TemporalUnit::Hours ) );
66 mTemporalProviderTimeUnitComboBox->addItem( tr( "Days" ), static_cast<int>( Qgis::TemporalUnit::Days ) );
67
68 connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsMeshLayerProperties::changeCrs );
70
71 // QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
72 // switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
73 // and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
74 initOptionsBase( false );
75
76 connect( lyr->styleManager(), &QgsMapLayerStyleManager::currentStyleChanged, this, &QgsMeshLayerProperties::syncAndRepaint );
77
78 connect( this, &QDialog::accepted, this, &QgsMeshLayerProperties::apply );
79 connect( this, &QDialog::rejected, this, &QgsMeshLayerProperties::rollback );
80 connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsMeshLayerProperties::apply );
81
82 connect( mMeshLayer, &QgsMeshLayer::dataChanged, this, &QgsMeshLayerProperties::syncAndRepaint );
83 connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMeshLayerProperties::showHelp );
84
85 connect( mTemporalReloadButton, &QPushButton::clicked, this, &QgsMeshLayerProperties::reloadTemporalProperties );
86 connect( mTemporalDateTimeReference, &QDateTimeEdit::dateTimeChanged, this, &QgsMeshLayerProperties::onTimeReferenceChange );
89
90 mScaleRangeWidget->setMapCanvas( mCanvas );
91 chkUseScaleDependentRendering->setChecked( lyr->hasScaleBasedVisibility() );
92 mScaleRangeWidget->setScaleRange( lyr->minimumScale(), lyr->maximumScale() );
93
94 connect( mAlwaysTimeFromSourceCheckBox, &QCheckBox::stateChanged, this, [this] {
95 mTemporalDateTimeReference->setEnabled( !mAlwaysTimeFromSourceCheckBox->isChecked() );
96 if ( mAlwaysTimeFromSourceCheckBox->isChecked() )
97 reloadTemporalProperties();
98 } );
99
100 mComboBoxTemporalDatasetMatchingMethod->addItem( tr( "Find Closest Dataset Before Requested Time" ), QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetBeforeStartRangeTime );
101 mComboBoxTemporalDatasetMatchingMethod->addItem( tr( "Find Closest Dataset From Requested Time (After or Before)" ), QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetFromStartRangeTime );
102
103 QVBoxLayout *labelingLayout = nullptr;
104
105 if ( mMeshLayer->contains( QgsMesh::ElementType::Face ) )
106 {
107 // Create the Labeling dialog tab
108 labelingLayout = new QVBoxLayout( labelingFrame );
109 labelingLayout->setContentsMargins( 0, 0, 0, 0 );
110 mLabelingDialog = new QgsMeshLabelingWidget( mMeshLayer, mCanvas, labelingFrame );
111 mLabelingDialog->layout()->setContentsMargins( 0, 0, 0, 0 );
112 labelingLayout->addWidget( mLabelingDialog );
113 labelingFrame->setLayout( labelingLayout );
114 }
115 else
116 {
117 mLabelingDialog = nullptr;
118 mOptsPage_Labels->setEnabled( false ); // disable labeling item
119 }
120
121 QVBoxLayout *metadataLayout = new QVBoxLayout( metadataFrame );
122 metadataLayout->setContentsMargins( 0, 0, 0, 0 );
123 metadataFrame->setContentsMargins( 0, 0, 0, 0 );
124 mMetadataWidget = new QgsMetadataWidget( this, mMeshLayer );
125 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
126 mMetadataWidget->setMapCanvas( mCanvas );
127 metadataLayout->addWidget( mMetadataWidget );
128 metadataFrame->setLayout( metadataLayout );
129 mOptsPage_Metadata->setContentsMargins( 0, 0, 0, 0 );
130 mBackupCrs = mMeshLayer->crs();
131
132 mTemporalDateTimeStart->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
133 mTemporalDateTimeEnd->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
134 mTemporalDateTimeReference->setDisplayFormat( "yyyy-MM-dd HH:mm:ss" );
135
136 setMetadataWidget( mMetadataWidget, mOptsPage_Metadata );
137
138 // update based on lyr's current state
139 syncToLayer();
140
141 QgsSettings settings;
142 // if dialog hasn't been opened/closed yet, default to Styles tab, which is used most often
143 // this will be read by restoreOptionsBaseUi()
144 if ( !settings.contains( QStringLiteral( "/Windows/MeshLayerProperties/tab" ) ) )
145 {
146 settings.setValue( QStringLiteral( "Windows/MeshLayerProperties/tab" ), mOptStackedWidget->indexOf( mOptsPage_Style ) );
147 }
148
149 //Add help page references
150 mOptsPage_Information->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#information-properties" ) );
151 mOptsPage_Source->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#source-properties" ) );
152 mOptsPage_Style->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#symbology-properties" ) );
153 mOptsPage_Rendering->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#rendering-properties" ) );
154 mOptsPage_Temporal->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#temporal-properties" ) );
155 mOptsPage_Metadata->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#metadata-properties" ) );
156
157 mBtnStyle = new QPushButton( tr( "Style" ) );
158 QMenu *menuStyle = new QMenu( this );
159 menuStyle->addAction( tr( "Load Style…" ), this, &QgsMeshLayerProperties::loadStyleFromFile );
160 menuStyle->addAction( tr( "Save Style…" ), this, &QgsMeshLayerProperties::saveStyleToFile );
161 menuStyle->addSeparator();
162 menuStyle->addAction( tr( "Save as Default" ), this, &QgsMeshLayerProperties::saveStyleAsDefault );
163 menuStyle->addAction( tr( "Restore Default" ), this, &QgsMeshLayerProperties::loadDefaultStyle );
164 mBtnStyle->setMenu( menuStyle );
165 connect( menuStyle, &QMenu::aboutToShow, this, &QgsMeshLayerProperties::aboutToShowStyleMenu );
166
167 buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );
168
169 mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
170 QMenu *menuMetadata = new QMenu( this );
171 mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, &QgsMeshLayerProperties::loadMetadataFromFile );
172 mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, &QgsMeshLayerProperties::saveMetadataToFile );
173 mBtnMetadata->setMenu( menuMetadata );
174 buttonBox->addButton( mBtnMetadata, QDialogButtonBox::ResetRole );
175
176 initialize();
177}
178
180{
181 Q_ASSERT( mRendererMeshPropertiesWidget );
182
183 QgsDebugMsgLevel( QStringLiteral( "populate general information tab" ), 4 );
184 /*
185 * Information Tab
186 */
187 QString myStyle = QgsApplication::reportStyleSheet();
188 myStyle.append( QStringLiteral( "body { margin: 10px; }\n " ) );
189 mInformationTextBrowser->clear();
190 mInformationTextBrowser->document()->setDefaultStyleSheet( myStyle );
191 mInformationTextBrowser->setHtml( mMeshLayer->htmlMetadata() );
192 mInformationTextBrowser->setOpenLinks( false );
193 connect( mInformationTextBrowser, &QTextBrowser::anchorClicked, this, &QgsMeshLayerProperties::openUrl );
194
195 QgsDebugMsgLevel( QStringLiteral( "populate source tab" ), 4 );
196 /*
197 * Source Tab
198 */
199 mLayerOrigNameLineEd->setText( mMeshLayer->name() );
200 whileBlocking( mCrsSelector )->setCrs( mMeshLayer->crs() );
201
202 mDatasetGroupTreeWidget->syncToLayer( mMeshLayer );
203
204 QgsDebugMsgLevel( QStringLiteral( "populate config tab" ), 4 );
205 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
206 w->syncToLayer( mMeshLayer );
207
208 QgsDebugMsgLevel( QStringLiteral( "populate rendering tab" ), 4 );
209 if ( mMeshLayer->isEditable() )
210 mSimplifyMeshGroupBox->setEnabled( false );
211
212 QgsMeshSimplificationSettings simplifySettings = mMeshLayer->meshSimplificationSettings();
213 mSimplifyMeshGroupBox->setChecked( simplifySettings.isEnabled() );
214 mSimplifyReductionFactorSpinBox->setValue( simplifySettings.reductionFactor() );
215 mSimplifyMeshResolutionSpinBox->setValue( simplifySettings.meshResolution() );
216
217 QgsDebugMsgLevel( QStringLiteral( "populate temporal tab" ), 4 );
218 const QgsMeshLayerTemporalProperties *temporalProperties = qobject_cast<const QgsMeshLayerTemporalProperties *>( mMeshLayer->temporalProperties() );
219 whileBlocking( mTemporalDateTimeReference )->setDateTime( temporalProperties->referenceTime() );
220 const QgsDateTimeRange timeRange = temporalProperties->timeExtent();
221 mTemporalDateTimeStart->setDateTime( timeRange.begin() );
222 mTemporalDateTimeEnd->setDateTime( timeRange.end() );
223 if ( mMeshLayer->dataProvider() )
224 {
225 mTemporalProviderTimeUnitComboBox->setCurrentIndex(
226 mTemporalProviderTimeUnitComboBox->findData( static_cast<int>( mMeshLayer->dataProvider()->temporalCapabilities()->temporalUnit() ) )
227 );
228 }
229 mAlwaysTimeFromSourceCheckBox->setChecked( temporalProperties->alwaysLoadReferenceTimeFromSource() );
230 mComboBoxTemporalDatasetMatchingMethod->setCurrentIndex(
231 mComboBoxTemporalDatasetMatchingMethod->findData( temporalProperties->matchingMethod() )
232 );
233
234 mStaticDatasetWidget->syncToLayer();
235 mStaticDatasetGroupBox->setChecked( !mMeshLayer->temporalProperties()->isActive() );
236
237 // legend
238 mLegendConfigEmbeddedWidget->setLayer( mMeshLayer );
239 mIncludeByDefaultInLayoutLegendsCheck->setChecked( mMeshLayer->legend() && !mMeshLayer->legend()->flags().testFlag( Qgis::MapLayerLegendFlag::ExcludeByDefault ) );
240}
241
246
251
256
258{
259 Q_ASSERT( mRendererMeshPropertiesWidget );
260
261 mLegendConfigEmbeddedWidget->applyToLayer();
262
263 QgsDebugMsgLevel( QStringLiteral( "processing general tab" ), 4 );
264 /*
265 * General Tab
266 */
267 mMeshLayer->setName( mLayerOrigNameLineEd->text() );
268
269 QgsDebugMsgLevel( QStringLiteral( "processing source tab" ), 4 );
270 /*
271 * Source Tab
272 */
273 mDatasetGroupTreeWidget->apply();
274
275 QgsDebugMsgLevel( QStringLiteral( "processing config tabs" ), 4 );
276
277 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
278 w->apply();
279
280
281 QgsDebugMsgLevel( QStringLiteral( "processing rendering tab" ), 4 );
282 /*
283 * Rendering Tab
284 */
285 QgsMeshSimplificationSettings simplifySettings;
286 simplifySettings.setEnabled( mSimplifyMeshGroupBox->isChecked() );
287 simplifySettings.setReductionFactor( mSimplifyReductionFactorSpinBox->value() );
288 simplifySettings.setMeshResolution( mSimplifyMeshResolutionSpinBox->value() );
289 bool needMeshUpdating = ( ( simplifySettings.isEnabled() != mMeshLayer->meshSimplificationSettings().isEnabled() ) || ( simplifySettings.reductionFactor() != mMeshLayer->meshSimplificationSettings().reductionFactor() ) );
290
291 mMeshLayer->setMeshSimplificationSettings( simplifySettings );
292
293 mMeshLayer->setScaleBasedVisibility( chkUseScaleDependentRendering->isChecked() );
294 mMeshLayer->setMinimumScale( mScaleRangeWidget->minimumScale() );
295 mMeshLayer->setMaximumScale( mScaleRangeWidget->maximumScale() );
296
297 QgsDebugMsgLevel( QStringLiteral( "processing labeling tab" ), 4 );
298 /*
299 * Labeling Tab
300 */
301 if ( mLabelingDialog )
302 {
303 mLabelingDialog->writeSettingsToLayer();
304 }
305
306 QgsDebugMsgLevel( QStringLiteral( "processing temporal tab" ), 4 );
307 /*
308 * Temporal Tab
309 */
310
311 mMeshLayer->setReferenceTime( mTemporalDateTimeReference->dateTime() );
312 if ( mMeshLayer->dataProvider() )
313 mMeshLayer->dataProvider()->setTemporalUnit(
314 static_cast<Qgis::TemporalUnit>( mTemporalProviderTimeUnitComboBox->currentData().toInt() )
315 );
316
317 mStaticDatasetWidget->apply();
318 bool needEmitRendererChanged = mMeshLayer->temporalProperties()->isActive() == mStaticDatasetGroupBox->isChecked();
319 mMeshLayer->temporalProperties()->setIsActive( !mStaticDatasetGroupBox->isChecked() );
320 mMeshLayer->setTemporalMatchingMethod( static_cast<QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod>(
321 mComboBoxTemporalDatasetMatchingMethod->currentData().toInt()
322 ) );
323 static_cast<QgsMeshLayerTemporalProperties *>(
324 mMeshLayer->temporalProperties()
325 )
326 ->setAlwaysLoadReferenceTimeFromSource( mAlwaysTimeFromSourceCheckBox->isChecked() );
327
328 mMetadataWidget->acceptMetadata();
329
330 mBackupCrs = mMeshLayer->crs();
331
332 if ( needMeshUpdating )
333 mMeshLayer->reload();
334
335 if ( needEmitRendererChanged )
336 emit mMeshLayer->rendererChanged();
337
338 // legend
339 if ( QgsMapLayerLegend *legend = mMeshLayer->legend() )
340 {
341 legend->setFlag( Qgis::MapLayerLegendFlag::ExcludeByDefault, !mIncludeByDefaultInLayoutLegendsCheck->isChecked() );
342 }
343
344 //make sure the layer is redrawn
345 mMeshLayer->triggerRepaint();
346
347 // notify the project we've made a change
349
350 // Resync what have to be resync (widget that can be changed by other properties part)
351 mStaticDatasetWidget->syncToLayer();
352 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
353 w->syncToLayer( mMeshLayer );
354}
355
356void QgsMeshLayerProperties::changeCrs( const QgsCoordinateReferenceSystem &crs )
357{
358 QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mCanvas, tr( "Select Transformation" ) );
359 mMeshLayer->setCrs( crs );
360}
361
362void QgsMeshLayerProperties::syncAndRepaint()
363{
364 syncToLayer();
365 mMeshLayer->triggerRepaint();
366}
367
368void QgsMeshLayerProperties::showHelp()
369{
370 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( "helpPage" );
371
372 if ( helpPage.isValid() )
373 {
374 QgsHelp::openHelp( helpPage.toString() );
375 }
376 else
377 {
378 QgsHelp::openHelp( QStringLiteral( "working_with_mesh/mesh_properties.html" ) );
379 }
380}
381
382void QgsMeshLayerProperties::aboutToShowStyleMenu()
383{
384 QMenu *m = qobject_cast<QMenu *>( sender() );
385
387 // re-add style manager actions!
388 m->addSeparator();
390}
391
392void QgsMeshLayerProperties::reloadTemporalProperties()
393{
394 if ( !mMeshLayer->dataProvider() )
395 return;
396 QgsMeshDataProviderTemporalCapabilities *temporalCapabalities = mMeshLayer->dataProvider()->temporalCapabilities();
397 QgsDateTimeRange timeExtent;
398 QDateTime referenceTime = temporalCapabalities->referenceTime();
399 if ( referenceTime.isValid() )
400 {
401 timeExtent = temporalCapabalities->timeExtent();
402 whileBlocking( mTemporalDateTimeReference )->setDateTime( referenceTime );
403 }
404 else
405 // The reference time already here is used again to define the time extent
406 timeExtent = temporalCapabalities->timeExtent( mTemporalDateTimeReference->dateTime() );
407
408 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
409 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
410}
411
412void QgsMeshLayerProperties::onTimeReferenceChange()
413{
414 if ( !mMeshLayer->dataProvider() )
415 return;
416 const QgsDateTimeRange &timeExtent = mMeshLayer->dataProvider()->temporalCapabilities()->timeExtent( mTemporalDateTimeReference->dateTime() );
417 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
418 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
419}
420
422{
423 if ( mBackupCrs != mMeshLayer->crs() )
424 mMeshLayer->setCrs( mBackupCrs );
425
427}
TemporalUnit
Temporal units.
Definition qgis.h:5159
@ Hours
Hours.
Definition qgis.h:5163
@ Seconds
Seconds.
Definition qgis.h:5161
@ Minutes
Minutes.
Definition qgis.h:5162
@ ExcludeByDefault
If set, the layer should not be included in legends by default, and must be manually added by a user.
Definition qgis.h:4555
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...
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:38
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.
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
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.
An abstract interface for implementations of legends for one map layer.
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:80
bool hasScaleBasedVisibility() const
Returns whether scale based visibility is enabled for the layer.
void dataChanged()
Data of layer changed.
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.
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...
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 datasetGroupsChanged()
Emitted when dataset groups changed (addition or removal).
Master widget for configuration of labeling of a mesh 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.
void setAlwaysLoadReferenceTimeFromSource(bool autoReloadFromProvider)
Sets whether the time proporties are automatically reloaded from provider when project is opened or l...
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 activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
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.
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...
Stores settings for use within QGIS.
Definition qgssettings.h:65
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 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:446
T end() const
Returns the upper bound of the range.
Definition qgsrange.h:453
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:6511
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:61
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:761