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 class QHelpEngine;
61 class QStringList;
62 class vtkPVXMLElement;
63 class vtkSMProxyLocator;
64 class vtkSMStateLoader;
65 
74 class PQCORE_EXPORT pqApplicationCore : public QObject
75 {
76  Q_OBJECT
77  typedef QObject Superclass;
78 public:
79  // Get the global instace for the pqApplicationCore.
80  static pqApplicationCore* instance();
81 
87  pqApplicationCore(int& argc, char** argv, pqOptions* options=0, QObject* parent=0);
88 
91  { return this->Options; }
92 
97  { return this->ObjectBuilder; }
98 
101  void setUndoStack(pqUndoStack* stack);
103  { return this->UndoStack; }
104 
114  void registerManager(const QString& function, QObject* manager);
115 
117  //. \sa registerManager
118  QObject* manager(const QString& function);
119 
121  void unRegisterManager(const QString& function);
122 
125  QHelpEngine* helpEngine();
126 
129  void registerDocumentation(const QString& filename);
130 
136  { return this->ServerManagerObserver; }
137 
143  { return this->ServerManagerModel; }
144 
146  { return this->WidgetFactory; }
147 
152  { return this->InterfaceTracker; }
153 
160  { return this->LinksModel; }
161 
164  { return this->PluginManager; }
165 
168  { return this->ProgressManager; }
169 
174  { return this->DisplayPolicy; }
175 
178  { return this->OutputWindowAdapter; }
179 
181  { return this->OutputWindow; }
182 
186  void setDisplayPolicy(pqDisplayPolicy* dp);
187 
189  virtual pqTestUtility* testUtility();
190 
193  pqRecentlyUsedResourcesList& recentlyUsedResources();
194 
197  pqServerConfigurationCollection& serverConfigurations();
198 
200  pqSettings* settings();
201 
203  vtkPVXMLElement* saveState();
204  void saveState(const QString& filename);
205 
208  void loadState(vtkPVXMLElement* root, pqServer* server, vtkSMStateLoader* loader=NULL);
209 
213  void loadState(const char* filename, pqServer* server, vtkSMStateLoader* loader=NULL);
214 
216  void loadStateFromString(const char* xmlcontents, pqServer* server, vtkSMStateLoader* loader=NULL);
217 
220  void loadStateIncremental(vtkPVXMLElement* root, pqServer* server, vtkSMStateLoader* loader=NULL);
221  void loadStateIncremental(const QString& filename, pqServer* server, vtkSMStateLoader* loader=NULL);
222 
226  bool isLoadingState(){return this->LoadingState;};
227 
229  pqServer* getActiveServer() const;
230 
234  void loadDistributedPlugins(const char* filename=0);
235 
237  virtual ~pqApplicationCore();
238 public slots:
239 
242  void prepareForQuit();
243 
245  void quit();
246 
248  void showOutputWindow();
249 
253  void loadConfiguration(const QString& filename);
254  void loadConfigurationXML(const char* xmldata);
255 
257  void render();
258 
259 signals:
265  void aboutToLoadState(vtkPVXMLElement* root);
266 
270  void stateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
271 
275  void stateSaved(vtkPVXMLElement* root);
276 
278  void undoStackChanged(pqUndoStack*);
279 
281  void loadXML(vtkPVXMLElement*);
282 
284  void forceFilterMenuRefresh();
285 
287  void updateMasterEnableState(bool);
288 
289 protected slots:
290  void onStateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
291  void onStateSaved(vtkPVXMLElement* root);
292 
293 protected:
295 
299 
313  QHelpEngine* HelpEngine;
314  QPointer<pqTestUtility> TestUtility;
315 
316 private:
317  Q_DISABLE_COPY(pqApplicationCore)
318 
319  class pqInternals;
320  pqInternals* Internal;
321  static pqApplicationCore* Instance;
322  void constructor();
323  void createOutputWindow();
324 };
325 
326 #endif
327 
pqProgressManager * ProgressManager
pqOutputWindow * OutputWindow
pqLinksModel * LinksModel
pqDisplayPolicy * getDisplayPolicy() const
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:55
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:45
This is a vtkSMProxyManager observer.
pqServerConfigurationCollection * ServerConfigurations
pqOutputWindowAdapter * OutputWindowAdapter
pqDisplayPolicy * DisplayPolicy
QPointer< pqTestUtility > TestUtility
QHelpEngine * HelpEngine
pqObjectBuilder * ObjectBuilder
pqServerManagerModel is the model for the Server Manager.
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
pqUndoStack * getUndoStack() const
pqUndoStack represents a vtkSMUndoStack along with a a vtkSMUndoStackBuilder.
Definition: pqUndoStack.h:54
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:62