/usr/include/paraview/pqObjectBuilder.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | /*=========================================================================
Program: ParaView
Module: pqObjectBuilder.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#ifndef pqObjectBuilder_h
#define pqObjectBuilder_h
#include <QObject>
#include "pqCoreModule.h"
#include <QMap>
#include <QVariant>
class pqAnimationCue;
class pqDataRepresentation;
class pqOutputPort;
class pqPipelineSource;
class pqProxy;
class pqRepresentation;
class pqScalarBarRepresentation;
class pqScalarsToColors;
class pqServer;
class pqServerResource;
class pqView;
class vtkSMProxy;
/// pqObjectBuilder is loosely based on the \c 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.
class PQCORE_EXPORT pqObjectBuilder : public QObject
{
Q_OBJECT
typedef QObject Superclass;
public:
pqObjectBuilder(QObject* parent=0);
virtual ~pqObjectBuilder();
/// 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.
pqServer* createServer(const pqServerResource& resource);
/// Destroy a server connection
void removeServer(pqServer *server);
/// Resets the server by destroying the old pqServer instance and creating
/// a new one while keeping the same underlying session alive.
pqServer* resetServer(pqServer* server);
/// Creates a source of the given server manager group (\c sm_group) and
/// name (\c sm_name) on the given \c server. On success, returns the
/// pqPipelineSource for the created proxy.
virtual pqPipelineSource* createSource(const QString& sm_group,
const QString& sm_name, pqServer* server);
/// Creates a filter with the given Server Manager group (\c sm_group) and
/// name (\c 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* createFilter(
const QString& group, const QString& name,
QMap<QString, QList<pqOutputPort*> > namedInputs, pqServer* server);
/// Convenience method that takes a single input source.
virtual pqPipelineSource* createFilter(
const QString& group, const QString& name,
pqPipelineSource* input, int output_port = 0);
/// Creates a reader of the given server manager group (\c sm_group) and
/// name (\c sm_name) on the given \c server. On success, returns the
/// pqPipelineSource for the created proxy.
virtual pqPipelineSource* createReader(const QString& sm_group,
const QString& sm_name, const QStringList& files, pqServer* server);
/// Creates a new view module of the given type on the given server.
virtual pqView* createView(const QString& type,
pqServer* server);
/// Destroys the view module. This destroys the view module
/// as well as all the displays in the view module.
virtual void destroy(pqView* view);
/// Creates a representation to show the data from the given output port of a
/// source in the given \c view.
virtual pqDataRepresentation* createDataRepresentation(
pqOutputPort* source, pqView* view, const QString &representationType="");
/// 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 vtkSMProxy* createProxy(const QString& sm_group,
const QString& sm_name, pqServer* server,
const QString& reg_group);
/// Destroys the data display. It will remove the display from any
/// view modules it is added to and then unregister it.
virtual void destroy(pqRepresentation* repr);
/// Destroys a source/filter. Removing a source involves the following:
// \li removing all displays belonging to the source,
// \li breaking any input connections.
// \li unregistering the source.
// Note that the source must have no consumers, otherwise,
// one cannot delete the source.
virtual void destroy(pqPipelineSource* source);
/// Destroys an animation cue and all keyframe objects, if any in that cue.
virtual void destroy(pqAnimationCue* cue);
/// Convenience method, simply unregisters the Server Manager proxy
/// which the pqProxy represents.
virtual void destroy(pqProxy* proxy);
/// Destroy all sources/filters on a server.
virtual void destroySources(pqServer* server=0);
/// Destroy all lookup tables and scalar bars associated with them.
virtual void destroyLookupTables(pqServer* server=0);
/// Destroys all proxies that are involved in pipelines i.e. simply calls
/// destroySources(), destroyLookupTables().
virtual void destroyPipelineProxies(pqServer* server=0);
/// This method unregisters all proxies on the given server.
/// This is usually done in anticipate of a disconnect
/// or starting afresh.
virtual void destroyAllProxies(pqServer* server);
/// 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.
static QString getFileNamePropertyName(vtkSMProxy*);
/// Returns true while pqObjectBuilder is in createServer() call.
bool waitingForConnection() const
{ return this->WaitingForConnection; }
public slots:
/// Closes any open connections for reverse-connection.
void abortPendingConnections();
signals:
/// Emitted after a new server connection is created
void finishedAddingServer(pqServer *server);
/// 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 sourceCreated(pqPipelineSource*);
/// 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 filterCreated(pqPipelineSource*);
/// 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 readerCreated(pqPipelineSource*, const QString& filename);
void readerCreated(pqPipelineSource*, const QStringList& filename);
/// fired before attempting to create a view.
void aboutToCreateView(pqServer* server);
/// 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 viewCreated(pqView*);
/// 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 dataRepresentationCreated(pqDataRepresentation*);
/// Fired on successful completion of any method that creates a pqProxy
/// or subclass including createDataRepresentation,
/// createView, createFilter, createSource,
/// createReader etc.
void proxyCreated(pqProxy*);
/// 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 proxyCreated(vtkSMProxy*);
/// 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 destroying(pqView* view);
/// 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 destroying(pqRepresentation* display);
/// 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 destroying(pqPipelineSource* source);
/// 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.
void destroying(pqProxy* proxy);
protected:
/// Unregisters a proxy.
virtual void destroyProxyInternal(pqProxy* proxy);
private:
pqObjectBuilder(const pqObjectBuilder&); // Not implemented.
void operator=(const pqObjectBuilder&); // Not implemented.
bool WaitingForConnection;
};
#endif
|