ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
ClustersModel Class Reference

#include <ClustersModel.h>

Inheritance diagram for ClustersModel:

Public Types

enum class  Column {
  Color , Name , ID , NumberOfIndices ,
  ModifiedByUser , Count
}
 

Public Member Functions

 ClustersModel (QObject *parent=nullptr)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVector< Cluster > & getClusters ()
 
void setClusters (const QVector< Cluster > &clusters)
 
void removeClustersById (const QStringList &ids)
 
void setClusterPrefix (const QString &clusterPrefix)
 
void colorizeClusters (std::int32_t randomSeed=0)
 
void colorizeClusters (const QImage &colorMapImage)
 
std::uint32_t getNumberOfUserModifiedClusters () const
 
bool hasUserModifications () const
 
bool doAllClusterNamesStartWith (const QString &prefix)
 

Public Attributes

QVector< Cluster_clusters
 
QVector< bool > _modifiedByUser
 
QString _clusterPrefix
 

Protected Member Functions

bool mayOverrideUserInput ()
 

Detailed Description

Clusters model class

List model class for storing clusters

Author
Thomas Kroes

Member Enumeration Documentation

◆ Column

enum class ClustersModel::Column
strong

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

Constructor & Destructor Documentation

◆ ClustersModel()

ClustersModel::ClustersModel ( QObject *  parent = nullptr)

Constructor

Parameters
parentPointer to parent object

Member Function Documentation

◆ colorizeClusters() [1/2]

void ClustersModel::colorizeClusters ( const QImage &  colorMapImage)

Colorize clusters by color map

Parameters
colorMapImageColor map image

◆ colorizeClusters() [2/2]

void ClustersModel::colorizeClusters ( std::int32_t  randomSeed = 0)

Colorize clusters by pseudo-random colors

Parameters
randomSeedRandom seed for pseudo-random colors

◆ columnCount()

int ClustersModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Get the number of columns

Parameters
parentParent model index
Returns
Number of columns in the model

◆ data()

QVariant ClustersModel::data ( const QModelIndex &  index,
int  role 
) const
override

Get data

Parameters
indexModel index to query
roleData role
Returns
Data

◆ doAllClusterNamesStartWith()

bool ClustersModel::doAllClusterNamesStartWith ( const QString &  prefix)

Get whether all cluster names start with the supplied prefix

Parameters
prefixCluster prefix

◆ flags()

Qt::ItemFlags ClustersModel::flags ( const QModelIndex &  index) const
override

Get item flags

Parameters
indexModel index
Returns
Item flags

◆ getClusters()

QVector< Cluster > & ClustersModel::getClusters ( )

Get clusters

◆ 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
sectionSection
orientationOrientation
roleData 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
idsUnique identifiers of the clusters to remove

◆ rowCount()

int ClustersModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Get the number of row

Parameters
parentParent model index
Returns
Number of rows in the model

◆ setClusterPrefix()

void ClustersModel::setClusterPrefix ( const QString &  clusterPrefix)

Set cluster prefix

Parameters
clusterPrefixCluster name prefix

◆ setClusters()

void ClustersModel::setClusters ( const QVector< Cluster > &  clusters)

Set clusters

Parameters
clustersPointer 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
indexModel index
valueData value in variant form
roleData role
Returns
Whether the data was properly set or not

Member Data Documentation

◆ _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

Vector of clusters


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