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

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=0)
 
 ~pqObjectBuilder () override
 
pqServercreateServer (const pqServerResource &resource, int connectionTimeout=60)
 Create a server connection give a server resource. More...
 
void removeServer (pqServer *server)
 Destroy a server connection. More...
 
pqServerresetServer (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 pqPipelineSourcecreateSource (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 pqPipelineSourcecreateFilter (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 pqPipelineSourcecreateFilter (const QString &group, const QString &name, pqPipelineSource *input, int output_port=0)
 Convenience method that takes a single input source. More...
 
virtual pqPipelineSourcecreateReader (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 pqViewcreateView (const QString &type, pqServer *server)
 Creates a new view module of the given type on the given server. More...
 
pqViewcreateView (const QString &type, pqServer *server, bool detachedFromLayout)
 Deprecated in ParaView 5.7. 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 pqDataRepresentationcreateDataRepresentation (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 vtkSMProxycreateProxy (const QString &sm_group, const QString &sm_name, pqServer *server, const QString &reg_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=0)
 Destroy all sources/filters on a server. More...
 
virtual void destroyLookupTables (pqServer *server=0)
 Destroy all lookup tables and scalar bars associated with them. More...
 
virtual void destroyPipelineProxies (pqServer *server=0)
 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...
 

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...
 

Detailed Description

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. Unlink, 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 69 of file pqObjectBuilder.h.

Constructor & Destructor Documentation

◆ pqObjectBuilder()

pqObjectBuilder::pqObjectBuilder ( QObject *  parent = 0)

◆ ~pqObjectBuilder()

pqObjectBuilder::~pqObjectBuilder ( )
override

Member Function Documentation

◆ createServer()

pqServer* pqObjectBuilder::createServer ( const pqServerResource resource,
int  connectionTimeout = 60 
)

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.

◆ removeServer()

void pqObjectBuilder::removeServer ( pqServer server)

Destroy a server connection.

◆ resetServer()

pqServer* pqObjectBuilder::resetServer ( pqServer server)

Resets the server by destroying the old pqServer instance and creating a new one while keeping the same underlying session alive.

◆ createSource()

virtual pqPipelineSource* pqObjectBuilder::createSource ( const QString &  sm_group,
const QString &  sm_name,
pqServer server 
)
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.

◆ createFilter() [1/2]

virtual pqPipelineSource* pqObjectBuilder::createFilter ( const QString &  group,
const QString &  name,
QMap< QString, QList< pqOutputPort *> >  namedInputs,
pqServer server 
)
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.

◆ createFilter() [2/2]

virtual pqPipelineSource* pqObjectBuilder::createFilter ( const QString &  group,
const QString &  name,
pqPipelineSource input,
int  output_port = 0 
)
virtual

Convenience method that takes a single input source.

◆ createReader()

virtual pqPipelineSource* pqObjectBuilder::createReader ( const QString &  sm_group,
const QString &  sm_name,
const QStringList &  files,
pqServer server 
)
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.

◆ createView() [1/2]

virtual pqView* pqObjectBuilder::createView ( const QString &  type,
pqServer server 
)
virtual

Creates a new view module of the given type on the given server.

◆ createView() [2/2]

pqView* pqObjectBuilder::createView ( const QString &  type,
pqServer server,
bool  detachedFromLayout 
)

Deprecated in ParaView 5.7.

detachedFromLayout argument is not longer applicable. All views are now created detached by default.

◆ destroy() [1/5]

virtual void pqObjectBuilder::destroy ( pqView view)
virtual

Destroys the view module.

This destroys the view module as well as all the displays in the view module.

◆ addToLayout()

virtual void pqObjectBuilder::addToLayout ( pqView view,
pqProxy layout = nullptr 
)
virtual

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.

◆ createDataRepresentation()

virtual pqDataRepresentation* pqObjectBuilder::createDataRepresentation ( pqOutputPort source,
pqView view,
const QString &  representationType = "" 
)
virtual

Creates a representation to show the data from the given output port of a source in the given view.

◆ createProxy()

virtual vtkSMProxy* pqObjectBuilder::createProxy ( const QString &  sm_group,
const QString &  sm_name,
pqServer server,
const QString &  reg_group 
)
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.

◆ destroy() [2/5]

virtual void pqObjectBuilder::destroy ( pqRepresentation repr)
virtual

Destroys the data display.

It will remove the display from any view modules it is added to and then unregister it.

◆ destroy() [3/5]

virtual void pqObjectBuilder::destroy ( pqPipelineSource source)
virtual

Destroys a source/filter.

Removing a source involves the following:

◆ destroy() [4/5]

virtual void pqObjectBuilder::destroy ( pqAnimationCue cue)
virtual

Destroys an animation cue and all keyframe objects, if any in that cue.

◆ destroy() [5/5]

virtual void pqObjectBuilder::destroy ( pqProxy proxy)
virtual

Convenience method, simply unregisters the Server Manager proxy which the pqProxy represents.

◆ destroySources()

virtual void pqObjectBuilder::destroySources ( pqServer server = 0)
virtual

Destroy all sources/filters on a server.

◆ destroyLookupTables()

virtual void pqObjectBuilder::destroyLookupTables ( pqServer server = 0)
virtual

Destroy all lookup tables and scalar bars associated with them.

◆ destroyPipelineProxies()

virtual void pqObjectBuilder::destroyPipelineProxies ( pqServer server = 0)
virtual

Destroys all proxies that are involved in pipelines i.e.

simply calls destroySources(), destroyLookupTables().

◆ destroyAllProxies()

virtual void pqObjectBuilder::destroyAllProxies ( pqServer server)
virtual

This method unregisters all proxies on the given server.

This is usually done in anticipate of a disconnect or starting afresh.

◆ getFileNamePropertyName()

static QString pqObjectBuilder::getFileNamePropertyName ( vtkSMProxy )
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.

◆ waitingForConnection()

bool pqObjectBuilder::waitingForConnection ( ) const
inline

Returns true while pqObjectBuilder is in createServer() call.

Definition at line 239 of file pqObjectBuilder.h.

◆ forceWaitingForConnection()

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

◆ abortPendingConnections

void pqObjectBuilder::abortPendingConnections ( )
slot

Closes any open connections for reverse-connection.

◆ finishedAddingServer

void pqObjectBuilder::finishedAddingServer ( pqServer server)
signal

Emitted after a new server connection is created.

◆ sourceCreated

void pqObjectBuilder::sourceCreated ( pqPipelineSource )
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.

◆ filterCreated

void pqObjectBuilder::filterCreated ( pqPipelineSource )
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.

◆ readerCreated [1/2]

void pqObjectBuilder::readerCreated ( pqPipelineSource ,
const QString &  filename 
)
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.

◆ readerCreated [2/2]

void pqObjectBuilder::readerCreated ( pqPipelineSource ,
const QStringList &  filename 
)
signal

◆ aboutToCreateView

void pqObjectBuilder::aboutToCreateView ( pqServer server)
signal

fired before attempting to create a view.

◆ viewCreated

void pqObjectBuilder::viewCreated ( pqView )
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.

◆ dataRepresentationCreated

void pqObjectBuilder::dataRepresentationCreated ( pqDataRepresentation )
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.

◆ proxyCreated [1/2]

void pqObjectBuilder::proxyCreated ( pqProxy )
signal

Fired on successful completion of any method that creates a pqProxy or subclass including createDataRepresentation, createView, createFilter, createSource, createReader etc.

◆ proxyCreated [2/2]

void pqObjectBuilder::proxyCreated ( vtkSMProxy )
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.

◆ destroying [1/4]

void pqObjectBuilder::destroying ( pqView view)
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.

◆ destroying [2/4]

void pqObjectBuilder::destroying ( pqRepresentation display)
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.

◆ destroying [3/4]

void pqObjectBuilder::destroying ( pqPipelineSource source)
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.

◆ destroying [4/4]

void pqObjectBuilder::destroying ( pqProxy proxy)
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.

◆ destroyProxyInternal()

virtual void pqObjectBuilder::destroyProxyInternal ( pqProxy proxy)
protectedvirtual

Unregisters a proxy.


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