pqObjectBuilder is loosely based on the Builder
design pattern.
More...
#include <pqObjectBuilder.h>
Inherits QObject.
Public Slots | |
void | abortPendingConnections () |
Closes any open connections for reverse-connection. More... | |
Signals | |
void | finishedAddingServer (pqServer *server) |
Emitted after a new server connection is created. More... | |
void | sourceCreated (pqPipelineSource *) |
Fired on successful completion of createSource(). More... | |
void | filterCreated (pqPipelineSource *) |
Fired on successful completion of createFilter(). More... | |
void | readerCreated (pqPipelineSource *, const QString &filename) |
Fired on successful completion of createReader(). More... | |
void | readerCreated (pqPipelineSource *, const QStringList &filename) |
void | aboutToCreateView (pqServer *server) |
fired before attempting to create a view. More... | |
void | viewCreated (pqView *) |
Fired on successful completion of createView(). More... | |
void | dataRepresentationCreated (pqDataRepresentation *) |
Fired on successful completion of createDataRepresentation(). More... | |
void | proxyCreated (pqProxy *) |
Fired on successful completion of any method that creates a pqProxy or subclass including createDataRepresentation, createView, createFilter, createSource, createReader etc. More... | |
void | proxyCreated (vtkSMProxy *) |
Fired on successful completion of createProxy(). More... | |
void | destroying (pqView *view) |
Fired when destroy(pqView*) is called. More... | |
void | destroying (pqRepresentation *display) |
Fired when destroy(pqRepresentation*) is called. More... | |
void | destroying (pqPipelineSource *source) |
Fired when destroy(pqPipelineSource*) is called. More... | |
void | destroying (pqProxy *proxy) |
Fired when destroy(pqProxy*) is called. More... | |
Public Member Functions | |
pqObjectBuilder (QObject *parent=nullptr) | |
~pqObjectBuilder () override | |
void | removeServer (pqServer *server) |
Destroy a server connection. More... | |
pqServer * | resetServer (pqServer *server) |
Resets the server by destroying the old pqServer instance and creating a new one while keeping the same underlying session alive. More... | |
virtual pqPipelineSource * | createSource (const QString &sm_group, const QString &sm_name, pqServer *server) |
Creates a source of the given server manager group (sm_group ) and name (sm_name ) on the given server . More... | |
virtual pqPipelineSource * | createFilter (const QString &group, const QString &name, QMap< QString, QList< pqOutputPort *>> namedInputs, pqServer *server) |
Creates a filter with the given Server Manager group (sm_group ) and name (sm_name ). More... | |
virtual pqPipelineSource * | createFilter (const QString &group, const QString &name, pqPipelineSource *input, int output_port=0) |
Convenience method that takes a single input source. More... | |
virtual pqPipelineSource * | createReader (const QString &sm_group, const QString &sm_name, const QStringList &files, pqServer *server) |
Creates a reader of the given server manager group (sm_group ) and name (sm_name ) on the given server . More... | |
virtual pqView * | createView (const QString &type, pqServer *server) |
Creates a new view module of the given type on the given server. More... | |
virtual void | destroy (pqView *view) |
Destroys the view module. More... | |
virtual void | addToLayout (pqView *view, pqProxy *layout=nullptr) |
Assigns the view to the layout. More... | |
virtual pqDataRepresentation * | createDataRepresentation (pqOutputPort *source, pqView *view, const QString &representationType="") |
Creates a representation to show the data from the given output port of a source in the given view . More... | |
virtual vtkSMProxy * | createProxy (const QString &sm_group, const QString &sm_name, pqServer *server, const QString ®_group) |
Convenience method to create a proxy of any type on the given server. More... | |
virtual void | destroy (pqRepresentation *repr) |
Destroys the data display. More... | |
virtual void | destroy (pqPipelineSource *source) |
Destroys a source/filter. More... | |
virtual void | destroy (pqAnimationCue *cue) |
Destroys an animation cue and all keyframe objects, if any in that cue. More... | |
virtual void | destroy (pqProxy *proxy) |
Convenience method, simply unregisters the Server Manager proxy which the pqProxy represents. More... | |
virtual void | destroySources (pqServer *server=nullptr) |
Destroy all sources/filters on a server. More... | |
virtual void | destroyLookupTables (pqServer *server=nullptr) |
Destroy all lookup tables and scalar bars associated with them. More... | |
virtual void | destroyPipelineProxies (pqServer *server=nullptr) |
Destroys all proxies that are involved in pipelines i.e. More... | |
virtual void | destroyAllProxies (pqServer *server) |
This method unregisters all proxies on the given server. More... | |
bool | waitingForConnection () const |
Returns true while pqObjectBuilder is in createServer() call. More... | |
bool | forceWaitingForConnection (bool force) |
Set ForceWaitingForConnection When set to true, WaitingForConnection() will always return true When set to false, no effect. More... | |
pqServer * | createServer (const pqServerResource &resource, int connectionTimeout=60) |
Create a server connection give a server resource. More... | |
pqServer * | createServer (const pqServerResource &resource, int connectionTimeout, vtkNetworkAccessManager::ConnectionResult &result) |
Create a server connection give a server resource. More... | |
Static Public Member Functions | |
static QString | getFileNamePropertyName (vtkSMProxy *) |
This is a convenience method to return the name of the property on the proxy, if any, which can be used to set the filename. More... | |
Protected Member Functions | |
virtual void | destroyProxyInternal (pqProxy *proxy) |
Unregisters a proxy. More... | |
pqObjectBuilder is loosely based on the Builder
design pattern.
It is used to create as well as destroy complex objects such as views, displays, sources etc. Since most of the public API is virtual, it is possible for custom applications to subclass pqObjectBuilder to provide their own implementation for creation/ destroying these objects. The application layer accesses the ObjectBuilder through the pqApplicationCore singleton. NOTE: pqObjectBuilder replaces the previously supported pqPipelineBuilder. Unlike pqPipelineBuilder, this class no longer deals with undo/redo stack. The application layer components that use the ObjectBuilder are supposed to bother about the undo stack i.e. call begin/end on the undo stack before/after calling creation/destruction method on the ObjectBuilder.
Definition at line 42 of file pqObjectBuilder.h.
pqObjectBuilder::pqObjectBuilder | ( | QObject * | parent = nullptr | ) |
|
override |
|
inline |
Create a server connection give a server resource.
By default, this method does not create a new connection if one already exists. Also it disconnects from any existing server connection before connecting to a new one. This behavior can be changed by setting MultipleConnectionsSupport to true. In that case this will always try to connect the server using the details specified in the resource irrespective if the server is already connected or any other server connections exists and will wait for timeout seconds for direct connection. 0 means no retry, -1 means infinite retries. Calling this method while waiting for a previous server connection to be established raises errors. The result arg provide information about the failure or sucess of the connection, see vtkNetworkAccessManager::ConnectionResult for possible values.
Definition at line 67 of file pqObjectBuilder.h.
pqServer* pqObjectBuilder::createServer | ( | const pqServerResource & | resource, |
int | connectionTimeout, | ||
vtkNetworkAccessManager::ConnectionResult & | result | ||
) |
Create a server connection give a server resource.
By default, this method does not create a new connection if one already exists. Also it disconnects from any existing server connection before connecting to a new one. This behavior can be changed by setting MultipleConnectionsSupport to true. In that case this will always try to connect the server using the details specified in the resource irrespective if the server is already connected or any other server connections exists and will wait for timeout seconds for direct connection. 0 means no retry, -1 means infinite retries. Calling this method while waiting for a previous server connection to be established raises errors. The result arg provide information about the failure or sucess of the connection, see vtkNetworkAccessManager::ConnectionResult for possible values.
void pqObjectBuilder::removeServer | ( | pqServer * | server | ) |
Destroy a server connection.
Resets the server by destroying the old pqServer instance and creating a new one while keeping the same underlying session alive.
|
virtual |
Creates a source of the given server manager group (sm_group
) and name (sm_name
) on the given server
.
On success, returns the pqPipelineSource for the created proxy.
|
virtual |
Creates a filter with the given Server Manager group (sm_group
) and name (sm_name
).
If the filter accepts multiple inputs, all the inputs provided in the list are set as input, instead only the first one is set as the input. All inputs must be on the same server.
|
virtual |
Convenience method that takes a single input source.
|
virtual |
Creates a reader of the given server manager group (sm_group
) and name (sm_name
) on the given server
.
On success, returns the pqPipelineSource for the created proxy.
Creates a new view module of the given type on the given server.
|
virtual |
Destroys the view module.
This destroys the view module as well as all the displays in the view module.
Assigns the view to the layout.
If layout is nullptr, this method will use an arbitrary layout on the same server as the view, if any, or create a new layout and assign the view to it.
|
virtual |
Creates a representation to show the data from the given output port of a source in the given view
.
|
virtual |
Convenience method to create a proxy of any type on the given server.
One can alternatively use the vtkSMProxyManager to create new proxies directly. This method additionally set the connection ID on the new proxy. If reg_name is empty, then a new name is assigned.
|
virtual |
Destroys the data display.
It will remove the display from any view modules it is added to and then unregister it.
|
virtual |
Destroys a source/filter.
Removing a source involves the following:
|
virtual |
Destroys an animation cue and all keyframe objects, if any in that cue.
|
virtual |
Convenience method, simply unregisters the Server Manager proxy which the pqProxy represents.
|
virtual |
Destroy all sources/filters on a server.
|
virtual |
Destroy all lookup tables and scalar bars associated with them.
|
virtual |
Destroys all proxies that are involved in pipelines i.e.
simply calls destroySources(), destroyLookupTables().
|
virtual |
This method unregisters all proxies on the given server.
This is usually done in anticipate of a disconnect or starting afresh.
|
static |
This is a convenience method to return the name of the property on the proxy, if any, which can be used to set the filename.
If no such property exists, this returns a null string. If there are more than 1 properties with FileListDomain, then it looks at the Hints for the proxy for the XML of the form <DefaultFileNameProperty name="<propertyname>" />
and uses that property otherwise simply returns the first one encountered.
|
inline |
Returns true while pqObjectBuilder is in createServer() call.
Definition at line 215 of file pqObjectBuilder.h.
bool pqObjectBuilder::forceWaitingForConnection | ( | bool | force | ) |
Set ForceWaitingForConnection When set to true, WaitingForConnection() will always return true When set to false, no effect.
Returns the previous state
|
slot |
Closes any open connections for reverse-connection.
|
signal |
Emitted after a new server connection is created.
|
signal |
Fired on successful completion of createSource().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
Fired on successful completion of createFilter().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
Fired on successful completion of createReader().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
|
signal |
fired before attempting to create a view.
|
signal |
Fired on successful completion of createView().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
Fired on successful completion of createDataRepresentation().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
Fired on successful completion of any method that creates a pqProxy or subclass including createDataRepresentation, createView, createFilter, createSource, createReader etc.
|
signal |
Fired on successful completion of createProxy().
Remember that this signal is fired only when the creation of the object is requested by the GUI. It wont be triggered when the python client creates the source or when state is loaded or on undo/redo.
|
signal |
Fired when destroy(pqView*) is called.
This signal is fired before the process for destruction of the object begins. Remember that this signal is fired only when the destruction of the object is requested by the GUI. It wont be triggered when the python client unregisters the source or when state is loaded or on undo/redo.
|
signal |
Fired when destroy(pqRepresentation*) is called.
This signal is fired before the process for destruction of the object begins. Remember that this signal is fired only when the destruction of the object is requested by the GUI. It wont be triggered when the python client unregisters the source or when state is loaded or on undo/redo.
|
signal |
Fired when destroy(pqPipelineSource*) is called.
This signal is fired before the process for destruction of the object begins. Remember that this signal is fired only when the destruction of the object is requested by the GUI. It wont be triggered when the python client unregisters the source or when state is loaded or on undo/redo.
|
signal |
Fired when destroy(pqProxy*) is called.
This signal is fired before the process for destruction of the object begins. Remember that this signal is fired only when the destruction of the object is requested by the GUI. It wont be triggered when the python client unregisters the source or when state is loaded or on undo/redo.
|
protectedvirtual |
Unregisters a proxy.