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