44 const QString &baseName,
45 const QString &providerKey,
55 QgsDataProvider::ReadFlags
flags = QgsDataProvider::ReadFlags();
60 setDataSourcePrivate( meshLayerPath, baseName, providerKey, providerOptions,
flags );
65 setDefaultRendererSettings( mDatasetGroupStore->datasetGroupIndexes() );
71 void QgsMeshLayer::setDefaultRendererSettings(
const QList<int> &groupIndexes )
74 if ( groupIndexes.count() > 0 )
80 if ( meta.
maximum() == std::numeric_limits<double>::quiet_NaN() &&
81 meta.
minimum() == std::numeric_limits<double>::quiet_NaN() )
93 for (
int i : groupIndexes )
111 applyClassificationOnScalarSettings( meta, scalarSettings );
118 void QgsMeshLayer::createSimplifiedMeshes()
120 if ( mSimplificationSettings.
isEnabled() && !hasSimplifiedMeshes() )
124 QVector<QgsTriangularMesh *> simplifyMeshes =
125 mTriangularMeshes[0]->simplifyMesh( reductionFactor );
127 for (
int i = 0; i < simplifyMeshes.count() ; ++i )
129 mTriangularMeshes.emplace_back( simplifyMeshes[i] );
134 bool QgsMeshLayer::hasSimplifiedMeshes()
const
137 return ( mTriangularMeshes.size() > 1 );
142 delete mDataProvider;
147 return mDataProvider;
152 return mDataProvider;
170 return mDataProvider->
extent();
187 if ( mDatasetGroupStore->addPersistentDatasets( path ) )
189 mExtraDatasetUri.append( path );
191 if ( !isTemporalBefore &&
dataProvider()->temporalCapabilities()->hasTemporalCapabilities() )
198 QDateTime referenceTime = defaultReferenceTime;
199 if ( !defaultReferenceTime.isValid() )
200 referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0 ), Qt::UTC );
215 if ( mDatasetGroupStore->addDatasetGroup( datasetGroup ) )
225 return mDatasetGroupStore->saveDatasetGroup( path, datasetGroupIndex, driver );
230 return mNativeMesh.get();
235 return mNativeMesh.get();
240 for (
const std::unique_ptr<QgsTriangularMesh> &lod : mTriangularMeshes )
242 if ( lod && lod->averageTriangleSize() > minimumTriangleSize )
246 if ( !mTriangularMeshes.empty() )
247 return mTriangularMeshes.back().get();
254 return mTriangularMeshes.size();
259 if ( mTriangularMeshes.empty() )
262 return mTriangularMeshes.front().get();
264 if ( lodIndex >=
int( mTriangularMeshes.size() ) )
265 return mTriangularMeshes.back().get();
267 return mTriangularMeshes.at( lodIndex ).get();
280 if ( mTriangularMeshes.empty() )
283 mTriangularMeshes.emplace_back( baseMesh );
286 if ( mTriangularMeshes[0].get()->update( mNativeMesh.get(), transform ) )
287 mTriangularMeshes.resize( 1 );
289 createSimplifiedMeshes();
294 return mRendererCache.get();
299 return mRendererSettings;
306 mRendererSettings = settings;
320 return mTimeSettings;
325 mTimeSettings = settings;
332 return QgsMeshLayerUtils::formatTime( hours, mTemporalProperties->
referenceTime(), mTimeSettings );
334 return QgsMeshLayerUtils::formatTime( hours, QDateTime(), mTimeSettings );
339 return mDatasetGroupStore->datasetGroupCount();
344 return mDatasetGroupStore->extraDatasetGroupCount();
349 return mDatasetGroupStore->datasetGroupIndexes();
354 return mDatasetGroupStore->enabledDatasetGroupIndexes();
359 return mDatasetGroupStore->datasetGroupMetadata( index );
364 return mDatasetGroupStore->datasetCount( index.
group() );
369 return mDatasetGroupStore->datasetMetadata( index );
374 return mDatasetGroupStore->datasetValue( index, valueIndex );
379 return mDatasetGroupStore->datasetValues( index, valueIndex, count );
384 return mDatasetGroupStore->dataset3dValues( index, faceIndex, count );
389 return mDatasetGroupStore->areFacesActive( index, faceIndex, count );
394 return mDatasetGroupStore->isFaceActive( index, faceIndex );
404 if (
dataProvider()->contains( QgsMesh::ElementType::Edge ) )
406 QgsRectangle searchRectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
410 if ( faceIndex >= 0 )
427 const int v1 = face[0], v2 = face[1], v3 = face[2];
432 const double x = QgsMeshLayerUtils::interpolateFromVerticesData( p1, p2, p3, val1.
x(), val2.
x(), val3.
x(), point );
433 double y = std::numeric_limits<double>::quiet_NaN();
436 y = QgsMeshLayerUtils::interpolateFromVerticesData( p1, p2, p3, val1.
y(), val2.
y(), val3.
y(), point );
451 value = block2d.
value( 0 );
479 if ( faceIndex >= 0 )
493 int selectedIndex = closestEdge( point, searchRadius, projectedPoint );
495 if ( selectedIndex >= 0 )
509 const int v1 = edge.first, v2 = edge.second;
513 double edgeLength = p1.
distance( p2 );
514 double dist1 = p1.
distance( projectedPoint.
x(), projectedPoint.
y() );
515 value = QgsMeshLayerUtils::interpolateFromVerticesData( dist1 / edgeLength, val1, val2 );
535 if ( ! mTemporalProperties->
isActive() )
538 const QDateTime layerReferenceTime = mTemporalProperties->
referenceTime();
539 QDateTime utcTime = timeRange.begin();
540 if ( utcTime.timeSpec() != Qt::UTC )
541 utcTime.setTimeSpec( Qt::UTC );
542 qint64 startTime = layerReferenceTime.msecsTo( utcTime );
544 return mDatasetGroupStore->datasetIndexAtTime( startTime, datasetGroupIndex, mTemporalProperties->
matchingMethod() );
549 qint64 usedRelativeTime = relativeTime.
seconds() * 1000;
558 return mDatasetGroupStore->datasetIndexAtTime( relativeTime.
seconds() * 1000, datasetGroupIndex, mTemporalProperties->
matchingMethod() );
563 if ( meta.
extraOptions().contains( QStringLiteral(
"classification" ) ) )
567 QStringList classes = meta.
extraOptions()[QStringLiteral(
"classification" )].split( QStringLiteral(
";;" ) );
570 if ( meta.
extraOptions().contains( QStringLiteral(
"units" ) ) )
571 units = meta.
extraOptions()[ QStringLiteral(
"units" )];
573 QVector<QVector<double>> bounds;
574 for (
const QString &classe : classes )
576 QStringList boundsStr = classe.split(
',' );
577 QVector<double> bound;
578 for (
const QString &boundStr : boundsStr )
579 bound.append( boundStr.toDouble() );
580 bounds.append( bound );
583 if ( ( bounds.count() == 1 && bounds.first().count() > 2 ) ||
584 ( bounds.count() > 1 ) )
586 const QVector<double> firstClass = bounds.first();
587 const QVector<double> lastClass = bounds.last();
588 double minValue = firstClass.count() > 1 ? ( firstClass.first() + firstClass.last() ) / 2 : firstClass.first();
589 double maxValue = lastClass.count() > 1 ? ( lastClass.first() + lastClass.last() ) / 2 : lastClass.first();
590 double diff = maxValue - minValue;
591 QList<QgsColorRampShader::ColorRampItem> colorRampItemlist;
592 for (
int i = 0; i < bounds.count(); ++i )
594 const QVector<double> &boundClass = bounds.at( i );
597 if ( !boundClass.isEmpty() )
599 double scalarValue = ( boundClass.first() + boundClass.last() ) / 2;
600 item.
color = colorRamp->
color( ( scalarValue - minValue ) / diff );
601 if ( i != 0 && i < bounds.count() - 1 )
603 item.
label = QString( (
"%1 - %2 %3" ) ).
604 arg( QString::number( boundClass.first() ) ).
605 arg( QString::number( boundClass.last() ) ).
609 colorRampItemlist.append( item );
612 if ( firstClass.count() == 1 )
613 colorRampItemlist.first().label = QObject::tr(
"below %1 %2" ).
614 arg( QString::number( firstClass.first() ) ).
618 colorRampItemlist.first().label = QString( (
"%1 - %2 %3" ) ).
619 arg( QString::number( firstClass.first() ) ).
620 arg( QString::number( firstClass.last() ) ).
624 if ( lastClass.count() == 1 )
625 colorRampItemlist.last().label = QObject::tr(
"above %1 %2" ).
626 arg( QString::number( lastClass.first() ) ).
630 colorRampItemlist.last().label = QString( (
"%1 - %2 %3" ) ).
631 arg( QString::number( lastClass.first() ) ).
632 arg( QString::number( lastClass.last() ) ).
651 if ( mTemporalProperties->
isActive() )
659 if ( mTemporalProperties->
isActive() )
665 void QgsMeshLayer::fillNativeMesh()
667 Q_ASSERT( !mNativeMesh );
669 mNativeMesh.reset(
new QgsMesh() );
677 void QgsMeshLayer::onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes )
680 for (
int i = 0; i < datasetGroupIndexes.count(); ++i )
681 assignDefaultStyleToDatasetGroup( datasetGroupIndexes.at( i ) );
689 return mDatasetGroupStore->datasetGroupTreeItem();
694 mDatasetGroupStore->setDatasetGroupTreeItem( rootItem );
695 updateActiveDatasetGroups();
698 int QgsMeshLayer::closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const
700 QgsRectangle searchRectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
704 int selectedIndex = -1;
708 double sqrMaxDistFromPoint = pow( searchRadius, 2 );
709 for (
const int edgeIndex : edgeIndexes )
715 double sqrDist = point.
sqrDistToSegment( vertex1.
x(), vertex1.
y(), vertex2.
x(), vertex2.
y(), projPoint );
716 if ( sqrDist < sqrMaxDistFromPoint )
718 selectedIndex = edgeIndex;
719 projectedPoint = projPoint;
720 sqrMaxDistFromPoint = sqrDist;
725 return selectedIndex;
736 mTemporalProperties->
setReferenceTime( referenceTime, lDataProvider->temporalCapabilities() );
751 return exactPosition;
752 QgsRectangle rectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
753 double maxDistance = searchRadius;
756 for (
const int edgeIndex : edgeIndexes )
761 double dist1 = point.
distance( vertex1 );
762 double dist2 = point.
distance( vertex2 );
763 if ( dist1 < maxDistance )
766 exactPosition = vertex1;
768 if ( dist2 < maxDistance )
771 exactPosition = vertex2;
777 for (
const int faceIndex : faceIndexes )
780 for (
int i = 0; i < 3; ++i )
783 double dist = point.
distance( vertex );
784 if ( dist < maxDistance )
787 exactPosition = vertex;
792 return exactPosition;
798 closestEdge( point, searchRadius, projectedPoint );
800 return projectedPoint;
808 return centroidPosition;
809 QgsRectangle rectangle( point.
x() - searchRadius, point.
y() - searchRadius, point.
x() + searchRadius, point.
y() + searchRadius );
810 double maxDistance = std::numeric_limits<double>::max();
813 for (
const int faceIndex : faceIndexes )
816 if ( nativefaceIndex < 0 && nativefaceIndex >= mesh->
faceCentroids().count() )
819 double dist = point.
distance( centroid );
820 if ( dist < maxDistance )
823 centroidPosition = centroid;
827 return centroidPosition;
832 mDatasetGroupStore->resetDatasetGroupTreeItem();
833 updateActiveDatasetGroups();
838 if ( !mDataProvider )
841 for (
int i = 0; i < groupCount; ++i )
853 qint64 time = mDatasetGroupStore->datasetRelativeTime( index );
863 return mDatasetGroupStore->datasetRelativeTime( index );
866 void QgsMeshLayer::updateActiveDatasetGroups()
870 if ( !mDatasetGroupStore->datasetGroupTreeItem() )
880 if ( !activeScalarItem && treeItem->
childCount() > 0 )
881 activeScalarItem = treeItem->
child( 0 );
883 if ( activeScalarItem && !activeScalarItem->
isEnabled() )
885 for (
int i = 0; i < treeItem->
childCount(); ++i )
887 activeScalarItem = treeItem->
child( i );
891 activeScalarItem =
nullptr;
895 if ( activeScalarItem )
903 if ( !( activeVectorItem && activeVectorItem->
isEnabled() ) )
914 void QgsMeshLayer::setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags )
922 if ( !
mDataSource.isEmpty() && !provider.isEmpty() )
924 ok = setDataProvider( provider, options,
flags );
935 switch ( elementType )
938 return snapOnVertex( point, searchRadius );
940 return snapOnEdge( point, searchRadius );
942 return snapOnFace( point, searchRadius );
976 return mSimplificationSettings;
981 mSimplificationSettings = simplifySettings;
992 props[
"color1"] =
"13,8,135,255";
993 props[
"color2"] =
"240,249,33,255";
995 "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:"
996 "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:"
997 "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:"
998 "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:"
999 "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:"
1000 "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:"
1001 "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:"
1002 "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:"
1003 "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:"
1004 "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";
1008 void QgsMeshLayer::assignDefaultStyleToDatasetGroup(
int groupIndex )
1011 double groupMin =
metadata.minimum();
1012 double groupMax =
metadata.maximum();
1015 fcn.classifyColorRamp( 5, -1,
QgsRectangle(),
nullptr );
1042 createSimplifiedMeshes();
1045 if ( !mRendererCache )
1046 mRendererCache.reset(
new QgsMeshLayerRendererCache() );
1054 Q_UNUSED( errorMessage )
1057 QDomElement elem = node.toElement();
1061 QDomElement elemRendererSettings = elem.firstChildElement(
"mesh-renderer-settings" );
1062 if ( !elemRendererSettings.isNull() )
1063 mRendererSettings.
readXml( elemRendererSettings, context );
1065 QDomElement elemSimplifySettings = elem.firstChildElement(
"mesh-simplify-settings" );
1066 if ( !elemSimplifySettings.isNull() )
1067 mSimplificationSettings.
readXml( elemSimplifySettings, context );
1070 QDomNode blendModeNode = node.namedItem( QStringLiteral(
"blendMode" ) );
1071 if ( !blendModeNode.isNull() )
1073 QDomElement e = blendModeNode.toElement();
1080 QDomNode layerOpacityNode = node.namedItem( QStringLiteral(
"layerOpacity" ) );
1081 if ( !layerOpacityNode.isNull() )
1083 QDomElement e = layerOpacityNode.toElement();
1094 Q_UNUSED( errorMessage )
1097 QDomElement elem = node.toElement();
1101 QDomElement elemRendererSettings = mRendererSettings.
writeXml( doc, context );
1102 elem.appendChild( elemRendererSettings );
1104 QDomElement elemSimplifySettings = mSimplificationSettings.
writeXml( doc, context );
1105 elem.appendChild( elemSimplifySettings );
1108 QDomElement blendModeElement = doc.createElement( QStringLiteral(
"blendMode" ) );
1110 blendModeElement.appendChild( blendModeText );
1111 node.appendChild( blendModeElement );
1116 QDomElement layerOpacityElem = doc.createElement( QStringLiteral(
"layerOpacity" ) );
1117 QDomText layerOpacityText = doc.createTextNode( QString::number(
opacity() ) );
1118 layerOpacityElem.appendChild( layerOpacityText );
1119 node.appendChild( layerOpacityElem );
1127 return writeSymbology( node, doc, errorMessage, context, categories );
1132 return readSymbology( node, errorMessage, context, categories );
1138 if ( provider == QLatin1String(
"mdal" ) )
1160 QDomNode pkeyNode = layer_node.namedItem( QStringLiteral(
"provider" ) );
1162 if ( pkeyNode.isNull() )
1168 QDomElement pkeyElt = pkeyNode.toElement();
1178 QgsDataProvider::ReadFlags
flags = QgsDataProvider::ReadFlags();
1184 QDomElement elemExtraDatasets = layer_node.firstChildElement( QStringLiteral(
"extra-datasets" ) );
1185 if ( !elemExtraDatasets.isNull() )
1187 QDomElement elemUri = elemExtraDatasets.firstChildElement( QStringLiteral(
"uri" ) );
1188 while ( !elemUri.isNull() )
1191 mExtraDatasetUri.append( uri );
1192 elemUri = elemUri.nextSiblingElement( QStringLiteral(
"uri" ) );
1196 if ( pkeyNode.toElement().hasAttribute( QStringLiteral(
"time-unit" ) ) )
1197 mTemporalUnit =
static_cast<QgsUnitTypes::TemporalUnit>( pkeyNode.toElement().attribute( QStringLiteral(
"time-unit" ) ).toInt() );
1200 QDomElement elemDatasetGroupsStore = layer_node.firstChildElement( QStringLiteral(
"mesh-dataset-groups-store" ) );
1201 if ( elemDatasetGroupsStore.isNull() )
1204 mDatasetGroupStore->readXml( elemDatasetGroupsStore, context );
1211 if ( !mTemporalProperties->
timeExtent().begin().isValid() )
1215 QDomElement elemStaticDataset = layer_node.firstChildElement( QStringLiteral(
"static-active-dataset" ) );
1216 if ( elemStaticDataset.hasAttribute( QStringLiteral(
"scalar" ) ) )
1218 mStaticScalarDatasetIndex = elemStaticDataset.attribute( QStringLiteral(
"scalar" ) ).toInt();
1220 if ( elemStaticDataset.hasAttribute( QStringLiteral(
"vector" ) ) )
1222 mStaticVectorDatasetIndex = elemStaticDataset.attribute( QStringLiteral(
"vector" ) ).toInt();
1231 QDomElement mapLayerNode = layer_node.toElement();
1233 if ( mapLayerNode.isNull() || ( QLatin1String(
"maplayer" ) != mapLayerNode.nodeName() ) )
1242 if ( mDataProvider )
1244 QDomElement provider = document.createElement( QStringLiteral(
"provider" ) );
1245 QDomText providerText = document.createTextNode(
providerType() );
1246 provider.appendChild( providerText );
1247 layer_node.appendChild( provider );
1250 const QStringList extraDatasetUris = mDataProvider->
extraDatasets();
1251 QDomElement elemExtraDatasets = document.createElement( QStringLiteral(
"extra-datasets" ) );
1252 for (
const QString &uri : extraDatasetUris )
1255 QDomElement elemUri = document.createElement( QStringLiteral(
"uri" ) );
1256 elemUri.appendChild( document.createTextNode( path ) );
1257 elemExtraDatasets.appendChild( elemUri );
1259 layer_node.appendChild( elemExtraDatasets );
1262 QDomElement elemStaticDataset = document.createElement( QStringLiteral(
"static-active-dataset" ) );
1263 elemStaticDataset.setAttribute( QStringLiteral(
"scalar" ), mStaticScalarDatasetIndex );
1264 elemStaticDataset.setAttribute( QStringLiteral(
"vector" ), mStaticVectorDatasetIndex );
1265 layer_node.appendChild( elemStaticDataset );
1268 layer_node.appendChild( mDatasetGroupStore->writeXml( document, context ) );
1272 return writeSymbology( layer_node, document, errorMsg, context );
1277 if ( mDataProvider && mDataProvider->
isValid() )
1283 mNativeMesh.reset(
new QgsMesh );
1288 mTriangularMeshes.clear();
1291 mRendererCache.reset(
new QgsMeshLayerRendererCache() );
1297 if ( mDataProvider )
1300 return QStringList();
1306 QString myMetadata = QStringLiteral(
"<html>\n<body>\n" );
1309 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Information from provider" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1310 myMetadata += QLatin1String(
"<table class=\"list-view\">\n" );
1313 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Name" ) + QStringLiteral(
"</td><td>" ) +
name() + QStringLiteral(
"</td></tr>\n" );
1318 if ( uriComponents.contains( QStringLiteral(
"path" ) ) )
1320 path = uriComponents[QStringLiteral(
"path" )].toString();
1321 if ( QFile::exists( path ) )
1322 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" );
1324 if ( uriComponents.contains( QStringLiteral(
"url" ) ) )
1326 const QString url = uriComponents[QStringLiteral(
"url" )].toString();
1327 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" );
1332 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Source" ) + QStringLiteral(
"</td><td>%1" ).arg(
publicSource() ) + QStringLiteral(
"</td></tr>\n" );
1335 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" ) + tr(
"Extent" ) + QStringLiteral(
"</td><td>" ) +
extent().
toString() + QStringLiteral(
"</td></tr>\n" );
1338 QLocale locale = QLocale();
1339 locale.setNumberOptions( locale.numberOptions() &= ~QLocale::NumberOption::OmitGroupSeparator );
1343 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1344 + tr(
"Vertex count" ) + QStringLiteral(
"</td><td>" )
1345 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->vertexCount() ) ) )
1346 + QStringLiteral(
"</td></tr>\n" );
1347 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1348 + tr(
"Face count" ) + QStringLiteral(
"</td><td>" )
1349 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->faceCount() ) ) )
1350 + QStringLiteral(
"</td></tr>\n" );
1351 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1352 + tr(
"Edge count" ) + QStringLiteral(
"</td><td>" )
1353 + ( locale.toString(
static_cast<qlonglong
>(
dataProvider()->edgeCount() ) ) )
1354 + QStringLiteral(
"</td></tr>\n" );
1355 myMetadata += QStringLiteral(
"<tr><td class=\"highlight\">" )
1356 + tr(
"Dataset groups count" ) + QStringLiteral(
"</td><td>" )
1358 + QStringLiteral(
"</td></tr>\n" );
1362 myMetadata += QLatin1String(
"</table>\n<br><br>" );
1368 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Identification" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1370 myMetadata += QLatin1String(
"<br><br>\n" );
1373 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Extent" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1375 myMetadata += QLatin1String(
"<br><br>\n" );
1378 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Access" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1380 myMetadata += QLatin1String(
"<br><br>\n" );
1383 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Contacts" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1385 myMetadata += QLatin1String(
"<br><br>\n" );
1388 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"Links" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1390 myMetadata += QLatin1String(
"<br><br>\n" );
1393 myMetadata += QStringLiteral(
"<h1>" ) + tr(
"History" ) + QStringLiteral(
"</h1>\n<hr>\n" );
1395 myMetadata += QLatin1String(
"<br><br>\n" );
1397 myMetadata += QLatin1String(
"\n</body>\n</html>\n" );
1403 mDatasetGroupStore->setPersistentProvider(
nullptr, QStringList() );
1405 delete mDataProvider;
1411 if ( !mDataProvider )
1413 QgsDebugMsgLevel( QStringLiteral(
"Unable to get mesh data provider" ), 2 );
1417 mDataProvider->setParent(
this );
1418 QgsDebugMsgLevel( QStringLiteral(
"Instantiated the mesh data provider plugin" ), 2 );
1428 mDatasetGroupStore->setPersistentProvider( mDataProvider, mExtraDatasetUri );
1431 if ( provider == QLatin1String(
"mesh_memory" ) )
1438 assignDefaultStyleToDatasetGroup( i );
1447 return mTemporalProperties;
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
@ EqualInterval
Uses equal interval.
QgsColorRamp * sourceColorRamp() const
Returns the source color ramp.
@ Exact
Assigns the color of the exact matching value in the color ramp item list.
void setClassificationMode(ClassificationMode classificationMode)
Sets classification mode.
void setColorRampItemList(const QList< QgsColorRampShader::ColorRampItem > &list)
Sets a custom colormap.
void setColorRampType(QgsColorRampShader::Type colorRampType)
Sets the color ramp type.
Abstract base class for color ramps.
virtual QColor color(double value) const =0
Returns the color corresponding to a specified value.
Contains information about the context in which a coordinate transform is executed.
bool hasTemporalCapabilities() const
Returns true if the provider has temporal capabilities available.
@ FlagTrustDataSource
Trust datasource config (primary key unicity, geometry type and srid, etc). Improves provider load ti...
QgsCoordinateTransformContext transformContext() const
Returns data provider coordinate transform context.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
void dataChanged()
Emitted whenever a change is made to the data provider which may have caused changes in the provider'...
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.
virtual void reloadData()
Reloads the data from the source for providers with data caches to synchronize, changes in the data s...
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)
Sets data coordinate transform context to transformContext.
static QgsColorRamp * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsColorRamp from a map of properties.
Class defining color to render mesh datasets.
Represents a simple line renderer with width and color varying depending on values.
Represents a width than can vary depending on values.
void setMaximumValue(double maximumValue)
Sets the maximum value used to defined the variable width.
void setMinimumValue(double minimumValue)
Sets the minimum value used to defined the variable width.
A representation of the interval between two datetime values.
double seconds() const
Returns the interval duration in seconds.
static QString typeToString(QgsMapLayerType type)
Converts a map layer type to a string value.
static QgsMapLayerLegend * defaultMeshLegend(QgsMeshLayer *ml)
Create new legend implementation for mesh layer.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for storage of map layer temporal properties.
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
Base class for all map layer types.
virtual bool isSpatial() const
Returns true if the layer is considered a spatial layer, ie it has some form of geometry associated w...
QString source() const
Returns the source for the layer.
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
QString publicSource() const
Gets a version of the internal layer definition that has sensitive bits removed (for example,...
QgsMapLayer::LayerFlags flags() const
Returns the flags for this layer.
QString mLayerName
Name of the layer - used for display.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
QString crsHtmlMetadata() const
Returns a HTML fragment containing the layer's CRS metadata, for use in the htmlMetadata() method.
QgsLayerMetadata metadata
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
virtual void setOpacity(double opacity)
Sets the opacity for the layer, where opacity is a value between 0 (totally transparent) and 1....
QString mProviderKey
Data provider key (name of the data provider)
QgsCoordinateTransformContext transformContext() const
Returns the layer data provider coordinate transform context or a default transform context if the la...
void rendererChanged()
Signal emitted when renderer is changed.
void dataSourceChanged()
Emitted whenever the layer's data source has been changed.
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
void dataChanged()
Data of layer changed.
QString mDataSource
Data source description string, varies by layer type.
@ FlagTrustLayerMetadata
Trust layer metadata. Improves layer load time by skipping expensive checks like primary key unicity,...
@ FlagDontResolveLayers
Don't resolve layer paths or create data providers for layers.
void setValid(bool valid)
Sets whether layer is valid or not.
void readCommonStyle(const QDomElement &layerElement, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)
Read style data common to all layer types.
QgsMapLayer::ReadFlags mReadFlags
Read flags. It's up to the subclass to respect these when restoring state from XML.
void setLegend(QgsMapLayerLegend *legend)
Assign a legend controller to the map layer.
@ Rendering
Rendering: scale visibility, simplify method, opacity.
void setProviderType(const QString &providerType)
Sets the providerType (provider key)
void writeCommonStyle(QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const
Write style data common to all layer types.
void invalidateWgs84Extent()
Invalidates the WGS84 extent.
bool mShouldValidateCrs
true if the layer's CRS should be validated and invalid CRSes are not permitted.
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
Abstract class to interpolate 3d stacked mesh data to 2d data.
QgsMeshDataBlock calculate(const QgsMesh3dDataBlock &block3d, QgsFeedback *feedback=nullptr) const
Calculated 2d block values from 3d stacked mesh values.
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N faces defined on base mesh frame.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
QgsMeshDatasetValue value(int index) const
Returns a value represented by the index For active flag the behavior is undefined.
bool isValid() const
Whether the block is valid.
QgsUnitTypes::TemporalUnit temporalUnit() const
Returns the temporal unit used to read data by the data provider.
QDateTime referenceTime() const
Returns the reference time.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
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.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
void setTemporalUnit(QgsUnitTypes::TemporalUnit unit)
Sets the temporal unit of the provider and reload data if it changes.
virtual void populateMesh(QgsMesh *mesh) const =0
Populates the mesh vertices, edges and faces.
Class used to register and access all the dataset groups related to a mesh layer.
void datasetGroupsAdded(QList< int > indexes)
Emitted after dataset groups are added.
Tree item for display of the mesh dataset groups.
int childCount() const
Returns the count of children.
int datasetGroupIndex() const
QgsMeshDatasetGroupTreeItem * childFromDatasetGroupIndex(int index)
Returns the child with dataset group index Searches as depper as needed on the child hierarchy.
QgsMeshDatasetGroupTreeItem * child(int row) const
Returns a child.
Abstract class that represents a dataset group.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
bool isValid() const
Returns whether index is valid, ie at least groups is set.
int group() const
Returns a group index.
int dataset() const
Returns a dataset index within group()
virtual int datasetGroupCount() const =0
Returns number of datasets groups loaded.
virtual QStringList extraDatasets() const =0
Returns list of additional dataset file URIs added using addDataset() calls.
QgsMeshDatasetValue represents single dataset value.
double y() const
Returns y value.
double x() const
Returns x value.
Implementation of threaded rendering for mesh layers.
Implementation of map layer temporal properties for mesh layers.
QDateTime referenceTime() const
Returns the reference time.
void setMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match dataset from temporal capabilities.
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod() const
Returns the method used to match dataset from temporal capabilities.
void setReferenceTime(const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities)
Sets the reference time and update the time extent from the temporal capabilities,...
void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities) override
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
QgsDateTimeRange timeExtent() const
Returns the time extent.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void setMeshSimplificationSettings(const QgsMeshSimplificationSettings &meshSimplificationSettings)
Sets mesh simplification settings.
int datasetCount(const QgsMeshDatasetIndex &index) const
Returns the dataset count in the dataset groups.
QList< int > datasetGroupsIndexes() const
Returns the list of indexes of dataset groups handled by the layer.
QgsRectangle extent() const override
Returns the extent of the layer.
void setStaticVectorDatasetIndex(const QgsMeshDatasetIndex &staticVectorDatasetIndex)
Sets the static vector dataset index that is rendered if the temporal properties is not active.
void setStaticScalarDatasetIndex(const QgsMeshDatasetIndex &staticScalarDatasetIndex)
Sets the static scalar dataset index that is rendered if the temporal properties is not active.
QgsMeshRendererSettings rendererSettings() const
Returns renderer settings.
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.
void activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
int datasetGroupCount() const
Returns the dataset groups count handle by the layer.
void updateTriangularMesh(const QgsCoordinateTransform &transform=QgsCoordinateTransform())
Gets native mesh and updates (creates if it doesn't exist) the base triangular mesh.
bool addDatasets(const QString &path, const QDateTime &defaultReferenceTime=QDateTime())
Adds datasets to the mesh from file with path.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
void reload() override
Synchronises with changes in the datasource.
QgsMeshDatasetIndex activeScalarDatasetAtTime(const QgsDateTimeRange &timeRange) const
Returns dataset index from active scalar group depending on the time range.
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 ...
bool readXml(const QDomNode &layer_node, QgsReadWriteContext &context) override
Called by readLayerXML(), used by children to read state specific to them from project files.
QStringList subLayers() const override
Returns the sublayers of this layer.
void setDatasetGroupTreeRootItem(QgsMeshDatasetGroupTreeItem *rootItem)
Sets the root items of the dataset group tree item.
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...
QgsMesh * nativeMesh()
Returns native mesh (nullptr before rendering or calling to updateMesh)
QgsTriangularMesh * triangularMeshByLodIndex(int lodIndex) const
Returns triangular corresponding to the index of level of details.
QString htmlMetadata() const override
Obtain a formatted HTML string containing assorted metadata for this layer.
QgsMesh3dDataBlock dataset3dValue(const QgsMeshDatasetIndex &index, const QgsPointXY &point) const
Returns the 3d values of stacked 3d mesh defined by the given point.
QgsMeshLayer * clone() const override
Returns a new instance equivalent to this one except for the id which is still unique.
void timeSettingsChanged()
Emitted when time format is changed.
QList< int > enabledDatasetGroupsIndexes() const
Returns the list of indexes of enables dataset groups handled by the layer.
void resetDatasetGroupTreeItem()
Reset the dataset group tree item to default from provider.
int triangularMeshLevelOfDetailCount() const
Returns the count of levels of detail of the mesh simplification.
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...
QgsMeshDatasetIndex staticVectorDatasetIndex() const
Returns the static vector dataset index that is rendered if the temporal properties is not active.
QgsMeshDatasetIndex datasetIndexAtRelativeTime(const QgsInterval &relativeTime, int datasetGroupIndex) const
Returns dataset index from datasets group depending on the relative time from the layer reference tim...
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.
QgsMeshDataBlock datasetValues(const QgsMeshDatasetIndex &index, int valueIndex, int count) const
Returns N vector/scalar values from the index from the dataset.
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 setTransformContext(const QgsCoordinateTransformContext &transformContext) override
Sets the coordinate transform context to transformContext.
QgsMeshSimplificationSettings meshSimplificationSettings() const
Returns mesh simplification settings.
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
QgsMeshDatasetIndex activeVectorDatasetAtTime(const QgsDateTimeRange &timeRange) const
Returns dataset index from active vector group depending on the time range If the temporal properties...
QgsMeshDataBlock areFacesActive(const QgsMeshDatasetIndex &index, int faceIndex, int count) const
Returns whether the faces are active for particular dataset.
QgsMeshDatasetIndex staticScalarDatasetIndex() const
Returns the static scalar dataset index that is rendered if the temporal properties is not active.
bool isFaceActive(const QgsMeshDatasetIndex &index, int faceIndex) const
Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes.
QgsMeshDatasetMetadata datasetMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset metadata.
bool saveDataset(const QString &path, int datasetGroupIndex, QString driver)
Saves datasets group on file with the specified driver.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
QgsInterval firstValidTimeStep() const
Returns the first valid time step of the dataset groups, invalid QgInterval if no time step is presen...
QgsInterval datasetRelativeTime(const QgsMeshDatasetIndex &index)
Returns the relative time of the dataset from the reference time of its group.
QgsMeshDatasetIndex datasetIndexAtTime(const QgsDateTimeRange &timeRange, int datasetGroupIndex) const
Returns dataset index from datasets group depending on the time range.
QgsMeshDatasetValue datasetValue(const QgsMeshDatasetIndex &index, int valueIndex) const
Returns vector/scalar value associated with the index from the dataset To read multiple continuous va...
QgsMeshTimeSettings timeSettings() const
Returns time format settings.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories) const override
void setReferenceTime(const QDateTime &referenceTime)
Sets the reference time of the layer.
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.
int extraDatasetGroupCount() const
Returns the extra dataset groups count handle by the layer.
void setRendererSettings(const QgsMeshRendererSettings &settings)
Sets new renderer settings.
qint64 datasetRelativeTimeInMilliseconds(const QgsMeshDatasetIndex &index)
Returns the relative time (in milliseconds) of the dataset from the reference time of its group.
QgsTriangularMesh * triangularMesh(double minimumTriangleSize=0) const
Returns triangular mesh (nullptr before rendering or calling to updateMesh).
void setTemporalMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match the temporal dataset from a requested time, see activeVectorDatasetAtTi...
QgsMeshDatasetGroupTreeItem * datasetGroupTreeRootItem() const
Returns the root items of the dataset group tree item.
bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories) override
QString providerType() const
Returns the provider type for this layer.
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...
QString formatTime(double hours)
Returns (date) time in hours formatted to human readable form.
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
QgsMeshLayerRendererCache * rendererCache()
Returns native mesh (nullptr before rendering)
void setTimeSettings(const QgsMeshTimeSettings &settings)
Sets time format settings.
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.
Represents a mesh renderer settings for mesh object.
void setEnabled(bool enabled)
Sets whether mesh structure rendering is enabled.
Represents a mesh renderer settings for scalar datasets.
void setClassificationMinimumMaximum(double minimum, double maximum)
Sets min/max values used for creation of the color ramp shader.
void setColorRampShader(const QgsColorRampShader &shader)
Sets color ramp shader function.
QgsColorRampShader colorRampShader() const
Returns color ramp shader function.
@ None
Does not use resampling.
@ NeighbourAverage
Does a simple average of values defined for all surrounding faces/vertices.
void setEdgeStrokeWidth(const QgsInterpolatedLineWidth &strokeWidth)
Sets the stroke width used to render edges scalar dataset.
void setDataResamplingMethod(const DataResamplingMethod &dataResamplingMethod)
Sets data interpolation method.
Represents all mesh renderer settings.
void setActiveVectorDatasetGroup(int activeVectorDatasetGroup)
Sets the active vector dataset group.
QgsMeshRendererScalarSettings scalarSettings(int groupIndex) const
Returns renderer settings.
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
int activeScalarDatasetGroup() const
Returns the active scalar dataset group.
QgsMesh3dAveragingMethod * averagingMethod() const
Returns averaging method for conversion of 3d stacked mesh data to 2d data.
void setActiveScalarDatasetGroup(int activeScalarDatasetGroup)
Sets the active scalar dataset group.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context=QgsReadWriteContext())
Reads configuration from the given DOM element.
void setVectorSettings(int groupIndex, const QgsMeshRendererVectorSettings &settings)
Sets new renderer settings.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const
Writes configuration to a new DOM element.
void setScalarSettings(int groupIndex, const QgsMeshRendererScalarSettings &settings)
Sets new renderer settings.
void setNativeMeshSettings(const QgsMeshRendererMeshSettings &settings)
Sets new native mesh renderer settings, triggers repaint.
Represents a renderer settings for vector datasets.
void setColorRampShader(const QgsColorRampShader &colorRampShader)
Returns the color ramp shader used to render vector datasets.
Represents a overview renderer settings.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const
Writes configuration to a new DOM element.
double reductionFactor() const
Returns the reduction factor used to build simplified mesh.
bool isEnabled() const
Returns if the overview is active.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context)
Reads configuration from the given DOM element.
Represents a mesh time settings for mesh datasets.
static QgsPainting::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
static QPainter::CompositionMode getCompositionMode(QgsPainting::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
A class to represent a 2D point.
double distance(double x, double y) const SIP_HOLDGIL
Returns the distance between this point and a specified x, y coordinate.
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.
Point geometry type, with support for z-dimension and m-values.
double distance(double x, double y) const SIP_HOLDGIL
Returns the Cartesian 2D distance between this point and a specified x, y coordinate.
QVariantMap decodeUri(const QString &providerKey, const QString &uri)
Breaks a provider data source URI into its component paths (e.g.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
virtual void setMaximumValue(double value)
Sets the maximum value for the raster shader.
virtual void setMinimumValue(double value)
Sets the minimum value for the raster shader.
The class is used as a container of context for various read/write operations on other objects.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
A rectangle specified with double values.
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
void setMinimal() SIP_HOLDGIL
Set a rectangle so that min corner is at max and max corner is at min.
Contains information about the context of a rendering operation.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
static QgsStyle * defaultStyle()
Returns default application-wide style.
QgsColorRamp * colorRamp(const QString &name) const
Returns a new copy of the specified color ramp.
bool isActive() const
Returns true if the temporal property is active.
void setIsActive(bool active)
Sets whether the temporal property is active.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
const QVector< QgsMeshFace > & triangles() const
Returns triangles.
QList< int > edgeIndexesForRectangle(const QgsRectangle &rectangle) const
Finds indexes of edges intersecting given bounding box It uses spatial indexing.
const QVector< QgsMeshVertex > & vertices() const
Returns vertices in map coordinate system.
const QVector< QgsMeshEdge > & edges() const
Returns edges.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
const QVector< QgsMeshVertex > & faceCentroids() const
Returns centroids of the native faces in map CRS.
const QVector< int > & trianglesToNativeFaces() const
Returns mapping between triangles and original faces.
QList< int > faceIndexesForRectangle(const QgsRectangle &rectangle) const
Finds indexes of triangles intersecting given bounding box It uses spatial indexing.
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.
TemporalUnit
Temporal units.
@ TemporalMilliseconds
Milliseconds.
QgsMapLayerType
Types of layers that can be added to a map.
#define QgsDebugMsgLevel(str, level)
QVector< int > QgsMeshFace
List of vertex indexes.
QPair< int, int > QgsMeshEdge
Edge is a straight line seqment between 2 points.
#define INVALID_MESHLAYER_TIME
Setting options for creating vector data providers.
Setting options for loading mesh layers.
QgsCoordinateTransformContext transformContext
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
Mesh - vertices, edges and faces.
ElementType
Defines type of mesh elements.