ParaView
pqApplicationCore.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqApplicationCore.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqApplicationCore_h
33 #define pqApplicationCore_h
34 
35 #include "pqCoreModule.h"
36 #include <QObject>
37 #include <QPointer>
38 
39 class pq3DWidgetFactory;
40 class pqDisplayPolicy;
41 class pqInterfaceTracker;
42 class pqLinksModel;
43 class pqObjectBuilder;
44 class pqOptions;
45 class pqOutputWindow;
47 class pqPipelineSource;
48 class pqPluginManager;
49 class pqProgressManager;
51 class pqServer;
55 class pqServerResource;
56 class pqSettings;
57 class pqTestUtility;
58 class pqUndoStack;
59 class QApplication;
60 #ifdef PARAVIEW_USE_QTHELP
61 class QHelpEngine;
62 #endif
63 class QStringList;
64 class vtkPVXMLElement;
65 class vtkSMProxyLocator;
66 class vtkSMStateLoader;
67 
78 class PQCORE_EXPORT pqApplicationCore : public QObject
79 {
80  Q_OBJECT
81  typedef QObject Superclass;
82 
83 public:
84  // Get the global instace for the pqApplicationCore.
85  static pqApplicationCore* instance();
86 
94  pqApplicationCore(int& argc, char** argv, pqOptions* options = 0, QObject* parent = 0);
95 
99  pqOptions* getOptions() const { return this->Options; }
100 
106  pqObjectBuilder* getObjectBuilder() const { return this->ObjectBuilder; }
107 
112  void setUndoStack(pqUndoStack* stack);
113  pqUndoStack* getUndoStack() const { return this->UndoStack; }
114 
126  void registerManager(const QString& function, QObject* manager);
127 
131  //. \sa registerManager
132  QObject* manager(const QString& function);
133 
137  void unRegisterManager(const QString& function);
138 
139 #ifdef PARAVIEW_USE_QTHELP
140 
144  QHelpEngine* helpEngine();
145 #endif
146 
151  void registerDocumentation(const QString& filename);
152 
159  pqServerManagerObserver* getServerManagerObserver() { return this->ServerManagerObserver; }
160 
167  pqServerManagerModel* getServerManagerModel() const { return this->ServerManagerModel; }
168 
169  pq3DWidgetFactory* get3DWidgetFactory() const { return this->WidgetFactory; }
170 
176  pqInterfaceTracker* interfaceTracker() const { return this->InterfaceTracker; }
177 
185  pqLinksModel* getLinksModel() const { return this->LinksModel; }
186 
190  pqPluginManager* getPluginManager() const { return this->PluginManager; }
191 
195  pqProgressManager* getProgressManager() const { return this->ProgressManager; }
196 
202  pqDisplayPolicy* getDisplayPolicy() const { return this->DisplayPolicy; }
203 
207  pqOutputWindowAdapter* outputWindowAdapter() { return this->OutputWindowAdapter; }
208 
209  pqOutputWindow* outputWindow() { return this->OutputWindow; }
210 
216  void setDisplayPolicy(pqDisplayPolicy* dp);
217 
221  virtual pqTestUtility* testUtility();
222 
227  pqRecentlyUsedResourcesList& recentlyUsedResources();
228 
233  pqServerConfigurationCollection& serverConfigurations();
234 
238  pqSettings* settings();
239 
243  vtkPVXMLElement* saveState();
244  void saveState(const QString& filename);
245 
250  void loadState(vtkPVXMLElement* root, pqServer* server, vtkSMStateLoader* loader = NULL);
251 
257  void loadState(const char* filename, pqServer* server, vtkSMStateLoader* loader = NULL);
258 
262  void loadStateFromString(
263  const char* xmlcontents, pqServer* server, vtkSMStateLoader* loader = NULL);
264 
269  void loadStateIncremental(
270  vtkPVXMLElement* root, pqServer* server, vtkSMStateLoader* loader = NULL);
271  void loadStateIncremental(
272  const QString& filename, pqServer* server, vtkSMStateLoader* loader = NULL);
273 
279  bool isLoadingState() { return this->LoadingState; };
280 
284  pqServer* getActiveServer() const;
285 
291  void loadDistributedPlugins(const char* filename = 0);
292 
296  virtual ~pqApplicationCore();
297 public slots:
298 
303  void prepareForQuit();
304 
308  void quit();
309 
313  void showOutputWindow();
314 
320  void loadConfiguration(const QString& filename);
321  void loadConfigurationXML(const char* xmldata);
322 
326  void render();
327 
328 signals:
336  void aboutToLoadState(vtkPVXMLElement* root);
337 
343  void stateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
344 
350  void stateSaved(vtkPVXMLElement* root);
351 
355  void undoStackChanged(pqUndoStack*);
356 
360  void loadXML(vtkPVXMLElement*);
361 
365  void forceFilterMenuRefresh();
366 
370  void updateMasterEnableState(bool);
371 
372 protected slots:
373  void onStateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
374  void onStateSaved(vtkPVXMLElement* root);
375 
376 protected:
378 
382 
396 #ifdef PARAVIEW_USE_QTHELP
397  QHelpEngine* HelpEngine;
398 #endif
399  QPointer<pqTestUtility> TestUtility;
400 
401 private:
402  Q_DISABLE_COPY(pqApplicationCore)
403 
404  class pqInternals;
405  pqInternals* Internal;
406  static pqApplicationCore* Instance;
407  void constructor();
408  void createOutputWindow();
409 };
410 
411 #endif
pqProgressManager * ProgressManager
pqOutputWindow * OutputWindow
pqLinksModel * LinksModel
pqDisplayPolicy * getDisplayPolicy() const
Returns the display policy instance used by the application.
pqServerManagerObserver * ServerManagerObserver
This class is the crux of the ParaView application.
pqInterfaceTracker * interfaceTracker() const
Locates the interface tracker for the application.
vtkOutputWindow implementation that converts VTK output messages into Qt signals. ...
pqRecentlyUsedResourcesList encapsulates a persistent collection of recently-used resources (data fil...
A Qt based model to represent the vtkSMLinks in the server manager.
Definition: pqLinksModel.h:56
pqPluginManager * PluginManager
pqRecentlyUsedResourcesList * RecentlyUsedResourcesList
pqPluginManager * getPluginManager() const
pqPluginManager manages all functionality associated with loading plugins.
pqProgressManager is progress manager.
pq3DWidgetFactory * get3DWidgetFactory() const
pqObjectBuilder is loosely based on the Builder design pattern.
pqProgressManager * getProgressManager() const
ProgressManager is the manager that streamlines progress.
pqServerManagerModel * ServerManagerModel
Display policy defines the application specific policy for creating display proxies.
pqServerManagerObserver * getServerManagerObserver()
ServerManagerObserver observer the vtkSMProxyManager for changes to the server manager and fires sign...
This is 3DWidget Factory.
Provides an output dialog that will display all VTK/ParaView debug/warning/error output.
pqInterfaceTracker * InterfaceTracker
pqOutputWindow * outputWindow()
pqServerConfigurationCollection maintains a serializable collection of server-configurations defined ...
pqSettings extends QSettings to add support for following:
Definition: pqSettings.h:47
This is a vtkSMProxyManager observer.
pqServerConfigurationCollection * ServerConfigurations
pqOutputWindowAdapter * OutputWindowAdapter
pqDisplayPolicy * DisplayPolicy
QPointer< pqTestUtility > TestUtility
pqObjectBuilder * ObjectBuilder
pqServerManagerModel is the model for the Server Manager.
is used to locate proxies referred to in state xmls while loading state files.
pqOutputWindowAdapter * outputWindowAdapter()
Returns the output window.
bool isLoadingState()
Check to see if its in the process of loading a state Reliance on this flag is chimerical since we ca...
pqUndoStack * UndoStack
pqObjectBuilder * getObjectBuilder() const
Get the Object Builder.
pqOptions * getOptions() const
Provides access to the command line options object.
PQ representation for a vtkSMProxy that can be involved in a pipeline.
pqServerManagerModel * getServerManagerModel() const
ServerManagerModel is the representation of the ServerManager using pqServerManagerModelItem subclass...
pq3DWidgetFactory * WidgetFactory
Utility class to load state from XML.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
pqUndoStack * getUndoStack() const
pqUndoStack represents a vtkSMUndoStack along with a a vtkSMUndoStackBuilder.
Definition: pqUndoStack.h:56
Command line options for pqClient.
Definition: pqOptions.h:45
pqLinksModel * getLinksModel() const
pqLinksModel is the model used to keep track of proxy/property links maintained by vtkSMProxyManager...
pqInterfaceTracker is used by ParaView components to locate interface-implementations.
pqServerResource encapsulates a resource in ParaView.
pqPluginManager works with vtkSMPluginManager to keep track for plugins loaded/available.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64