Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pqSILModel Class Reference

QAbstractItemModel for legacy SIL (vtkGraph-based SIL) More...

#include <pqSILModel.h>

Inherits QAbstractItemModel.

Collaboration diagram for pqSILModel:
Collaboration graph
[legend]

Public Slots

void update ()
 Used to reset the model based on the sil. More...
 

Signals

void checkStatusChanged ()
 

Public Member Functions

 pqSILModel (QObject *parent=0)
 
 ~pqSILModel () override
 
QModelIndex hierarchyIndex (const QString &hierarchyName) const
 Returns the QModelIndex for the hierarchy with the given name, if present. More...
 
QVariant headerData (int, Qt::Orientation, int role=Qt::DisplayRole) const override
 
QList< QVariant > status (const QString &hierarchyName) const
 API to get/set status of a given hierarchy. More...
 
void setStatus (const QString &hierarchyName, const QList< QVariant > &values)
 
void setSILDomain (vtkSMSILDomain *domain)
 
void domainModified ()
 
QModelIndex makeIndex (vtkIdType vertexid) const
 Returns the model index for a vertex. More...
 
vtkIdType findVertex (const char *name) const
 Returns the vertex id for a vertex with the given name in the SIL. More...
 
QAbstractItemModel Methods
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Gets the number of rows for a given index. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Gets the number of columns for a given index. More...
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const override
 Gets whether or not the given index has child items. More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 Gets a model index for a given location. More...
 
QModelIndex parent (const QModelIndex &index) const override
 Gets the parent for a given index. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Gets the data for a given model index. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Gets the flags for a given model index. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 Sets the role data for the item at index to value. More...
 

Protected Member Functions

void checkStateUpdated (vtkObject *caller, unsigned long eventid, void *calldata)
 Called every time vtkSMSILModel tells us that the check state has changed. More...
 
bool isLeaf (vtkIdType vertexid) const
 Returns if the given vertex id refers to a leaf node. More...
 
vtkIdType parent (vtkIdType vertexid) const
 Returns the parent vertex id for the given vertex. More...
 
int childrenCount (vtkIdType vertexid) const
 Returns the number of children for the given vertex. More...
 
void collectLeaves (vtkIdType vertexid, std::set< vtkIdType > &list)
 Used to initialize the HierarchyVertexIds list with the leaf node ids for each of the hierarchies. More...
 

Protected Attributes

vtkSMSILModelSILModel
 
QMap< vtkIdType, QModelIndex > * ModelIndexCache
 Cache used by makeIndex() to avoid iterating over the edges each time. More...
 
QMap< QString, QModelIndex > Hierarchies
 
QMap< QString, std::set< vtkIdType > > HierarchyVertexIds
 This map keeps a list of vertex ids that refer to the leaves in the hierarchy. More...
 
vtkSmartPointer< vtkSMSILDomainSILDomain
 
unsigned long SILDomainObserverId
 

Detailed Description

QAbstractItemModel for legacy SIL (vtkGraph-based SIL)

pqSILModel is QAbstractItemModel implementation for legacy SIL.

Legacy Warning

While not deprecated, this class exists to support readers that use legacy representation for SIL which used a vtkGraph to represent the SIL. It is recommended that newer code uses vtkSubsetInclusionLattice (or subclass) to represent the SIL. In that case, you should use pqSubsetInclusionLatticeTreeModel instead.

Definition at line 61 of file pqSILModel.h.

Constructor & Destructor Documentation

◆ pqSILModel()

pqSILModel::pqSILModel ( QObject *  parent = 0)

◆ ~pqSILModel()

pqSILModel::~pqSILModel ( )
override

Member Function Documentation

◆ rowCount()

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

Gets the number of rows for a given index.

Parameters
parentThe parent index.
Returns
The number of rows for the given index.

◆ columnCount()

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

Gets the number of columns for a given index.

Parameters
parentThe parent index.
Returns
The number of columns for the given index.

◆ hasChildren()

bool pqSILModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const
override

Gets whether or not the given index has child items.

Parameters
parentThe parent index.
Returns
True if the given index has child items.

◆ index()

QModelIndex pqSILModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Gets a model index for a given location.

Parameters
rowThe row number.
columnThe column number.
parentThe parent index.
Returns
A model index for the given location.

◆ parent() [1/2]

QModelIndex pqSILModel::parent ( const QModelIndex &  index) const
override

Gets the parent for a given index.

Parameters
indexThe model index.
Returns
A model index for the parent of the given index.

◆ data()

QVariant pqSILModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Gets the data for a given model index.

Parameters
indexThe model index.
roleThe role to get data for.
Returns
The data for the given model index.

◆ flags()

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

Gets the flags for a given model index.

The flags for an item indicate if it is enabled, editable, etc.

Parameters
indexThe model index.
Returns
The flags for the given model index.

◆ setData()

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

Sets the role data for the item at index to value.

Returns true if successful; otherwise returns false.

◆ hierarchyIndex()

QModelIndex pqSILModel::hierarchyIndex ( const QString &  hierarchyName) const

Returns the QModelIndex for the hierarchy with the given name, if present.

If the hierarchy is not present an index referring to an empty tree will be returned.

◆ headerData()

QVariant pqSILModel::headerData ( int  ,
Qt::Orientation  ,
int  role = Qt::DisplayRole 
) const
inlineoverride

Definition at line 158 of file pqSILModel.h.

◆ status()

QList<QVariant> pqSILModel::status ( const QString &  hierarchyName) const

API to get/set status of a given hierarchy.

◆ setStatus()

void pqSILModel::setStatus ( const QString &  hierarchyName,
const QList< QVariant > &  values 
)

◆ setSILDomain()

void pqSILModel::setSILDomain ( vtkSMSILDomain domain)

◆ domainModified()

void pqSILModel::domainModified ( )

◆ makeIndex()

QModelIndex pqSILModel::makeIndex ( vtkIdType  vertexid) const

Returns the model index for a vertex.

◆ findVertex()

vtkIdType pqSILModel::findVertex ( const char *  name) const

Returns the vertex id for a vertex with the given name in the SIL.

Returns -1 if no such vertex could be found.

◆ checkStatusChanged

void pqSILModel::checkStatusChanged ( )
signal

◆ update

void pqSILModel::update ( )
slot

Used to reset the model based on the sil.

◆ checkStateUpdated()

void pqSILModel::checkStateUpdated ( vtkObject caller,
unsigned long  eventid,
void *  calldata 
)
protected

Called every time vtkSMSILModel tells us that the check state has changed.

We fire the dataChanged() event so that the view updates.

◆ isLeaf()

bool pqSILModel::isLeaf ( vtkIdType  vertexid) const
protected

Returns if the given vertex id refers to a leaf node.

◆ parent() [2/2]

vtkIdType pqSILModel::parent ( vtkIdType  vertexid) const
protected

Returns the parent vertex id for the given vertex.

It's an error to call this method for the root vertex id i.e. 0.

◆ childrenCount()

int pqSILModel::childrenCount ( vtkIdType  vertexid) const
protected

Returns the number of children for the given vertex.

◆ collectLeaves()

void pqSILModel::collectLeaves ( vtkIdType  vertexid,
std::set< vtkIdType > &  list 
)
protected

Used to initialize the HierarchyVertexIds list with the leaf node ids for each of the hierarchies.

Member Data Documentation

◆ SILModel

vtkSMSILModel* pqSILModel::SILModel
protected

Definition at line 226 of file pqSILModel.h.

◆ ModelIndexCache

QMap<vtkIdType, QModelIndex>* pqSILModel::ModelIndexCache
protected

Cache used by makeIndex() to avoid iterating over the edges each time.

Definition at line 231 of file pqSILModel.h.

◆ Hierarchies

QMap<QString, QModelIndex> pqSILModel::Hierarchies
protected

Definition at line 233 of file pqSILModel.h.

◆ HierarchyVertexIds

QMap<QString, std::set<vtkIdType> > pqSILModel::HierarchyVertexIds
protected

This map keeps a list of vertex ids that refer to the leaves in the hierarchy.

Definition at line 239 of file pqSILModel.h.

◆ SILDomain

vtkSmartPointer<vtkSMSILDomain> pqSILModel::SILDomain
protected

Definition at line 240 of file pqSILModel.h.

◆ SILDomainObserverId

unsigned long pqSILModel::SILDomainObserverId
protected

Definition at line 241 of file pqSILModel.h.


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