Version: 8.3.0
PVGUI_Module Class Reference

Implementation SALOME module wrapping ParaView GUI.

#include <PVGUI_Module.h>

Inheritance diagram for PVGUI_Module:
Inheritance graph

Public Slots

virtual bool activateModule (SUIT_Study *)
 Activate module. More...
 
virtual bool deactivateModule (SUIT_Study *)
 Deactivate module. More...
 
virtual void onApplicationClosed (SUIT_Application *)
 Called when application is closed. More...
 
virtual void studyClosed (SUIT_Study *)
 Called when study is closed. More...
 

Public Member Functions

 PVGUI_Module ()
 Constructor. Sets the default name for the module. More...
 
 ~PVGUI_Module ()
 Destructor. More...
 
virtual void initialize (CAM_Application *)
 Initialize module. Creates menus, prepares context menu, etc. More...
 
virtual void windows (QMap< int, int > &) const
 Get list of compliant dockable GUI elements. More...
 
void openFile (const char *)
 Open file of format supported by ParaView. More...
 
void executeScript (const char *)
 Execute a Python script. More...
 
void saveParaviewState (const QString &)
 Saves ParaView state to a disk file. More...
 
void loadParaviewState (const QString &)
 Restores ParaView state from a disk file. More...
 
void clearParaviewState ()
 Delete all objects for Paraview Pipeline Browser. More...
 
QString getTraceString ()
 Debug function printing out the given interpreter's execution context. More...
 
void startTrace ()
 Starts Python trace. More...
 
void stopTrace ()
 Stops Python trace. More...
 
void saveTrace (const char *)
 Saves trace string to disk file. More...
 
pqServer * getActiveServer ()
 Returns current active ParaView server. More...
 
virtual void createPreferences ()
 Creates PARAVIS preferences panel. More...
 
virtual CAM_DataModel * createDataModel ()
 Create data model. More...
 

Static Public Member Functions

static PVServer_ServiceWrapper * GetEngine ()
 Retrieve the PVSERVER CORBA engine. This uses the Python wrapper provided by the PVViewer code in GUI (class PVViewer_EngineWrapper). More...
 
static pqPVApplicationCore * GetPVApplication ()
 Get the ParaView application singleton. More...
 

Protected Slots

virtual void onInitTimer ()
 Initialisation timer event - Starts up the Python trace. More...
 
virtual void onViewManagerAdded (SUIT_ViewManager *)
 Called when view manager is added. More...
 
virtual void onViewManagerRemoved (SUIT_ViewManager *)
 Called when view manager is removed. More...
 
virtual void onPVViewCreated (SUIT_ViewWindow *)
 Show toolbars at vw PV view window creating when PARAVIS is active. More...
 
virtual void onPVViewDelete (SUIT_ViewWindow *)
 Save toolbars state at view view closing. More...
 

Private Types

enum  {
  OpenFileId, LoadStateId, SaveStateId, SaveDataId,
  SaveScreenshotId, ExportId, SaveAnimationId, SaveGeometryId,
  ConnectId, DisconnectId, UndoId, RedoId,
  CameraUndoId, CameraRedoId, FindDataId, ChangeInputId,
  IgnoreTimeId, DeleteId, DeleteAllId, SettingsId,
  ViewSettingsId, FullScreenId, FirstFrameId, PreviousFrameId,
  PlayId, NextFrameId, LastFrameId, LoopId,
  CreateCustomFilterId, ManageCustomFiltersId, CreateLookmarkId, ManageLinksId,
  AddCameraLinkId, ManagePluginsExtensionsId, DumpWidgetNamesId, RecordTestId,
  RecordTestScreenshotId, PlayTestId, MaxWindowSizeId, CustomWindowSizeId,
  TimerLogId, OutputWindowId, PythonShellId, ShowTraceId,
  RestartTraceId, AboutParaViewId, ParaViewHelpId, EnableTooltipsId
}
 Menu actions. More...
 
typedef QMap< QWidget *, bool > WgMap
 
typedef QMap< int, bool > DockWindowMap
 

Private Slots

void showHelpForProxy (const QString &, const QString &)
 Slot to show help for proxy. More...
 
void onPreAccept ()
 Slot to show the waiting state. More...
 
void onPostAccept ()
 Slot to show the ready state. More...
 
void endWaitCursor ()
 Slot to switch off wait cursor. More...
 
void onDataRepresentationUpdated ()
 
void onStartProgress ()
 Slot called when the progress bar starts. More...
 
void onEndProgress ()
 Slot called when the progress bar is done. More...
 
void onShowTrace ()
 . Show ParaView python trace. More...
 
void onRestartTrace ()
 . Re-initialize ParaView python trace. More...
 
void onStopTrace ()
 . Close ParaView python trace. More...
 

Private Member Functions

void pvCreateActions ()
 Create actions for ParaView GUI operations. More...
 
void pvCreateMenus ()
 Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class. More...
 
void pvCreateToolBars ()
 Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class. More...
 
void setupDockWidgets ()
 Create dock widgets for ParaView widgets. More...
 
void saveDockWidgetsState (bool=true)
 Save states of dockable ParaView widgets. More...
 
void restoreDockWidgetsState ()
 Restore states of dockable ParaView widgets. More...
 
void showView (bool)
 Shows or hides ParaView view window. More...
 
QStringList getEmbeddedMacrosList ()
 Get list of embedded macros files. More...
 
void updateMacros ()
 update macros state More...
 
void storeCommonWindowsState ()
 store visibility of the common dockable windows (OB, PyConsole, ... etc.) More...
 
void restoreCommonWindowsState ()
 restore visibility of the common dockable windows (OB, PyConsole, ... etc.) More...
 

Private Attributes

int mySourcesMenuId
 
int myFiltersMenuId
 
int myMacrosMenuId
 
int myRecentMenuId
 
WgMap myDockWidgets
 
WgMap myToolbars
 
WgMap myToolbarBreaks
 
QList< QMenu * > myMenus
 
DockWindowMap myCommonMap
 
QtMessageHandler myOldMsgHandler
 
vtkEventQtSlotConnect * VTKConnect
 
pqPythonScriptEditor * myTraceWindow
 
QTimer * myInitTimer
 Single shot timer used to connect to the PVServer, and start the trace. More...
 
PVViewer_GUIElements * myGuiElements
 

Member Typedef Documentation

typedef QMap<QWidget*, bool> PVGUI_Module::WgMap
private
typedef QMap<int, bool> PVGUI_Module::DockWindowMap
private

Member Enumeration Documentation

anonymous enum
private
Enumerator
OpenFileId 
LoadStateId 
SaveStateId 
SaveDataId 
SaveScreenshotId 
ExportId 
SaveAnimationId 
SaveGeometryId 
ConnectId 
DisconnectId 
UndoId 
RedoId 
CameraUndoId 
CameraRedoId 
FindDataId 
ChangeInputId 
IgnoreTimeId 
DeleteId 
DeleteAllId 
SettingsId 
ViewSettingsId 
FullScreenId 
FirstFrameId 
PreviousFrameId 
PlayId 
NextFrameId 
LastFrameId 
LoopId 
CreateCustomFilterId 
ManageCustomFiltersId 
CreateLookmarkId 
ManageLinksId 
AddCameraLinkId 
ManagePluginsExtensionsId 
DumpWidgetNamesId 
RecordTestId 
RecordTestScreenshotId 
PlayTestId 
MaxWindowSizeId 
CustomWindowSizeId 
TimerLogId 
OutputWindowId 
PythonShellId 
ShowTraceId 
RestartTraceId 
AboutParaViewId 
ParaViewHelpId 
EnableTooltipsId 

Constructor & Destructor Documentation

PVGUI_Module::PVGUI_Module ( )
PVGUI_Module::~PVGUI_Module ( )

References myInitTimer.

Member Function Documentation

void PVGUI_Module::initialize ( CAM_Application *  app)
virtual
void PVGUI_Module::windows ( QMap< int, int > &  m) const
virtual
Parameters
mmap to be filled in ("type":"default_position")
void PVGUI_Module::openFile ( const char *  theName)
void PVGUI_Module::executeScript ( const char *  script)
void PVGUI_Module::saveParaviewState ( const QString &  theFileName)
void PVGUI_Module::loadParaviewState ( const QString &  theFileName)

References getActiveServer().

void PVGUI_Module::clearParaviewState ( )

References DeleteAllId.

QString PVGUI_Module::getTraceString ( )

Returns trace string

void PVGUI_Module::startTrace ( )

Start trace invoking the newly introduced C++ API (PV 4.2) (inspired from pqTraceReaction::start())

References PARAVIS_MODULE_NAME.

void PVGUI_Module::stopTrace ( )
void PVGUI_Module::saveTrace ( const char *  theName)

References getTraceString().

pqServer * PVGUI_Module::getActiveServer ( )
void PVGUI_Module::createPreferences ( )
virtual

References PARAVIS_MODULE_NAME, and stopTrace().

PVServer_ServiceWrapper * PVGUI_Module::GetEngine ( )
static
See Also
GetCPPEngine()
pqPVApplicationCore * PVGUI_Module::GetPVApplication ( )
static
CAM_DataModel * PVGUI_Module::createDataModel ( )
virtual
Returns
module specific data model
void PVGUI_Module::pvCreateMenus ( )
private
void PVGUI_Module::pvCreateToolBars ( )
private
void PVGUI_Module::setupDockWidgets ( )
private

Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc. ParaView pqMainWindowCore class is fully responsible for these dock widgets' contents. ==> To update this function, see the reference set up of ParaView in Application/Paraview/ParaviewMainWindow.ui.

References myDockWidgets, and showHelpForProxy().

void PVGUI_Module::saveDockWidgetsState ( bool  hideWidgets = true)
private
void PVGUI_Module::restoreDockWidgetsState ( )
private
void PVGUI_Module::showView ( bool  toShow)
private

Shows (toShow = true) or hides ParaView view window.

QStringList PVGUI_Module::getEmbeddedMacrosList ( )
private
void PVGUI_Module::updateMacros ( )
private

Update the list of embedded macros.

References getEmbeddedMacrosList().

void PVGUI_Module::storeCommonWindowsState ( )
private

Store visibility of the common dockable windows (OB, PyConsole, ... etc.)

References myCommonMap.

void PVGUI_Module::restoreCommonWindowsState ( )
private

Restore visibility of the common dockable windows (OB, PyConsole, ... etc.)

References myCommonMap.

void PVGUI_Module::showHelpForProxy ( const QString &  groupname,
const QString &  proxyname 
)
privateslot
void PVGUI_Module::onPreAccept ( )
privateslot
void PVGUI_Module::onPostAccept ( )
privateslot

References endWaitCursor().

void PVGUI_Module::endWaitCursor ( )
privateslot
void PVGUI_Module::onDataRepresentationUpdated ( )
privateslot
void PVGUI_Module::onStartProgress ( )
privateslot
void PVGUI_Module::onEndProgress ( )
privateslot
void PVGUI_Module::onShowTrace ( )
privateslot

References getTraceString(), and myTraceWindow.

void PVGUI_Module::onRestartTrace ( )
privateslot

References startTrace(), and stopTrace().

void PVGUI_Module::onStopTrace ( )
privateslot

References stopTrace().

bool PVGUI_Module::activateModule ( SUIT_Study *  study)
virtualslot
Parameters
studycurrent study
Returns
true if activaion is done successfully or 0 to prevent activation on error

References myFiltersMenuId, myMacrosMenuId, myMenus, myOldMsgHandler, myRecentMenuId, mySourcesMenuId, paravisCleanUp(), ParavisMessageOutput(), restoreDockWidgetsState(), showView(), and storeCommonWindowsState().

bool PVGUI_Module::deactivateModule ( SUIT_Study *  study)
virtualslot
Parameters
studycurrent study
Returns
true if deactivaion is done successfully or 0 to prevent deactivation on error

References myDockWidgets, myFiltersMenuId, myMacrosMenuId, myMenus, myOldMsgHandler, myRecentMenuId, mySourcesMenuId, paravisCleanUp(), restoreCommonWindowsState(), and saveDockWidgetsState().

void PVGUI_Module::onApplicationClosed ( SUIT_Application *  theApp)
virtualslot

Process finalize application functionality from ParaView in order to save server settings and nullify application pointer if the application is being closed.

Parameters
theAppapplication
void PVGUI_Module::studyClosed ( SUIT_Study *  study)
virtualslot

Removes data model from the study.

Parameters
studystudy being closed

References clearParaviewState(), onRestartTrace(), and showView().

void PVGUI_Module::onInitTimer ( )
protectedvirtualslot

References startTrace().

void PVGUI_Module::onViewManagerAdded ( SUIT_ViewManager *  vm)
protectedvirtualslot
void PVGUI_Module::onViewManagerRemoved ( SUIT_ViewManager *  vm)
protectedvirtualslot

References onPVViewCreated().

void PVGUI_Module::onPVViewCreated ( SUIT_ViewWindow *  vw)
protectedvirtualslot
void PVGUI_Module::onPVViewDelete ( SUIT_ViewWindow *  view)
protectedvirtualslot

Field Documentation

int PVGUI_Module::mySourcesMenuId
private
int PVGUI_Module::myFiltersMenuId
private
int PVGUI_Module::myMacrosMenuId
private
int PVGUI_Module::myRecentMenuId
private
WgMap PVGUI_Module::myDockWidgets
private
WgMap PVGUI_Module::myToolbars
private
WgMap PVGUI_Module::myToolbarBreaks
private
QList<QMenu*> PVGUI_Module::myMenus
private
DockWindowMap PVGUI_Module::myCommonMap
private
QtMessageHandler PVGUI_Module::myOldMsgHandler
private
vtkEventQtSlotConnect* PVGUI_Module::VTKConnect
private
pqPythonScriptEditor* PVGUI_Module::myTraceWindow
private
QTimer* PVGUI_Module::myInitTimer
private
PVViewer_GUIElements* PVGUI_Module::myGuiElements
private