ParaView
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
pqObjectBuilder Class Reference

pqObjectBuilder is loosely based on the Builder design pattern. More...

#include <pqObjectBuilder.h>

Collaboration diagram for pqObjectBuilder:
Collaboration graph
[legend]

List of all members.

Public Slots

void abortPendingConnections ()
 Closes any open connections for reverse-connection.

Signals

void finishedAddingServer (pqServer *server)
 Emitted after a new server connection is created.
void activeServerChanged (pqServer *server)
 Emitted when another server is avilable after a server remove.
void sourceCreated (pqPipelineSource *)
 Fired on successful completion of createSource().
void filterCreated (pqPipelineSource *)
 Fired on successful completion of createFilter().
void readerCreated (pqPipelineSource *, const QString &filename)
 Fired on successful completion of createReader().
void readerCreated (pqPipelineSource *, const QStringList &filename)
void aboutToCreateView (pqServer *server)
 fired before attempting to create a view.
void viewCreated (pqView *)
 Fired on successful completion of createView().
void dataRepresentationCreated (pqDataRepresentation *)
 Fired on successful completion of createDataRepresentation().
void scalarBarDisplayCreated (pqScalarBarRepresentation *)
 Fired on successful completion of createScalarBarDisplay().
void proxyCreated (pqProxy *)
 Fired on successful completion of any method that creates a pqProxy or subclass including createScalarBarDisplay, createDataRepresentation, createView, createFilter, createSource, createReader etc.
void proxyCreated (vtkSMProxy *)
 Fired on successful completion of createProxy().
void destroying (pqView *view)
 Fired when destroy(pqView*) is called.
void destroying (pqRepresentation *display)
 Fired when destroy(pqRepresentation*) is called.
void destroying (pqPipelineSource *source)
 Fired when destroy(pqPipelineSource*) is called.
void destroying (pqProxy *proxy)
 Fired when destroy(pqProxy*) is called.

Public Member Functions

 pqObjectBuilder (QObject *parent=0)
virtual ~pqObjectBuilder ()
pqServercreateServer (const pqServerResource &resource)
 Create a server connection give a server resource.
void removeServer (pqServer *server)
 Destroy a server connection.
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.
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).
virtual pqPipelineSourcecreateFilter (const QString &group, const QString &name, QMap< QString, QList< pqOutputPort * > > namedInputs, pqServer *server, const QMap< QString, QVariant > &properties)
 Creates a filter with the given Server Manager group (sm_group) and name (sm_name).
virtual pqPipelineSourcecreateFilter (const QString &group, const QString &name, pqPipelineSource *input, int output_port=0)
 Convenience method that takes a single input source.
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.
virtual pqViewcreateView (const QString &type, pqServer *server)
 Creates a new view module of the given type on the given server.
virtual void destroy (pqView *view)
 Destroys the view module.
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.
virtual void destroy (pqRepresentation *repr)
 Destroys the data display.
virtual pqScalarBarRepresentationcreateScalarBarDisplay (pqScalarsToColors *lookupTable, pqView *view)
 Creates a scalar bar display to show a lookup table in the view.
virtual pqAnimationScenecreateAnimationScene (pqServer *server)
 Creates an animation scene on the given server connection.
virtual vtkSMProxycreateProxy (const QString &sm_group, const QString &sm_name, pqServer *server, const QString &reg_group, const QString &reg_name=QString())
 Convenience method to create a proxy of any type on the given server.
virtual void destroy (pqPipelineSource *source)
 Destroys a source/filter. Removing a source involves the following:
virtual void destroy (pqAnimationCue *cue)
 Destroys an animation cue and all keyframe objects, if any in that cue.
virtual void destroy (pqProxy *proxy)
 Convenience method, simply unregisters the Server Manager proxy which the pqProxy represents.
virtual void destroySources (pqServer *server=0)
 Destroy all sources/filters on a server.
virtual void destroyLookupTables (pqServer *server=0)
 Destroy all lookup tables and scalar bars associated with them.
virtual void destroyPipelineProxies (pqServer *server=0)
 Destroys all proxies that are involved in pipelines i.e.
virtual void destroyAllProxies (pqServer *server)
 This method unregisters all proxies on the given server.
bool waitingForConnection () const
 Returns true while pqObjectBuilder is in createServer() call.

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.

Protected Member Functions

virtual vtkSMProxycreateProxyInternal (const QString &sm_group, const QString &sm_name, pqServer *server, const QString &reg_group, const QString &reg_name, const QMap< QString, QVariant > &properties)
 Create a proxy of the given type.
virtual void destroyProxyInternal (pqProxy *proxy)
 Unregisters a proxy.
virtual void initializeInheritedProperties (pqDataRepresentation *repr)
 Called after a data representation to created.

Protected Attributes

pqNameCountNameGenerator
 Used to create names for registering proxies.

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 68 of file pqObjectBuilder.h.


Constructor & Destructor Documentation

pqObjectBuilder::pqObjectBuilder ( QObject *  parent = 0)
virtual pqObjectBuilder::~pqObjectBuilder ( ) [virtual]

Member Function Documentation

pqServer* pqObjectBuilder::createServer ( const pqServerResource resource)

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. Calling this method while waiting for a previous server connection to be established raises errors.

void pqObjectBuilder::removeServer ( pqServer server)

Destroy a server connection.

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.

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.

virtual pqPipelineSource* pqObjectBuilder::createFilter ( const QString &  group,
const QString &  name,
QMap< QString, QList< pqOutputPort * > >  namedInputs,
pqServer server,
const QMap< QString, QVariant > &  properties 
) [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. This also takes properties to initialize the filter with. Note: a separate function was added as opposed to making the last parameter with a default value due to bug in gcc < 4.4

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.

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.

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

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

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.

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.

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.

virtual pqScalarBarRepresentation* pqObjectBuilder::createScalarBarDisplay ( pqScalarsToColors lookupTable,
pqView view 
) [virtual]

Creates a scalar bar display to show a lookup table in the view.

virtual pqAnimationScene* pqObjectBuilder::createAnimationScene ( pqServer server) [virtual]

Creates an animation scene on the given server connection.

virtual vtkSMProxy* pqObjectBuilder::createProxy ( const QString &  sm_group,
const QString &  sm_name,
pqServer server,
const QString &  reg_group,
const QString &  reg_name = QString() 
) [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 void pqObjectBuilder::destroy ( pqPipelineSource source) [virtual]

Destroys a source/filter. Removing a source involves the following:

virtual void pqObjectBuilder::destroy ( pqAnimationCue cue) [virtual]

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

virtual void pqObjectBuilder::destroy ( pqProxy proxy) [virtual]

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

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

Destroy all sources/filters on a server.

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

Destroy all lookup tables and scalar bars associated with them.

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

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

simply calls destroySources(), destroyLookupTables().

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.

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

bool pqObjectBuilder::waitingForConnection ( ) const [inline]

Returns true while pqObjectBuilder is in createServer() call.

Definition at line 202 of file pqObjectBuilder.h.

void pqObjectBuilder::abortPendingConnections ( ) [slot]

Closes any open connections for reverse-connection.

void pqObjectBuilder::finishedAddingServer ( pqServer server) [signal]

Emitted after a new server connection is created.

void pqObjectBuilder::activeServerChanged ( pqServer server) [signal]

Emitted when another server is avilable after a server remove.

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.

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.

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.

void pqObjectBuilder::readerCreated ( pqPipelineSource ,
const QStringList &  filename 
) [signal]
void pqObjectBuilder::aboutToCreateView ( pqServer server) [signal]

fired before attempting to create a view.

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.

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.

void pqObjectBuilder::scalarBarDisplayCreated ( pqScalarBarRepresentation ) [signal]

Fired on successful completion of createScalarBarDisplay().

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.

void pqObjectBuilder::proxyCreated ( pqProxy ) [signal]

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

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.

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.

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.

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.

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.

virtual vtkSMProxy* pqObjectBuilder::createProxyInternal ( const QString &  sm_group,
const QString &  sm_name,
pqServer server,
const QString &  reg_group,
const QString &  reg_name,
const QMap< QString, QVariant > &  properties 
) [protected, virtual]

Create a proxy of the given type.

If reg_name=QString(), a new name will be assigned to it.

virtual void pqObjectBuilder::destroyProxyInternal ( pqProxy proxy) [protected, virtual]

Unregisters a proxy.

virtual void pqObjectBuilder::initializeInheritedProperties ( pqDataRepresentation repr) [protected, virtual]

Called after a data representation to created.

This use the <InheritRepresentationProperties> hints to inherit properties from input representation is possible.


Member Data Documentation

Used to create names for registering proxies.

Definition at line 314 of file pqObjectBuilder.h.


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