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 "vtkPVConfig.h" // for PARAVIEW_USE_QTHELP
37 #include <QObject>
38 #include <QPointer>
39 
40 class pqInterfaceTracker;
41 class pqLinksModel;
43 class pqObjectBuilder;
44 class pqOptions;
45 class pqPipelineSource;
46 class pqPluginManager;
47 class pqProgressManager;
49 class pqServer;
53 class pqServerResource;
54 class pqSettings;
55 class pqTestUtility;
56 class pqUndoStack;
57 class QApplication;
58 #ifdef PARAVIEW_USE_QTHELP
59 class QHelpEngine;
60 #endif
61 class QStringList;
62 class vtkPVXMLElement;
63 class vtkSMProxyLocator;
64 class vtkSMStateLoader;
65 
76 class PQCORE_EXPORT pqApplicationCore : public QObject
77 {
78  Q_OBJECT
79  typedef QObject Superclass;
80 
81 public:
82  // Get the global instance for the pqApplicationCore.
83  static pqApplicationCore* instance();
84 
92  pqApplicationCore(int& argc, char** argv, pqOptions* options = 0, QObject* parent = 0);
93 
97  pqOptions* getOptions() const { return this->Options; }
98 
104  pqObjectBuilder* getObjectBuilder() const { return this->ObjectBuilder; }
105 
110  void setUndoStack(pqUndoStack* stack);
111  pqUndoStack* getUndoStack() const { return this->UndoStack; }
112 
124  void registerManager(const QString& function, QObject* manager);
125 
129  //. \sa registerManager
130  QObject* manager(const QString& function);
131 
135  void unRegisterManager(const QString& function);
136 
137 #ifdef PARAVIEW_USE_QTHELP
138 
142  QHelpEngine* helpEngine();
143 #endif
144 
149  void registerDocumentation(const QString& filename);
150 
157  pqServerManagerObserver* getServerManagerObserver() { return this->ServerManagerObserver; }
158 
165  pqServerManagerModel* getServerManagerModel() const { return this->ServerManagerModel; }
166 
172  pqInterfaceTracker* interfaceTracker() const { return this->InterfaceTracker; }
173 
181  pqLinksModel* getLinksModel() const { return this->LinksModel; }
182 
187  {
188  return this->MainWindowEventManager;
189  }
190 
194  pqPluginManager* getPluginManager() const { return this->PluginManager; }
195 
199  pqProgressManager* getProgressManager() const { return this->ProgressManager; }
200 
204  virtual pqTestUtility* testUtility();
205 
210  pqRecentlyUsedResourcesList& recentlyUsedResources();
211 
216  pqServerConfigurationCollection& serverConfigurations();
217 
221  pqSettings* settings();
222 
231  void clearSettings();
232 
236  vtkPVXMLElement* saveState();
237 
242  bool saveState(const QString& filename);
243 
248  void loadState(vtkPVXMLElement* root, pqServer* server, vtkSMStateLoader* loader = NULL);
249 
255  void loadState(const char* filename, pqServer* server, vtkSMStateLoader* loader = NULL);
256 
260  void loadStateFromString(
261  const char* xmlcontents, pqServer* server, vtkSMStateLoader* loader = NULL);
262 
263  void clearViewsForLoadingState(pqServer* server);
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 
277  void setLoadingState(bool value) { this->LoadingState = value; };
278 
284  bool isLoadingState() { return this->LoadingState; };
285 
289  pqServer* getActiveServer() const;
290 
294  ~pqApplicationCore() override;
295 
299  void _paraview_client_environment_complete();
300 
301 public Q_SLOTS:
302 
307  void prepareForQuit();
308 
312  void quit();
313 
319  void loadConfiguration(const QString& filename);
320  void loadConfigurationXML(const char* xmldata);
321 
325  void render();
326 
327 Q_SIGNALS:
335  void aboutToLoadState(vtkPVXMLElement* root);
336 
342  void stateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
343 
349  void stateSaved(vtkPVXMLElement* root);
350 
354  void undoStackChanged(pqUndoStack*);
355 
359  void loadXML(vtkPVXMLElement*);
360 
364  void forceFilterMenuRefresh();
365 
369  void updateMasterEnableState(bool);
370 
375  void clientEnvironmentDone();
376 
377 protected Q_SLOTS:
378  void onStateLoaded(vtkPVXMLElement* root, vtkSMProxyLocator* locator);
379  void onStateSaved(vtkPVXMLElement* root);
380  void onHelpEngineWarning(const QString&);
381 
382 private Q_SLOTS:
388  void generalSettingsChanged();
389 
390 protected:
392 
406 #ifdef PARAVIEW_USE_QTHELP
407  QHelpEngine* HelpEngine;
408 #endif
409  QPointer<pqTestUtility> TestUtility;
410 
411 private:
412  Q_DISABLE_COPY(pqApplicationCore)
413 
414  class pqInternals;
415  pqInternals* Internal;
416  static pqApplicationCore* Instance;
417  void constructor();
418 };
419 
420 #endif
pqProgressManager * ProgressManager
pqLinksModel * LinksModel
pqServerManagerObserver * ServerManagerObserver
This class is the crux of the ParaView application.
void setLoadingState(bool value)
Set the loading state flag.
pqInterfaceTracker * interfaceTracker() const
Locates the interface tracker for the application.
manages recently used resources
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.
pqObjectBuilder is loosely based on the Builder design pattern.
pqProgressManager * getProgressManager() const
ProgressManager is the manager that streamlines progress.
pqServerManagerModel * ServerManagerModel
pqServerManagerObserver * getServerManagerObserver()
ServerManagerObserver observer the vtkSMProxyManager for changes to the server manager and fires sign...
pqInterfaceTracker * InterfaceTracker
pqMainWindowEventManager is a manager for marshalling a main window&#39;s events to pqReactions.
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
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
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.
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...
pqMainWindowEventManager * MainWindowEventManager
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
pqMainWindowEventManager * getMainWindowEventManager() const
pqMainWindowManager manages signals called for main window events.