Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | List of all members
pqLinksModel Class Reference

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...
 
vtkSMLinkgetLink (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...
 
vtkSMProxygetProxy1 (const QModelIndex &idx) const
 get the first proxy for a link More...
 
vtkSMProxygetProxy2 (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...
 
vtkSMLinkgetLink (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...
 
pqInteractiveViewLinkgetInteractiveViewLink (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...
 
pqCameraWidgetViewLinkgetCameraWidgetViewLink (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 pqProxyrepresentativeProxy (vtkSMProxy *proxy)
 Return a representative proxy. More...
 
static vtkSMProxyListDomainproxyListDomain (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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ ItemType

type of link (camera, proxy or property)

Enumerator
Unknown 
Proxy 
Camera 
CameraWidget 
Property 
Selection 

Definition at line 37 of file pqLinksModel.h.

Constructor & Destructor Documentation

◆ pqLinksModel()

pqLinksModel::pqLinksModel ( QObject *  parent = nullptr)

construct a links model

◆ ~pqLinksModel()

pqLinksModel::~pqLinksModel ( )
override

destruct a links model

Member Function Documentation

◆ rowCount()

int pqLinksModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

the number of rows (number of links)

◆ columnCount()

int pqLinksModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

the number of columns

◆ data()

QVariant pqLinksModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

data for an index

◆ headerData()

QVariant pqLinksModel::headerData ( int  section,
Qt::Orientation  orient,
int  role = Qt::DisplayRole 
) const
override

header data

◆ getLinkType()

ItemType pqLinksModel::getLinkType ( const QModelIndex &  idx) const

get the type of link from model index

◆ getLink() [1/2]

vtkSMLink* pqLinksModel::getLink ( const QModelIndex &  idx) const

get the link from model index

◆ findLink()

QModelIndex pqLinksModel::findLink ( vtkSMLink link) const

search for a link and return model index

◆ FindLinksFromProxy()

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

◆ getProxy1()

vtkSMProxy* pqLinksModel::getProxy1 ( const QModelIndex &  idx) const

get the first proxy for a link

◆ getProxy2()

vtkSMProxy* pqLinksModel::getProxy2 ( const QModelIndex &  idx) const

get the second proxy for a link

◆ getProperty1()

QString pqLinksModel::getProperty1 ( const QModelIndex &  idx) const

get the first property for a link

◆ getProperty2()

QString pqLinksModel::getProperty2 ( const QModelIndex &  idx) const

get the second property for a link

◆ getLinkName()

QString pqLinksModel::getLinkName ( const QModelIndex &  idx) const

get the name of a link

◆ getLink() [2/2]

vtkSMLink* pqLinksModel::getLink ( const QString &  name) const

get the link from a name

◆ addProxyLink()

void pqLinksModel::addProxyLink ( const QString &  name,
vtkSMProxy proxy1,
vtkSMProxy proxy2 
)

add a proxy based link

◆ addCameraLink()

void pqLinksModel::addCameraLink ( const QString &  name,
vtkSMProxy proxy1,
vtkSMProxy proxy2,
bool  interactiveViewLink = false 
)

add a camera based link

◆ addCameraWidgetLink()

void pqLinksModel::addCameraWidgetLink ( const QString &  name,
vtkSMProxy proxy1,
vtkSMProxy proxy2 
)

add a camera widget based link

◆ hasInteractiveViewLink()

bool pqLinksModel::hasInteractiveViewLink ( const QString &  name)

return true if pqLinksModels contain an interactive view link associated to name

◆ getInteractiveViewLink()

pqInteractiveViewLink* pqLinksModel::getInteractiveViewLink ( const QString &  name)

return pointer to the interactive view link associated to name

◆ hasCameraWidgetViewLink()

bool pqLinksModel::hasCameraWidgetViewLink ( const QString &  name)

return true if pqLinksModels contain an camera widget view link associated to name

◆ getCameraWidgetViewLink()

pqCameraWidgetViewLink* pqLinksModel::getCameraWidgetViewLink ( const QString &  name)

return pointer to the interactive view link associated to name

◆ addPropertyLink()

void pqLinksModel::addPropertyLink ( const QString &  name,
vtkSMProxy proxy1,
const QString &  prop1,
vtkSMProxy proxy2,
const QString &  prop2 
)

add a property based link

◆ addSelectionLink()

void pqLinksModel::addSelectionLink ( const QString &  name,
vtkSMProxy proxy1,
vtkSMProxy proxy2,
bool  convertToIndices = true 
)

add a selection based link

◆ removeLink() [1/2]

void pqLinksModel::removeLink ( const QModelIndex &  idx)

remove a link by index

◆ removeLink() [2/2]

void pqLinksModel::removeLink ( const QString &  name)

remove a link by name

◆ representativeProxy()

static pqProxy* pqLinksModel::representativeProxy ( vtkSMProxy proxy)
static

Return a representative proxy.

It could be itself, or in the case of internal proxies, the owning pqProxy.

◆ proxyListDomain()

static vtkSMProxyListDomain* pqLinksModel::proxyListDomain ( vtkSMProxy proxy)
static

return the proxy list domain for a proxy this domain is used to get internal linkable proxies

◆ linkAdded

void pqLinksModel::linkAdded ( int  linkType)
signal

Fired when a link is added.

◆ linkRemoved

void pqLinksModel::linkRemoved ( const QString &  name)
signal

Fired when a link is removed.

◆ onSessionCreated

void pqLinksModel::onSessionCreated ( pqServer )
protectedslot

◆ onSessionRemoved

void pqLinksModel::onSessionRemoved ( pqServer )
protectedslot

◆ onStateLoaded

void pqLinksModel::onStateLoaded ( vtkPVXMLElement root,
vtkSMProxyLocator locator 
)
protectedslot

method called when a state is loaded, will create interactive view link according to xml node

◆ onStateSaved

void pqLinksModel::onStateSaved ( vtkPVXMLElement root)
protectedslot

method called when state is saved Will save interactive view links in xml

◆ createInteractiveViewLink

void pqLinksModel::createInteractiveViewLink ( const QString &  name,
vtkSMProxy displayView,
vtkSMProxy linkedView,
double  xPos = 0.375,
double  yPos = 0.375,
double  xSize = 0.25,
double  ySize = 0.25 
)
protectedslot

Create a interactive view link with provided parameters.

◆ createCameraWidgetViewLink

void pqLinksModel::createCameraWidgetViewLink ( const QString &  name,
vtkSMProxy displayView,
vtkSMProxy linkedView 
)
protectedslot

Create a camera widget view link with provided parameters.

◆ emitLinkRemoved

void pqLinksModel::emitLinkRemoved ( const QString &  name)
protectedslot

Convenience method used by the internal.


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