ParaView
Public Types | Public Slots | Signals | Public Member Functions | Friends
pqPipelineModel Class Reference

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

#include <pqPipelineModel.h>

List of all members.

Public Types

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

Public Slots

void addServer (pqServer *server)
 Called when a new server connection is detected.
void removeServer (pqServer *server)
 Called when a server connection is closed. Removes the server from the list.
void addSource (pqPipelineSource *source)
 Called when a new source/filter/bundle is registered.
void removeSource (pqPipelineSource *source)
 Called when a new source/filter/bundle is unregistred.
void addConnection (pqPipelineSource *source, pqPipelineSource *sink, int)
 Called when new pipeline connection (between two pipeline objects) is made.
void removeConnection (pqPipelineSource *source, pqPipelineSource *sink, int)
 Called when new pipeline connection (between two pipeline objects) is broken.
void setView (pqView *module)
 Updates the icons in the current window column.

Signals

void firstChildAdded (const QModelIndex &index)

Public Member Functions

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

Friends

class pqPipelineModelDataItem

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 93 of file pqPipelineModel.h.


Member Enumeration Documentation

Enumerator:
Invalid 
Server 
Proxy 
Port 
Link 

Definition at line 98 of file pqPipelineModel.h.

Enumerator:
AnnotationFilterRole 
SessionFilterRole 

Definition at line 106 of file pqPipelineModel.h.


Constructor & Destructor Documentation

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

Makes a copy of a pipeline model.

Parameters:
otherThe pipeline model to copy.
parentThe parent object.
pqPipelineModel::pqPipelineModel ( const pqServerManagerModel other,
QObject *  parent = 0 
)

Creates a pipeline model from a server manager model.

Parameters:
otherUsed to build a pipeline model.
parentThe parent object.
virtual pqPipelineModel::~pqPipelineModel ( ) [virtual]

Member Function Documentation

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

virtual Qt::ItemFlags pqPipelineModel::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.
pqServerManagerModelItem* pqPipelineModel::getItemFor ( const QModelIndex &  ) const

Given the index, get the pqServerManagerModelItem it represents.

NULL is returned for root or invalid index.

QModelIndex pqPipelineModel::getIndexFor ( pqServerManagerModelItem item) const

Given the index, get the pqServerManagerModelItem it represents.

NULL is returned for root or invalid index.

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.
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 216 of file pqPipelineModel.h.

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 221 of file pqPipelineModel.h.

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.
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.
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.
QModelIndex pqPipelineModel::getNextIndex ( const 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.
pqView* pqPipelineModel::view ( ) const [inline]

Provides access to the view.

Definition at line 253 of file pqPipelineModel.h.

void pqPipelineModel::setModifiedFont ( const QFont &  font)

Sets the font hint for modified items.

Parameters:
fontThe 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.

Parameters:
annotationkey 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::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.
void pqPipelineModel::disableFilterSession ( )

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

void pqPipelineModel::addServer ( pqServer server) [slot]

Called when a new server connection is detected.

Adds the connection to the list.

void pqPipelineModel::removeServer ( pqServer server) [slot]

Called when a server connection is closed. Removes the server from the list.

void pqPipelineModel::addSource ( pqPipelineSource source) [slot]

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

void pqPipelineModel::removeSource ( pqPipelineSource source) [slot]

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

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

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

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

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

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.

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

Friends And Related Function Documentation

friend class pqPipelineModelDataItem [friend]

Definition at line 328 of file pqPipelineModel.h.


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