#include <ClustersModel.h>
Clusters model class
List model class for storing clusters
- Author
- Thomas Kroes
◆ Column
Columns
| Enumerator |
|---|
| Color | |
| Name | Color of the cluster
|
| ID | Name of the cluster
|
| NumberOfIndices | Identifier of the cluster
|
| ModifiedByUser | Number of indices in the cluster
|
| Count | Whether the cluster is modified by the user Number of columns
|
◆ ClustersModel()
| ClustersModel::ClustersModel |
( |
QObject * |
parent = nullptr | ) |
|
Constructor
- Parameters
-
| parent | Pointer to parent object |
◆ colorizeClusters() [1/2]
| void ClustersModel::colorizeClusters |
( |
const QImage & |
colorMapImage | ) |
|
Colorize clusters by color map
- Parameters
-
| colorMapImage | Color map image |
◆ colorizeClusters() [2/2]
| void ClustersModel::colorizeClusters |
( |
std::int32_t |
randomSeed = 0 | ) |
|
Colorize clusters by pseudo-random colors
- Parameters
-
| randomSeed | Random seed for pseudo-random colors |
◆ columnCount()
| int ClustersModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
override |
Get the number of columns
- Parameters
-
- Returns
- Number of columns in the model
◆ data()
| QVariant ClustersModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
override |
Get data
- Parameters
-
| index | Model index to query |
| role | Data role |
- Returns
- Data
◆ doAllClusterNamesStartWith()
| bool ClustersModel::doAllClusterNamesStartWith |
( |
const QString & |
prefix | ) |
|
Get whether all cluster names start with the supplied prefix
- Parameters
-
◆ flags()
| Qt::ItemFlags ClustersModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
override |
Get item flags
- Parameters
-
- Returns
- Item flags
◆ getClusters()
| QVector< Cluster > & ClustersModel::getClusters |
( |
| ) |
|
◆ getNumberOfUserModifiedClusters()
| std::uint32_t ClustersModel::getNumberOfUserModifiedClusters |
( |
| ) |
const |
Get the number of clusters that have been modified by the user
- Returns
- Number of user modified clusters
◆ hasUserModifications()
| bool ClustersModel::hasUserModifications |
( |
| ) |
const |
Get whether the model has user modifications
- Returns
- Whether the model has user modifications
◆ headerData()
| QVariant ClustersModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
override |
Get header data
- Parameters
-
| section | Section |
| orientation | Orientation |
| role | Data role |
- Returns
- Header
◆ index()
| QModelIndex ClustersModel::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| const |
|
override |
Mandatory override for QAbstractItemModel. Provides an index associated to a particular data item at location (row, column).
◆ mayOverrideUserInput()
| bool ClustersModel::mayOverrideUserInput |
( |
| ) |
|
|
protected |
Get whether user modified clusters may be overridden by bulk operations (prefix change etc.)
◆ removeClustersById()
| void ClustersModel::removeClustersById |
( |
const QStringList & |
ids | ) |
|
Remove clusters by their unique identifiers
- Parameters
-
| ids | Unique identifiers of the clusters to remove |
◆ rowCount()
| int ClustersModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
override |
Get the number of row
- Parameters
-
- Returns
- Number of rows in the model
◆ setClusterPrefix()
| void ClustersModel::setClusterPrefix |
( |
const QString & |
clusterPrefix | ) |
|
Set cluster prefix
- Parameters
-
◆ setClusters()
| void ClustersModel::setClusters |
( |
const QVector< Cluster > & |
clusters | ) |
|
Set clusters
- Parameters
-
| clusters | Pointer to clusters |
◆ setData()
| bool ClustersModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
override |
Sets the data value for the given model index and data role
- Parameters
-
| index | Model index |
| value | Data value in variant form |
| role | Data role |
- Returns
- Whether the data was properly set or not
◆ _clusterPrefix
| QString ClustersModel::_clusterPrefix |
Boolean for each cluster, denoting whether it has been modified by the user
◆ _clusters
| QVector<Cluster> ClustersModel::_clusters |
◆ _modifiedByUser
| QVector<bool> ClustersModel::_modifiedByUser |
The documentation for this class was generated from the following files:
- D:/Work/ManiVault/DevBundle/allmain/source/core/HDPS/src/plugins/ClusterData/src/ClustersModel.h
- D:/Work/ManiVault/DevBundle/allmain/source/core/HDPS/src/plugins/ClusterData/src/ClustersModel.cpp