Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Attributes | List of all members
pqApplicationCore Class Reference

This class is the crux of the ParaView application. More...

#include <pqApplicationCore.h>

Inheritance diagram for pqApplicationCore:
Inheritance graph
[legend]
Collaboration diagram for pqApplicationCore:
Collaboration graph
[legend]

Public Slots

void prepareForQuit ()
 Applications calls this to ensure that any cleanup is performed correctly. More...
 
void quit ()
 Calls QCoreApplication::quit(). More...
 
void updateAvailableReadersAndWriters ()
 Update the available readers and writers using the factories. More...
 
void render ()
 Renders all windows. More...
 
void loadConfiguration (const QString &filename)
 Load configuration xml. More...
 
void loadConfigurationXML (const char *xmldata)
 Load configuration xml. More...
 

Signals

void aboutToWriteState (QString filename)
 Fired before a state file, either python or XML, is written. More...
 
void aboutToReadState (QString filename)
 Fired before a state file, either python or XML, is read. More...
 
void aboutToLoadState (vtkPVXMLElement *root)
 Fired before a state xml is being loaded. More...
 
void stateLoaded (vtkPVXMLElement *root, vtkSMProxyLocator *locator)
 Fired when a state file is loaded successfully. More...
 
void stateSaved (vtkPVXMLElement *root)
 Fired to save state xml. More...
 
void undoStackChanged (pqUndoStack *)
 Fired when the undo stack is set. More...
 
void loadXML (vtkPVXMLElement *)
 Fired on loadConfiguration(). More...
 
void forceFilterMenuRefresh ()
 Fired when the filter menu state needs to be manually updated. More...
 
void updateMasterEnableState (bool)
 Fired when master changed. More...
 
void clientEnvironmentDone ()
 Fired when the ParaView Client infrastructure has completed setting up the environment. More...
 

Public Member Functions

 pqApplicationCore (int &argc, char **argv, vtkCLIOptions *options=nullptr, bool addStandardArgs=true, QObject *parent=nullptr)
 Initializes the ParaView application engine. More...
 
pqObjectBuildergetObjectBuilder () const
 Get the Object Builder. More...
 
void setUndoStack (pqUndoStack *stack)
 Set/Get the application's central undo stack. More...
 
pqUndoStackgetUndoStack () const
 
void registerManager (const QString &function, QObject *manager)
 Custom Applications may need use various "managers" All such manager can be registered with the pqApplicationCore so that that can be used by other components of the application. More...
 
QObject * manager (const QString &function)
 Returns a manager for a particular function, if any. More...
 
void unRegisterManager (const QString &function)
 Unregisters a manager for a particular function, if any. More...
 
QHelpEngine * helpEngine ()
 provides access to the help engine. More...
 
void registerDocumentation (const QString &filename)
 QHelpEngine doesn't like filenames in resource space. More...
 
pqServerManagerObservergetServerManagerObserver ()
 ServerManagerObserver observer the vtkSMProxyManager for changes to the server manager and fires signals on certain actions such as registeration/unregistration of proxies etc. More...
 
pqServerManagerModelgetServerManagerModel () const
 ServerManagerModel is the representation of the ServerManager using pqServerManagerModelItem subclasses. More...
 
pqInterfaceTrackerinterfaceTracker () const
 Locates the interface tracker for the application. More...
 
pqLinksModelgetLinksModel () const
 pqLinksModel is the model used to keep track of proxy/property links maintained by vtkSMProxyManager. More...
 
pqMainWindowEventManagergetMainWindowEventManager () const
 pqMainWindowManager manages signals called for main window events. More...
 
pqPluginManagergetPluginManager () const
 pqPluginManager manages all functionality associated with loading plugins. More...
 
pqProgressManagergetProgressManager () const
 ProgressManager is the manager that streamlines progress. More...
 
virtual pqTestUtility * testUtility ()
 Provides access to the test utility. More...
 
pqRecentlyUsedResourcesListrecentlyUsedResources ()
 Returns the set of recently-used resources i.e. More...
 
pqServerConfigurationCollectionserverConfigurations ()
 Returns the collection of server configurations known. More...
 
pqSettingssettings ()
 Get the application settings. More...
 
void clearSettings ()
 Clears the settings. More...
 
vtkPVXMLElementsaveState ()
 Save the ServerManager state to a XML element. More...
 
bool saveState (const QString &filename, vtkTypeUInt32 location=0x10)
 Save the ServerManager state to a file. More...
 
void loadState (vtkPVXMLElement *root, pqServer *server, vtkSMStateLoader *loader=nullptr)
 Loads the ServerManager state. More...
 
void loadState (const char *filename, pqServer *server, vtkSMStateLoader *loader=nullptr)
 Load state xml from a file. More...
 
void loadStateFromString (const char *xmlcontents, pqServer *server, vtkSMStateLoader *loader=nullptr)
 Loads state from an in-memory buffer. More...
 
void clearViewsForLoadingState (pqServer *server)
 
void loadStateIncremental (vtkPVXMLElement *root, pqServer *server, vtkSMStateLoader *loader=nullptr)
 Same as loadState() except that it doesn't clear the current visualization state. More...
 
void loadStateIncremental (const QString &filename, pqServer *server, vtkSMStateLoader *loader=nullptr)
 
void setLoadingState (bool value)
 Set the loading state flag. More...
 
bool isLoadingState ()
 Check to see if its in the process of loading a state Reliance on this flag is chimerical since we cannot set this ivar when state file is being loaded from python shell. More...
 
pqServergetActiveServer () const
 returns the active server is any. More...
 
QString getTranslationsPathFromInterfaceLanguage (QString prefix, QString locale)
 returns a path to a directory containing a translation binary file located in a path specified by the PV_TRANSLATIONS_DIR environment variable or in the resources directory. More...
 
QTranslator * getQtTranslations (QString prefix, QString locale)
 returns a QTranslator with a loaded qm file. More...
 
QString getInterfaceLanguage ()
 returns interface language in use in a locale code form. More...
 
 ~pqApplicationCore () override
 Destructor. More...
 
void _paraview_client_environment_complete ()
 INTERNAL. More...
 

Static Public Member Functions

static pqApplicationCoreinstance ()
 

Protected Slots

void onStateLoaded (vtkPVXMLElement *root, vtkSMProxyLocator *locator)
 
void onStateSaved (vtkPVXMLElement *root)
 
void onHelpEngineWarning (const QString &)
 

Protected Attributes

bool LoadingState
 
pqLinksModelLinksModel
 
pqObjectBuilderObjectBuilder
 
pqInterfaceTrackerInterfaceTracker
 
pqMainWindowEventManagerMainWindowEventManager
 
pqPluginManagerPluginManager
 
pqProgressManagerProgressManager
 
pqServerManagerModelServerManagerModel
 
pqServerManagerObserverServerManagerObserver
 
pqUndoStackUndoStack
 
pqRecentlyUsedResourcesListRecentlyUsedResourcesList
 
pqServerConfigurationCollectionServerConfigurations
 
pqSettingsSettings
 
QHelpEngine * HelpEngine
 
QPointer< pqTestUtility > TestUtility
 

Detailed Description

This class is the crux of the ParaView application.

It creates and manages various managers which are necessary for the ParaView-based client to work with the ServerManager. For clients based of the pqCore library, simply instantiate this pqApplicationCore after QApplication initialization and then create your main window etc. like a standard Qt application. You can then use the facilities provided by pqCore such as the pqObjectBuilder, pqUndoStack etc. in your application. After that point.

Definition at line 60 of file pqApplicationCore.h.

Constructor & Destructor Documentation

◆ pqApplicationCore()

pqApplicationCore::pqApplicationCore ( int argc,
char **  argv,
vtkCLIOptions options = nullptr,
bool  addStandardArgs = true,
QObject *  parent = nullptr 
)

Initializes the ParaView application engine.

vtkCLIOptions may be provide if the application wants to customize command line argument processing. By default all standard ParaView-specific command line arguments will be supported. To avoid that, simply pass addStandardArgs=false.

Note
This constructor may raise pqApplicationCoreExitCode exception if the initialization process was short circuited and the application should simply quit.
If options is nullptr, an vtkCLIOptions instance will be created and used. It is also setup to accept extra / unknown arguments without raising errors.

◆ ~pqApplicationCore()

pqApplicationCore::~pqApplicationCore ( )
override

Destructor.

Member Function Documentation

◆ instance()

static pqApplicationCore* pqApplicationCore::instance ( )
static

◆ getObjectBuilder()

pqObjectBuilder* pqApplicationCore::getObjectBuilder ( ) const
inline

Get the Object Builder.

Object Buider must be used to create complex objects such as sources, filters, readers, views, displays etc.

Definition at line 91 of file pqApplicationCore.h.

◆ setUndoStack()

void pqApplicationCore::setUndoStack ( pqUndoStack stack)

Set/Get the application's central undo stack.

By default no undo stack is provided. Applications must set on up as required.

◆ getUndoStack()

pqUndoStack* pqApplicationCore::getUndoStack ( ) const
inline

Definition at line 98 of file pqApplicationCore.h.

◆ registerManager()

void pqApplicationCore::registerManager ( const QString &  function,
QObject *  manager 
)

Custom Applications may need use various "managers" All such manager can be registered with the pqApplicationCore so that that can be used by other components of the application.

Registering with pqApplicationCore gives easy access to these managers from the application code. Note that custom applications are not required to register managers. However certain optional components of the pqCore may expect some managers. Only one manager can be registered for a function.

◆ manager()

QObject* pqApplicationCore::manager ( const QString &  function)

Returns a manager for a particular function, if any.

◆ unRegisterManager()

void pqApplicationCore::unRegisterManager ( const QString &  function)

Unregisters a manager for a particular function, if any.

◆ helpEngine()

QHelpEngine* pqApplicationCore::helpEngine ( )

provides access to the help engine.

The engine is created the first time this method is called.

◆ registerDocumentation()

void pqApplicationCore::registerDocumentation ( const QString &  filename)

QHelpEngine doesn't like filenames in resource space.

This method creates a temporary file for the resource and registers that with the QHelpEngine.

◆ getServerManagerObserver()

pqServerManagerObserver* pqApplicationCore::getServerManagerObserver ( )
inline

ServerManagerObserver observer the vtkSMProxyManager for changes to the server manager and fires signals on certain actions such as registeration/unregistration of proxies etc.

Returns the ServerManagerObserver used by the application.

Definition at line 142 of file pqApplicationCore.h.

◆ getServerManagerModel()

pqServerManagerModel* pqApplicationCore::getServerManagerModel ( ) const
inline

ServerManagerModel is the representation of the ServerManager using pqServerManagerModelItem subclasses.

It makes it possible to explore the ServerManager with ease by separating proxies based on their functionality/type.

Definition at line 150 of file pqApplicationCore.h.

◆ interfaceTracker()

pqInterfaceTracker* pqApplicationCore::interfaceTracker ( ) const
inline

Locates the interface tracker for the application.

pqInterfaceTracker is used to locate all interface implementations typically loaded from plugins.

Definition at line 157 of file pqApplicationCore.h.

◆ getLinksModel()

pqLinksModel* pqApplicationCore::getLinksModel ( ) const
inline

pqLinksModel is the model used to keep track of proxy/property links maintained by vtkSMProxyManager.

TODO: It may be worthwhile to investigate if we even need a global pqLinksModel. All the information is already available in vtkSMProxyManager.

Definition at line 166 of file pqApplicationCore.h.

◆ getMainWindowEventManager()

pqMainWindowEventManager* pqApplicationCore::getMainWindowEventManager ( ) const
inline

pqMainWindowManager manages signals called for main window events.

Definition at line 171 of file pqApplicationCore.h.

◆ getPluginManager()

pqPluginManager* pqApplicationCore::getPluginManager ( ) const
inline

pqPluginManager manages all functionality associated with loading plugins.

Definition at line 179 of file pqApplicationCore.h.

◆ getProgressManager()

pqProgressManager* pqApplicationCore::getProgressManager ( ) const
inline

ProgressManager is the manager that streamlines progress.

Definition at line 184 of file pqApplicationCore.h.

◆ testUtility()

virtual pqTestUtility* pqApplicationCore::testUtility ( )
virtual

Provides access to the test utility.

Reimplemented in pqPVApplicationCore.

◆ recentlyUsedResources()

pqRecentlyUsedResourcesList& pqApplicationCore::recentlyUsedResources ( )

Returns the set of recently-used resources i.e.

data files and state files.

◆ serverConfigurations()

pqServerConfigurationCollection& pqApplicationCore::serverConfigurations ( )

Returns the collection of server configurations known.

Server configurations have information about connecting to different servers.

◆ settings()

pqSettings* pqApplicationCore::settings ( )

Get the application settings.

◆ clearSettings()

void pqApplicationCore::clearSettings ( )

Clears the settings.

Since various UI components that only read settings at creation time may get out of sync, it's best to warn the user to restart the application.

Any changes made to pqSettings after calling this method will be lost and will not get restored. If that's not desired, see QSettings::clear.

◆ saveState() [1/2]

vtkPVXMLElement* pqApplicationCore::saveState ( )

Save the ServerManager state to a XML element.

◆ saveState() [2/2]

bool pqApplicationCore::saveState ( const QString &  filename,
vtkTypeUInt32  location = 0x10 
)

Save the ServerManager state to a file.

Return true if the operation succeeded otherwise return false.

◆ loadState() [1/2]

void pqApplicationCore::loadState ( vtkPVXMLElement root,
pqServer server,
vtkSMStateLoader loader = nullptr 
)

Loads the ServerManager state.

Emits the signal stateLoaded() on loading state successfully.

◆ loadState() [2/2]

void pqApplicationCore::loadState ( const char *  filename,
pqServer server,
vtkSMStateLoader loader = nullptr 
)

Load state xml from a file.

The filename can be a Qt resource file, besides regular filesystem files (refer to QFile documentation for more information on Qt resource system).

◆ loadStateFromString()

void pqApplicationCore::loadStateFromString ( const char *  xmlcontents,
pqServer server,
vtkSMStateLoader loader = nullptr 
)

Loads state from an in-memory buffer.

◆ clearViewsForLoadingState()

void pqApplicationCore::clearViewsForLoadingState ( pqServer server)

◆ loadStateIncremental() [1/2]

void pqApplicationCore::loadStateIncremental ( vtkPVXMLElement root,
pqServer server,
vtkSMStateLoader loader = nullptr 
)

Same as loadState() except that it doesn't clear the current visualization state.

◆ loadStateIncremental() [2/2]

void pqApplicationCore::loadStateIncremental ( const QString &  filename,
pqServer server,
vtkSMStateLoader loader = nullptr 
)

◆ setLoadingState()

void pqApplicationCore::setLoadingState ( bool  value)
inline

Set the loading state flag.

Definition at line 262 of file pqApplicationCore.h.

◆ isLoadingState()

bool pqApplicationCore::isLoadingState ( )
inline

Check to see if its in the process of loading a state Reliance on this flag is chimerical since we cannot set this ivar when state file is being loaded from python shell.

Definition at line 269 of file pqApplicationCore.h.

◆ getActiveServer()

pqServer* pqApplicationCore::getActiveServer ( ) const

returns the active server is any.

◆ getTranslationsPathFromInterfaceLanguage()

QString pqApplicationCore::getTranslationsPathFromInterfaceLanguage ( QString  prefix,
QString  locale 
)

returns a path to a directory containing a translation binary file located in a path specified by the PV_TRANSLATIONS_DIR environment variable or in the resources directory.

The binary file returned is the first one to have a name matching the locale given in the user settings.

Parameters
prefixThe prefix the filename should contain.
localeThe locale the filename suffix should contain.

◆ getQtTranslations()

QTranslator* pqApplicationCore::getQtTranslations ( QString  prefix,
QString  locale 
)

returns a QTranslator with a loaded qm file.

The qm file can come either from the Qt's translation directory or from the ParaView's shared directory.

Parameters
prefixThe prefix the filename should contain.
localeThe locale the filename suffix should contain.

◆ getInterfaceLanguage()

QString pqApplicationCore::getInterfaceLanguage ( )

returns interface language in use in a locale code form.

It is first read from PV_INTERFACE_LANGUAGE environment variable if defined, then recovered from user settings. If not set, return en.

◆ _paraview_client_environment_complete()

void pqApplicationCore::_paraview_client_environment_complete ( )

INTERNAL.

Do not use.

◆ prepareForQuit

void pqApplicationCore::prepareForQuit ( )
slot

Applications calls this to ensure that any cleanup is performed correctly.

◆ quit

void pqApplicationCore::quit ( )
slot

Calls QCoreApplication::quit().

◆ loadConfiguration

void pqApplicationCore::loadConfiguration ( const QString &  filename)
slot

Load configuration xml.

This results in firing of the loadXML() signal which different components that support configuration catch and process to update their behavior. This also update available readers and writers.

◆ loadConfigurationXML

void pqApplicationCore::loadConfigurationXML ( const char *  xmldata)
slot

Load configuration xml.

This results in firing of the loadXML() signal which different components that support configuration catch and process to update their behavior. This also update available readers and writers.

◆ updateAvailableReadersAndWriters

void pqApplicationCore::updateAvailableReadersAndWriters ( )
slot

Update the available readers and writers using the factories.

◆ render

void pqApplicationCore::render ( )
slot

Renders all windows.

◆ aboutToWriteState

void pqApplicationCore::aboutToWriteState ( QString  filename)
signal

Fired before a state file, either python or XML, is written.

Note that writing can still fail at this point.

◆ aboutToReadState

void pqApplicationCore::aboutToReadState ( QString  filename)
signal

Fired before a state file, either python or XML, is read.

Note that loading can still fail at this point.

◆ aboutToLoadState

void pqApplicationCore::aboutToLoadState ( vtkPVXMLElement root)
signal

Fired before a state xml is being loaded.

One can add slots for this signal and modify the fired xml-element as part of pre-processing before attempting to load the state xml. Note that never attempt to connect to signal in a delayed fashion i.e using Qt::QueuedConnection etc. since the root will be destroyed.

◆ stateLoaded

void pqApplicationCore::stateLoaded ( vtkPVXMLElement root,
vtkSMProxyLocator locator 
)
signal

Fired when a state file is loaded successfully.

GUI components that may have state saved in the XML state file must listen to this signal and handle process the XML to update their state.

◆ stateSaved

void pqApplicationCore::stateSaved ( vtkPVXMLElement root)
signal

Fired to save state xml.

Components that need to save XML state should listen to this signal and add their XML elements to the root. DO NOT MODIFY THE ROOT besides adding new children.

◆ undoStackChanged

void pqApplicationCore::undoStackChanged ( pqUndoStack )
signal

Fired when the undo stack is set.

◆ loadXML

void pqApplicationCore::loadXML ( vtkPVXMLElement )
signal

◆ forceFilterMenuRefresh

void pqApplicationCore::forceFilterMenuRefresh ( )
signal

Fired when the filter menu state needs to be manually updated.

◆ updateMasterEnableState

void pqApplicationCore::updateMasterEnableState ( bool  )
signal

Fired when master changed.

true if current user is master, false otherwise.

◆ clientEnvironmentDone

void pqApplicationCore::clientEnvironmentDone ( )
signal

Fired when the ParaView Client infrastructure has completed setting up the environment.

◆ onStateLoaded

void pqApplicationCore::onStateLoaded ( vtkPVXMLElement root,
vtkSMProxyLocator locator 
)
protectedslot

◆ onStateSaved

void pqApplicationCore::onStateSaved ( vtkPVXMLElement root)
protectedslot

◆ onHelpEngineWarning

void pqApplicationCore::onHelpEngineWarning ( const QString &  )
protectedslot

Member Data Documentation

◆ LoadingState

bool pqApplicationCore::LoadingState
protected

Definition at line 423 of file pqApplicationCore.h.

◆ LinksModel

pqLinksModel* pqApplicationCore::LinksModel
protected

Definition at line 425 of file pqApplicationCore.h.

◆ ObjectBuilder

pqObjectBuilder* pqApplicationCore::ObjectBuilder
protected

Definition at line 426 of file pqApplicationCore.h.

◆ InterfaceTracker

pqInterfaceTracker* pqApplicationCore::InterfaceTracker
protected

Definition at line 427 of file pqApplicationCore.h.

◆ MainWindowEventManager

pqMainWindowEventManager* pqApplicationCore::MainWindowEventManager
protected

Definition at line 428 of file pqApplicationCore.h.

◆ PluginManager

pqPluginManager* pqApplicationCore::PluginManager
protected

Definition at line 429 of file pqApplicationCore.h.

◆ ProgressManager

pqProgressManager* pqApplicationCore::ProgressManager
protected

Definition at line 430 of file pqApplicationCore.h.

◆ ServerManagerModel

pqServerManagerModel* pqApplicationCore::ServerManagerModel
protected

Definition at line 431 of file pqApplicationCore.h.

◆ ServerManagerObserver

pqServerManagerObserver* pqApplicationCore::ServerManagerObserver
protected

Definition at line 432 of file pqApplicationCore.h.

◆ UndoStack

pqUndoStack* pqApplicationCore::UndoStack
protected

Definition at line 433 of file pqApplicationCore.h.

◆ RecentlyUsedResourcesList

pqRecentlyUsedResourcesList* pqApplicationCore::RecentlyUsedResourcesList
protected

Definition at line 434 of file pqApplicationCore.h.

◆ ServerConfigurations

pqServerConfigurationCollection* pqApplicationCore::ServerConfigurations
protected

Definition at line 435 of file pqApplicationCore.h.

◆ Settings

pqSettings* pqApplicationCore::Settings
protected

Definition at line 436 of file pqApplicationCore.h.

◆ HelpEngine

QHelpEngine* pqApplicationCore::HelpEngine
protected

Definition at line 437 of file pqApplicationCore.h.

◆ TestUtility

QPointer<pqTestUtility> pqApplicationCore::TestUtility
protected

Definition at line 438 of file pqApplicationCore.h.


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