Public Types | Public Slots | Signals | Public Member Functions | Friends | List of all members
pqPipelineModel Class Reference

This class is the model for the PipelineLine browser tree view. More...

#include <pqPipelineModel.h>

Inherits QAbstractItemModel.

Public Types

enum  ItemType {
  Invalid = -1, Server = 0, Proxy, Port,
  Extractor, Link
}
 
enum  ItemRole { AnnotationFilterRole = 33, SessionFilterRole = 34 }
 

Public Slots

void addServer (pqServer *server)
 Called when a new server connection is detected. More...
 
void removeServer (pqServer *server)
 Called when a server connection is closed. More...
 
void addSource (pqPipelineSource *source)
 Called when a new source/filter/bundle is registered. More...
 
void removeSource (pqPipelineSource *source)
 Called when a new source/filter/bundle is unregistered. More...
 
void addConnection (pqPipelineSource *source, pqPipelineSource *sink, int)
 Called when new pipeline connection (between two pipeline objects) is made. More...
 
void removeConnection (pqPipelineSource *source, pqPipelineSource *sink, int)
 Called when new pipeline connection (between two pipeline objects) is broken. More...
 
void setView (pqView *module)
 Updates the icons in the current window column. More...
 
void addConnection (pqServerManagerModelItem *source, pqExtractor *sink)
 Called to update extractor connections. More...
 
void removeConnection (pqServerManagerModelItem *source, pqExtractor *sink)
 Called to update extractor connections. More...
 
void addExtractor (pqExtractor *)
 Add/remove extractor. More...
 
void removeExtractor (pqExtractor *)
 Add/remove extractor. More...
 

Signals

void firstChildAdded (const QModelIndex &index)
 
void childWithChildrenAdded (const QModelIndex &index)
 

Public Member Functions

 pqPipelineModel (QObject *parent=nullptr)
 
 pqPipelineModel (const pqPipelineModel &other, QObject *parent=nullptr)
 Makes a copy of a pipeline model. More...
 
 pqPipelineModel (const pqServerManagerModel &other, QObject *parent=nullptr)
 Creates a pipeline model from a server manager model. More...
 
 ~pqPipelineModel () override
 
bool isEditable () const
 Gets whether or not the model indexes are editable. More...
 
void setEditable (bool editable)
 Sets whether or not the model indexes are editable. More...
 
void setSelectable (const QModelIndex &index, bool selectable)
 Sets whether or not the given index is selectable. More...
 
bool isSelectable (const QModelIndex &index) const
 Gets whether or not the given index is selectable. More...
 
void setSubtreeSelectable (pqServerManagerModelItem *item, bool selectable)
 Sets whether of not an item subtree is selectable. More...
 
QModelIndex getNextIndex (QModelIndex index, const QModelIndex &root=QModelIndex()) const
 Gets the next model index in the tree. More...
 
pqViewview () const
 Provides access to the view. More...
 
void setModifiedFont (const QFont &font)
 Sets the font hint for modified items. More...
 
void enableFilterAnnotationKey (const QString &expectedAnnotation)
 Store the annotation key that will be used when "this->data( ... , pqPipelineMode::AnnotationFilterRole)" get called. More...
 
void disableFilterAnnotationKey ()
 Disable annotation key, so "this->data( ... , pqPipelineMode::AnnotationFilterRole)" will always return a QVariant("true") More...
 
void setAnnotationFilterMatching (bool matching)
 Set wether annotation filter should display matching or non matching sources. More...
 
void enableFilterSession (vtkSession *session)
 Store the session key that will be used when "this->data( ... , pqPipelineMode::SessionFilterRole)" get called. More...
 
void disableFilterSession ()
 Disable annotation key, so "this->data( ... , pqPipelineMode::SessionFilterRole)" will always return a QVariant("true") 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...
 
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...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Gets the flags for a given model index. More...
 
Object Mapping
pqServerManagerModelItemgetItemFor (const QModelIndex &) const
 Given the index, get the pqServerManagerModelItem it represents. More...
 
QModelIndex getIndexFor (pqServerManagerModelItem *item) const
 Given the index, get the pqServerManagerModelItem it represents. More...
 
ItemType getTypeFor (const QModelIndex &index) const
 Gets the type for the given index. More...
 

Friends

class pqPipelineModelDataItem
 
class ModifiedLiveInsituLink
 

Detailed Description

This class is the model for the PipelineLine browser tree view.

The pqPipelineModel class is used to represent the pipeline graph as a tree.

pqServerManagerModel models the vtkSMProxyManager for the GUI. The vtkSMProxyManager maintains all proxies and hence it is difficult to detect/trasvers pipelines etc etc. The pqServerManagerModel provides a simplified view of the Server Manager. This class takes that simplified "model" and transforms it into hierarchical tables which can be represented by the Tree View.

The top of the hierarchy is the server objects. Each connected server is added to the root node. An object with no inputs is added as a child of its server. The outputs of an object are added as its children. Objects with multiple inputs present a problem.

Instead of repeating information in the tree, the object with multiple inputs is moved to the server. All its outputs are treated normally and added as children. In place of the object with more than one input, a link object is placed in the child list of the input objects. The link item represents a connection instead of a pipeline object.

Definition at line 55 of file pqPipelineModel.h.

Member Enumeration Documentation

◆ ItemType

Enumerator
Invalid 
Server 
Proxy 
Port 
Extractor 
Link 

Definition at line 60 of file pqPipelineModel.h.

◆ ItemRole

Enumerator
AnnotationFilterRole 
SessionFilterRole 

Definition at line 70 of file pqPipelineModel.h.

Constructor & Destructor Documentation

◆ pqPipelineModel() [1/3]

pqPipelineModel::pqPipelineModel ( QObject *  parent = nullptr)

◆ pqPipelineModel() [2/3]

pqPipelineModel::pqPipelineModel ( const pqPipelineModel other,
QObject *  parent = nullptr 
)

Makes a copy of a pipeline model.

Parameters
otherThe pipeline model to copy.
parentThe parent object.

◆ pqPipelineModel() [3/3]

pqPipelineModel::pqPipelineModel ( const pqServerManagerModel other,
QObject *  parent = nullptr 
)

Creates a pipeline model from a server manager model.

Parameters
otherUsed to build a pipeline model.
parentThe parent object.

◆ ~pqPipelineModel()

pqPipelineModel::~pqPipelineModel ( )
override

Member Function Documentation

◆ rowCount()

int pqPipelineModel::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 pqPipelineModel::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 pqPipelineModel::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 pqPipelineModel::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()

QModelIndex pqPipelineModel::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 pqPipelineModel::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.

◆ setData()

bool pqPipelineModel::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.

◆ flags()

Qt::ItemFlags pqPipelineModel::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.

◆ getItemFor()

pqServerManagerModelItem* pqPipelineModel::getItemFor ( const QModelIndex &  ) const

Given the index, get the pqServerManagerModelItem it represents.

nullptr is returned for root or invalid index.

◆ getIndexFor()

QModelIndex pqPipelineModel::getIndexFor ( pqServerManagerModelItem item) const

Given the index, get the pqServerManagerModelItem it represents.

nullptr is returned for root or invalid index.

◆ getTypeFor()

ItemType pqPipelineModel::getTypeFor ( const QModelIndex &  index) const

Gets the type for the given index.

Parameters
indexThe model index to look up.
Returns
The type for the given index.

◆ isEditable()

bool pqPipelineModel::isEditable ( ) const
inline

Gets whether or not the model indexes are editable.

Returns
True if the model indexes can be edited.

Definition at line 206 of file pqPipelineModel.h.

◆ setEditable()

void pqPipelineModel::setEditable ( bool  editable)
inline

Sets whether or not the model indexes are editable.

Parameters
editableTrue if the model indexes can be edited.

Definition at line 213 of file pqPipelineModel.h.

◆ setSelectable()

void pqPipelineModel::setSelectable ( const QModelIndex &  index,
bool  selectable 
)

Sets whether or not the given index is selectable.

Parameters
indexThe model index.
selectableTrue if the index can be selected.

◆ isSelectable()

bool pqPipelineModel::isSelectable ( const QModelIndex &  index) const

Gets whether or not the given index is selectable.

Parameters
indexThe model index.
Returns
True if the given index is selectable.

◆ setSubtreeSelectable()

void pqPipelineModel::setSubtreeSelectable ( pqServerManagerModelItem item,
bool  selectable 
)

Sets whether of not an item subtree is selectable.

Parameters
itemThe root of the subtree.
selectableTrue if the items can be selected.

◆ getNextIndex()

QModelIndex pqPipelineModel::getNextIndex ( QModelIndex  index,
const QModelIndex &  root = QModelIndex() 
) const

Gets the next model index in the tree.

Parameters
indexThe current index.
rootAn alternate root for walking a subtree.
Returns
An index to the next item in the tree or an invalid index when the end of the tree is reached.

◆ view()

pqView* pqPipelineModel::view ( ) const
inline

Provides access to the view.

Definition at line 254 of file pqPipelineModel.h.

◆ setModifiedFont()

void pqPipelineModel::setModifiedFont ( const QFont &  font)

Sets the font hint for modified items.

Parameters
fontThe font to use for modified items.

◆ enableFilterAnnotationKey()

void pqPipelineModel::enableFilterAnnotationKey ( const QString &  expectedAnnotation)

Store the annotation key that will be used when "this->data( ... , pqPipelineMode::AnnotationFilterRole)" get called.

Parameters
expectedAnnotationkey that will be lookup inside the above code.

◆ disableFilterAnnotationKey()

void pqPipelineModel::disableFilterAnnotationKey ( )

Disable annotation key, so "this->data( ... , pqPipelineMode::AnnotationFilterRole)" will always return a QVariant("true")

◆ setAnnotationFilterMatching()

void pqPipelineModel::setAnnotationFilterMatching ( bool  matching)

Set wether annotation filter should display matching or non matching sources.

◆ enableFilterSession()

void pqPipelineModel::enableFilterSession ( vtkSession session)

Store the session key that will be used when "this->data( ... , pqPipelineMode::SessionFilterRole)" get called.

Parameters
sessionthat will be lookup inside the above code.

◆ disableFilterSession()

void pqPipelineModel::disableFilterSession ( )

Disable annotation key, so "this->data( ... , pqPipelineMode::SessionFilterRole)" will always return a QVariant("true")

◆ addServer

void pqPipelineModel::addServer ( pqServer server)
slot

Called when a new server connection is detected.

Adds the connection to the list.

◆ removeServer

void pqPipelineModel::removeServer ( pqServer server)
slot

Called when a server connection is closed.

Removes the server from the list.

◆ addSource

void pqPipelineModel::addSource ( pqPipelineSource source)
slot

Called when a new source/filter/bundle is registered.

◆ removeSource

void pqPipelineModel::removeSource ( pqPipelineSource source)
slot

Called when a new source/filter/bundle is unregistered.

◆ addConnection [1/2]

void pqPipelineModel::addConnection ( pqPipelineSource source,
pqPipelineSource sink,
int   
)
slot

Called when new pipeline connection (between two pipeline objects) is made.

◆ removeConnection [1/2]

void pqPipelineModel::removeConnection ( pqPipelineSource source,
pqPipelineSource sink,
int   
)
slot

Called when new pipeline connection (between two pipeline objects) is broken.

◆ addConnection [2/2]

void pqPipelineModel::addConnection ( pqServerManagerModelItem source,
pqExtractor sink 
)
slot

Called to update extractor connections.

◆ removeConnection [2/2]

void pqPipelineModel::removeConnection ( pqServerManagerModelItem source,
pqExtractor sink 
)
slot

Called to update extractor connections.

◆ addExtractor

void pqPipelineModel::addExtractor ( pqExtractor )
slot

Add/remove extractor.

◆ removeExtractor

void pqPipelineModel::removeExtractor ( pqExtractor )
slot

Add/remove extractor.

◆ setView

void pqPipelineModel::setView ( pqView module)
slot

Updates the icons in the current window column.

The current window column shows whether or not the source is displayed in the current window. When the current window changes the entire column needs to be updated.

◆ firstChildAdded

void pqPipelineModel::firstChildAdded ( const QModelIndex &  index)
signal

◆ childWithChildrenAdded

void pqPipelineModel::childWithChildrenAdded ( const QModelIndex &  index)
signal

Friends And Related Function Documentation

◆ pqPipelineModelDataItem

friend class pqPipelineModelDataItem
friend

Definition at line 388 of file pqPipelineModel.h.

◆ ModifiedLiveInsituLink

friend class ModifiedLiveInsituLink
friend

Definition at line 435 of file pqPipelineModel.h.


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