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

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 855 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 463 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 473 of file qgsmeshdataset.cpp.

◆ ~QgsMeshDatasetGroupTreeItem()

QgsMeshDatasetGroupTreeItem::~QgsMeshDatasetGroupTreeItem ( )

Destructor, destructs also the children.

Definition at line 524 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 552 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 564 of file qgsmeshdataset.cpp.

◆ childCount()

int QgsMeshDatasetGroupTreeItem::childCount ( ) const

Returns the count of children.

Returns
the children's count

Definition at line 594 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 572 of file qgsmeshdataset.cpp.

◆ clone()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::clone ( ) const

Clones the item.

Returns
the cloned item

Definition at line 538 of file qgsmeshdataset.cpp.

◆ datasetGroupIndex()

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

Definition at line 650 of file qgsmeshdataset.cpp.

◆ datasetGroupType()

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

Definition at line 670 of file qgsmeshdataset.cpp.

◆ defaultName()

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

Definition at line 665 of file qgsmeshdataset.cpp.

◆ description()

QString QgsMeshDatasetGroupTreeItem::description ( ) const

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

Since
QGIS 3.16

Definition at line 675 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 610 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 740 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 655 of file qgsmeshdataset.cpp.

◆ isVector()

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

Definition at line 645 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 637 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 624 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 812 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 559 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 629 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 680 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 660 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 817 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 699 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 599 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 706 of file qgsmeshdataset.cpp.


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