ParaView
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
pqSILModel Class Reference

#include <pqSILModel.h>

Collaboration diagram for pqSILModel:
Collaboration graph
[legend]

List of all members.

Public Slots

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

Signals

void checkStatusChanged ()

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

vtkSMSILModelSILModel
QMap< vtkIdType, QModelIndex > * ModelIndexCache
 Cache used by makeIndex() to avoid iterating over the edges each time.
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.
vtkSmartPointer< vtkGraphSIL

Detailed Description

Definition at line 47 of file pqSILModel.h.


Constructor & Destructor Documentation

pqSILModel::pqSILModel ( QObject *  parent = 0)
virtual pqSILModel::~pqSILModel ( ) [virtual]

Member Function Documentation

virtual int pqSILModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]

Gets the number of rows for a given index.

Parameters:
parentThe parent index.
Returns:
The number of rows for the given index.
virtual int pqSILModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]

Gets the number of columns for a given index.

Parameters:
parentThe parent index.
Returns:
The number of columns for the given index.
virtual bool pqSILModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const [virtual]

Gets whether or not the given index has child items.

Parameters:
parentThe parent index.
Returns:
True if the given index has child items.
virtual QModelIndex pqSILModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]

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.
virtual QModelIndex pqSILModel::parent ( const QModelIndex &  index) const [virtual]

Gets the parent for a given index.

Parameters:
indexThe model index.
Returns:
A model index for the parent of the given index.
virtual QVariant pqSILModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const [virtual]

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.
virtual Qt::ItemFlags pqSILModel::flags ( const QModelIndex &  index) const [virtual]

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.
bool pqSILModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

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

Returns true if successful; otherwise returns false.

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.

virtual QVariant pqSILModel::headerData ( int  ,
Qt::Orientation  ,
int  role = Qt::DisplayRole 
) const [inline, virtual]

Definition at line 126 of file pqSILModel.h.

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

API to get/set status of a given hierarchy.

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

Returns the model index for a vertex.

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.

void pqSILModel::checkStatusChanged ( ) [signal]
void pqSILModel::update ( vtkGraph sil) [slot]

Used to reset the model based on the sil.

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.

bool pqSILModel::isLeaf ( vtkIdType  vertexid) const [protected]

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

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.

int pqSILModel::childrenCount ( vtkIdType  vertexid) const [protected]

Returns the number of children for the given vertex.

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

Definition at line 173 of file pqSILModel.h.

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

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

Definition at line 176 of file pqSILModel.h.

QMap<QString, QModelIndex> pqSILModel::Hierarchies [protected]

Definition at line 178 of file pqSILModel.h.

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 182 of file pqSILModel.h.

Definition at line 183 of file pqSILModel.h.


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