Public Types | Public Member Functions | Protected Attributes | List of all members
pqAnnotationsModel Class Reference

#include <pqAnnotationsModel.h>

Inherits QAbstractTableModel.

Collaboration diagram for pqAnnotationsModel:
Collaboration graph
[legend]

Public Types

enum  ColumnRoles {
  VISIBILITY = 0, COLOR, OPACITY, VALUE,
  LABEL, NUMBER_OF_COLUMNS, COLOR_DATA = NUMBER_OF_COLUMNS, OPACITY_DATA
}
 

Public Member Functions

 pqAnnotationsModel (QObject *parentObject=nullptr)
 
 ~pqAnnotationsModel () override
 
int columnCount () const
 Return the number of columns. More...
 
void setVisibilityDomain (vtkSMStringListDomain *domain)
 
bool hasColors () const
 
void reorder (std::vector< int > newOrder)
 Reorders the list of annotations, following the indexes given by newOrder. More...
 
Qt::ItemFlags flags (const QModelIndex &idx) const override
 Reimplements QAbstractTableModel. More...
 
int rowCount (const QModelIndex &prnt=QModelIndex()) const override
 Reimplements QAbstractTableModel. More...
 
int columnCount (const QModelIndex &) const override
 Reimplements QAbstractTableModel. More...
 
bool setData (const QModelIndex &idx, const QVariant &value, int role=Qt::EditRole) override
 Reimplements QAbstractTableModel. More...
 
QVariant data (const QModelIndex &idx, int role=Qt::DisplayRole) const override
 Reimplements QAbstractTableModel. More...
 
bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role) override
 Reimplements QAbstractTableModel. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Reimplements QAbstractTableModel. More...
 
Qt::DropActions supportedDropActions () const override
 Reimplements QAbstractTableModel. More...
 
QStringList mimeTypes () const override
 Reimplements QAbstractTableModel. More...
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 Reimplements QAbstractTableModel. More...
 
bool dropMimeData (const QMimeData *mime_data, Qt::DropAction action, int row, int column, const QModelIndex &parentIdx) override
 Reimplements QAbstractTableModel. More...
 
QModelIndex addAnnotation (const QModelIndex &after=QModelIndex())
 Add/remove annotations. More...
 
QModelIndex removeAnnotations (const QModelIndexList &toRemove=QModelIndexList())
 Add/remove annotations. More...
 
void removeAllAnnotations ()
 Add/remove annotations. More...
 
void setAnnotations (const std::vector< std::pair< QString, QString >> &newAnnotations, bool quiet=false)
 Set/Get the value-annotation pairs. More...
 
std::vector< std::pair< QString, QString > > annotations () const
 Set/Get the value-annotation pairs. More...
 
void setVisibilities (const std::vector< std::pair< QString, int >> &newVisibilities)
 Set/Get the visibilities. More...
 
std::vector< std::pair< QString, int > > visibilities () const
 Set/Get the visibilities. More...
 
void setIndexedColors (const std::vector< QColor > &newColors)
 Set/Get the colors. More...
 
std::vector< QColor > indexedColors () const
 Set/Get the colors. More...
 
void setIndexedOpacities (const std::vector< double > &newOpacities)
 Set/Get IndexedOpacities. More...
 
std::vector< doubleindexedOpacities () const
 Set/Get IndexedOpacities. More...
 
void setGlobalOpacity (double opacity)
 Set/Get the global opacity value. More...
 
double globalOpacity () const
 Set/Get the global opacity value. More...
 
void setSelectedOpacity (QList< int > rows, double opacity)
 Set the opacity for the given rows. More...
 
void setSupportsReorder (bool reorder)
 Set/Get SupportsReorder. More...
 
bool supportsReorder () const
 Set/Get SupportsReorder. More...
 

Protected Attributes

double GlobalOpacity = 1.0
 
vtkSmartPointer< vtkSMStringListDomainVisibilityDomain
 
bool SupportsReorder = false
 

Detailed Description

Definition at line 24 of file pqAnnotationsModel.h.

Member Enumeration Documentation

◆ ColumnRoles

Enumerator
VISIBILITY 
COLOR 
OPACITY 
VALUE 
LABEL 
NUMBER_OF_COLUMNS 
COLOR_DATA 
OPACITY_DATA 

Definition at line 33 of file pqAnnotationsModel.h.

Constructor & Destructor Documentation

◆ pqAnnotationsModel()

pqAnnotationsModel::pqAnnotationsModel ( QObject *  parentObject = nullptr)

◆ ~pqAnnotationsModel()

pqAnnotationsModel::~pqAnnotationsModel ( )
override

Member Function Documentation

◆ flags()

Qt::ItemFlags pqAnnotationsModel::flags ( const QModelIndex &  idx) const
override

Reimplements QAbstractTableModel.

◆ rowCount()

int pqAnnotationsModel::rowCount ( const QModelIndex &  prnt = QModelIndex()) const
override

Reimplements QAbstractTableModel.

◆ columnCount() [1/2]

int pqAnnotationsModel::columnCount ( const QModelIndex &  ) const
override

Reimplements QAbstractTableModel.

◆ setData()

bool pqAnnotationsModel::setData ( const QModelIndex &  idx,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Reimplements QAbstractTableModel.

◆ data()

QVariant pqAnnotationsModel::data ( const QModelIndex &  idx,
int  role = Qt::DisplayRole 
) const
override

Reimplements QAbstractTableModel.

◆ setHeaderData()

bool pqAnnotationsModel::setHeaderData ( int  section,
Qt::Orientation  orientation,
const QVariant &  value,
int  role 
)
override

Reimplements QAbstractTableModel.

◆ headerData()

QVariant pqAnnotationsModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Reimplements QAbstractTableModel.

◆ supportedDropActions()

Qt::DropActions pqAnnotationsModel::supportedDropActions ( ) const
override

Reimplements QAbstractTableModel.

◆ mimeTypes()

QStringList pqAnnotationsModel::mimeTypes ( ) const
override

Reimplements QAbstractTableModel.

◆ mimeData()

QMimeData* pqAnnotationsModel::mimeData ( const QModelIndexList &  indexes) const
override

Reimplements QAbstractTableModel.

◆ dropMimeData()

bool pqAnnotationsModel::dropMimeData ( const QMimeData *  mime_data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parentIdx 
)
override

Reimplements QAbstractTableModel.

◆ columnCount() [2/2]

int pqAnnotationsModel::columnCount ( ) const
inline

Return the number of columns.

Definition at line 67 of file pqAnnotationsModel.h.

◆ setVisibilityDomain()

void pqAnnotationsModel::setVisibilityDomain ( vtkSMStringListDomain domain)

◆ addAnnotation()

QModelIndex pqAnnotationsModel::addAnnotation ( const QModelIndex &  after = QModelIndex())

Add/remove annotations.

◆ removeAnnotations()

QModelIndex pqAnnotationsModel::removeAnnotations ( const QModelIndexList &  toRemove = QModelIndexList())

Add/remove annotations.

◆ removeAllAnnotations()

void pqAnnotationsModel::removeAllAnnotations ( )

Add/remove annotations.

◆ setAnnotations()

void pqAnnotationsModel::setAnnotations ( const std::vector< std::pair< QString, QString >> &  newAnnotations,
bool  quiet = false 
)

Set/Get the value-annotation pairs.

Emit dataChanged signal, unless quiet is true.

◆ annotations()

std::vector<std::pair<QString, QString> > pqAnnotationsModel::annotations ( ) const

Set/Get the value-annotation pairs.

Emit dataChanged signal, unless quiet is true.

◆ setVisibilities()

void pqAnnotationsModel::setVisibilities ( const std::vector< std::pair< QString, int >> &  newVisibilities)

Set/Get the visibilities.

◆ visibilities()

std::vector<std::pair<QString, int> > pqAnnotationsModel::visibilities ( ) const

Set/Get the visibilities.

◆ setIndexedColors()

void pqAnnotationsModel::setIndexedColors ( const std::vector< QColor > &  newColors)

Set/Get the colors.

◆ indexedColors()

std::vector<QColor> pqAnnotationsModel::indexedColors ( ) const

Set/Get the colors.

◆ hasColors()

bool pqAnnotationsModel::hasColors ( ) const

◆ setIndexedOpacities()

void pqAnnotationsModel::setIndexedOpacities ( const std::vector< double > &  newOpacities)

Set/Get IndexedOpacities.

◆ indexedOpacities()

std::vector<double> pqAnnotationsModel::indexedOpacities ( ) const

Set/Get IndexedOpacities.

◆ setGlobalOpacity()

void pqAnnotationsModel::setGlobalOpacity ( double  opacity)
inline

Set/Get the global opacity value.

Default is 1.0. GlobalOpacity corresponds to a cached value only used to draw the global opacity swatch. The opacity value of each items is modified using the setHeaderData method. Note that setHeaderData can also modify the GlobalOpacity value.

Definition at line 124 of file pqAnnotationsModel.h.

◆ globalOpacity()

double pqAnnotationsModel::globalOpacity ( ) const
inline

Set/Get the global opacity value.

Default is 1.0. GlobalOpacity corresponds to a cached value only used to draw the global opacity swatch. The opacity value of each items is modified using the setHeaderData method. Note that setHeaderData can also modify the GlobalOpacity value.

Definition at line 125 of file pqAnnotationsModel.h.

◆ setSelectedOpacity()

void pqAnnotationsModel::setSelectedOpacity ( QList< int rows,
double  opacity 
)

Set the opacity for the given rows.

◆ setSupportsReorder()

void pqAnnotationsModel::setSupportsReorder ( bool  reorder)

Set/Get SupportsReorder.

Default is false.

◆ supportsReorder()

bool pqAnnotationsModel::supportsReorder ( ) const

Set/Get SupportsReorder.

Default is false.

◆ reorder()

void pqAnnotationsModel::reorder ( std::vector< int newOrder)

Reorders the list of annotations, following the indexes given by newOrder.

Member Data Documentation

◆ GlobalOpacity

double pqAnnotationsModel::GlobalOpacity = 1.0
protected

Definition at line 149 of file pqAnnotationsModel.h.

◆ VisibilityDomain

vtkSmartPointer<vtkSMStringListDomain> pqAnnotationsModel::VisibilityDomain
protected

Definition at line 150 of file pqAnnotationsModel.h.

◆ SupportsReorder

bool pqAnnotationsModel::SupportsReorder = false
protected

Definition at line 151 of file pqAnnotationsModel.h.


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