QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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( mTemporalProviderTimeUnitComboBox->findData( static_cast<int>( mMeshLayer->dataProvider()->temporalCapabilities()->temporalUnit() ) ) );
229 }
230 mAlwaysTimeFromSourceCheckBox->setChecked( temporalProperties->alwaysLoadReferenceTimeFromSource() );
231 mComboBoxTemporalDatasetMatchingMethod->setCurrentIndex( mComboBoxTemporalDatasetMatchingMethod->findData( temporalProperties->matchingMethod() ) );
232
233 mStaticDatasetWidget->syncToLayer();
234 mStaticDatasetGroupBox->setChecked( !mMeshLayer->temporalProperties()->isActive() );
235
236 // legend
237 mLegendConfigEmbeddedWidget->setLayer( mMeshLayer );
238 mIncludeByDefaultInLayoutLegendsCheck->setChecked( mMeshLayer->legend() && !mMeshLayer->legend()->flags().testFlag( Qgis::MapLayerLegendFlag::ExcludeByDefault ) );
239}
240
245
250
255
257{
258 Q_ASSERT( mRendererMeshPropertiesWidget );
259
260 mLegendConfigEmbeddedWidget->applyToLayer();
261
262 QgsDebugMsgLevel( u"processing general tab"_s, 4 );
263 /*
264 * General Tab
265 */
266 mMeshLayer->setName( mLayerOrigNameLineEd->text() );
267
268 QgsDebugMsgLevel( u"processing source tab"_s, 4 );
269 /*
270 * Source Tab
271 */
272 mDatasetGroupTreeWidget->apply();
273
274 QgsDebugMsgLevel( u"processing config tabs"_s, 4 );
275
276 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
277 w->apply();
278
279
280 QgsDebugMsgLevel( u"processing rendering tab"_s, 4 );
281 /*
282 * Rendering Tab
283 */
284 QgsMeshSimplificationSettings simplifySettings;
285 simplifySettings.setEnabled( mSimplifyMeshGroupBox->isChecked() );
286 simplifySettings.setReductionFactor( mSimplifyReductionFactorSpinBox->value() );
287 simplifySettings.setMeshResolution( mSimplifyMeshResolutionSpinBox->value() );
288 bool needMeshUpdating
289 = ( ( 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( u"processing labeling tab"_s, 4 );
298 /*
299 * Labeling Tab
300 */
301 if ( mLabelingDialog )
302 {
303 mLabelingDialog->writeSettingsToLayer();
304 }
305
306 QgsDebugMsgLevel( u"processing temporal tab"_s, 4 );
307 /*
308 * Temporal Tab
309 */
310
311 mMeshLayer->setReferenceTime( mTemporalDateTimeReference->dateTime() );
312 if ( mMeshLayer->dataProvider() )
313 mMeshLayer->dataProvider()->setTemporalUnit( static_cast<Qgis::TemporalUnit>( mTemporalProviderTimeUnitComboBox->currentData().toInt() ) );
314
315 mStaticDatasetWidget->apply();
316 bool needEmitRendererChanged = mMeshLayer->temporalProperties()->isActive() == mStaticDatasetGroupBox->isChecked();
317 mMeshLayer->temporalProperties()->setIsActive( !mStaticDatasetGroupBox->isChecked() );
318 mMeshLayer->setTemporalMatchingMethod( static_cast<QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod>( mComboBoxTemporalDatasetMatchingMethod->currentData().toInt() ) );
319 static_cast<QgsMeshLayerTemporalProperties *>( mMeshLayer->temporalProperties() )->setAlwaysLoadReferenceTimeFromSource( mAlwaysTimeFromSourceCheckBox->isChecked() );
320
321 mMetadataWidget->acceptMetadata();
322
323 mBackupCrs = mMeshLayer->crs();
324
325 if ( needMeshUpdating )
326 mMeshLayer->reload();
327
328 if ( needEmitRendererChanged )
329 emit mMeshLayer->rendererChanged();
330
331 // legend
332 if ( QgsMapLayerLegend *legend = mMeshLayer->legend() )
333 {
334 legend->setFlag( Qgis::MapLayerLegendFlag::ExcludeByDefault, !mIncludeByDefaultInLayoutLegendsCheck->isChecked() );
335 }
336
337 //make sure the layer is redrawn
338 mMeshLayer->triggerRepaint();
339
340 // notify the project we've made a change
342
343 // Resync what have to be resync (widget that can be changed by other properties part)
344 mStaticDatasetWidget->syncToLayer();
345 for ( QgsMapLayerConfigWidget *w : std::as_const( mConfigWidgets ) )
346 w->syncToLayer( mMeshLayer );
347}
348
349void QgsMeshLayerProperties::changeCrs( const QgsCoordinateReferenceSystem &crs )
350{
351 QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mCanvas, tr( "Select Transformation" ) );
352 mMeshLayer->setCrs( crs );
353}
354
355void QgsMeshLayerProperties::syncAndRepaint()
356{
357 syncToLayer();
358 mMeshLayer->triggerRepaint();
359}
360
361void QgsMeshLayerProperties::showHelp()
362{
363 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( "helpPage" );
364
365 if ( helpPage.isValid() )
366 {
367 QgsHelp::openHelp( helpPage.toString() );
368 }
369 else
370 {
371 QgsHelp::openHelp( u"working_with_mesh/mesh_properties.html"_s );
372 }
373}
374
375void QgsMeshLayerProperties::aboutToShowStyleMenu()
376{
377 QMenu *m = qobject_cast<QMenu *>( sender() );
378
380 // re-add style manager actions!
381 m->addSeparator();
383}
384
385void QgsMeshLayerProperties::reloadTemporalProperties()
386{
387 if ( !mMeshLayer->dataProvider() )
388 return;
389 QgsMeshDataProviderTemporalCapabilities *temporalCapabalities = mMeshLayer->dataProvider()->temporalCapabilities();
390 QgsDateTimeRange timeExtent;
391 QDateTime referenceTime = temporalCapabalities->referenceTime();
392 if ( referenceTime.isValid() )
393 {
394 timeExtent = temporalCapabalities->timeExtent();
395 whileBlocking( mTemporalDateTimeReference )->setDateTime( referenceTime );
396 }
397 else
398 // The reference time already here is used again to define the time extent
399 timeExtent = temporalCapabalities->timeExtent( mTemporalDateTimeReference->dateTime() );
400
401 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
402 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
403}
404
405void QgsMeshLayerProperties::onTimeReferenceChange()
406{
407 if ( !mMeshLayer->dataProvider() )
408 return;
409 const QgsDateTimeRange &timeExtent = mMeshLayer->dataProvider()->temporalCapabilities()->timeExtent( mTemporalDateTimeReference->dateTime() );
410 mTemporalDateTimeStart->setDateTime( timeExtent.begin() );
411 mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
412}
413
415{
416 if ( mBackupCrs != mMeshLayer->crs() )
417 mMeshLayer->setCrs( mBackupCrs );
418
420}
TemporalUnit
Temporal units.
Definition qgis.h:5316
@ Hours
Hours.
Definition qgis.h:5320
@ Seconds
Seconds.
Definition qgis.h:5318
@ Minutes
Minutes.
Definition qgis.h:5319
@ ExcludeByDefault
If set, the layer should not be included in legends by default, and must be manually added by a user.
Definition qgis.h:4699
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:408
T end() const
Returns the upper bound of the range.
Definition qgsrange.h:415
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition qgis.h:6880
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:63
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:705