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... | |
pqView * | view () 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 | |
pqServerManagerModelItem * | getItemFor (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 |
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.
Enumerator | |
---|---|
Invalid | |
Server | |
Proxy | |
Port | |
Extractor | |
Link |
Definition at line 60 of file pqPipelineModel.h.
Enumerator | |
---|---|
AnnotationFilterRole | |
SessionFilterRole |
Definition at line 70 of file pqPipelineModel.h.
pqPipelineModel::pqPipelineModel | ( | QObject * | parent = nullptr | ) |
pqPipelineModel::pqPipelineModel | ( | const pqPipelineModel & | other, |
QObject * | parent = nullptr |
||
) |
Makes a copy of a pipeline model.
other | The pipeline model to copy. |
parent | The parent object. |
pqPipelineModel::pqPipelineModel | ( | const pqServerManagerModel & | other, |
QObject * | parent = nullptr |
||
) |
Creates a pipeline model from a server manager model.
other | Used to build a pipeline model. |
parent | The parent object. |
|
override |
Gets the number of rows for a given index.
parent | The parent index. |
Gets the number of columns for a given index.
parent | The parent index. |
|
override |
Gets whether or not the given index has child items.
parent | The parent index. |
|
override |
Gets a model index for a given location.
row | The row number. |
column | The column number. |
parent | The parent index. |
|
override |
Gets the parent for a given index.
index | The model index. |
|
override |
Gets the data for a given model index.
index | The model index. |
role | The role to get data for. |
|
override |
Sets the role data for the item at index to value.
Returns true if successful; otherwise returns false.
|
override |
Gets the flags for a given model index.
The flags for an item indicate if it is enabled, editable, etc.
index | The model index. |
pqServerManagerModelItem* pqPipelineModel::getItemFor | ( | const QModelIndex & | ) | const |
Given the index, get the pqServerManagerModelItem it represents.
nullptr is returned for root or invalid index.
QModelIndex pqPipelineModel::getIndexFor | ( | pqServerManagerModelItem * | item | ) | const |
Given the index, get the pqServerManagerModelItem it represents.
nullptr is returned for root or invalid index.
Gets the type for the given index.
index | The model index to look up. |
|
inline |
Gets whether or not the model indexes are editable.
Definition at line 206 of file pqPipelineModel.h.
|
inline |
Sets whether or not the model indexes are editable.
editable | True if the model indexes can be edited. |
Definition at line 213 of file pqPipelineModel.h.
void pqPipelineModel::setSelectable | ( | const QModelIndex & | index, |
bool | selectable | ||
) |
Sets whether or not the given index is selectable.
index | The model index. |
selectable | True if the index can be selected. |
bool pqPipelineModel::isSelectable | ( | const QModelIndex & | index | ) | const |
Gets whether or not the given index is selectable.
index | The model index. |
void pqPipelineModel::setSubtreeSelectable | ( | pqServerManagerModelItem * | item, |
bool | selectable | ||
) |
Sets whether of not an item subtree is selectable.
item | The root of the subtree. |
selectable | True if the items can be selected. |
QModelIndex pqPipelineModel::getNextIndex | ( | QModelIndex | index, |
const QModelIndex & | root = QModelIndex() |
||
) | const |
Gets the next model index in the tree.
index | The current index. |
root | An alternate root for walking a subtree. |
|
inline |
Provides access to the view.
Definition at line 254 of file pqPipelineModel.h.
void pqPipelineModel::setModifiedFont | ( | const QFont & | font | ) |
Sets the font hint for modified items.
font | The font to use for modified items. |
void pqPipelineModel::enableFilterAnnotationKey | ( | const QString & | expectedAnnotation | ) |
Store the annotation key that will be used when "this->data( ... , pqPipelineMode::AnnotationFilterRole)" get called.
expectedAnnotation | key that will be lookup inside the above code. |
void pqPipelineModel::disableFilterAnnotationKey | ( | ) |
Disable annotation key, so "this->data( ... , pqPipelineMode::AnnotationFilterRole)" will always return a QVariant("true")
void pqPipelineModel::setAnnotationFilterMatching | ( | bool | matching | ) |
Set wether annotation filter should display matching or non matching sources.
void pqPipelineModel::enableFilterSession | ( | vtkSession * | session | ) |
Store the session key that will be used when "this->data( ... , pqPipelineMode::SessionFilterRole)" get called.
session | that will be lookup inside the above code. |
void pqPipelineModel::disableFilterSession | ( | ) |
Disable annotation key, so "this->data( ... , pqPipelineMode::SessionFilterRole)" will always return a QVariant("true")
|
slot |
Called when a new server connection is detected.
Adds the connection to the list.
|
slot |
Called when a server connection is closed.
Removes the server from the list.
|
slot |
Called when a new source/filter/bundle is registered.
|
slot |
Called when a new source/filter/bundle is unregistered.
|
slot |
Called when new pipeline connection (between two pipeline objects) is made.
|
slot |
Called when new pipeline connection (between two pipeline objects) is broken.
|
slot |
Called to update extractor connections.
|
slot |
Called to update extractor connections.
|
slot |
Add/remove extractor.
|
slot |
Add/remove extractor.
|
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.
|
signal |
|
signal |
|
friend |
Definition at line 388 of file pqPipelineModel.h.
|
friend |
Definition at line 435 of file pqPipelineModel.h.