A Qt based model to represent the vtkSMLinks in the server manager. More...
#include <pqLinksModel.h>
Inherits QAbstractTableModel.
Public Types | |
enum | ItemType { Unknown, Proxy, Camera, CameraWidget, Property, Selection } |
type of link (camera, proxy or property) More... | |
Signals | |
void | linkAdded (int linkType) |
Fired when a link is added. More... | |
void | linkRemoved (const QString &name) |
Fired when a link is removed. More... | |
Public Member Functions | |
pqLinksModel (QObject *parent=nullptr) | |
construct a links model More... | |
~pqLinksModel () override | |
destruct a links model More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
the number of rows (number of links) More... | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
the number of columns More... | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
data for an index More... | |
QVariant | headerData (int section, Qt::Orientation orient, int role=Qt::DisplayRole) const override |
header data More... | |
ItemType | getLinkType (const QModelIndex &idx) const |
get the type of link from model index More... | |
vtkSMLink * | getLink (const QModelIndex &idx) const |
get the link from model index More... | |
QModelIndex | findLink (vtkSMLink *link) const |
search for a link and return model index More... | |
int | FindLinksFromProxy (vtkSMProxy *inputProxy, int direction, vtkCollection *links) const |
search for a link using an proxy and a direction use a none direction to get input and output More... | |
vtkSMProxy * | getProxy1 (const QModelIndex &idx) const |
get the first proxy for a link More... | |
vtkSMProxy * | getProxy2 (const QModelIndex &idx) const |
get the second proxy for a link More... | |
QString | getProperty1 (const QModelIndex &idx) const |
get the first property for a link More... | |
QString | getProperty2 (const QModelIndex &idx) const |
get the second property for a link More... | |
QString | getLinkName (const QModelIndex &idx) const |
get the name of a link More... | |
vtkSMLink * | getLink (const QString &name) const |
get the link from a name More... | |
void | addProxyLink (const QString &name, vtkSMProxy *proxy1, vtkSMProxy *proxy2) |
add a proxy based link More... | |
void | addCameraLink (const QString &name, vtkSMProxy *proxy1, vtkSMProxy *proxy2, bool interactiveViewLink=false) |
add a camera based link More... | |
void | addCameraWidgetLink (const QString &name, vtkSMProxy *proxy1, vtkSMProxy *proxy2) |
add a camera widget based link More... | |
bool | hasInteractiveViewLink (const QString &name) |
return true if pqLinksModels contain an interactive view link associated to name More... | |
pqInteractiveViewLink * | getInteractiveViewLink (const QString &name) |
return pointer to the interactive view link associated to name More... | |
bool | hasCameraWidgetViewLink (const QString &name) |
return true if pqLinksModels contain an camera widget view link associated to name More... | |
pqCameraWidgetViewLink * | getCameraWidgetViewLink (const QString &name) |
return pointer to the interactive view link associated to name More... | |
void | addPropertyLink (const QString &name, vtkSMProxy *proxy1, const QString &prop1, vtkSMProxy *proxy2, const QString &prop2) |
add a property based link More... | |
void | addSelectionLink (const QString &name, vtkSMProxy *proxy1, vtkSMProxy *proxy2, bool convertToIndices=true) |
add a selection based link More... | |
void | removeLink (const QModelIndex &idx) |
remove a link by index More... | |
void | removeLink (const QString &name) |
remove a link by name More... | |
Static Public Member Functions | |
static pqProxy * | representativeProxy (vtkSMProxy *proxy) |
Return a representative proxy. More... | |
static vtkSMProxyListDomain * | proxyListDomain (vtkSMProxy *proxy) |
return the proxy list domain for a proxy this domain is used to get internal linkable proxies More... | |
Protected Slots | |
void | onSessionCreated (pqServer *) |
void | onSessionRemoved (pqServer *) |
void | onStateLoaded (vtkPVXMLElement *root, vtkSMProxyLocator *locator) |
method called when a state is loaded, will create interactive view link according to xml node More... | |
void | onStateSaved (vtkPVXMLElement *root) |
method called when state is saved Will save interactive view links in xml More... | |
void | createInteractiveViewLink (const QString &name, vtkSMProxy *displayView, vtkSMProxy *linkedView, double xPos=0.375, double yPos=0.375, double xSize=0.25, double ySize=0.25) |
Create a interactive view link with provided parameters. More... | |
void | createCameraWidgetViewLink (const QString &name, vtkSMProxy *displayView, vtkSMProxy *linkedView) |
Create a camera widget view link with provided parameters. More... | |
void | emitLinkRemoved (const QString &name) |
Convenience method used by the internal. More... | |
A Qt based model to represent the vtkSMLinks in the server manager.
All links are bi-directional between two proxies.
Definition at line 28 of file pqLinksModel.h.
type of link (camera, proxy or property)
Enumerator | |
---|---|
Unknown | |
Proxy | |
Camera | |
CameraWidget | |
Property | |
Selection |
Definition at line 37 of file pqLinksModel.h.
pqLinksModel::pqLinksModel | ( | QObject * | parent = nullptr | ) |
construct a links model
|
override |
destruct a links model
the number of rows (number of links)
the number of columns
|
override |
data for an index
|
override |
header data
get the type of link from model index
QModelIndex pqLinksModel::findLink | ( | vtkSMLink * | link | ) | const |
search for a link and return model index
int pqLinksModel::FindLinksFromProxy | ( | vtkSMProxy * | inputProxy, |
int | direction, | ||
vtkCollection * | links | ||
) | const |
search for a link using an proxy and a direction use a none direction to get input and output
vtkSMProxy* pqLinksModel::getProxy1 | ( | const QModelIndex & | idx | ) | const |
get the first proxy for a link
vtkSMProxy* pqLinksModel::getProxy2 | ( | const QModelIndex & | idx | ) | const |
get the second proxy for a link
QString pqLinksModel::getProperty1 | ( | const QModelIndex & | idx | ) | const |
get the first property for a link
QString pqLinksModel::getProperty2 | ( | const QModelIndex & | idx | ) | const |
get the second property for a link
QString pqLinksModel::getLinkName | ( | const QModelIndex & | idx | ) | const |
get the name of a link
void pqLinksModel::addProxyLink | ( | const QString & | name, |
vtkSMProxy * | proxy1, | ||
vtkSMProxy * | proxy2 | ||
) |
add a proxy based link
void pqLinksModel::addCameraLink | ( | const QString & | name, |
vtkSMProxy * | proxy1, | ||
vtkSMProxy * | proxy2, | ||
bool | interactiveViewLink = false |
||
) |
add a camera based link
void pqLinksModel::addCameraWidgetLink | ( | const QString & | name, |
vtkSMProxy * | proxy1, | ||
vtkSMProxy * | proxy2 | ||
) |
add a camera widget based link
bool pqLinksModel::hasInteractiveViewLink | ( | const QString & | name | ) |
return true if pqLinksModels contain an interactive view link associated to name
pqInteractiveViewLink* pqLinksModel::getInteractiveViewLink | ( | const QString & | name | ) |
return pointer to the interactive view link associated to name
bool pqLinksModel::hasCameraWidgetViewLink | ( | const QString & | name | ) |
return true if pqLinksModels contain an camera widget view link associated to name
pqCameraWidgetViewLink* pqLinksModel::getCameraWidgetViewLink | ( | const QString & | name | ) |
return pointer to the interactive view link associated to name
void pqLinksModel::addPropertyLink | ( | const QString & | name, |
vtkSMProxy * | proxy1, | ||
const QString & | prop1, | ||
vtkSMProxy * | proxy2, | ||
const QString & | prop2 | ||
) |
add a property based link
void pqLinksModel::addSelectionLink | ( | const QString & | name, |
vtkSMProxy * | proxy1, | ||
vtkSMProxy * | proxy2, | ||
bool | convertToIndices = true |
||
) |
add a selection based link
void pqLinksModel::removeLink | ( | const QModelIndex & | idx | ) |
remove a link by index
void pqLinksModel::removeLink | ( | const QString & | name | ) |
remove a link by name
|
static |
Return a representative proxy.
It could be itself, or in the case of internal proxies, the owning pqProxy.
|
static |
return the proxy list domain for a proxy this domain is used to get internal linkable proxies
|
signal |
Fired when a link is added.
|
signal |
Fired when a link is removed.
|
protectedslot |
|
protectedslot |
|
protectedslot |
method called when a state is loaded, will create interactive view link according to xml node
|
protectedslot |
method called when state is saved Will save interactive view links in xml
|
protectedslot |
Create a interactive view link with provided parameters.
|
protectedslot |
Create a camera widget view link with provided parameters.
|
protectedslot |
Convenience method used by the internal.