QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsMeshDatasetGroupTreeItem Class Reference

Tree item for display of the mesh dataset groups. More...

#include <qgsmeshdataset.h>

Public Member Functions

 QgsMeshDatasetGroupTreeItem ()
 Constructor for an empty dataset group tree item. More...
 
 QgsMeshDatasetGroupTreeItem (const QDomElement &itemElement, const QgsReadWriteContext &context)
 Constructor from a DOM element, constructs also the children. More...
 
 QgsMeshDatasetGroupTreeItem (const QString &defaultName, const QString &sourceName, bool isVector, int index)
 Constructor. More...
 
 ~QgsMeshDatasetGroupTreeItem ()
 Destructor, destructs also the children. More...
 
void appendChild (QgsMeshDatasetGroupTreeItem *item)
 Appends a child item. More...
 
QgsMeshDatasetGroupTreeItemchild (int row) const
 Returns a child. More...
 
int childCount () const
 Returns the count of children. More...
 
QgsMeshDatasetGroupTreeItemchildFromDatasetGroupIndex (int index)
 Returns the child with dataset group index Searches as depper as needed on the child hierarchy. More...
 
QgsMeshDatasetGroupTreeItemclone () const
 Clones the item. More...
 
int datasetGroupIndex () const
 
QgsMeshDatasetGroup::Type datasetGroupType () const
 
QString defaultName () const
 
QString description () const
 Returns description about the dataset group (URI, formula,...) More...
 
QList< int > enabledDatasetGroupIndexes () const
 Returns a list of enabled dataset group indexes, included deeper children. More...
 
QList< int > groupIndexDependencies () const
 Returns a list of group index corresponding to dataset group that depends on the dataset group represented by this item. More...
 
bool isEnabled () const
 
bool isVector () const
 
QString name () const
 Returns the name of the item This name is the default name if the name has not been overridden (. More...
 
QgsMeshDatasetGroupTreeItemparentItem () const
 Returns the parent item, nullptr if it is root item. More...
 
QString providerName () const
 Returns the name used by the provider to identify the dataset. More...
 
void removeChild (QgsMeshDatasetGroupTreeItem *item)
 Removes and destroy a item child if exists. More...
 
int row () const
 Returns the position of the item in the parent. More...
 
void setDatasetGroup (QgsMeshDatasetGroup *datasetGroup)
 Set parameters of the item in accordance with the dataset group. More...
 
void setIsEnabled (bool isEnabled)
 Sets whether the item is enabled, that is if it is displayed in view. More...
 
void setName (const QString &name)
 Overrides the default name with the name to display. More...
 
void setPersistentDatasetGroup (const QString &uri)
 Set parameters of the item in accordance with the persistent dataset group with uri. More...
 
int totalChildCount () const
 Returns the total count of children, that is included deeper children and disabled items. More...
 
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context)
 Writes the item and its children in a DOM document. More...
 

Detailed Description

Tree item for display of the mesh dataset groups.

Dataset group is set of datasets with the same name, but different control variable (e.g. time)

Support for multiple levels, because groups can have subgroups, for example

Groups: Depth Minimum Maximum Velocity Wind speed Minimum Maximum

Tree items handle also the dependencies between dataset groups represented by these items

Since
QGIS 3.14 in core API

Definition at line 846 of file qgsmeshdataset.h.

Constructor & Destructor Documentation

◆ QgsMeshDatasetGroupTreeItem() [1/3]

QgsMeshDatasetGroupTreeItem::QgsMeshDatasetGroupTreeItem ( )
default

Constructor for an empty dataset group tree item.

◆ QgsMeshDatasetGroupTreeItem() [2/3]

QgsMeshDatasetGroupTreeItem::QgsMeshDatasetGroupTreeItem ( const QString &  defaultName,
const QString &  sourceName,
bool  isVector,
int  index 
)

Constructor.

Parameters
defaultNamethe name that will be used to display the item if iot not overrides (
See also
setName())
Parameters
sourceNamethe name used by the source (provider, dataset group store,...)
isVectorwhether the dataset group is a vector dataset group
indexindex of the dataset group

Definition at line 447 of file qgsmeshdataset.cpp.

◆ QgsMeshDatasetGroupTreeItem() [3/3]

QgsMeshDatasetGroupTreeItem::QgsMeshDatasetGroupTreeItem ( const QDomElement &  itemElement,
const QgsReadWriteContext context 
)

Constructor from a DOM element, constructs also the children.

Parameters
itemElementthe DOM element
contextwriting context (e.g. for conversion between relative and absolute paths)

Definition at line 457 of file qgsmeshdataset.cpp.

◆ ~QgsMeshDatasetGroupTreeItem()

QgsMeshDatasetGroupTreeItem::~QgsMeshDatasetGroupTreeItem ( )

Destructor, destructs also the children.

Definition at line 508 of file qgsmeshdataset.cpp.

Member Function Documentation

◆ appendChild()

void QgsMeshDatasetGroupTreeItem::appendChild ( QgsMeshDatasetGroupTreeItem item)

Appends a child item.

Note
takes ownership of item

Definition at line 536 of file qgsmeshdataset.cpp.

◆ child()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::child ( int  row) const

Returns a child.

Parameters
rowthe position of the child
Returns
the item at the position row

Definition at line 548 of file qgsmeshdataset.cpp.

◆ childCount()

int QgsMeshDatasetGroupTreeItem::childCount ( ) const

Returns the count of children.

Returns
the children's count

Definition at line 578 of file qgsmeshdataset.cpp.

◆ childFromDatasetGroupIndex()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::childFromDatasetGroupIndex ( int  index)

Returns the child with dataset group index Searches as depper as needed on the child hierarchy.

Parameters
indexthe index of the dataset group index
Returns
the item with index as dataset group index, nullptr if no item is found

Definition at line 556 of file qgsmeshdataset.cpp.

◆ clone()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::clone ( ) const

Clones the item.

Returns
the cloned item

Definition at line 522 of file qgsmeshdataset.cpp.

◆ datasetGroupIndex()

int QgsMeshDatasetGroupTreeItem::datasetGroupIndex ( ) const
Returns
the dataset group index

Definition at line 634 of file qgsmeshdataset.cpp.

◆ datasetGroupType()

QgsMeshDatasetGroup::Type QgsMeshDatasetGroupTreeItem::datasetGroupType ( ) const
Returns
the dataset group type
Since
QGIS 3.16

Definition at line 654 of file qgsmeshdataset.cpp.

◆ defaultName()

QString QgsMeshDatasetGroupTreeItem::defaultName ( ) const
Returns
the default name

Definition at line 649 of file qgsmeshdataset.cpp.

◆ description()

QString QgsMeshDatasetGroupTreeItem::description ( ) const

Returns description about the dataset group (URI, formula,...)

Since
QGIS 3.16

Definition at line 659 of file qgsmeshdataset.cpp.

◆ enabledDatasetGroupIndexes()

QList< int > QgsMeshDatasetGroupTreeItem::enabledDatasetGroupIndexes ( ) const

Returns a list of enabled dataset group indexes, included deeper children.

Returns
the list of dataset group indexes
Since
QGIS 3.16.3

Definition at line 594 of file qgsmeshdataset.cpp.

◆ groupIndexDependencies()

QList< int > QgsMeshDatasetGroupTreeItem::groupIndexDependencies ( ) const

Returns a list of group index corresponding to dataset group that depends on the dataset group represented by this item.

Returns
list of group index

Definition at line 724 of file qgsmeshdataset.cpp.

◆ isEnabled()

bool QgsMeshDatasetGroupTreeItem::isEnabled ( ) const
Returns
whether the item is enabled, that is if it is displayed in view

Definition at line 639 of file qgsmeshdataset.cpp.

◆ isVector()

bool QgsMeshDatasetGroupTreeItem::isVector ( ) const
Returns
whether the dataset group is vector

Definition at line 629 of file qgsmeshdataset.cpp.

◆ name()

QString QgsMeshDatasetGroupTreeItem::name ( ) const

Returns the name of the item This name is the default name if the name has not been overridden (.

See also
setName())
Returns
the name to display

Definition at line 621 of file qgsmeshdataset.cpp.

◆ parentItem()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::parentItem ( ) const

Returns the parent item, nullptr if it is root item.

Returns
the parent item

Definition at line 608 of file qgsmeshdataset.cpp.

◆ providerName()

QString QgsMeshDatasetGroupTreeItem::providerName ( ) const

Returns the name used by the provider to identify the dataset.

Returns
the provider name
Since
QGIS 3.16

Definition at line 796 of file qgsmeshdataset.cpp.

◆ removeChild()

void QgsMeshDatasetGroupTreeItem::removeChild ( QgsMeshDatasetGroupTreeItem item)

Removes and destroy a item child if exists.

Parameters
itemthe item to append
Since
QGIS 3.16

Definition at line 543 of file qgsmeshdataset.cpp.

◆ row()

int QgsMeshDatasetGroupTreeItem::row ( ) const

Returns the position of the item in the parent.

Returns
tow position of the item

Definition at line 613 of file qgsmeshdataset.cpp.

◆ setDatasetGroup()

void QgsMeshDatasetGroupTreeItem::setDatasetGroup ( QgsMeshDatasetGroup datasetGroup)

Set parameters of the item in accordance with the dataset group.

Parameters
datasetGrouppointer to the dataset group to accord with
Since
QGIS 3.16

Definition at line 664 of file qgsmeshdataset.cpp.

◆ setIsEnabled()

void QgsMeshDatasetGroupTreeItem::setIsEnabled ( bool  isEnabled)

Sets whether the item is enabled, that is if it is displayed in view.

Parameters
isEnabledwhether the item is enabled

Definition at line 644 of file qgsmeshdataset.cpp.

◆ setName()

void QgsMeshDatasetGroupTreeItem::setName ( const QString &  name)

Overrides the default name with the name to display.

The default name is still stored in the item but will not be displayed anymore except if the empty string is set.

Parameters
nameto display

Definition at line 801 of file qgsmeshdataset.cpp.

◆ setPersistentDatasetGroup()

void QgsMeshDatasetGroupTreeItem::setPersistentDatasetGroup ( const QString &  uri)

Set parameters of the item in accordance with the persistent dataset group with uri.

Parameters
uriuri of the persistent dataset group
Since
QGIS 3.16

Definition at line 683 of file qgsmeshdataset.cpp.

◆ totalChildCount()

int QgsMeshDatasetGroupTreeItem::totalChildCount ( ) const

Returns the total count of children, that is included deeper children and disabled items.

Returns
the total children's count

Definition at line 583 of file qgsmeshdataset.cpp.

◆ writeXml()

QDomElement QgsMeshDatasetGroupTreeItem::writeXml ( QDomDocument &  doc,
const QgsReadWriteContext context 
)

Writes the item and its children in a DOM document.

Parameters
docthe DOM document
contextwriting context (e.g. for conversion between relative and absolute paths)
Returns
the dom element where the item is written

Definition at line 690 of file qgsmeshdataset.cpp.


The documentation for this class was generated from the following files: