1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/mesh/qgsmeshlayer.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11 12 13 14class QgsMeshLayer : QgsMapLayer 15{ 16%Docstring(signature="appended") 17 18Represents a mesh layer supporting display of data on structured or unstructured meshes 19 20The :py:class:`QgsMeshLayer` is instantiated by specifying the name of a data provider, 21such as mdal, and url defining the specific data set to connect to. 22The vector layer constructor in turn instantiates a :py:class:`QgsMeshDataProvider` subclass 23corresponding to the provider type, and passes it the url. The data provider 24connects to the data source. 25 26The :py:class:`QgsMeshLayer` provides a common interface to the different data types. It does not 27yet support editing transactions. 28 29The main data providers supported by QGIS are listed below. 30 31Mesh data providers 32------------------- 33 34Memory data providerType (mesh_memory) 35~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 37The memory data provider is used to construct in memory data, for example scratch 38data. There is no inherent persistent storage of the data. The data source uri is constructed. 39Data can be populated by setMesh(const QString &vertices, const QString &faces), where 40vertices and faces is comma separated coordinates and connections for mesh. 41E.g. to create mesh with one quad and one triangle 42 43.. code-block:: python 44 45 uri = "1.0, 2.0 \n" \ 46 "2.0, 2.0 \n" \ 47 "3.0, 2.0 \n" \ 48 "2.0, 3.0 \n" \ 49 "1.0, 3.0 \n" \ 50 "---" \ 51 "0, 1, 3, 4 \n" \ 52 "1, 2, 3 \n" 53 54 scratchLayer = QgsMeshLayer(uri, "My Scratch layer", "mesh_memory") 55 56MDAL data provider (mdal) 57~~~~~~~~~~~~~~~~~~~~~~~~~ 58 59Accesses data using the MDAL drivers (https://github.com/lutraconsulting/MDAL). The url 60is the MDAL connection string. QGIS must be built with MDAL support to allow this provider. 61 62 63.. code-block:: python 64 65 uri = "test/land.2dm" 66 scratchLayer = QgsMeshLayer(uri, "My Scratch Layer", "mdal") 67 68 69 70.. note:: 71 72 The API is considered EXPERIMENTAL and can be changed without a notice 73 74 75.. versionadded:: 3.2 76%End 77 78%TypeHeaderCode 79#include "qgsmeshlayer.h" 80%End 81 public: 82 83 struct LayerOptions 84 { 85 86 explicit LayerOptions( const QgsCoordinateTransformContext &transformContext = QgsCoordinateTransformContext( ) ); 87%Docstring 88Constructor for LayerOptions with optional ``transformContext``. 89 90.. note:: 91 92 transformContext argument was added in QGIS 3.8 93%End 94 95 QgsCoordinateTransformContext transformContext; 96 97 bool loadDefaultStyle; 98 99 bool skipCrsValidation; 100 }; 101 102 explicit QgsMeshLayer( const QString &path = QString(), const QString &baseName = QString(), const QString &providerLib = QStringLiteral( "mesh_memory" ), 103 const QgsMeshLayer::LayerOptions &options = QgsMeshLayer::LayerOptions() ); 104%Docstring 105Constructor - creates a mesh layer 106 107The QgsMeshLayer is constructed by instantiating a data provider. The provider 108interprets the supplied path (url) of the data source to connect to and access the 109data. 110 111:param path: The path or url of the parameter. Typically this encodes 112 parameters used by the data provider as url query items. 113:param baseName: The name used to represent the layer in the legend 114:param providerLib: The name of the data provider, e.g., "mesh_memory", "mdal" 115:param options: general mesh layer options 116%End 117 118 ~QgsMeshLayer(); 119 120 121 SIP_PYOBJECT __repr__(); 122%Docstring 123QgsMeshLayer cannot be copied. 124%End 125%MethodCode 126 QString str = QStringLiteral( "<QgsMeshLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) ); 127 sipRes = PyUnicode_FromString( str.toUtf8().constData() ); 128%End 129 130 virtual QgsMeshDataProvider *dataProvider(); 131 132 virtual QgsMeshLayer *clone() const /Factory/; 133 134 virtual QgsRectangle extent() const; 135 136 virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/; 137 138 virtual bool readSymbology( const QDomNode &node, QString &errorMessage, 139 QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ); 140 virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, 141 const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const; 142 virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const; 143 144 virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ); 145 146 virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const; 147 148 virtual QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const; 149 150 virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ); 151 152 virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const; 153 154 virtual QgsMapLayerTemporalProperties *temporalProperties(); 155 156 virtual void reload(); 157 158 virtual QStringList subLayers() const; 159 160 virtual QString htmlMetadata() const; 161 162 virtual bool isEditable() const; 163 164 virtual bool supportsEditing() const; 165 166 virtual QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL}; 167 168 169 QString providerType() const; 170%Docstring 171Returns the provider type for this layer 172%End 173 174 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() ); 175%Docstring 176Adds datasets to the mesh from file with ``path``. Use the the time ``defaultReferenceTime`` as reference time is not provided in the file 177 178:param path: the path to the atasets file 179:param defaultReferenceTime: reference time used if not provided in the file 180 181:return: whether the dataset is added 182 183.. versionadded:: 3.14 184%End 185 186 bool addDatasets( QgsMeshDatasetGroup *datasetGroup /Transfer/ ); 187%Docstring 188Adds extra datasets to the mesh. Take ownership. 189 190:param datasetGroup: the extra dataset group 191 192:return: whether the dataset is effectively added 193 194.. versionadded:: 3.16 195%End 196 197 bool saveDataset( const QString &path, int datasetGroupIndex, QString driver ); 198%Docstring 199Saves datasets group on file with the specified ``driver`` 200 201:param path: the path of the file 202:param datasetGroupIndex: the index of the dataset group 203:param driver: the driver to used for saving 204 205:return: false if succeeds 206 207.. versionadded:: 3.16 208%End 209 210 211 212 213 214 215 void updateTriangularMesh( const QgsCoordinateTransform &transform = QgsCoordinateTransform() ); 216%Docstring 217Gets native mesh and updates (creates if it doesn't exist) the base triangular mesh 218 219:param transform: Transformation from layer CRS to destination (e.g. map) CRS. With invalid transform, it keeps the native mesh CRS 220 221.. versionadded:: 3.14 222%End 223 224 225 QgsMeshRendererSettings rendererSettings() const; 226%Docstring 227Returns renderer settings 228%End 229 void setRendererSettings( const QgsMeshRendererSettings &settings ); 230%Docstring 231Sets new renderer settings 232%End 233 234 QgsMeshTimeSettings timeSettings() const; 235%Docstring 236Returns time format settings 237 238.. versionadded:: 3.8 239%End 240 241 void setTimeSettings( const QgsMeshTimeSettings &settings ); 242%Docstring 243Sets time format settings 244 245.. versionadded:: 3.8 246%End 247 248 249 250 QString formatTime( double hours ); 251%Docstring 252Returns (date) time in hours formatted to human readable form 253 254:param hours: time in double in hours 255 256:return: formatted time string 257 258.. versionadded:: 3.8 259%End 260 261 int datasetGroupCount() const; 262%Docstring 263Returns the dataset groups count handle by the layer 264 265.. versionadded:: 3.16 266%End 267 268 int extraDatasetGroupCount() const; 269%Docstring 270Returns the extra dataset groups count handle by the layer 271 272.. versionadded:: 3.16 273%End 274 275 QList<int> datasetGroupsIndexes() const; 276%Docstring 277Returns the list of indexes of dataset groups handled by the layer 278 279.. note:: 280 281 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 282 In the layer scope, those indexes can be different from the data provider indexes. 283 284.. versionadded:: 3.16 285%End 286 287 QList<int> enabledDatasetGroupsIndexes() const; 288%Docstring 289Returns the list of indexes of enables dataset groups handled by the layer 290 291.. note:: 292 293 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 294 In the layer scope, those indexes can be different from the data provider indexes. 295 296.. versionadded:: 3.16.3 297%End 298 299 QgsMeshDatasetGroupMetadata datasetGroupMetadata( const QgsMeshDatasetIndex &index ) const; 300%Docstring 301Returns the dataset groups metadata 302 303.. note:: 304 305 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 306 In the layer scope, those indexes can be different from the data provider indexes. 307 308.. versionadded:: 3.16 309%End 310 311 int datasetCount( const QgsMeshDatasetIndex &index ) const; 312%Docstring 313Returns the dataset count in the dataset groups 314 315:param index: index of the dataset in the group 316 317.. note:: 318 319 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 320 In the layer scope, those indexes can be different from the data provider indexes. 321 322 323.. versionadded:: 3.16 324%End 325 326 QgsMeshDatasetMetadata datasetMetadata( const QgsMeshDatasetIndex &index ) const; 327%Docstring 328Returns the dataset metadata 329 330:param index: index of the dataset 331 332.. note:: 333 334 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 335 In the layer scope, those indexes can be different from the data provider indexes. 336 337 338.. versionadded:: 3.16 339%End 340 341 QgsMeshDatasetValue datasetValue( const QgsMeshDatasetIndex &index, int valueIndex ) const; 342%Docstring 343Returns vector/scalar value associated with the index from the dataset 344To read multiple continuous values, use :py:func:`~QgsMeshLayer.datasetValues` 345 346See :py:func:`QgsMeshDatasetMetadata.isVector()` or :py:func:`QgsMeshDataBlock.type()` 347to check if the returned value is vector or scalar 348 349Returns invalid value for DataOnVolumes 350 351:param index: index of the dataset 352:param valueIndex: index of the value 353 354.. note:: 355 356 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 357 In the layer scope, those indexes can be different from the data provider indexes. 358 359 360.. versionadded:: 3.16 361%End 362 363 QgsMeshDataBlock datasetValues( const QgsMeshDatasetIndex &index, int valueIndex, int count ) const; 364%Docstring 365Returns N vector/scalar values from the index from the dataset 366 367See :py:func:`QgsMeshDatasetMetadata.isVector()` or :py:func:`QgsMeshDataBlock.type()` 368to check if the returned value is vector or scalar 369 370Returns invalid block for DataOnVolumes. Use :py:func:`QgsMeshLayerUtils.datasetValues()` if you 371need block for any type of data type 372 373:param index: index of the dataset 374:param valueIndex: index of the value 375:param count: number of values to return 376 377.. note:: 378 379 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 380 In the layer scope, those indexes can be different from the data provider indexes. 381 382 383.. versionadded:: 3.16 384%End 385 386 QgsMesh3dDataBlock dataset3dValues( const QgsMeshDatasetIndex &index, int faceIndex, int count ) const; 387%Docstring 388Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes 389 390See :py:func:`QgsMeshDatasetMetadata.isVector()` to check if the returned value is vector or scalar 391 392returns invalid block for DataOnFaces and DataOnVertices. 393 394:param index: index of the dataset 395:param faceIndex: index of the face 396:param count: number of values to return 397 398.. note:: 399 400 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 401 In the layer scope, those indexes can be different from the data provider indexes. 402 403 404.. versionadded:: 3.16 405%End 406 407 bool isFaceActive( const QgsMeshDatasetIndex &index, int faceIndex ) const; 408%Docstring 409Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes 410 411See :py:func:`QgsMeshDatasetMetadata.isVector()` to check if the returned value is vector or scalar 412 413returns invalid block for DataOnFaces and DataOnVertices. 414%End 415 416 QgsMeshDataBlock areFacesActive( const QgsMeshDatasetIndex &index, int faceIndex, int count ) const; 417%Docstring 418Returns whether the faces are active for particular dataset 419 420:param index: index of the dataset 421:param faceIndex: index of the face 422:param count: number of values to return 423 424.. note:: 425 426 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 427 In the layer scope, those indexes are different from the data provider indexes. 428 429 430.. versionadded:: 3.16 431%End 432 433 QgsMeshDatasetValue datasetValue( const QgsMeshDatasetIndex &index, const QgsPointXY &point, double searchRadius = 0 ) const; 434%Docstring 435Interpolates the value on the given point from given dataset. 436For 3D datasets, it uses :py:func:`~QgsMeshLayer.dataset3dValue`, \n 437For 1D datasets, it uses :py:func:`~QgsMeshLayer.dataset1dValue` with ``searchRadius`` 438 439.. note:: 440 441 It uses previously cached and indexed triangular mesh 442 and so if the layer has not been rendered previously 443 (e.g. when used in a script) it returns NaN value 444 445.. seealso:: :py:func:`updateTriangularMesh` 446 447:param index: dataset index specifying group and dataset to extract value from 448:param point: point to query in map coordinates 449:param searchRadius: the radius of the search area in map unit 450 451:return: interpolated value at the point. Returns NaN values for values 452 outside the mesh layer, nodata values and in case triangular mesh was not 453 previously used for rendering 454 455 456.. note:: 457 458 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 459 In the layer scope, those indexes are different from the data provider indexes. 460 461 462.. versionadded:: 3.4 463%End 464 465 QgsMesh3dDataBlock dataset3dValue( const QgsMeshDatasetIndex &index, const QgsPointXY &point ) const; 466%Docstring 467Returns the 3d values of stacked 3d mesh defined by the given point 468 469.. note:: 470 471 It uses previously cached and indexed triangular mesh 472 and so if the layer has not been rendered previously 473 (e.g. when used in a script) it returns NaN value 474 475.. seealso:: :py:func:`updateTriangularMesh` 476 477:param index: dataset index specifying group and dataset to extract value from 478:param point: point to query in map coordinates 479 480:return: all 3d stacked values that belong to face defined by given point. Returns invalid block 481 for point outside the mesh layer or in case triangular mesh was not 482 previously used for rendering or for datasets that do not have type DataOnVolumes 483 484 485.. note:: 486 487 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 488 In the layer scope, those indexes are different from the data provider indexes. 489 490 491.. versionadded:: 3.12 492%End 493 494 QgsMeshDatasetValue dataset1dValue( const QgsMeshDatasetIndex &index, const QgsPointXY &point, double searchRadius ) const; 495%Docstring 496Returns the value of 1D mesh dataset defined on edge that are in the search area defined by point ans searchRadius 497 498.. note:: 499 500 It uses previously cached and indexed triangular mesh 501 and so if the layer has not been rendered previously 502 (e.g. when used in a script) it returns NaN value 503 504.. seealso:: :py:func:`updateTriangularMesh` 505 506:param index: dataset index specifying group and dataset to extract value from 507:param point: the center point of the search area 508:param searchRadius: the radius of the searc area in map unit 509 510:return: interpolated value at the projected point. Returns NaN values for values 511 outside the mesh layer and in case triangular mesh was not previously used for rendering 512 513 514.. note:: 515 516 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 517 In the layer scope, those indexes are different from the data provider indexes. 518 519 520.. versionadded:: 3.14 521%End 522 523 QgsMeshDatasetIndex datasetIndexAtTime( const QgsDateTimeRange &timeRange, int datasetGroupIndex ) const; 524%Docstring 525Returns dataset index from datasets group depending on the time range. 526If the temporal properties is not active, returns invalid dataset index. This method is used for rendering mesh layer. 527 528:param timeRange: the time range 529:param datasetGroupIndex: the index of the dataset group 530 531:return: dataset index 532 533.. note:: 534 535 the returned dataset index depends on the matching method, see :py:func:`~QgsMeshLayer.setTemporalMatchingMethod` 536 537 538.. note:: 539 540 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 541 In the layer scope, those indexes are different from the data provider indexes. 542 543 544.. versionadded:: 3.14 545%End 546 547 QgsMeshDatasetIndex datasetIndexAtRelativeTime( const QgsInterval &relativeTime, int datasetGroupIndex ) const; 548%Docstring 549Returns dataset index from datasets group depending on the relative time from the layer reference time. 550Dataset index is valid even the temporal properties is inactive. This method is used for calculation on mesh layer. 551 552:param relativeTime: the relative from the mesh layer reference time 553:param datasetGroupIndex: the index of the dataset group 554 555:return: dataset index 556 557.. note:: 558 559 the returned dataset index depends on the matching method, see :py:func:`~QgsMeshLayer.setTemporalMatchingMethod` 560 561 562.. note:: 563 564 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 565 In the layer scope, those indexes are different from the data provider indexes. 566 567 568.. versionadded:: 3.16 569%End 570 571 QList<QgsMeshDatasetIndex> datasetIndexInRelativeTimeInterval( const QgsInterval &startRelativeTime, const QgsInterval &endRelativeTime, int datasetGroupIndex ) const; 572%Docstring 573Returns a list of dataset indexes from datasets group that are in a interval time from the layer reference time. 574Dataset index is valid even the temporal properties is inactive. This method is used for calculation on mesh layer. 575 576:param startRelativeTime: the start time of the relative interval from the reference time. 577:param endRelativeTime: the end time of the relative interval from the reference time. 578:param datasetGroupIndex: the index of the dataset group 579 580:return: dataset index 581 582.. note:: 583 584 indexes are used to distinguish all the dataset groups handled by the layer (from dataprovider, extra dataset group,...) 585 In the layer scope, those indexes are different from the data provider indexes. 586 587 588.. versionadded:: 3.22 589%End 590 591 QgsMeshDatasetIndex activeScalarDatasetAtTime( const QgsDateTimeRange &timeRange ) const; 592%Docstring 593Returns dataset index from active scalar group depending on the time range. 594If the temporal properties is not active, return the static dataset 595 596:param timeRange: the time range 597 598:return: dataset index 599 600.. note:: 601 602 the returned dataset index depends on the matching method, see :py:func:`~QgsMeshLayer.setTemporalMatchingMethod` 603 604 605.. versionadded:: 3.14 606%End 607 608 QgsMeshDatasetIndex activeVectorDatasetAtTime( const QgsDateTimeRange &timeRange ) const; 609%Docstring 610Returns dataset index from active vector group depending on the time range 611If the temporal properties is not active, return the static dataset 612 613:param timeRange: the time range 614 615:return: dataset index 616 617.. note:: 618 619 the returned dataset index depends on the matching method, see :py:func:`~QgsMeshLayer.setTemporalMatchingMethod` 620 621 622.. versionadded:: 3.14 623%End 624 625 626 627 QgsMeshDatasetIndex staticScalarDatasetIndex() const; 628%Docstring 629Returns the static scalar dataset index that is rendered if the temporal properties is not active 630 631.. versionadded:: 3.14 632%End 633 634 QgsMeshDatasetIndex staticVectorDatasetIndex() const; 635%Docstring 636Returns the static vector dataset index that is rendered if the temporal properties is not active 637 638.. versionadded:: 3.14 639%End 640 641 void setReferenceTime( const QDateTime &referenceTime ); 642%Docstring 643Sets the reference time of the layer 644 645:param referenceTime: the reference time 646 647.. versionadded:: 3.14 648%End 649 650 void setTemporalMatchingMethod( const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod ); 651%Docstring 652Sets the method used to match the temporal dataset from a requested time, see :py:func:`~QgsMeshLayer.activeVectorDatasetAtTime` 653 654:param matchingMethod: the matching method 655 656.. versionadded:: 3.14 657%End 658 659 QgsPointXY snapOnElement( QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius ); 660%Docstring 661Returns the position of the snapped point on the mesh element closest to ``point`` intersecting with 662the searching area defined by ``point`` and ``searchRadius`` 663 664For vertex, the snapped position is the vertex position 665For edge, the snapped position is the projected point on the edge, extremity of edge if outside the edge 666For face, the snapped position is the centroid of the face 667The returned position is in map coordinates. 668 669.. note:: 670 671 It uses previously cached and indexed triangular mesh 672 and so if the layer has not been rendered previously 673 (e.g. when used in a script) it returns empty :py:class:`QgsPointXY` 674 675.. seealso:: :py:func:`updateTriangularMesh` 676 677:param elementType: the type of element to snap 678:param point: the center of the search area in map coordinates 679:param searchRadius: the radius of the search area in map units 680 681:return: the position of the snapped point on the closest element, empty :py:class:`QgsPointXY` if no element of type ``elementType`` 682 683 684.. versionadded:: 3.14 685%End 686 687 QList<int> selectVerticesByExpression( QgsExpression expression ); 688%Docstring 689Returns a list of vertex indexes that meet the condition defined by ``expression`` with the context ``expressionContext`` 690 691To express the relation with a vertex, the expression can be defined with function returning value 692linked to the current vertex, like " $vertex_z ", "$vertex_as_point" 693 694.. versionadded:: 3.22 695%End 696 697 QList<int> selectFacesByExpression( QgsExpression expression ); 698%Docstring 699Returns a list of faces indexes that meet the condition defined by ``expression`` with the context ``expressionContext`` 700 701To express the relation with a face, the expression can be defined with function returning value 702linked to the current face, like " $face_area " 703 704.. versionadded:: 3.22 705%End 706 707 QgsMeshDatasetGroupTreeItem *datasetGroupTreeRootItem() const; 708%Docstring 709Returns the root items of the dataset group tree item 710 711:return: the root item 712 713.. versionadded:: 3.14 714%End 715 716 void setDatasetGroupTreeRootItem( QgsMeshDatasetGroupTreeItem *rootItem ); 717%Docstring 718Sets the root items of the dataset group tree item. 719Changes active dataset groups if those one are not enabled anymore : 720 721- new active scalar dataset group is the first root item enabled child 722- new active vector dataset group is none 723 724Doesn't take ownership of the pointed item, the root item is cloned. 725 726:param rootItem: the new root item 727 728.. versionadded:: 3.14 729%End 730 731 void resetDatasetGroupTreeItem(); 732%Docstring 733Reset the dataset group tree item to default from provider 734 735.. versionadded:: 3.14 736%End 737 738 QgsInterval firstValidTimeStep() const; 739%Docstring 740Returns the first valid time step of the dataset groups, invalid QgInterval if no time step is present 741 742.. versionadded:: 3.14 743%End 744 745 QgsInterval datasetRelativeTime( const QgsMeshDatasetIndex &index ); 746%Docstring 747Returns the relative time of the dataset from the reference time of its group 748 749.. versionadded:: 3.16 750%End 751 752 qint64 datasetRelativeTimeInMilliseconds( const QgsMeshDatasetIndex &index ); 753%Docstring 754Returns the relative time (in milliseconds) of the dataset from the reference time of its group 755 756.. versionadded:: 3.16 757%End 758 759 bool startFrameEditing( const QgsCoordinateTransform &transform ); 760%Docstring 761Starts edition of the mesh frame. Coordinate ``transform`` used to initialize the triangular mesh if needed. 762This operation will disconnect the mesh layer from the data provider anf removes all existing dataset group 763 764.. versionadded:: 3.22 765%End 766 767 bool commitFrameEditing( const QgsCoordinateTransform &transform, bool continueEditing = true ); 768%Docstring 769Commits edition of the mesh frame, 770Rebuilds the triangular mesh and its spatial index with ``transform``, 771Continue editing with the same mesh editor if ``continueEditing`` is True 772 773:return: ``True`` if the commit succeeds 774 775.. versionadded:: 3.22 776%End 777 778 bool rollBackFrameEditing( const QgsCoordinateTransform &transform, bool continueEditing = true ); 779%Docstring 780Rolls Back edition of the mesh frame. 781Reload mesh from file, rebuilds the triangular mesh and its spatial index with ``transform``, 782Continue editing with the same mesh editor if ``continueEditing`` is ``True`` 783 784:return: ``True`` if the rollback succeeds 785 786.. versionadded:: 3.22 787%End 788 789 void stopFrameEditing( const QgsCoordinateTransform &transform ); 790%Docstring 791Stops edition of the mesh, re-indexes the faces and vertices, 792rebuilds the triangular mesh and its spatial index with ``transform``, 793clean the undostack 794 795.. versionadded:: 3.22 796%End 797 798 bool reindex( const QgsCoordinateTransform &transform, bool renumber ); 799%Docstring 800Re-indexes the faces and vertices, and renumber the indexes if ``renumber`` is ``True``. 801rebuilds the triangular mesh and its spatial index with ``transform``, 802clean the undostack 803 804Returns ``False`` if the operation fails 805 806.. versionadded:: 3.22 807%End 808 809 QgsMeshEditor *meshEditor(); 810%Docstring 811Returns a pointer to the mesh editor own by the mesh layer 812 813.. versionadded:: 3.22 814%End 815 816 virtual bool isModified() const; 817 818%Docstring 819Returns whether the mesh frame has been modified since the last save 820 821.. versionadded:: 3.22 822%End 823 824 bool contains( const QgsMesh::ElementType &type ) const; 825%Docstring 826Returns whether the mesh contains at mesh elements of given type 827 828.. versionadded:: 3.22 829%End 830 831 int meshVertexCount() const; 832%Docstring 833Returns the vertices count of the mesh frame 834 835.. note:: 836 837 during mesh editing, some vertices can be void and are not included in this returned value 838 839.. versionadded:: 3.22 840%End 841 842 int meshFaceCount() const; 843%Docstring 844Returns the faces count of the mesh frame 845 846.. note:: 847 848 during mesh editing, some faces can be void and are not included in this returned value 849 850.. versionadded:: 3.22 851%End 852 853 int meshEdgeCount() const; 854%Docstring 855Returns the edges count of the mesh frame 856 857.. versionadded:: 3.22 858%End 859 860 public slots: 861 862 virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ); 863 864%Docstring 865Sets the coordinate transform context to ``transformContext``. 866 867.. versionadded:: 3.8 868%End 869 870 signals: 871 872 void activeScalarDatasetGroupChanged( int index ); 873%Docstring 874Emitted when active scalar group dataset is changed 875 876.. versionadded:: 3.14 877%End 878 879 void activeVectorDatasetGroupChanged( int index ); 880%Docstring 881Emitted when active vector group dataset is changed 882 883.. versionadded:: 3.14 884%End 885 886 void timeSettingsChanged( ); 887%Docstring 888Emitted when time format is changed 889 890.. versionadded:: 3.8 891%End 892 893 private: // Private methods 894 QgsMeshLayer( const QgsMeshLayer &rhs ); 895}; 896 897/************************************************************************ 898 * This file has been generated automatically from * 899 * * 900 * src/core/mesh/qgsmeshlayer.h * 901 * * 902 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 903 ************************************************************************/ 904