QGIS API Documentation  3.14.0-Pi (9f7028fd23)
Public Member Functions | List of all members
QgsMeshDatasetGroupTreeItem Class Reference

#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, contruct also the children. More...
 
 QgsMeshDatasetGroupTreeItem (const QString &defaultName, bool isVector, int index)
 Constructor. More...
 
 ~QgsMeshDatasetGroupTreeItem ()
 Destructor, destructs also the chilren. More...
 
void appendChild (QgsMeshDatasetGroupTreeItem *item)
 Appends a item child. 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
 
QString defaultName () const
 
bool isEnabled () const
 
bool isVector () const
 
QString name () const
 Returns the name of the item This mame is the default name if the name has not been overrided (. More...
 
QgsMeshDatasetGroupTreeItemparentItem () const
 Returns the parent item, nullptr if it is root item. More...
 
int row () const
 Returns the position of the item in the parent. 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...
 
int totalChildCount () const
 Returns the total count of children, that is included deeper children. More...
 
QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context)
 Write 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

Since
QGIS 3.14 in core API

Definition at line 546 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,
bool  isVector,
int  index 
)

Constructor.

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

Definition at line 439 of file qgsmeshdataset.cpp.

◆ QgsMeshDatasetGroupTreeItem() [3/3]

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

Constructor from a DOM element, contruct also the children.

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

Definition at line 448 of file qgsmeshdataset.cpp.

◆ ~QgsMeshDatasetGroupTreeItem()

QgsMeshDatasetGroupTreeItem::~QgsMeshDatasetGroupTreeItem ( )

Destructor, destructs also the chilren.

Definition at line 475 of file qgsmeshdataset.cpp.

Member Function Documentation

◆ appendChild()

void QgsMeshDatasetGroupTreeItem::appendChild ( QgsMeshDatasetGroupTreeItem item)

Appends a item child.

Parameters
itemthe item to append
Note
takes ownership of item

Definition at line 493 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 positon row

Definition at line 500 of file qgsmeshdataset.cpp.

◆ childCount()

int QgsMeshDatasetGroupTreeItem::childCount ( ) const

Returns the count of children.

Returns
the children's count

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

◆ clone()

QgsMeshDatasetGroupTreeItem * QgsMeshDatasetGroupTreeItem::clone ( ) const

Clones the item.

Returns
the cloned item

Definition at line 480 of file qgsmeshdataset.cpp.

◆ datasetGroupIndex()

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

Definition at line 572 of file qgsmeshdataset.cpp.

◆ defaultName()

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

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

◆ isVector()

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

Definition at line 567 of file qgsmeshdataset.cpp.

◆ name()

QString QgsMeshDatasetGroupTreeItem::name ( ) const

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

See also
setName())
Returns
the name to display

Definition at line 559 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 546 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 551 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 582 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 setted.

Parameters
nameto display

Definition at line 609 of file qgsmeshdataset.cpp.

◆ totalChildCount()

int QgsMeshDatasetGroupTreeItem::totalChildCount ( ) const

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

Returns

Definition at line 535 of file qgsmeshdataset.cpp.

◆ writeXml()

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

Write 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 592 of file qgsmeshdataset.cpp.


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