QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
42 const QString &baseName,
43 const QString &providerKey,
55 if ( !meshLayerPath.isEmpty() && !providerKey.isEmpty() )
58 QgsDataProvider::ReadFlags
flags = QgsDataProvider::ReadFlags();
63 ok = setDataProvider( providerKey, providerOptions,
flags );
69 setDefaultRendererSettings( mDatasetGroupStore->datasetGroupIndexes() );
82 void QgsMeshLayer::setDefaultRendererSettings(
const QList<int> &groupIndexes )
85 if ( groupIndexes.count() > 0 )
91 if ( meta.
maximum() == std::numeric_limits<double>::quiet_NaN() &&
92 meta.
minimum() == std::numeric_limits<double>::quiet_NaN() )
104 for (
int i : groupIndexes )
122 applyClassificationOnScalarSettings( meta, scalarSettings );
129 void QgsMeshLayer::createSimplifiedMeshes()
131 if ( mSimplificationSettings.
isEnabled() && !hasSimplifiedMeshes() )
135 QVector<QgsTriangularMesh *> simplifyMeshes =
136 mTriangularMeshes[0]->simplifyMesh( reductionFactor );
138 for (
int i = 0; i < simplifyMeshes.count() ; ++i )
140 mTriangularMeshes.emplace_back( simplifyMeshes[i] );
145 bool QgsMeshLayer::hasSimplifiedMeshes()
const
148 return ( mTriangularMeshes.size() > 1 );
153 delete mDataProvider;
158 return mDataProvider;
163 return mDataProvider;
181 return mDataProvider->
extent();
198 if ( mDatasetGroupStore->addPersistentDatasets( path ) )
201 if ( !isTemporalBefore &&
dataProvider()->temporalCapabilities()->hasTemporalCapabilities() )
208 QDateTime referenceTime = defaultReferenceTime;
209 if ( !defaultReferenceTime.isValid() )
210 referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ), Qt::UTC );
225 if ( mDatasetGroupStore->addDatasetGroup( datasetGroup ) )
235 return mDatasetGroupStore->saveDatasetGroup( path, datasetGroupIndex, driver );
240 return mNativeMesh.get();
245 return mNativeMesh.get();
250 for (
const std::unique_ptr<QgsTriangularMesh> &lod : mTriangularMeshes )
252 if ( lod && lod->averageTriangleSize() > minimumTriangleSize )
256 if ( !mTriangularMeshes.empty() )
257 return mTriangularMeshes.back().get();
272 if ( mTriangularMeshes.empty() )
275 mTriangularMeshes.emplace_back( baseMesh );
278 if ( mTriangularMeshes[0].get()->update( mNativeMesh.get(), transform ) )
279 mTriangularMeshes.resize( 1 );
284 return mRendererCache.get();
289 return mRendererSettings;
296 mRendererSettings = settings;
310 return mTimeSettings;
315 mTimeSettings = settings;
322 return QgsMeshLayerUtils::formatTime( hours, mTemporalProperties->
referenceTime(), mTimeSettings );
324 return QgsMeshLayerUtils::formatTime( hours, QDateTime(), mTimeSettings );
329 return mDatasetGroupStore->datasetGroupCount();
334 return mDatasetGroupStore->extraDatasetGroupCount();
339 return mDatasetGroupStore->datasetGroupIndexes();
344 return mDatasetGroupStore->datasetGroupMetadata( index );
349 return mDatasetGroupStore->datasetCount( index.
group() );
354 return mDatasetGroupStore->datasetMetadata( index );
359 return mDatasetGroupStore->datasetValue( index, valueIndex );
364 return mDatasetGroupStore->datasetValues( index, valueIndex, count );
369 return mDatasetGroupStore->dataset3dValues( index, faceIndex, count );
374 return mDatasetGroupStore->areFacesActive( index, faceIndex, count );
379 return mDatasetGroupStore->isFaceActive( index, faceIndex );
389 if (
dataProvider()->contains( QgsMesh::ElementType::Edge ) )
391 QgsRectangle searchRectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
395 if ( faceIndex >= 0 )
412 const int v1 = face[0], v2 = face[1], v3 = face[2];
417 const double x = QgsMeshLayerUtils::interpolateFromVerticesData( p1, p2, p3, val1.
x(), val2.
x(), val3.
x(), point );
418 double y = std::numeric_limits<double>::quiet_NaN();
421 y = QgsMeshLayerUtils::interpolateFromVerticesData( p1, p2, p3, val1.
y(), val2.
y(), val3.
y(), point );
436 value = block2d.
value( 0 );
464 if ( faceIndex >= 0 )
478 int selectedIndex = closestEdge( point, searchRadius, projectedPoint );
480 if ( selectedIndex >= 0 )
494 const int v1 = edge.first, v2 = edge.second;
498 double edgeLength = p1.
distance( p2 );
499 double dist1 = p1.
distance( projectedPoint.
x(), projectedPoint.
y() );
500 value = QgsMeshLayerUtils::interpolateFromVerticesData( dist1 / edgeLength, val1, val2 );
519 if ( ! mTemporalProperties->
isActive() )
522 const QDateTime layerReferenceTime = mTemporalProperties->
referenceTime();
523 qint64 startTime = layerReferenceTime.msecsTo( timeRange.begin() );
525 return mDatasetGroupStore->datasetIndexAtTime( startTime, datasetGroupIndex, mTemporalProperties->
matchingMethod() );
530 qint64 usedRelativeTime = relativeTime.
seconds() * 1000;
539 return mDatasetGroupStore->datasetIndexAtTime( relativeTime.
seconds() * 1000, datasetGroupIndex, mTemporalProperties->
matchingMethod() );
544 if ( meta.
extraOptions().contains( QStringLiteral(
"classification" ) ) )
548 QStringList classes = meta.
extraOptions()[QStringLiteral(
"classification" )].split( QStringLiteral(
";;" ) );
551 if ( meta.
extraOptions().contains( QStringLiteral(
"units" ) ) )
552 units = meta.
extraOptions()[ QStringLiteral(
"units" )];
554 QVector<QVector<double>> bounds;
555 for (
const QString &classe : classes )
557 QStringList boundsStr = classe.split(
',' );
558 QVector<double> bound;
559 for (
const QString &boundStr : boundsStr )
560 bound.append( boundStr.toDouble() );
561 bounds.append( bound );
564 if ( ( bounds.count() == 1 && bounds.first().count() > 2 ) ||
565 ( bounds.count() > 1 ) )
567 const QVector<double> firstClass = bounds.first();
568 const QVector<double> lastClass = bounds.last();
569 double minValue = firstClass.count() > 1 ? ( firstClass.first() + firstClass.last() ) / 2 : firstClass.first();
570 double maxValue = lastClass.count() > 1 ? ( lastClass.first() + lastClass.last() ) / 2 : lastClass.first();
571 double diff = maxValue - minValue;
572 QList<QgsColorRampShader::ColorRampItem> colorRampItemlist;
573 for (
int i = 0; i < bounds.count(); ++i )
575 const QVector<double> &boundClass = bounds.at( i );
578 if ( !boundClass.isEmpty() )
580 double scalarValue = ( boundClass.first() + boundClass.last() ) / 2;
581 item.
color = colorRamp->
color( ( scalarValue - minValue ) / diff );
582 if ( i != 0 && i < bounds.count() - 1 )
584 item.
label = QString( (
"%1 - %2 %3" ) ).
585 arg( QString::number( boundClass.first() ) ).
586 arg( QString::number( boundClass.last() ) ).
590 colorRampItemlist.append( item );
593 if ( firstClass.count() == 1 )
594 colorRampItemlist.first().label = QObject::tr(
"below %1 %2" ).
595 arg( QString::number( firstClass.first() ) ).
599 colorRampItemlist.first().label = QString( (
"%1 - %2 %3" ) ).
600 arg( QString::number( firstClass.first() ) ).
601 arg( QString::number( firstClass.last() ) ).
605 if ( lastClass.count() == 1 )
606 colorRampItemlist.last().label = QObject::tr(
"above %1 %2" ).
607 arg( QString::number( lastClass.first() ) ).
611 colorRampItemlist.last().label = QString( (
"%1 - %2 %3" ) ).
612 arg( QString::number( lastClass.first() ) ).
613 arg( QString::number( lastClass.last() ) ).
632 if ( mTemporalProperties->
isActive() )
640 if ( mTemporalProperties->
isActive() )
646 void QgsMeshLayer::fillNativeMesh()
648 Q_ASSERT( !mNativeMesh );
650 mNativeMesh.reset(
new QgsMesh() );
658 void QgsMeshLayer::onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes )
661 for (
int i = 0; i < datasetGroupIndexes.count(); ++i )
662 assignDefaultStyleToDatasetGroup( datasetGroupIndexes.at( i ) );
670 return mDatasetGroupStore->datasetGroupTreeItem();
675 mDatasetGroupStore->setDatasetGroupTreeItem( rootItem );
676 updateActiveDatasetGroups();
679 int QgsMeshLayer::closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const
681 QgsRectangle searchRectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
685 int selectedIndex = -1;
689 double sqrMaxDistFromPoint = pow( searchRadius, 2 );
690 for (
const int edgeIndex : edgeIndexes )
696 double sqrDist = point.
sqrDistToSegment( vertex1.
x(), vertex1.
y(), vertex2.
x(), vertex2.
y(), projPoint );
697 if ( sqrDist < sqrMaxDistFromPoint )
699 selectedIndex = edgeIndex;
700 projectedPoint = projPoint;
701 sqrMaxDistFromPoint = sqrDist;
706 return selectedIndex;
717 mTemporalProperties->
setReferenceTime( referenceTime, lDataProvider->temporalCapabilities() );
732 return exactPosition;
733 QgsRectangle rectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
734 double maxDistance = searchRadius;
737 for (
const int edgeIndex : edgeIndexes )
742 double dist1 = point.
distance( vertex1 );
743 double dist2 = point.
distance( vertex2 );
744 if ( dist1 < maxDistance )
747 exactPosition = vertex1;
749 if ( dist2 < maxDistance )
752 exactPosition = vertex2;
758 for (
const int faceIndex : faceIndexes )
761 for (
int i = 0; i < 3; ++i )
764 double dist = point.
distance( vertex );
765 if ( dist < maxDistance )
768 exactPosition = vertex;
773 return exactPosition;
779 closestEdge( point, searchRadius, projectedPoint );
781 return projectedPoint;
789 return centroidPosition;
790 QgsRectangle rectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
791 double maxDistance = std::numeric_limits<double>::max();
794 for (
const int faceIndex : faceIndexes )
797 if ( nativefaceIndex < 0 && nativefaceIndex >= mesh->
faceCentroids().count() )
800 double dist = point.
distance( centroid );
801 if ( dist < maxDistance )
804 centroidPosition = centroid;
808 return centroidPosition;
813 mDatasetGroupStore->resetDatasetGroupTreeItem();
814 updateActiveDatasetGroups();
819 if ( !mDataProvider )
822 for (
int i = 0; i < groupCount; ++i )
834 qint64 time = mDatasetGroupStore->datasetRelativeTime( index );
844 return mDatasetGroupStore->datasetRelativeTime( index );
847 void QgsMeshLayer::updateActiveDatasetGroups()
851 if ( !mDatasetGroupStore->datasetGroupTreeItem() )
861 if ( !activeScalarItem && treeItem->
childCount() > 0 )
862 activeScalarItem = treeItem->
child( 0 );
864 if ( activeScalarItem && !activeScalarItem->
isEnabled() )
866 for (
int i = 0; i < treeItem->
childCount(); ++i )
868 activeScalarItem = treeItem->
child( i );
872 activeScalarItem =
nullptr;
876 if ( activeScalarItem )
884 if ( !( activeVectorItem && activeVectorItem->
isEnabled() ) )
897 switch ( elementType )
900 return snapOnVertex( point, searchRadius );
902 return snapOnEdge( point, searchRadius );
904 return snapOnFace( point, searchRadius );
938 return mSimplificationSettings;
943 mSimplificationSettings = simplifySettings;
954 props[
"color1"] =
"13,8,135,255";
955 props[
"color2"] =
"240,249,33,255";
957 "0.0196078;27,6,141,255:0.0392157;38,5,145,255:0.0588235;47,5,150,255:0.0784314;56,4,154,255:0.0980392;65,4,157,255:"
958 "0.117647;73,3,160,255:0.137255;81,2,163,255:0.156863;89,1,165,255:0.176471;97,0,167,255:0.196078;105,0,168,255:"
959 "0.215686;113,0,168,255:0.235294;120,1,168,255:0.254902;128,4,168,255:0.27451;135,7,166,255:0.294118;142,12,164,255:"
960 "0.313725;149,17,161,255:0.333333;156,23,158,255:0.352941;162,29,154,255:0.372549;168,34,150,255:0.392157;174,40,146,255:"
961 "0.411765;180,46,141,255:0.431373;186,51,136,255:0.45098;191,57,132,255:0.470588;196,62,127,255:0.490196;201,68,122,255:"
962 "0.509804;205,74,118,255:0.529412;210,79,113,255:0.54902;214,85,109,255:0.568627;218,91,105,255:0.588235;222,97,100,255:"
963 "0.607843;226,102,96,255:0.627451;230,108,92,255:0.647059;233,114,87,255:0.666667;237,121,83,255:0.686275;240,127,79,255:"
964 "0.705882;243,133,75,255:0.72549;245,140,70,255:0.745098;247,147,66,255:0.764706;249,154,62,255:0.784314;251,161,57,255:"
965 "0.803922;252,168,53,255:0.823529;253,175,49,255:0.843137;254,183,45,255:0.862745;254,190,42,255:0.882353;253,198,39,255:"
966 "0.901961;252,206,37,255:0.921569;251,215,36,255:0.941176;248,223,37,255:0.960784;246,232,38,255:0.980392;243,240,39,255";
970 void QgsMeshLayer::assignDefaultStyleToDatasetGroup(
int groupIndex )
973 double groupMin =
metadata.minimum();
974 double groupMax =
metadata.maximum();
977 fcn.classifyColorRamp( 5, -1,
QgsRectangle(),
nullptr );
1004 createSimplifiedMeshes();
1007 if ( !mRendererCache )
1008 mRendererCache.reset(
new QgsMeshLayerRendererCache() );
1016 Q_UNUSED( errorMessage )
1019 QDomElement elem = node.toElement();
1023 QDomElement elemRendererSettings = elem.firstChildElement(
"mesh-renderer-settings" );
1024 if ( !elemRendererSettings.isNull() )
1025 mRendererSettings.
readXml( elemRendererSettings );
1027 QDomElement elemSimplifySettings = elem.firstChildElement(
"mesh-simplify-settings" );
1028 if ( !elemSimplifySettings.isNull() )
1029 mSimplificationSettings.
readXml( elemSimplifySettings, context );
1032 QDomNode blendModeNode = node.namedItem( QStringLiteral(
"blendMode" ) );
1033 if ( !blendModeNode.isNull() )
1035 QDomElement e = blendModeNode.toElement();
1045 Q_UNUSED( errorMessage )
1048 QDomElement elem = node.toElement();
1052 QDomElement elemRendererSettings = mRendererSettings.
writeXml( doc );
1053 elem.appendChild( elemRendererSettings );
1055 QDomElement elemSimplifySettings = mSimplificationSettings.
writeXml( doc, context );
1056 elem.appendChild( elemSimplifySettings );
1059 QDomElement blendModeElement = doc.createElement( QStringLiteral(
"blendMode" ) );
1061 blendModeElement.appendChild( blendModeText );
1062 node.appendChild( blendModeElement );
1069 return writeSymbology( node, doc, errorMessage, context, categories );
1074 return readSymbology( node, errorMessage, context, categories );
1080 if ( provider == QLatin1String(
"mdal" ) )
1102 QDomNode pkeyNode = layer_node.namedItem( QStringLiteral(
"provider" ) );
1104 if ( pkeyNode.isNull() )
1110 QDomElement pkeyElt = pkeyNode.toElement();
1120 QgsDataProvider::ReadFlags
flags = QgsDataProvider::ReadFlags();
1130 QDomElement elemExtraDatasets = layer_node.firstChildElement( QStringLiteral(
"extra-datasets" ) );
1131 if ( !elemExtraDatasets.isNull() )
1133 QDomElement elemUri = elemExtraDatasets.firstChildElement( QStringLiteral(
"uri" ) );
1134 while ( !elemUri.isNull() )
1140 QgsDebugMsg( QStringLiteral(
"extra dataset (res %1): %2" ).arg( res ).arg( uri ) );
1145 elemUri = elemUri.nextSiblingElement( QStringLiteral(
"uri" ) );
1149 if ( mDataProvider && pkeyNode.toElement().hasAttribute( QStringLiteral(
"time-unit" ) ) )
1154 QDomElement elemDatasetGroupsStore = layer_node.firstChildElement( QStringLiteral(
"mesh-dataset-groups-store" ) );
1155 if ( elemDatasetGroupsStore.isNull() )
1158 mDatasetGroupStore->readXml( elemDatasetGroupsStore, context );
1163 if ( !mTemporalProperties->
timeExtent().begin().isValid() )
1167 QDomElement elemStaticDataset = layer_node.firstChildElement( QStringLiteral(
"static-active-dataset" ) );
1168 if ( elemStaticDataset.hasAttribute( QStringLiteral(
"scalar" ) ) )
1170 mStaticScalarDatasetIndex = elemStaticDataset.attribute( QStringLiteral(
"scalar" ) ).toInt();
1172 if ( elemStaticDataset.hasAttribute( QStringLiteral(
"vector" ) ) )
1174 mStaticVectorDatasetIndex = elemStaticDataset.attribute( QStringLiteral(
"vector" ) ).toInt();
1183 QDomElement mapLayerNode = layer_node.toElement();
1185 if ( mapLayerNode.isNull() || ( QLatin1String(
"maplayer" ) != mapLayerNode.nodeName() ) )
1191 mapLayerNode.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"mesh" ) );
1194 if ( mDataProvider )
1196 QDomElement provider = document.createElement( QStringLiteral(
"provider" ) );
1197 QDomText providerText = document.createTextNode(
providerType() );
1198 provider.appendChild( providerText );
1199 layer_node.appendChild( provider );
1202 const QStringList extraDatasetUris = mDataProvider->
extraDatasets();
1203 QDomElement elemExtraDatasets = document.createElement( QStringLiteral(
"extra-datasets" ) );
1204 for (
const QString &uri : extraDatasetUris )
1207 QDomElement elemUri = document.createElement( QStringLiteral(
"uri" ) );
1208 elemUri.appendChild( document.createTextNode( path ) );
1209 elemExtraDatasets.appendChild( elemUri );
1211 layer_node.appendChild( elemExtraDatasets );
1214 QDomElement elemStaticDataset = document.createElement( QStringLiteral(
"static-active-dataset" ) );
1215 elemStaticDataset.setAttribute( QStringLiteral(
"scalar" ), mStaticScalarDatasetIndex );
1216 elemStaticDataset.setAttribute( QStringLiteral(
"vector" ), mStaticVectorDatasetIndex );
1217 layer_node.appendChild( elemStaticDataset );
1220 layer_node.appendChild( mDatasetGroupStore->writeXml( document, context ) );
1224 return writeSymbology( layer_node, document, errorMsg, context );
1229 if ( mDataProvider && mDataProvider->
isValid() )
1235 mNativeMesh.reset(
new QgsMesh );
1240 mTriangularMeshes.clear();
1243 mRendererCache.reset(
new QgsMeshLayerRendererCache() );
1249 if ( mDataProvider )
1252 return QStringList();
1258 QString myMetadata = QStringLiteral(
"<html>\n<body>\n" );
1261 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Information from provider" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1262 myMetadata += QLatin1String(
"<table class=\"list-view\">\n" );
1265 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Name" ) + QStringLiteral(
"</td><td>" ) +
name() + QStringLiteral(
"</td></tr>\n" );
1270 if ( uriComponents.contains( QStringLiteral(
"path" ) ) )
1272 path = uriComponents[QStringLiteral(
"path" )].toString();
1273 if ( QFile::exists( path ) )
1274 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Path" ) + QStringLiteral(
"</td><td>%1" ).arg( QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( path ).toString(), QDir::toNativeSeparators( path ) ) ) + QStringLiteral(
"</td></tr>\n" );
1276 if ( uriComponents.contains( QStringLiteral(
"url" ) ) )
1278 const QString url = uriComponents[QStringLiteral(
"url" )].toString();
1279 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"URL" ) + QStringLiteral(
"</td><td>%1" ).arg( QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl( url ).toString(), url ) ) + QStringLiteral(
"</td></tr>\n" );
1284 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Source" ) + QStringLiteral(
"</td><td>%1" ).arg(
publicSource() ) + QStringLiteral(
"</td></tr>\n" );
1287 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"CRS" ) + QStringLiteral(
"</td><td>" );
1291 if (
crs().isGeographic() )
1292 myMetadata += tr(
"Geographic" );
1294 myMetadata += tr(
"Projected" );
1296 myMetadata += QLatin1String(
"</td></tr>\n" );
1299 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Extent" ) + QStringLiteral(
"</td><td>" ) +
extent().
toString() + QStringLiteral(
"</td></tr>\n" );
1302 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Unit" ) + QStringLiteral(
"</td><td>" ) +
QgsUnitTypes::toString(
crs().mapUnits() ) + QStringLiteral(
"</td></tr>\n" );
1305 QLocale locale = QLocale();
1306 locale.setNumberOptions( locale.numberOptions() &= ~QLocale::NumberOption::OmitGroupSeparator );
1310 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1311 + tr(
"Vertex count" ) + QStringLiteral(
"</td><td>" )
1312 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->vertexCount() ) ) )
1313 + QStringLiteral(
"</td></tr>\n" );
1314 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1315 + tr(
"Face count" ) + QStringLiteral(
"</td><td>" )
1316 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->faceCount() ) ) )
1317 + QStringLiteral(
"</td></tr>\n" );
1318 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1319 + tr(
"Edge count" ) + QStringLiteral(
"</td><td>" )
1320 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->edgeCount() ) ) )
1321 + QStringLiteral(
"</td></tr>\n" );
1322 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1323 + tr(
"Dataset groups count" ) + QStringLiteral(
"</td><td>" )
1325 + QStringLiteral(
"</td></tr>\n" );
1329 myMetadata += QLatin1String(
"</table>\n<br><br>" );
1332 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Identification" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1334 myMetadata += QLatin1String(
"<br><br>\n" );
1337 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Extent" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1339 myMetadata += QLatin1String(
"<br><br>\n" );
1342 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Access" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1344 myMetadata += QLatin1String(
"<br><br>\n" );
1347 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Contacts" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1349 myMetadata += QLatin1String(
"<br><br>\n" );
1352 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Links" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1354 myMetadata += QLatin1String(
"<br><br>\n" );
1357 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"History" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1359 myMetadata += QLatin1String(
"<br><br>\n" );
1361 myMetadata += QLatin1String(
"\n</body>\n</html>\n" );
1367 delete mDataProvider;
1373 if ( !mDataProvider )
1375 QgsDebugMsgLevel( QStringLiteral(
"Unable to get mesh data provider" ), 2 );
1379 mDataProvider->setParent(
this );
1380 QgsDebugMsgLevel( QStringLiteral(
"Instantiated the mesh data provider plugin" ), 2 );
1391 if ( provider == QLatin1String(
"mesh_memory" ) )
1397 mDatasetGroupStore->setPersistentProvider( mDataProvider );
1400 assignDefaultStyleToDatasetGroup( i );
1409 return mTemporalProperties;
QList< int > datasetGroupsIndexes() const
Returns the list of indexes of dataset groups count handled by the layer.
int dataset() const
Returns a dataset index within group()
virtual int datasetGroupCount() const =0
Returns number of datasets groups loaded.
Represents a renderer settings for vector datasets.
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
QgsUnitTypes::TemporalUnit temporalUnit() const
Returns the temporal unit used to read data by the data provider.
double distance(double x, double y) const SIP_HOLDGIL
Returns the distance between this point and a specified x, y coordinate.
QgsCoordinateReferenceSystem crs
Abstract base class for color ramps.
void readCommonStyle(const QDomElement &layerElement, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)
Read style data common to all layer types.
@ EqualInterval
Uses equal interval.
QgsMesh3dDataBlock dataset3dValue(const QgsMeshDatasetIndex &index, const QgsPointXY &point) const
Returns the 3d values of stacked 3d mesh defined by the given point.
void setTransformContext(const QgsCoordinateTransformContext &transformContext) override
Sets the coordinate transform context to transformContext.
double seconds() const
Returns the interval duration in seconds.
Contains information about the context in which a coordinate transform is executed.
void setClassificationMinimumMaximum(double minimum, double maximum)
Sets min/max values used for creation of the color ramp shader.
@ FlagTrustLayerMetadata
Trust layer metadata. Improves layer load time by skipping expensive checks like primary key unicity,...
QgsMeshDatasetIndex datasetIndexAtRelativeTime(const QgsInterval &relativeTime, int datasetGroupIndex) const
Returns dataset index from datasets group depending on the relative time from the layer reference tim...
void setReferenceTime(const QDateTime &referenceTime)
Sets the reference time of the layer.
const QVector< QgsMeshVertex > & vertices() const
Returns vertices in map coordinate system.
Represents a mesh time settings for mesh datasets.
Represents all mesh renderer settings.
Setting options for creating vector data providers.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer.
void setClassificationMode(ClassificationMode classificationMode)
Sets classification mode.
The class is used as a container of context for various read/write operations on other objects.
QgsMeshDatasetValue dataset1dValue(const QgsMeshDatasetIndex &index, const QgsPointXY &point, double searchRadius) const
Returns the value of 1D mesh dataset defined on edge that are in the search area defined by point ans...
bool saveDataset(const QString &path, int datasetGroupIndex, QString driver)
Saves datasets group on file with the specified driver.
double distance(double x, double y) const SIP_HOLDGIL
Returns the Cartesian 2D distance between this point and a specified x, y coordinate.
void setMeshSimplificationSettings(const QgsMeshSimplificationSettings &meshSimplificationSettings)
Sets mesh simplification settings.
void setActiveVectorDatasetGroup(int activeVectorDatasetGroup)
Sets the active vector dataset group.
QgsInterval firstValidTimeStep() const
Returns the first valid time step of the dataset groups, invalid QgInterval if no time step is presen...
Point geometry type, with support for z-dimension and m-values.
QString userFriendlyIdentifier(IdentifierType type=MediumString) const
Returns a user friendly identifier for the CRS.
Represents a mesh renderer settings for mesh object.
#define QgsDebugMsgLevel(str, level)
void setVectorSettings(int groupIndex, const QgsMeshRendererVectorSettings &settings)
Sets new renderer settings.
virtual bool addDataset(const QString &uri)=0
Associate dataset with the mesh.
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
void setScalarSettings(int groupIndex, const QgsMeshRendererScalarSettings &settings)
Sets new renderer settings.
bool readXml(const QDomNode &layer_node, QgsReadWriteContext &context) override
Called by readLayerXML(), used by children to read state specific to them from project files.
QgsMapLayer::ReadFlags mReadFlags
Read flags. It's up to the subclass to respect these when restoring state from XML.
const QVector< QgsMeshVertex > & faceCentroids() const
Returns centroids of the native faces in map CRS.
static QgsMapLayerLegend * defaultMeshLegend(QgsMeshLayer *ml)
Create new legend implementation for mesh layer.
QgsCoordinateTransformContext transformContext
void setTimeSettings(const QgsMeshTimeSettings &settings)
Sets time format settings.
QgsMeshDatasetGroupTreeItem * datasetGroupTreeRootItem() const
Returns the root items of the dataset group tree item.
void reload() override
Synchronises with changes in the datasource.
virtual void populateMesh(QgsMesh *mesh) const =0
Populates the mesh vertices, edges and faces.
@ FlagTrustDataSource
Trust datasource config (primary key unicity, geometry type and srid, etc). Improves provider load ti...
QgsMeshDatasetValue represents single dataset value.
QgsMapLayerType
Types of layers that can be added to a map.
QgsMeshLayerRendererCache * rendererCache()
Returns native mesh (nullptr before rendering)
QgsMeshSimplificationSettings meshSimplificationSettings() const
Returns mesh simplification settings.
bool writeXml(QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by children to write state specific to them to project files.
Contains information about the context of a rendering operation.
Implementation of map layer temporal properties for mesh layers.
void setMinimal() SIP_HOLDGIL
Set a rectangle so that min corner is at max and max corner is at min.
Tree item for display of the mesh dataset groups.
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
const QVector< QgsMeshFace > & triangles() const
Returns triangles.
void setStaticVectorDatasetIndex(const QgsMeshDatasetIndex &staticVectorDatasetIndex)
Sets the static vector dataset index that is rendered if the temporal properties is not active.
void setTemporalMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match the temporal dataset from a requested time, see activeVectorDatasetAtTi...
void setMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match dataset from temporal capabilities.
Mesh - vertices, edges and faces.
QStringList subLayers() const override
Returns the sublayers of this layer.
TemporalUnit
Temporal units.
void dataChanged()
Emitted whenever a change is made to the data provider which may have caused changes in the provider'...
bool isFaceActive(const QgsMeshDatasetIndex &index, int faceIndex) const
Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes.
QgsMeshDatasetValue datasetValue(const QgsMeshDatasetIndex &index, int valueIndex) const
Returns vector/scalar value associated with the index from the dataset To read multiple continuous va...
QList< int > edgeIndexesForRectangle(const QgsRectangle &rectangle) const
Finds indexes of edges intersecting given bounding box It uses spatial indexing.
void setReferenceTime(const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities)
Sets the reference time and update the time extent from the temporal capabilities,...
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context)
Reads configuration from the given DOM element.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
QgsTriangularMesh * triangularMesh(double minimumTriangleSize=0) const
Returns triangular mesh (nullptr before rendering or calling to updateMesh).
A rectangle specified with double values.
void setEdgeStrokeWidth(const QgsInterpolatedLineWidth &strokeWidth)
Sets the stroke width used to render edges scalar dataset.
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N faces defined on base mesh frame.
bool mShouldValidateCrs
true if the layer's CRS should be validated and invalid CRSes are not permitted.
QgsMeshLayer * clone() const override
Returns a new instance equivalent to this one except for the id which is still unique.
QgsDateTimeRange timeExtent() const
Returns the time extent.
QString mProviderKey
Data provider key (name of the data provider)
Setting options for loading mesh layers.
QgsCoordinateTransformContext transformContext() const
Returns data provider coordinate transform context.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
QgsMeshDatasetMetadata datasetMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset metadata.
int extraDatasetGroupCount() const
Returns the extra dataset groups count handle by the layer.
static QgsStyle * defaultStyle()
Returns default application-wide style.
static QgsPainting::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
void updateTriangularMesh(const QgsCoordinateTransform &transform=QgsCoordinateTransform())
Gets native mesh and updates (creates if it doesn't exist) the base triangular mesh.
QgsMeshRendererSettings rendererSettings() const
Returns renderer settings.
QString encodedSource(const QString &source, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by derived classes to encode provider's specific data source to proje...
Class used to register and access all the dataset groups related to a mesh layer.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
void dataSourceChanged()
Emitted whenever the layer's data source has been changed.
@ NeighbourAverage
Does a simple average of values defined for all surrounding faces/vertices.
void setMinimumValue(double minimumValue)
Sets the minimum value used to defined the variable width.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
@ FlagDontResolveLayers
Don't resolve layer paths or create data providers for layers.
QgsMeshDatasetIndex staticVectorDatasetIndex() const
Returns the static vector dataset index that is rendered if the temporal properties is not active.
QgsMapLayer::LayerFlags flags() const
Returns the flags for this layer.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
QgsMeshDatasetIndex datasetIndexAtTime(const QgsDateTimeRange &timeRange, int datasetGroupIndex) const
Returns dataset index from datasets group depending on the time range.
void setColorRampType(QgsColorRampShader::Type colorRampType)
Sets the color ramp type.
virtual void reloadData()
Reloads the data from the source by calling reloadProviderData() implemented by providers with data c...
int activeScalarDatasetGroup() const
Returns the active scalar dataset group.
int group() const
Returns a group index.
QgsColorRamp * sourceColorRamp() const
Returns the source color ramp.
QString htmlMetadata() const override
Obtain a formatted HTML string containing assorted metadata for this layer.
bool isActive() const
Returns true if the temporal property is active.
ElementType
Defines type of mesh elements.
QgsMeshRendererScalarSettings scalarSettings(int groupIndex) const
Returns renderer settings.
bool isEnabled() const
Returns if the overview is active.
@ Exact
Assigns the color of the exact matching value in the color ramp item list.
Represents a width than can vary depending on values.
QgsMesh3dDataBlock dataset3dValues(const QgsMeshDatasetIndex &index, int faceIndex, int count) const
Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes.
int childCount() const
Returns the count of children.
QgsColorRampShader colorRampShader() const
Returns color ramp shader function.
QString formatTime(double hours)
Returns (date) time in hours formatted to human readable form.
QgsInterval datasetRelativeTime(const QgsMeshDatasetIndex &index)
Returns the relative time of the dataset from the reference time of its group.
QgsMeshDatasetGroupTreeItem * childFromDatasetGroupIndex(int index)
Returns the child with dataset group index Searches as depper as needed on the child hierarchy.
static Q_INVOKABLE QString toString(QgsUnitTypes::DistanceUnit unit)
Returns a translated string representing a distance unit.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
void writeCommonStyle(QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const
Write style data common to all layer types.
QgsMeshTimeSettings timeSettings() const
Returns time format settings.
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void setDatasetGroupTreeRootItem(QgsMeshDatasetGroupTreeItem *rootItem)
Sets the root items of the dataset group tree item.
const QVector< QgsMeshEdge > & edges() const
Returns edges.
bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories) const override
static QPainter::CompositionMode getCompositionMode(QgsPainting::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
bool isValid() const
Returns whether index is valid, ie at least groups is set.
virtual void setMaximumValue(double value)
Sets the maximum value for the raster shader.
bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories) override
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
Class defining color to render mesh datasets.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
double x() const
Returns x value.
void setTemporalUnit(QgsUnitTypes::TemporalUnit unit)
Sets the temporal unit of the provider and reload data if it changes.
int datasetCount(const QgsMeshDatasetIndex &index) const
Returns the dataset count in the dataset groups.
qint64 firstTimeStepDuration(int group) const
Returns the duration of the first time step of the dataset group with index group.
Base class for providing data for QgsMeshLayer.
QDateTime referenceTime() const
Returns the reference time.
QVariantMap decodeUri(const QString &providerKey, const QString &uri)
Breaks a provider data source URI into its component paths (e.g.
@ None
Does not use resampling.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
Base class for storage of map layer temporal properties.
void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities) override
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
QString mDataSource
Data source description string, varies by layer type.
void setColorRampItemList(const QList< QgsColorRampShader::ColorRampItem > &list)
Sets a custom colormap.
void setNativeMeshSettings(const QgsMeshRendererMeshSettings &settings)
Sets new native mesh renderer settings, triggers repaint.
QgsMeshDatasetIndex activeVectorDatasetAtTime(const QgsDateTimeRange &timeRange) const
Returns dataset index from active vector group depending on the time range If the temporal properties...
qint64 datasetRelativeTimeInMilliseconds(const QgsMeshDatasetIndex &index)
Returns the relative time (in milliseconds) of the dataset from the reference time of its group.
@ FullString
Full definition – possibly a very lengthy string, e.g. with no truncation of custom WKT definitions.
int faceIndexForPoint_v2(const QgsPointXY &point) const
Finds index of triangle at given point It uses spatial indexing and don't use geos to be faster.
QVector< int > QgsMeshFace
List of vertex indexes.
void setIsActive(bool active)
Sets whether the temporal property is active.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
void rendererChanged()
Signal emitted when renderer is changed.
bool writeStyle(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const override
Write just the symbology information for the layer into the document.
void setColorRampShader(const QgsColorRampShader &shader)
Sets color ramp shader function.
bool readStyle(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) override
Read the style for the current layer from the DOM node supplied.
Abstract class to interpolate 3d stacked mesh data to 2d data.
Abstract class that represents a dataset group.
Represents a overview renderer settings.
void activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
A class to represent a 2D point.
QString decodedSource(const QString &source, const QString &provider, const QgsReadWriteContext &context) const override
Called by readLayerXML(), used by derived classes to decode provider's specific data source from proj...
void dataChanged()
Data of layer changed.
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)
Sets data coordinate transform context to transformContext.
QString publicSource() const
Gets a version of the internal layer definition that has sensitive bits removed (for example,...
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
Represents a mesh renderer settings for scalar datasets.
QString source() const
Returns the source for the layer.
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
QList< int > faceIndexesForRectangle(const QgsRectangle &rectangle) const
Finds indexes of triangles intersecting given bounding box It uses spatial indexing.
QMap< QString, QString > QgsStringMap
void setMaximumValue(double maximumValue)
Sets the maximum value used to defined the variable width.
@ TemporalMilliseconds
Milliseconds.
bool addDatasets(const QString &path, const QDateTime &defaultReferenceTime=QDateTime())
Adds datasets to the mesh from file with path.
void setDataResamplingMethod(const DataResamplingMethod &dataResamplingMethod)
Sets data interpolation method.
QgsCoordinateTransformContext transformContext() const
Returns the layer data provider coordinate transform context or a default transform context if the la...
QPair< int, int > QgsMeshEdge
Edge is a straight line seqment between 2 points.
virtual QStringList extraDatasets() const =0
Returns list of additional dataset file URIs added using addDataset() calls.
Base class for all map layer types.
const QVector< int > & trianglesToNativeFaces() const
Returns mapping between triangles and original faces.
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
A representation of the interval between two datetime values.
double y() const
Returns y value.
QgsMeshLayer(const QString &path=QString(), const QString &baseName=QString(), const QString &providerLib=QStringLiteral("mesh_memory"), const QgsMeshLayer::LayerOptions &options=QgsMeshLayer::LayerOptions())
Constructor - creates a mesh layer.
void timeSettingsChanged()
Emitted when time format is changed.
Implementation of threaded rendering for mesh layers.
virtual QColor color(double value) const =0
Returns the color corresponding to a specified value.
void setEnabled(bool enabled)
Sets whether mesh structure rendering is enabled.
QgsMeshDatasetIndex staticScalarDatasetIndex() const
Returns the static scalar dataset index that is rendered if the temporal properties is not active.
void resetDatasetGroupTreeItem()
Reset the dataset group tree item to default from provider.
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
QgsMesh3dAveragingMethod * averagingMethod() const
Returns averaging method for conversion of 3d stacked mesh data to 2d data.
void datasetGroupsAdded(QList< int > indexes)
Emitted after dataset groups are added.
static QgsColorRamp * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsColorRamp from a map of properties.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
int datasetGroupIndex() const
QgsMesh * nativeMesh()
Returns native mesh (nullptr before rendering or calling to updateMesh)
Triangular/Derived Mesh is mesh with vertices in map coordinates.
bool hasTemporalCapabilities() const
Returns true if the provider has temporal capabilities available.
QgsRectangle extent() const override
Returns the extent of the layer.
virtual bool isSpatial() const
Returns true if the layer is considered a spatial layer, ie it has some form of geometry associated w...
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const
Writes configuration to a new DOM element.
Represents a line with width and color varying depending on values.
QgsMeshDataBlock datasetValues(const QgsMeshDatasetIndex &index, int valueIndex, int count) const
Returns N vector/scalar values from the index from the dataset.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
void setStaticScalarDatasetIndex(const QgsMeshDatasetIndex &staticScalarDatasetIndex)
Sets the static scalar dataset index that is rendered if the temporal properties is not active.
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod() const
Returns the method used to match dataset from temporal capabilities.
void setValid(bool valid)
Sets whether layer is valid or not.
QgsMeshDatasetValue value(int index) const
Returns a value represented by the index For active flag the behavior is undefined.
QString providerType() const
Returns the provider type for this layer.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
void setRendererSettings(const QgsMeshRendererSettings &settings)
Sets new renderer settings.
QgsMeshDatasetGroupTreeItem * child(int row) const
Returns a child.
int datasetGroupCount() const
Returns the dataset groups count handle by the layer.
QgsMeshDataBlock calculate(const QgsMesh3dDataBlock &block3d, QgsFeedback *feedback=nullptr) const
Calculated 2d block values from 3d stacked mesh values.
double sqrDistToSegment(double x1, double y1, double x2, double y2, QgsPointXY &minDistPoint, double epsilon=DEFAULT_SEGMENT_EPSILON) const SIP_HOLDGIL
Returns the minimum distance between this point and a segment.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
double reductionFactor() const
Returns the reduction factor used to build simplified mesh.
void setProviderType(const QString &providerType)
Sets the providerType (provider key)
void setActiveScalarDatasetGroup(int activeScalarDatasetGroup)
Sets the active scalar dataset group.
QgsMeshDataBlock areFacesActive(const QgsMeshDatasetIndex &index, int faceIndex, int count) const
Returns whether the faces are active for particular dataset.
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
void setLegend(QgsMapLayerLegend *legend)
Assign a legend controller to the map layer.
QgsMeshDatasetIndex activeScalarDatasetAtTime(const QgsDateTimeRange &timeRange) const
Returns dataset index from active scalar group depending on the time range.
QgsColorRamp * colorRamp(const QString &name) const
Returns a new copy of the specified color ramp.
QgsLayerMetadata metadata
QgsPointXY snapOnElement(QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius)
Returns the position of the snapped point on the mesh element closest to point intersecting with the ...
virtual bool isValid() const =0
Returns true if this is a valid layer.
virtual QStringList subLayers() const
Sub-layers handled by this provider, in order from bottom to top.
QDateTime referenceTime() const
Returns the reference time.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
virtual void setMinimumValue(double value)
Sets the minimum value for the raster shader.
bool isValid() const
Whether the block is valid.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
#define INVALID_MESHLAYER_TIME