Back to index

salome-paravis  6.5.0
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Private Types | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
PVGUI_Module Class Reference

Implementation SALOME module wrapping ParaView GUI. More...

#include <PVGUI_Module.h>

List of all members.

Public Slots

void onImportFromVisu (QString theEntry)
 Imports MED data from VISU module by data entry.
virtual bool activateModule (SUIT_Study *)
 Activate module.
virtual bool deactivateModule (SUIT_Study *)
 Deactivate module.
virtual void onApplicationClosed (SUIT_Application *)
 Called when application is closed.
virtual void studyClosed (SUIT_Study *)
 Called when study is closed.

Public Member Functions

 PVGUI_Module ()
 Constructor.
 ~PVGUI_Module ()
 Destructor.
virtual void initialize (CAM_Application *)
 Initialize module.
virtual void windows (QMap< int, int > &) const
 Get list of compliant dockable GUI elements.
pqTabbedMultiViewWidget * getMultiViewManager () const
 Returns the ParaView multi-view manager.
virtual QString engineIOR () const
 Returns IOR of current engine.
void openFile (const char *theName)
 Open file of format supported by ParaView.
void executeScript (const char *script)
void saveParaviewState (const char *theFileName)
 Saves ParaView state to a disk file.
void loadParaviewState (const char *theFileName)
 Restores ParaView state from a disk file.
void clearParaviewState ()
 Delete all objects for Paraview Pipeline Browser.
QString getTraceString ()
void saveTrace (const char *theName)
 Saves trace string to disk file.
pqServer * getActiveServer ()
 Returns current active ParaView server.
virtual void createPreferences ()
 Creates PARAVIS preference pane.
virtual void contextMenuPopup (const QString &theClient, QMenu *theMenu, QString &theTitle)
 Creates ParaViS context menu popup.

Protected Slots

virtual void onModelOpened ()
 Called when study is opened.

Protected Member Functions

void timerEvent (QTimerEvent *event)
 Launches a tracing of current server.

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,
  AboutParaViewId, ParaViewHelpId, EnableTooltipsId, ParaViewNewWindowId,
  SaveStatePopupId, AddStatePopupId, CleanAndAddStatePopupId, ParaVisRenameId,
  ParaVisDeleteId
}
 Menu actions. More...
typedef QMap< QWidget *, bool > WgMap

Private Slots

void showHelpForProxy (const QString &, const QString &)
 Slot to show help for proxy.
void onPreAccept ()
 Slot to show the waiting state.
void onPostAccept ()
 Slot to show the ready state.
void endWaitCursor ()
 Slot to switch off wait cursor.
void onFinishedAddingServer (pqServer *)
void onStartProgress ()
void onEndProgress ()
void onShowTrace ()
void onNewParaViewWindow ()
 Show ParaView view.
void onSaveMultiState ()
 Save state under the module root object.
void onAddState ()
 Restore the selected state by merging with the current one.
void onCleanAddState ()
 Clean the current state and restore the selected one.
void onRename ()
 Rename the selected object.
void onDelete ()
 Delete the selected objects.

Private Member Functions

void pvCreateActions ()
 Create actions for ParaView GUI operations.
void pvCreateMenus ()
 Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class.
void pvCreateToolBars ()
 Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class.
void setupDockWidgets ()
 Create dock widgets for ParaView widgets.
void saveDockWidgetsState ()
 Save states of dockable ParaView widgets.
void restoreDockWidgetsState ()
 Restore states of dockable ParaView widgets.
void showView (bool)
 Shows or hides ParaView view window.
QMenu * getMenu (const int)
 Returns QMenu object for a given menu id.
QString getHelpFileName ()
 Discover help project files from the resources.
void deleteTemporaryFiles ()
 Deletes temporary files created during import operation from VISU.
void createActions ()
 Create actions for ParaViS.
void createMenus ()
 Create menus for ParaViS.
void loadSelectedState (bool toClear)
 Load selected state.
void updateMacros ()
 update macros state

Static Private Member Functions

static bool pvInit ()
 Initialize ParaView if not yet done (once per session)

Private Attributes

pqImplementation * Implementation
int mySelectionControlsTb
int mySourcesMenuId
int myFiltersMenuId
int myToolbarsMenuId
int myMacrosMenuId
int myRecentMenuId
WgMap myDockWidgets
WgMap myToolbars
WgMap myToolbarBreaks
QStringList myTemporaryFiles
QtMsgHandler myOldMsgHandler
vtkEventQtSlotConnect * VTKConnect
pqPythonScriptEditor * myTraceWindow
int myStateCounter

Static Private Attributes

static pqPVApplicationCore * MyCoreApp = 0

Detailed Description

Implementation SALOME module wrapping ParaView GUI.

Definition at line 47 of file PVGUI_Module.h.


Member Typedef Documentation

typedef QMap<QWidget*, bool> PVGUI_Module::WgMap [private]

Definition at line 260 of file PVGUI_Module.h.


Member Enumeration Documentation

anonymous enum [private]

Menu actions.

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 
AboutParaViewId 
ParaViewHelpId 
EnableTooltipsId 
ParaViewNewWindowId 
SaveStatePopupId 
AddStatePopupId 
CleanAndAddStatePopupId 
ParaVisRenameId 
ParaVisDeleteId 

Definition at line 52 of file PVGUI_Module.h.


Constructor & Destructor Documentation

Constructor.

Sets the default name for the module.

Definition at line 244 of file PVGUI_Module.cxx.

  : SalomeApp_Module( "PARAVIS" ),
    LightApp_Module( "PARAVIS" ),
    //    Implementation( 0 ),
    mySelectionControlsTb( -1 ),
    mySourcesMenuId( -1 ),
    myFiltersMenuId( -1 ),
    myMacrosMenuId(-1),
    myToolbarsMenuId(-1),
    myRecentMenuId(-1),
    myOldMsgHandler(0),
    myTraceWindow(0),
    myStateCounter(0)
{
#ifdef HAS_PV_DOC
  Q_INIT_RESOURCE( PVGUI );
#endif
  ParavisModule = this;

  // Clear old macros
  QString aDestPath = QString( "%1/.config/%2/Macros" ).arg( QDir::homePath() ).arg( QApplication::applicationName() );
  QStringList aFilter;
  aFilter << "*.py";

  QDir aDestDir(aDestPath);
  QStringList aDestFiles = aDestDir.entryList(aFilter, QDir::Files);
  foreach (QString aStr, aDestFiles) {
    aDestDir.remove(aStr);
  }
}

Destructor.

Definition at line 278 of file PVGUI_Module.cxx.

{
}

Member Function Documentation

bool PVGUI_Module::activateModule ( SUIT_Study *  study) [virtual, slot]

Activate module.

Parameters:
studycurrent study
Returns:
true if activaion is done successfully or 0 to prevent activation on error

Definition at line 658 of file PVGUI_Module.cxx.

{
  myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput);

  bool isDone = SalomeApp_Module::activateModule( study );
  if ( !isDone ) return false;

  showView( true );
  if ( mySourcesMenuId != -1 ) menuMgr()->show(mySourcesMenuId);
  if ( myFiltersMenuId != -1 ) menuMgr()->show(myFiltersMenuId);
  if ( myFiltersMenuId != -1 ) menuMgr()->show(myMacrosMenuId);
  if ( myFiltersMenuId != -1 ) menuMgr()->show(myToolbarsMenuId);
  setMenuShown( true );
  setToolShown( true );

  restoreDockWidgetsState();

   QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId );
   if(aMenu) {
      QList<QAction*> anActns = aMenu->actions();
      for (int i = 0; i < anActns.size(); ++i) {
             QAction* a = anActns.at(i);
        if(a)
           a->setVisible(true);
      }
    }

  if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId);

  return isDone;
}

Here is the call graph for this function:

Delete all objects for Paraview Pipeline Browser.

Definition at line 905 of file PVGUI_Module.cxx.

{
  QAction* deleteAllAction = action(DeleteAllId);
  if (deleteAllAction) {
    deleteAllAction->activate(QAction::Trigger);
  }
}

Here is the caller graph for this function:

void PVGUI_Module::contextMenuPopup ( const QString &  theClient,
QMenu *  theMenu,
QString &  theTitle 
) [virtual]

Creates ParaViS context menu popup.

Definition at line 1034 of file PVGUI_Module.cxx.

{
  SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
  
  // Check if we are in Object Browser
  SUIT_DataBrowser* ob = getApp()->objectBrowser();
  bool isOBClient = (ob && theClient == ob->popupClientType());
  if (!isOBClient) {
    return;
  }

  // Get list of selected objects
  LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
  SALOME_ListIO aListIO;
  aSelectionMgr->selectedObjects(aListIO);
  if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) {
    QString entry = QString(aListIO.First()->getEntry());
    
    // Get active study
    SalomeApp_Study* activeStudy = 
      dynamic_cast<SalomeApp_Study*>(getApp()->activeStudy());
    if(!activeStudy) {
      return;
    }

    // Get SALOMEDS client study 
    _PTR(Study) studyDS = activeStudy->studyDS();
    if(!studyDS) {
      return;
    }

    QString paravisDataType(PARAVIS::GetParavisGen(this)->ComponentDataType());
    if(activeStudy && activeStudy->isComponent(entry) && 
       activeStudy->componentDataType(entry) == paravisDataType) {
      // ParaViS module object
      theMenu->addSeparator();
      theMenu->addAction(action(SaveStatePopupId));
    }
    else {
      // Try to get state object
      _PTR(SObject) stateSObj = 
       studyDS->FindObjectID(entry.toLatin1().constData());
      if (!stateSObj) {
       return;
      }
      
      // Check local id
      _PTR(GenericAttribute) anAttr;
      if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) {
       return;
      }

      _PTR(AttributeLocalID) anID(anAttr);
      
      if (anID->Value() == PVSTATEID) {
       // Paraview state object
       theMenu->addSeparator();
       theMenu->addAction(action(AddStatePopupId));
       theMenu->addAction(action(CleanAndAddStatePopupId));
       theMenu->addSeparator();
       theMenu->addAction(action(ParaVisRenameId));
       theMenu->addAction(action(ParaVisDeleteId));
      }
    }
  }
}

Here is the call graph for this function:

void PVGUI_Module::createActions ( ) [private]

Create actions for ParaViS.

Returns list of ParaView toolbars.

Builds a menu which referred to toolbars

Create actions for ParaViS

Definition at line 624 of file PVGUI_Module_actions.cxx.

{
  QAction* anAction;

  // New ParaView window
  anAction = new QtxAction(tr("MEN_NEW_PV_VIEW"), tr("MEN_NEW_PV_VIEW"), 0, 
                        this, false, "ParaViS:Create new ParaView view");
  connect(anAction, SIGNAL(triggered()), this, SLOT(onNewParaViewWindow()));
  registerAction(ParaViewNewWindowId, anAction);

  // Save state under the module root object
  anAction = new QAction(tr("MEN_SAVE_MULTI_STATE"), this);
  connect(anAction, SIGNAL(triggered()), this, SLOT(onSaveMultiState()));
  registerAction(SaveStatePopupId, anAction);

  // Restore the selected state by merging with the current one
  anAction = new QAction(tr("MEN_ADD_STATE"), this);
  connect(anAction, SIGNAL(triggered()), this, SLOT(onAddState()));
  registerAction(AddStatePopupId, anAction);

  // Clean the current state and restore the selected one
  anAction = new QAction(tr("MEN_CLEAN_ADD_STATE"), this);
  connect(anAction, SIGNAL(triggered()), this, SLOT(onCleanAddState()));
  registerAction(CleanAndAddStatePopupId, anAction);

  // Rename the selected object (Object Browser)
  anAction = new QAction(tr("MEN_PARAVIS_RENAME"), this);
  connect(anAction, SIGNAL(triggered()), this, SLOT(onRename()));
  registerAction(ParaVisRenameId, anAction);

  // Delete the selected object (Object Browser)
  anAction = new QAction(tr("MEN_PARAVIS_DELETE"), this);
  connect(anAction, SIGNAL(triggered()), this, SLOT(onDelete()));
  registerAction(ParaVisDeleteId, anAction);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::createMenus ( ) [private]

Create menus for ParaViS.

Create actions for ParaViS.

Definition at line 663 of file PVGUI_Module_actions.cxx.

{
  // "Window" - "New Window" - "ParaView view" menu
  int aWindowMenu = createMenu(tr( "MEN_DESK_WINDOW" ), -1, -1);
  int aNewWindowMenu = createMenu(tr( "MEN_DESK_NEWWINDOW"), aWindowMenu, -1, -1);
  createMenu(ParaViewNewWindowId, aNewWindowMenu);
}

Here is the caller graph for this function:

void PVGUI_Module::createPreferences ( ) [virtual]

Creates PARAVIS preference pane.

Definition at line 1007 of file PVGUI_Module.cxx.

{
  // Paraview settings tab
  int aParaViewSettingsTab = addPreference( tr( "TIT_PVIEWSETTINGS" ) );
  int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, "PARAVIS", "");
  setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane()));

  // Paravis settings tab
  int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) );
  addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace");

  int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab,
                                LightApp_Preferences::Selector,
                                "PARAVIS", "savestate_type");
  QList<QVariant> aIndices;
  QStringList aStrings;
  aIndices<<0<<1<<2;
  aStrings<<tr("PREF_SAVE_TYPE_0");
  aStrings<<tr("PREF_SAVE_TYPE_1");
  aStrings<<tr("PREF_SAVE_TYPE_2");
  setPreferenceProperty(aSaveType, "strings", aStrings);
  setPreferenceProperty(aSaveType, "indexes", aIndices);
}
bool PVGUI_Module::deactivateModule ( SUIT_Study *  study) [virtual, slot]

Deactivate module.

Parameters:
studycurrent study
Returns:
true if deactivaion is done successfully or 0 to prevent deactivation on error

Definition at line 697 of file PVGUI_Module.cxx.

{
   QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId );
   if(aMenu) {
      QList<QAction*> anActns = aMenu->actions();
      for (int i = 0; i < anActns.size(); ++i) {
             QAction* a = anActns.at(i);
        if(a)
          a->setVisible(false);
      }
    }

  QList<QDockWidget*> aStreamingViews = application()->desktop()->findChildren<QDockWidget*>("pqStreamingControls");
  foreach(QDockWidget* aView, aStreamingViews) {
    if (!myDockWidgets.contains(aView))
      myDockWidgets[aView] = aView->isVisible();
  }

  /*if (pqImplementation::helpWindow) {
    pqImplementation::helpWindow->hide();
    }*/
  showView( false );
  // hide menus
  menuMgr()->hide(myRecentMenuId);
  menuMgr()->hide(mySourcesMenuId);
  menuMgr()->hide(myFiltersMenuId);
  menuMgr()->hide(myMacrosMenuId);
  menuMgr()->hide(myToolbarsMenuId);
  setMenuShown( false );
  setToolShown( false );


  saveDockWidgetsState();

  if (myOldMsgHandler)
    qInstallMsgHandler(myOldMsgHandler);

  return SalomeApp_Module::deactivateModule( study );
}

Here is the call graph for this function:

Deletes temporary files created during import operation from VISU.

Definition at line 985 of file PVGUI_Module.cxx.

{
  foreach(QString aFile, myTemporaryFiles) {
    if (QFile::exists(aFile)) {
      QFile::remove(aFile);
    }
  }
}

Here is the caller graph for this function:

void PVGUI_Module::endWaitCursor ( ) [private, slot]

Slot to switch off wait cursor.

Definition at line 617 of file PVGUI_Module.cxx.

{
  QApplication::restoreOverrideCursor();
}

Here is the caller graph for this function:

QString PVGUI_Module::engineIOR ( ) const [virtual]

Returns IOR of current engine.

Definition at line 805 of file PVGUI_Module.cxx.

{
  CORBA::String_var anIOR = PARAVIS::GetParavisGen(this)->GetIOR();
  return QString(anIOR.in());
}

Here is the call graph for this function:

void PVGUI_Module::executeScript ( const char *  script)

Definition at line 822 of file PVGUI_Module.cxx.

{
#ifndef WNT
  pqPythonManager* manager = qobject_cast<pqPythonManager*>(
                             pqApplicationCore::instance()->manager("PYTHON_MANAGER"));
  if (manager)  {
    pqPythonDialog* pyDiag = manager->pythonShellDialog();
    if (pyDiag) {
      pyDiag->runString(script);  
      }
    }
#endif
}

Here is the caller graph for this function:

Returns current active ParaView server.

Definition at line 998 of file PVGUI_Module.cxx.

{
  return pqApplicationCore::instance()->getActiveServer();
}

Here is the caller graph for this function:

QString PVGUI_Module::getHelpFileName ( ) [private]

Discover help project files from the resources.

Returns:
name of the help file.

Definition at line 1303 of file PVGUI_Module.cxx.

                                      {
  QString aPVHome(getenv("PVHOME"));
  if (aPVHome.isNull()) {
    qWarning("Wariable PVHOME is not defined");
    return QString();
  }
  QChar aSep = QDir::separator();
  //PARAVIEW_VERSION from the vtkPVConfig.h file
  QString aFileName =  aPVHome + aSep + "share" + aSep + "doc" + aSep + "paraview-"+ PARAVIEW_VERSION + aSep + "paraview.qch";
  return aFileName;
}
QMenu * PVGUI_Module::getMenu ( const int  id) [private]

Returns QMenu object for a given menu id.

Returns QMenu by its id.

Definition at line 553 of file PVGUI_Module_actions.cxx.

{
  QMenu* res = 0;
  SalomeApp_Application* anApp = getApp();
  SUIT_Desktop* desk = anApp->desktop();
  if ( desk ){
    QtxActionMenuMgr* menuMgr = desk->menuMgr();
    res = menuMgr->findMenu( id );
  }
  return res;
}

Here is the caller graph for this function:

pqTabbedMultiViewWidget * PVGUI_Module::getMultiViewManager ( ) const

Returns the ParaView multi-view manager.

Definition at line 625 of file PVGUI_Module.cxx.

{
  return qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
}

Definition at line 841 of file PVGUI_Module.cxx.

{
  QString traceString;
#ifndef WNT
  pqPythonManager* manager = qobject_cast<pqPythonManager*>(
                             pqApplicationCore::instance()->manager("PYTHON_MANAGER"));
  if (manager)  {
    pqPythonDialog* pyDiag = manager->pythonShellDialog();
    if (pyDiag) {
      pyDiag->runString("from paraview import smtrace\n"
                        "__smtraceString = smtrace.get_trace_string()\n");
      pyDiag->shell()->makeCurrent();
      PyObject* main_module = PyImport_AddModule((char*)"__main__");
      PyObject* global_dict = PyModule_GetDict(main_module);
      PyObject* string_object = PyDict_GetItemString(global_dict, "__smtraceString");
      char* string_ptr = string_object ? PyString_AsString(string_object) : 0;
      if (string_ptr)  {
        traceString = string_ptr;
      }
      pyDiag->shell()->releaseControl();
    }
  }
  if ((!traceString.isNull()) && traceString.length() != 0) {
    int aPos = traceString.indexOf(MYReplaceStr);
    while (aPos != -1) {
      traceString = traceString.replace(aPos, MYReplaceStr.length(), "pvsimple");
      aPos = traceString.indexOf(MYReplaceStr, aPos);
    }
    int aImportPos = traceString.indexOf(MYReplaceImportStr);
    if(aImportPos != -1)
      {
      traceString = traceString.replace(aImportPos, MYReplaceImportStr.length(), "except:\n  import pvsimple\n  from pvsimple import *");
      }
  }
#endif
  return traceString;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::initialize ( CAM_Application *  app) [virtual]

Initialize module.

Creates menus, prepares context menu, etc.

Parameters:
appSALOME GUI application instance

Definition at line 288 of file PVGUI_Module.cxx.

{
  SalomeApp_Module::initialize( app );

  // Create ParaViS actions
  createActions();
  // Create ParaViS menus
  createMenus();

  // Uncomment to debug ParaView initialization
  // "aa" used instead of "i" as GDB doesn't like "i" variables :)
  /*
  int aa = 1;
  while( aa ){
    aa = aa;
  }
  */
  
  // Initialize ParaView client
  pvInit();

  // Create GUI elements (menus, toolbars, dock widgets)
  //if ( !Implementation ){
    SalomeApp_Application* anApp = getApp();
    SUIT_Desktop* aDesktop = anApp->desktop();

    // connect(aDesktop, SIGNAL()

    // Remember current state of desktop toolbars
    QList<QToolBar*> foreignToolbars = aDesktop->findChildren<QToolBar*>();

    // Simulate ParaView client main window
    //Implementation = new pqImplementation( aDesktop );

    setupDockWidgets();
    
    pvCreateActions();
    pvCreateToolBars();
    pvCreateMenus();

    // new pqParaViewBehaviors(anApp->desktop(), this);
    // Has to be replaced in order to exclude using of pqQtMessageHandlerBehaviour
    //  Start pqParaViewBehaviors
    // Register ParaView interfaces.
    //pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager();
    pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker();

    // * adds support for standard paraview views.
    pgm->addInterface(new pqStandardViewModules(pgm));
    pgm->addInterface(new pqStandardSummaryPanelImplementation(pgm));

    // Load plugins distributed with application.
    pqApplicationCore::instance()->loadDistributedPlugins();

    // Define application behaviors.
    //new pqQtMessageHandlerBehavior(this);
    new pqDataTimeStepBehavior(this);
    new pqViewFrameActionsBehavior(this);
    new pqSpreadSheetVisibilityBehavior(this);
    new pqPipelineContextMenuBehavior(this);
    new pqDefaultViewBehavior(this);
    new pqAlwaysConnectedBehavior(this);
    new pqPVNewSourceBehavior(this);
    new pqDeleteBehavior(this);
    new pqUndoRedoBehavior(this);
    new pqCrashRecoveryBehavior(this);
    new pqAutoLoadPluginXMLBehavior(this);
    new pqPluginDockWidgetsBehavior(aDesktop);
    //new pqVerifyRequiredPluginBehavior(this);
    new pqPluginActionGroupBehavior(aDesktop);
    //new pqFixPathsInStateFilesBehavior(this);
    new pqCommandLineOptionsBehavior(this);
    new pqPersistentMainWindowStateBehavior(aDesktop);
    new pqObjectPickingBehavior(aDesktop);
    new pqCollaborationBehavior(this);

    // Setup quick-launch shortcuts.
    QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, aDesktop);
    QObject::connect(ctrlSpace, SIGNAL(activated()),
      pqApplicationCore::instance(), SLOT(quickLaunch()));
    QShortcut *altSpace = new QShortcut(Qt::ALT + Qt::Key_Space, aDesktop);
    QObject::connect(altSpace, SIGNAL(activated()),
      pqApplicationCore::instance(), SLOT(quickLaunch()));
    //  End pqParaViewBehaviors


    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
    QString aPath = resMgr->stringValue("resources", "PARAVIS", QString());
    if (!aPath.isNull()) {
      MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml");
      MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewReaders.xml");
      MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml");
      MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewWriters.xml");
    }
     
    // Force creation of engine
    PARAVIS::GetParavisGen(this);
    updateObjBrowser();

    // Find created toolbars
    QCoreApplication::processEvents();

    QList<QToolBar*> allToolbars = aDesktop->findChildren<QToolBar*>();
    foreach(QToolBar* aBar, allToolbars) {
      if (!foreignToolbars.contains(aBar)) {
        myToolbars[aBar] = true;
        myToolbarBreaks[aBar] = false;
        aBar->setVisible(false);
        aBar->toggleViewAction()->setVisible(false);
      }
    }
    //}

  updateMacros();
 
  // we need to start trace after connection is done
  connect(pqApplicationCore::instance()->getObjectBuilder(), SIGNAL(finishedAddingServer(pqServer*)), 
         this, SLOT(onFinishedAddingServer(pqServer*)));

  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
  bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false );
  // start timer to activate trace in a proper moment
  if(!isStop) 
    startTimer( 50 );

  this->VTKConnect = vtkEventQtSlotConnect::New();
  vtkProcessModule* pm = vtkProcessModule::GetProcessModule();

  this->VTKConnect->Connect(pm, vtkCommand::StartEvent,
    this, SLOT(onStartProgress()));
  this->VTKConnect->Connect(pm, vtkCommand::EndEvent,
    this, SLOT(onEndProgress()));
}

Here is the call graph for this function:

void PVGUI_Module::loadParaviewState ( const char *  theFileName)

Restores ParaView state from a disk file.

If toClear == true, the current ojects will be deleted

Definition at line 918 of file PVGUI_Module.cxx.

{
  pqApplicationCore::instance()->loadState(theFileName, getActiveServer());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::loadSelectedState ( bool  toClear) [private]

Load selected state.

Load selected paraview state.

If toClear == true, the current state will be cleared

Definition at line 1321 of file PVGUI_Module.cxx.

{
  QString fileName;

  LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
  SALOME_ListIO aListIO;
  aSelectionMgr->selectedObjects(aListIO);
  
  if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) {
    std::string entry = aListIO.First()->getEntry();
    
    // Get SALOMEDS client study 
    _PTR(Study) studyDS = PARAVIS::GetCStudy(this);
    if(!studyDS) {
      return;
    }

    // Check local id
    _PTR(SObject) stateSObj = studyDS->FindObjectID(entry);
    _PTR(GenericAttribute) anAttr;
    if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) {
      return;
    }
    _PTR(AttributeLocalID) anID(anAttr);
    if (!anID->Value() == PVSTATEID) {
      return;
    }

    // Get state file name
    if (stateSObj->FindAttribute(anAttr, "AttributeString")) {
      _PTR(AttributeString) aStringAttr(anAttr);
      QString stringValue(aStringAttr->Value().c_str());

      if (QFile::exists(stringValue)) {
       fileName = stringValue;
      }
    }
  }
  
  if (!fileName.isEmpty()) {
    if (toClear) {
      clearParaviewState();
    }

    loadParaviewState(fileName.toLatin1().constData());
  } 
  else {
    SUIT_MessageBox::critical(getApp()->desktop(),
                           tr("ERR_ERROR"),
                           tr("ERR_STATE_CANNOT_BE_RESTORED"));
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onAddState ( ) [private, slot]

Restore the selected state by merging with the current one.

Definition at line 1195 of file PVGUI_Module.cxx.

{
  loadSelectedState(false);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onApplicationClosed ( SUIT_Application *  theApp) [virtual, slot]

Called when application is closed.

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

Parameters:
theAppapplication

Definition at line 746 of file PVGUI_Module.cxx.

{
  pqApplicationCore::instance()->settings()->sync();
  int aAppsNb = SUIT_Session::session()->applications().size();
  if (aAppsNb == 1) {
    deleteTemporaryFiles();
    MyCoreApp->deleteLater();
  }
  CAM_Module::onApplicationClosed(theApp);
}

Here is the call graph for this function:

void PVGUI_Module::onCleanAddState ( ) [private, slot]

Clean the current state and restore the selected one.

Definition at line 1203 of file PVGUI_Module.cxx.

{
  loadSelectedState(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onDelete ( ) [private, slot]

Delete the selected objects.

Definition at line 1263 of file PVGUI_Module.cxx.

{
  LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
  SALOME_ListIO aListIO;
  aSelectionMgr->selectedObjects(aListIO);
  
  if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) {
    std::string entry = aListIO.First()->getEntry();
    
    // Get SALOMEDS client study 
    _PTR(Study) studyDS = PARAVIS::GetCStudy(this);
    if(!studyDS) {
      return;
    }
    
    // Unlock the study if it is locked
    bool isLocked = studyDS->GetProperties()->IsLocked();
    if (isLocked) {
      studyDS->GetProperties()->SetLocked(false);
    }
    
    // Remove the selected state from the study
    _PTR(StudyBuilder) studyBuilder = studyDS->NewBuilder();
    _PTR(SObject) stateSObj = studyDS->FindObjectID(entry);
    studyBuilder->RemoveObject(stateSObj);
    
    // Lock the study back if necessary
    if (isLocked) {
      studyDS->GetProperties()->SetLocked(true);
    }
    
    // Update object browser
    updateObjBrowser();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onEndProgress ( ) [private, slot]

Definition at line 427 of file PVGUI_Module.cxx.

{
  QApplication::restoreOverrideCursor();
}

Here is the caller graph for this function:

void PVGUI_Module::onFinishedAddingServer ( pqServer *  ) [private, slot]

Definition at line 432 of file PVGUI_Module.cxx.

{
  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
  bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false );
  if(!isStop) 
    startTimer( 50 );
}

Here is the caller graph for this function:

void PVGUI_Module::onImportFromVisu ( QString  theEntry) [slot]

Imports MED data from VISU module by data entry.

Definition at line 926 of file PVGUI_Module.cxx.

{
#ifdef WITH_VISU
  SUIT_OverrideCursor aWaitCursor;

  // get active study
  SalomeApp_Study* activeStudy = dynamic_cast<SalomeApp_Study*>(application()->activeStudy());
  if(!activeStudy) return;

  // get SALOMEDS client study 
  _PTR(Study) aStudy = activeStudy->studyDS();
  if(!aStudy) return;

  // find VISU component in a study
  _PTR(SComponent) aVisuComp = aStudy->FindComponent( "VISU" );
  if(!aVisuComp) return;

  // get SObject client by entry
  _PTR(SObject) aSObj = aStudy->FindObjectID(qPrintable(theEntry));
  if (!aSObj) return;

  // get CORBA SObject
  SALOMEDS_SObject* aSObject = _CAST(SObject, aSObj);
  if ( !aSObject ) return;

  // load VISU engine
  SALOME_NamingService* aNamingService = SalomeApp_Application::namingService();
  SALOME_LifeCycleCORBA aLCC(aNamingService);

  Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU");
  VISU::VISU_Gen_var aVISU = VISU::VISU_Gen::_narrow(aComponent);
  if(CORBA::is_nil(aVISU)) return;

  _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
  aStudyBuilder->LoadWith( aVisuComp, SalomeApp_Application::orb()->object_to_string(aVISU) );

  // get VISU result object
  CORBA::Object_var aResultObject = aSObject->GetObject();
  if (CORBA::is_nil(aResultObject)) return;
  VISU::Result_var aResult = VISU::Result::_narrow( aResultObject );
  if (CORBA::is_nil(aResult)) return;

  // export VISU result to the MED file
  std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
  std::string aFileName = aSObject->GetName();
  std::string aFilePath = aTmpDir + aFileName;

  if (aResult->ExportMED(aFilePath.c_str())) {
    openFile(aFilePath.c_str());
    myTemporaryFiles.append(QString(aFilePath.c_str()));
  }
#else
  MESSAGE("Visu module is not found.");
#endif
}

Here is the call graph for this function:

void PVGUI_Module::onModelOpened ( ) [protected, virtual, slot]

Called when study is opened.

Definition at line 775 of file PVGUI_Module.cxx.

{
  _PTR(Study) studyDS = PARAVIS::GetCStudy(this);
  if(!studyDS) {
    return;
  }
  
  _PTR(SComponent) paravisComp = 
    studyDS->FindComponent(PARAVIS::GetParavisGen(this)->ComponentDataType());
  if(!paravisComp) {
    return;
  }

  _PTR(ChildIterator) anIter(studyDS->NewChildIterator(paravisComp));
  for (; anIter->More(); anIter->Next()) {
    _PTR(SObject) aSObj = anIter->Value();
    _PTR(GenericAttribute) anAttr;
    if (!aSObj->FindAttribute(anAttr, "AttributeLocalID")) {
      continue;
    }
    _PTR(AttributeLocalID) anID(anAttr);
    if (anID->Value() == PVSTATEID) {
      myStateCounter++;
    }
  }
}

Here is the call graph for this function:

void PVGUI_Module::onNewParaViewWindow ( ) [private, slot]

Show ParaView view.

Definition at line 1115 of file PVGUI_Module.cxx.

{
  showView(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onPostAccept ( ) [private, slot]

Slot to show the ready state.

Definition at line 608 of file PVGUI_Module.cxx.

{
  getApp()->desktop()->statusBar()->showMessage(tr("STB_POSTACCEPT"), 2000);
  QTimer::singleShot(0, this, SLOT(endWaitCursor()));
}

Here is the call graph for this function:

void PVGUI_Module::onPreAccept ( ) [private, slot]

Slot to show the waiting state.

Definition at line 599 of file PVGUI_Module.cxx.

{
  getApp()->desktop()->statusBar()->showMessage(tr("STB_PREACCEPT"));
  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
}
void PVGUI_Module::onRename ( ) [private, slot]

Rename the selected object.

Definition at line 1211 of file PVGUI_Module.cxx.

{
  LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
  SALOME_ListIO aListIO;
  aSelectionMgr->selectedObjects(aListIO);
  
  if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) {
    std::string entry = aListIO.First()->getEntry();
    
    // Get SALOMEDS client study 
    _PTR(Study) studyDS = PARAVIS::GetCStudy(this);
    if(!studyDS) {
      return;
    }
    
    // Unlock the study if it is locked
    bool isLocked = studyDS->GetProperties()->IsLocked();
    if (isLocked) {
      studyDS->GetProperties()->SetLocked(false);
    }
    
    // Rename the selected state object
    _PTR(SObject) stateSObj = studyDS->FindObjectID(entry);
    if (!stateSObj) {
      return;
    }
    
    _PTR(GenericAttribute) anAttr;
    if (stateSObj->FindAttribute(anAttr, "AttributeName")) {
      _PTR(AttributeName) nameAttr (anAttr);
      QString newName = 
       LightApp_NameDlg::getName(getApp()->desktop(), nameAttr->Value().c_str());
      if (!newName.isEmpty()) {
       nameAttr->SetValue(newName.toLatin1().constData());
       aListIO.First()->setName(newName.toLatin1().constData());
      }
    }
    
    // Lock the study back if necessary
    if (isLocked) {
      studyDS->GetProperties()->SetLocked(true);
    }
    
    // Update object browser
    updateObjBrowser();
    
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onSaveMultiState ( ) [private, slot]

Save state under the module root object.

Definition at line 1123 of file PVGUI_Module.cxx.

{
  // Create state study object
  
  // Get SALOMEDS client study
  _PTR(Study) studyDS = PARAVIS::GetCStudy(this);
  if(!studyDS) {
    return;
  }
  
  _PTR(SComponent) paravisComp = 
    studyDS->FindComponent(PARAVIS::GetParavisGen(this)->ComponentDataType());
  if(!paravisComp) {
    return;
  }

  // Unlock the study if it is locked
  bool isLocked = studyDS->GetProperties()->IsLocked();
  if (isLocked) {
    studyDS->GetProperties()->SetLocked(false);
  }
  
  QString stateName = tr("SAVED_PARAVIEW_STATE_NAME") + 
    QString::number(myStateCounter + 1);

  _PTR(StudyBuilder) studyBuilder = studyDS->NewBuilder();
  _PTR(SObject) newSObj = studyBuilder->NewObject(paravisComp);

  // Set name
  _PTR(GenericAttribute) anAttr;
  anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeName");
  _PTR(AttributeName) nameAttr(anAttr);
  
  nameAttr->SetValue(stateName.toLatin1().constData());

  // Set local id
  anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeLocalID");
  _PTR(AttributeLocalID) localIdAttr(anAttr);
  
  localIdAttr->SetValue(PVSTATEID);

  // Set file name
  QString stateEntry = QString::fromStdString(newSObj->GetID());
 
  // File name for state saving
  QString tmpDir = QString::fromStdString(SALOMEDS_Tool::GetTmpDir());
  QString fileName = QString("%1_paravisstate:%2").arg(tmpDir, 
                                                 stateEntry);

  anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeString");
  _PTR(AttributeString) stringAttr(anAttr);
  
  stringAttr->SetValue(fileName.toLatin1().constData());

  // Lock the study back if necessary
  if (isLocked) {
    studyDS->GetProperties()->SetLocked(true);
  }
  
  // Save state
  saveParaviewState(fileName.toLatin1().constData());
  myTemporaryFiles.append(fileName);
  
  // Increment the counter
  myStateCounter++;

  updateObjBrowser();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onShowTrace ( ) [private, slot]

Definition at line 1101 of file PVGUI_Module.cxx.

{
  if (!myTraceWindow) {
    myTraceWindow = new pqPythonScriptEditor(getApp()->desktop());
  }
  myTraceWindow->setText(getTraceString());
  myTraceWindow->show();
  myTraceWindow->raise();
  myTraceWindow->activateWindow();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::onStartProgress ( ) [private, slot]

Definition at line 422 of file PVGUI_Module.cxx.

{
  QApplication::setOverrideCursor(Qt::WaitCursor);
}

Here is the caller graph for this function:

void PVGUI_Module::openFile ( const char *  theName)

Open file of format supported by ParaView.

Definition at line 815 of file PVGUI_Module.cxx.

{
  QStringList aFiles;
  aFiles<<theName;
  pqLoadDataReaction::loadData(aFiles);
}

Here is the caller graph for this function:

void PVGUI_Module::pvCreateActions ( ) [private]

Create actions for ParaView GUI operations.

Create actions for ParaView GUI operations duplicating menus and toolbars in MainWindow class of the standard ParaView GUI client application.

Definition at line 92 of file PVGUI_Module_actions.cxx.

{
  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();

  QPixmap aPixmap;
  QAction* anAction;
  //QtxAction* aQtxAction;
  
  // --- Menu "File"

  // Open File
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_OPEN_FILE"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_OPEN_FILE"), this);
  anAction->setToolTip(tr("TOP_OPEN_FILE"));
  anAction->setStatusTip(tr("STB_OPEN_FILE"));
  registerAction(OpenFileId, anAction);
  new pqLoadDataReaction(anAction);
  
  // Load State
  anAction = new QAction(tr("MEN_LOAD_STATE"), this);
  anAction->setToolTip(tr("TOP_LOAD_STATE"));
  anAction->setStatusTip(tr("STB_LOAD_STATE"));
  registerAction(LoadStateId, anAction);
  new pqLoadStateReaction(anAction);
  
  // Save State
  anAction = new QAction(tr("MEN_SAVE_STATE"), this);
  anAction->setToolTip(tr("TOP_SAVE_STATE"));
  anAction->setStatusTip(tr("STB_SAVE_STATE"));
  registerAction(SaveStateId, anAction);
  new pqSaveStateReaction(anAction);

  // Save Data
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_DATA"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_DATA"), this);
  anAction->setToolTip(tr("TOP_SAVE_DATA"));
  anAction->setStatusTip(tr("STB_SAVE_DATA"));
  registerAction(SaveDataId, anAction);
  new pqSaveDataReaction(anAction);

  // Save Screenshot
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_SCREENSHOT"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_SCREENSHOT"), this);
  anAction->setToolTip(tr("TOP_SAVE_SCREENSHOT"));
  anAction->setStatusTip(tr("STB_SAVE_SCREENSHOT"));
  registerAction(SaveScreenshotId, anAction);
  new pqSaveScreenshotReaction(anAction);

  // Export
  anAction = new QAction(tr("MEN_EXPORT"), this);
  anAction->setToolTip(tr("TOP_EXPORT"));
  anAction->setStatusTip(tr("STB_EXPORT"));
  registerAction(ExportId, anAction);
  new pqExportReaction(anAction);

  // Save Animation
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_ANIMATION"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_ANIMATION"), this);
  anAction->setToolTip(tr("TOP_SAVE_ANIMATION"));
  anAction->setStatusTip(tr("STB_SAVE_ANIMATION"));
  registerAction(SaveAnimationId, anAction);
  new pqSaveAnimationReaction(anAction);

  // Save Geometry
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_SAVE_GEOMETRY"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_SAVE_GEOMETRY"), this);
  anAction->setToolTip(tr("TOP_SAVE_GEOMETRY"));
  anAction->setStatusTip(tr("STB_SAVE_GEOMETRY"));
  registerAction(SaveGeometryId, anAction);
  new pqSaveAnimationGeometryReaction(anAction);

  // Connect
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CONNECT"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_CONNECT"), this);
  anAction->setToolTip(tr("TOP_CONNECT"));
  anAction->setStatusTip(tr("STB_CONNECT"));
  registerAction(ConnectId, anAction);
  new pqServerConnectReaction(anAction);

  // Disconnect
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_DISCONNECT"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_DISCONNECT"), this);
  anAction->setToolTip(tr("TOP_DISCONNECT"));
  anAction->setStatusTip(tr("STB_DISCONNECT"));
  registerAction(DisconnectId, anAction);
  new pqServerDisconnectReaction(anAction);

  // --- Menu "Edit"

  // Undo
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_UNDO"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_UNDO"), this);
  anAction->setToolTip(tr("TOP_UNDO"));
  anAction->setStatusTip(tr("STB_UNDO"));
  registerAction(UndoId, anAction);
  new pqUndoRedoReaction(anAction, true);

  // Redo
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_REDO"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_REDO"), this);
  anAction->setToolTip(tr("TOP_REDO"));
  anAction->setStatusTip(tr("STB_REDO"));
  registerAction(RedoId, anAction);
  new pqUndoRedoReaction(anAction, false);

  // Camera Undo
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_UNDO"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_UNDO"), this);
  anAction->setToolTip(tr("TOP_CAMERA_UNDO"));
  anAction->setStatusTip(tr("STB_CAMERA_UNDO"));
  registerAction(CameraUndoId, anAction);
  new pqCameraUndoRedoReaction(anAction, true);
  
  // Camera Redo
  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_REDO"), false );
  anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_REDO"), this);
  anAction->setToolTip(tr("TOP_CAMERA_REDO"));
  anAction->setStatusTip(tr("STB_CAMERA_REDO"));
  registerAction(CameraRedoId, anAction);
  new pqCameraUndoRedoReaction(anAction, false);

  // Find Data
  anAction = new QAction(tr("MEN_FIND_DATA"), this);
  anAction->setToolTip("");
  anAction->setStatusTip("");
  registerAction(FindDataId, anAction);
  new pqDataQueryReaction(anAction);
  
  // Change Input
  anAction = new QAction(tr("MEN_CHANGE_INPUT"), this);
  anAction->setToolTip(tr("TOP_CHANGE_INPUT"));
  anAction->setStatusTip(tr("STB_CHANGE_INPUT"));
  registerAction(ChangeInputId, anAction);
  new pqChangePipelineInputReaction(anAction);

  // Ignore source time
  anAction = new QAction(tr("MEN_IGNORE_TIME"), this);
  anAction->setToolTip(tr("TOP_IGNORE_TIME"));
  anAction->setStatusTip(tr("STB_IGNORE_TIME"));
  anAction->setCheckable(true);
  registerAction(IgnoreTimeId, anAction);
  new pqIgnoreSourceTimeReaction(anAction);

  // Delete
  anAction = new QAction(tr("MEN_DELETE"), this);
  anAction->setToolTip(tr("TOP_DELETE"));
  anAction->setStatusTip(tr("STB_DELETE"));
  registerAction(DeleteId, anAction);
  new pqDeleteReaction(anAction);

  // Delete All
  anAction = new QAction(tr("MEN_DELETE_ALL"), this);
  anAction->setToolTip(tr("TOP_DELETE_ALL"));
  anAction->setStatusTip(tr("STB_DELETE_ALL"));
  registerAction(DeleteAllId, anAction);
  new pqDeleteReaction(anAction, true);


  // Setting
  /*anAction = new QAction(tr("MEN_SETTINGS"), this);
  anAction->setToolTip(tr("TOP_SETTINGS"));
  anAction->setStatusTip(tr("STB_SETTINGS"));
  registerAction(SettingsId, anAction);
  new pqApplicationSettingsReaction(anAction);*/
  
  // View Settings
  anAction = new QAction(tr("MEN_VIEW_SETTINGS"), this);
  anAction->setToolTip(tr("TOP_VIEW_SETTINGS"));
  anAction->setStatusTip(tr("STB_VIEW_SETTINGS"));
  registerAction(ViewSettingsId, anAction);
  new pqViewSettingsReaction(anAction);

  // --- Menu "View"
  //pqViewManager* viewManager = qobject_cast<pqViewManager*>(
  //                             pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));

  //rnv: Commented to implement issue 
  //21318: EDF 1615 ALL: Display in full screen mode
  //Switching to the "Full screen" mode added in the SALOME GUI module.
  //if (viewManager) {
  //anAction = new QAction("Full Screen", this);
  //anAction->setObjectName("actionFullScreen");
  //anAction->setShortcut(QKeySequence("F11"));
  //connect(anAction, SIGNAL(triggered()), viewManager, SLOT(toggleFullScreen()));
  //registerAction(FullScreenId, anAction);
  //}

  // --- Menu "Tools"
  // Create Custom Filter
  anAction = new QAction(tr("MEN_CREATE_CUSTOM_FILTER"), this);
  anAction->setToolTip(tr("TOP_CREATE_CUSTOM_FILTER"));
  anAction->setStatusTip(tr("STB_CREATE_CUSTOM_FILTER"));
  registerAction(CreateCustomFilterId, anAction);
  new pqCreateCustomFilterReaction(anAction << pqSetName("actionToolsCreateCustomFilter"));

  // Manage Custom Filters
  anAction = new QAction(tr("MEN_MANAGE_CUSTOM_FILTERS"), this);
  anAction->setToolTip(tr("TOP_MANAGE_CUSTOM_FILTERS"));
  anAction->setStatusTip(tr("STB_MANAGE_CUSTOM_FILTERS"));
  registerAction(ManageCustomFiltersId, anAction);
  new pqManageCustomFiltersReaction(anAction << pqSetName("actionToolsManageCustomFilters"));

  // Manage Links
  anAction = new QAction(tr("MEN_MANAGE_LINKS"), this);
  anAction->setToolTip(tr("TOP_MANAGE_LINKS"));
  anAction->setStatusTip(tr("STB_MANAGE_LINKS"));
  registerAction(ManageLinksId, anAction);
  new pqManageLinksReaction(anAction << pqSetName("actionToolsManageLinks"));

  // Add Camera Link
  anAction = new QAction(tr("MEN_ADD_CAMERA_LINK"), this);
  anAction->setToolTip(tr("TOP_ADD_CAMERA_LINK"));
  anAction->setStatusTip(tr("STB_ADD_CAMERA_LINK"));
  registerAction(AddCameraLinkId, anAction);
  new pqCameraLinkReaction(anAction << pqSetName("actionToolsAddCameraLink"));

  // Manage Plugins/Extensions
  anAction = new QAction(tr("MEN_MANAGE_PLUGINS"), this);
  anAction->setToolTip(tr("TOP_MANAGE_PLUGINS"));
  anAction->setStatusTip(tr("STB_MANAGE_PLUGINS"));
  registerAction(ManagePluginsExtensionsId, anAction);
  new pqManagePluginsReaction(anAction << pqSetName("actionManage_Plugins"));

  // Record Test
  anAction = new QAction(tr("MEN_RECORD_TEST"), this);
  anAction->setToolTip(tr("TOP_RECORD_TEST"));
  anAction->setStatusTip(tr("STB_RECORD_TEST"));
  registerAction(RecordTestId, anAction);
  new pqTestingReaction(anAction << pqSetName("actionToolsRecordTest"), pqTestingReaction::RECORD);

  // Play Test
  anAction = new QAction(tr("MEN_PLAY_TEST"), this);
  anAction->setToolTip(tr("TOP_PLAY_TEST"));
  anAction->setStatusTip(tr("STB_PLAY_TEST"));
  registerAction(PlayTestId, anAction);
  new pqTestingReaction(anAction << pqSetName("actionToolsPlayTest"), pqTestingReaction::PLAYBACK);

  // Max Window Size
  anAction = new QAction(tr("MEN_MAX_WINDOW_SIZE"), this);
  anAction->setToolTip(tr("TOP_MAX_WINDOW_SIZE"));
  anAction->setStatusTip(tr("PRP_APP_MAX_WINDOW_SIZE"));
  anAction->setCheckable(true);
  registerAction(MaxWindowSizeId, anAction);
  new pqTestingReaction(anAction << pqSetName("actionTesting_Window_Size"),
                        pqTestingReaction::LOCK_VIEW_SIZE);

  // Custom Window Size
  anAction = new QAction(tr("MEN_CUSTOM_WINDOW_SIZE"), this);
  anAction->setToolTip(tr(""));
  anAction->setStatusTip(tr(""));
  anAction->setCheckable(true);
  registerAction(CustomWindowSizeId, anAction);
  new pqTestingReaction(anAction << pqSetName("actionTesting_Window_Size_Custom"),
                        pqTestingReaction::LOCK_VIEW_SIZE_CUSTOM);

  // Timer Log
  anAction = new QAction(tr("MEN_TIMER_LOG"), this);
  anAction->setToolTip(tr("TOP_TIMER_LOG"));
  anAction->setStatusTip(tr("STB_TIMER_LOG"));
  registerAction(TimerLogId, anAction);
  new pqTimerLogReaction(anAction << pqSetName("actionToolsTimerLog"));

  // Output Window
  anAction = new QAction(tr("MEN_OUTPUT_WINDOW"), this);
  anAction->setToolTip(tr("TOP_OUTPUT_WINDOW"));
  anAction->setStatusTip(tr("STB_OUTPUT_WINDOW"));
  registerAction(OutputWindowId, anAction);
  anAction << pqSetName("actionToolsOutputWindow");
  connect(anAction, SIGNAL(triggered()), pqApplicationCore::instance(), SLOT(showOutputWindow()));
  
 // Python Shell
  anAction = new QAction(tr("MEN_PYTHON_SHELL"), this);
  anAction->setToolTip(tr("TOP_PYTHON_SHELL"));
  anAction->setStatusTip(tr("STB_PYTHON_SHELL"));
  registerAction(PythonShellId, anAction);
  new pqPythonShellReaction(anAction << pqSetName("actionToolsPythonShell"));

  //Show Trace
  anAction = new QAction(tr("MEN_SHOW_TRACE"), this);
  anAction->setToolTip(tr("TOP_SHOW_TRACE"));
  anAction->setStatusTip(tr("STB_SHOW_TRACE"));
  connect(anAction, SIGNAL(triggered()), this, SLOT(onShowTrace()));
  registerAction(ShowTraceId, anAction);

  // --- Menu "Help"

  // About
  anAction = new QAction(tr("MEN_ABOUT"), this);
  anAction->setToolTip(tr("TOP_ABOUT"));
  anAction->setStatusTip(tr("STB_ABOUT"));
  registerAction(AboutParaViewId, anAction);
  new pqAboutDialogReaction(anAction << pqSetName("actionAbout"));

  // Native ParaView user documentation
  anAction = new QAction(tr("MEN_ABOUT"), this);
  registerAction(ParaViewHelpId, anAction);
  new pqHelpReaction(anAction);
  
  /*QString aFile = getHelpFileName();
  if (QFile::exists(aFile)) {
    aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PARAVIEW_HELP"), false );
    anAction = new QAction(QIcon(aPixmap), tr("MEN_PARAVIEW_HELP"), this);
    anAction->setToolTip(tr("TOP_PARAVIEW_HELP"));
    anAction->setStatusTip(tr("STB_PARAVIEW_HELP"));
    anAction->setShortcut(QKeySequence::HelpContents);
    connect(anAction, SIGNAL(triggered()), this, SLOT(showParaViewHelp()));
    registerAction(ParaViewHelpId, anAction);
    }*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::pvCreateMenus ( ) [private]

Create menus for ParaView GUI operations duplicating menus in pqMainWindow ParaView class.

In particular, ParaView is responsible for updating "Sources" and "Filters" menus. For this, specific menu managers created by pqMainWindowCore class are used, and PVGUI_Module is responsible for creation of corresponding QMenu objects only.

Definition at line 410 of file PVGUI_Module_actions.cxx.

{
  SUIT_Desktop* desk = application()->desktop();
  
  // --- Menu "File"
  int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );

  createMenu( OpenFileId, aPVMnu, 5 );

  // Recent Files
   myRecentMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
   QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId );
   pqRecentFilesMenu* aRecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
   QList<QAction*> anActns = aMenu->actions();
   for (int i = 0; i < anActns.size(); ++i) {
       createMenu( anActns.at(i), myRecentMenuId );
   }


  createMenu( separator(), aPVMnu, -1, 5 );

  createMenu( LoadStateId, aPVMnu, 15 );
  createMenu( SaveStateId, aPVMnu, 15 );
  createMenu( separator(), aPVMnu, -1, 15 );

  createMenu( SaveDataId, aPVMnu, 25 );
  createMenu( SaveScreenshotId, aPVMnu, 25 );
  createMenu( ExportId, aPVMnu, 25 );
  createMenu( separator(), aPVMnu, -1, 25 );

  createMenu( SaveAnimationId, aPVMnu, 35 );
  createMenu( SaveGeometryId, aPVMnu, 35 );
  createMenu( separator(), aPVMnu, -1, 35 );

  createMenu( ConnectId, aPVMnu, 45 );
  createMenu( DisconnectId, aPVMnu, 45 );
  createMenu( separator(), aPVMnu, -1, 45 );

  // --- Menu "Edit"
  aPVMnu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1 );

  createMenu( UndoId, aPVMnu );
  createMenu( RedoId, aPVMnu );
  createMenu( separator(), aPVMnu );

  createMenu( CameraUndoId, aPVMnu );
  createMenu( CameraRedoId, aPVMnu );
  createMenu( separator(), aPVMnu );

  createMenu( FindDataId, aPVMnu );
  createMenu( ChangeInputId, aPVMnu );
  createMenu( IgnoreTimeId, aPVMnu );
  createMenu( DeleteId, aPVMnu );
  createMenu( DeleteAllId, aPVMnu );
  createMenu( separator(), aPVMnu );

  //createMenu( SettingsId, aPVMnu );
  createMenu( ViewSettingsId, aPVMnu );
  createMenu( separator(), aPVMnu );

  // --- Menu "View"
  aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 );
  /*myToolbarsMenuId = createMenu( "Toolbars", aPVMnu );
  aMenu = getMenu( myToolbarsMenuId );
  if (aMenu) {
    buildToolbarsMenu();
    connect(aMenu, SIGNAL(aboutToShow()), this, SLOT(buildToolbarsMenu()));
  }
  createMenu( separator(), aPVMnu );*/

  createMenu( FullScreenId, aPVMnu );
  
  // --- Menu "Sources"

  // Install ParaView managers for "Sources" menu
  QMenu* aRes = 0;
  mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60);
  if ( (aRes = getMenu( mySourcesMenuId )) ) {
    pqParaViewMenuBuilders::buildSourcesMenu(*aRes, desk);
  }
  
  // --- Menu "Filters"

  // Install ParaView managers for "Filters" menu
  myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
  if ( (aRes = getMenu( myFiltersMenuId )) ) {
    pqParaViewMenuBuilders::buildFiltersMenu(*aRes, desk);
  }

   // --- Menu "Macros"
  myMacrosMenuId = createMenu( tr( "MEN_MACROS" ), -1, -1, 80 );
  if ( (aRes = getMenu( myMacrosMenuId )) ) {
    pqParaViewMenuBuilders::buildMacrosMenu(*aRes);
  }
 
  // --- Menu "Tools"

  int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );

  createMenu( CreateCustomFilterId, aToolsMnu );
  createMenu( AddCameraLinkId, aToolsMnu );
  createMenu( separator(), aToolsMnu );
  createMenu( ManageCustomFiltersId, aToolsMnu );
  createMenu( ManageLinksId, aToolsMnu );
  createMenu( ManagePluginsExtensionsId, aToolsMnu );
  createMenu( separator(), aToolsMnu );

  createMenu( RecordTestId, aToolsMnu );
  createMenu( PlayTestId, aToolsMnu );
  createMenu( MaxWindowSizeId, aToolsMnu );
  createMenu( CustomWindowSizeId, aToolsMnu );
  createMenu( separator(), aToolsMnu );

  createMenu( TimerLogId, aToolsMnu );
  createMenu( OutputWindowId, aToolsMnu );
  createMenu( separator(), aToolsMnu );

  createMenu( PythonShellId, aToolsMnu );
  createMenu( separator(), aToolsMnu );
  createMenu( ShowTraceId, aToolsMnu );

  // --- Menu "Help"

  int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
  createMenu( AboutParaViewId, aHelpMnu );

  int aHelpModule = createMenu( LightApp_Application::tr( "MEN_DESK_MODULE_HELP" ), aHelpMnu, -1 );
  createMenu( ParaViewHelpId, aHelpModule );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::pvCreateToolBars ( ) [private]

Create toolbars for ParaView GUI operations duplicating toolbars in pqMainWindow ParaView class.

Definition at line 544 of file PVGUI_Module_actions.cxx.

{
  SUIT_Desktop* desk = application()->desktop();
  pqParaViewMenuBuilders::buildToolbars(*desk);
}

Here is the caller graph for this function:

bool PVGUI_Module::pvInit ( ) [static, private]

Initialize ParaView if not yet done (once per session)

Static method, performs initialization of ParaView session.

Returns:
true if ParaView has been initialized successfully, otherwise false

Definition at line 503 of file PVGUI_Module.cxx.

{
  //  if ( !pqImplementation::Core ){
  if ( ! MyCoreApp) {
    // Obtain command-line arguments
    int argc = 0;
    char** argv = 0;
    QString aOptions = getenv("PARAVIS_OPTIONS");
    QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts);
    argv = new char*[aOptList.size() + 1];
    QStringList args = QApplication::arguments();
    argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis");
    argc++;

    foreach (QString aStr, aOptList) {
      argv[argc] = strdup( aStr.toLatin1().constData() );
      argc++;
    }
    MyCoreApp = new pqPVApplicationCore (argc, argv);
    if (MyCoreApp->getOptions()->GetHelpSelected() ||
        MyCoreApp->getOptions()->GetUnknownArgument() ||
        MyCoreApp->getOptions()->GetErrorMessage() ||
        MyCoreApp->getOptions()->GetTellVersion()) {
      return false;
      }

    // Not sure why this is needed. Andy added this ages ago with comment saying
    // needed for Mac apps. Need to check that it's indeed still required.
    QDir dir(QApplication::applicationDirPath());
    dir.cdUp();
    dir.cd("Plugins");
    QApplication::addLibraryPath(dir.absolutePath());
    // Load required application plugins.
    QString plugin_string = "";
    QStringList plugin_list = plugin_string.split(';',QString::SkipEmptyParts);
    pqBrandPluginsLoader loader;
    if (loader.loadPlugins(plugin_list) == false) {
      printf("Failed to load required plugins for this application\n");
      return false;
    }

    // Load optional plugins.
    plugin_string = "";
    plugin_list = plugin_string.split(';',QString::SkipEmptyParts);
    loader.loadPlugins(plugin_list, true); //quietly skip not-found plugins.

    // End of Initializer code

    vtkOutputWindow::SetInstance(PVGUI_OutputWindowAdapter::New());
    
    new pqTabbedMultiViewWidget(); // it registers as "MULTIVIEW_WIDGET on creation
    
    for (int i = 0; i < argc; i++)
      free(argv[i]);
    delete[] argv;
  }
  
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Restore states of dockable ParaView widgets.

Definition at line 294 of file PVGUI_Module_widgets.cxx.

{
  SUIT_Desktop* desk = application()->desktop();

  // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture
  // ... the following code is commented...
  //for (int i = 0; i < myDockWidgets.size(); ++i)
  //  myDockWidgets.at(i)->setParent(desk);
  //
  // Restore the state of the window ...
  //pqApplicationCore::instance()->settings()->restoreState("MainWindow", *desk);
  // ... and replaced - manually hide dock windows

  // restore dock widgets visibility state
  QMapIterator<QWidget*, bool> it1( myDockWidgets );
  while( it1.hasNext() ) {
    it1.next();
    QDockWidget* dw = qobject_cast<QDockWidget*>( it1.key() );
    dw->setVisible( it1.value() );
    dw->toggleViewAction()->setVisible( true );
  }
  // restore toolbar breaks state
  QMapIterator<QWidget*, bool> it2( myToolbarBreaks );
  while( it2.hasNext() ) {
    it2.next();
    QToolBar* tb = qobject_cast<QToolBar*>( it2.key() );
    if ( myToolbarBreaks[tb] )
      desk->insertToolBarBreak( tb );
  }
  // restore toolbar visibility state
  QMapIterator<QWidget*, bool> it3( myToolbars );
  while( it3.hasNext() ) {
    it3.next();
    QToolBar* tb = qobject_cast<QToolBar*>( it3.key() );
    tb->setVisible( it3.value() );
    tb->toggleViewAction()->setVisible( true );
  }
}

Here is the caller graph for this function:

Save states of dockable ParaView widgets.

Definition at line 249 of file PVGUI_Module_widgets.cxx.

{
  SUIT_Desktop* desk = application()->desktop();

  // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture
  // ... the following code is commented...
  // Save the state of the window ...
  // pqApplicationCore::instance()->settings()->saveState(*desk, "MainWindow");
  //
  //for (int i = 0; i < myDockWidgets.size(); ++i)
  //  myDockWidgets.at(i)->setParent(0);
  // ... and replaced - manually hide dock windows

  // store dock widgets visibility state and hide'em all
  QMapIterator<QWidget*, bool> it1( myDockWidgets );
  while( it1.hasNext() ) {
    it1.next();
    QDockWidget* dw = qobject_cast<QDockWidget*>( it1.key() );
    myDockWidgets[dw] = dw->isVisible();
    dw->setVisible( false );
    dw->toggleViewAction()->setVisible( false );
  }
  // store toolbar breaks state and remove all tollbar breaks 
  QMapIterator<QWidget*, bool> it2( myToolbarBreaks );
  while( it2.hasNext() ) {
    it2.next();
    QToolBar* tb = qobject_cast<QToolBar*>( it2.key() );
    myToolbarBreaks[tb] = desk->toolBarBreak( tb );
    if ( myToolbarBreaks[tb] )
      desk->removeToolBarBreak( tb );
  }
  // store toolbars visibility state and hide'em all
  QMapIterator<QWidget*, bool> it3( myToolbars );
  while( it3.hasNext() ) {
    it3.next();
    QToolBar* tb = qobject_cast<QToolBar*>( it3.key() );
    myToolbars[tb] = tb->isVisible();
    tb->setVisible( false );
    tb->toggleViewAction()->setVisible( false );
  }
}

Here is the caller graph for this function:

void PVGUI_Module::saveParaviewState ( const char *  theFileName)

Saves ParaView state to a disk file.

Definition at line 897 of file PVGUI_Module.cxx.

{
  pqApplicationCore::instance()->saveState(theFileName);
}

Here is the caller graph for this function:

void PVGUI_Module::saveTrace ( const char *  theName)

Saves trace string to disk file.

Definition at line 882 of file PVGUI_Module.cxx.

{
  QFile file(theName);
  if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
    MESSAGE( "Could not open file:" << theName );
    return;
  }
  QTextStream out(&file);
  out << getTraceString();
  file.close();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::setupDockWidgets ( ) [private]

Create dock widgets for ParaView widgets.

Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc.

ParaView pqMainWIndowCore class is fully responsible for these dock widgets' contents.

Definition at line 80 of file PVGUI_Module_widgets.cxx.

{
  SUIT_Desktop* desk = application()->desktop();
 
  desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
  desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

  // Pipeline
  QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "TTL_PIPELINE_BROWSER" ), desk );
  pipelineBrowserDock->setObjectName("pipelineBrowserDock");
  pipelineBrowserDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
  desk->addDockWidget( Qt::LeftDockWidgetArea, pipelineBrowserDock );
  pqPipelineBrowserWidget* browser = new pqPipelineBrowserWidget(pipelineBrowserDock);
  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu(*browser);
  pipelineBrowserDock->setWidget(browser);
  myDockWidgets[pipelineBrowserDock] = true;


  

  //Object inspector
  QDockWidget* objectInspectorDock = new QDockWidget( tr( "TTL_OBJECT_INSPECTOR" ), desk );
  objectInspectorDock->setObjectName("objectInspectorDock");
  objectInspectorDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
  desk->addDockWidget( Qt::LeftDockWidgetArea, objectInspectorDock );

  pqObjectInspectorWidget* objectInspectorWidget = new pqObjectInspectorWidget(objectInspectorDock);
  objectInspectorDock->setObjectName("objectInspectorWidget");
  objectInspectorWidget->setShowOnAccept(true);
  objectInspectorDock->setWidget(objectInspectorWidget);
  connect( objectInspectorWidget, SIGNAL( helpRequested(const QString&, const QString&) ),  this, SLOT( showHelpForProxy(const QString&, const QString&) ) );
  myDockWidgets[objectInspectorDock] = true;

  //Display Dock
  QDockWidget* displayDock = new QDockWidget( tr( "TTL_DISPLAY" ), desk );
  displayDock->setObjectName("displayDock");
  QWidget* displayWidgetFrame = new QWidget(displayDock);
  displayWidgetFrame->setObjectName("displayWidgetFrame");
  displayDock->setWidget(displayWidgetFrame);

  QScrollArea* displayScrollArea = new QScrollArea(displayWidgetFrame);
  displayScrollArea->setObjectName("displayScrollArea");
  displayScrollArea->setWidgetResizable(true);

  QVBoxLayout* verticalLayout = new QVBoxLayout(displayWidgetFrame);
  verticalLayout->setSpacing(0);
  verticalLayout->setContentsMargins(0, 0, 0, 0);

  pqDisplayProxyEditorWidget* displayWidget = new pqDisplayProxyEditorWidget(displayDock);
  displayWidget->setObjectName("displayWidget");
  displayScrollArea->setWidget(displayWidget);
  verticalLayout->addWidget(displayScrollArea);

  myDockWidgets[displayDock] = true;

  // information dock
  QDockWidget* informationDock = new QDockWidget(tr( "TTL_INFORMATION" ), desk);
  informationDock->setObjectName("informationDock");

  QWidget* informationWidgetFrame = new QWidget(informationDock);
  informationWidgetFrame->setObjectName("informationWidgetFrame");
  
  QVBoxLayout* verticalLayout_2 = new QVBoxLayout(informationWidgetFrame);
  verticalLayout_2->setSpacing(0);
  verticalLayout_2->setContentsMargins(0, 0, 0, 0);

  QScrollArea* informationScrollArea = new QScrollArea(informationWidgetFrame);
  informationScrollArea->setObjectName("informationScrollArea") ;
  informationScrollArea->setWidgetResizable(true);

  pqProxyInformationWidget* informationWidget = new pqProxyInformationWidget();
  informationWidget->setObjectName("informationWidget");
  informationWidget->setGeometry(QRect(0, 0, 77, 214));
  informationScrollArea->setWidget(informationWidget);

  verticalLayout_2->addWidget(informationScrollArea);
  informationDock->setWidget(informationWidgetFrame);

  myDockWidgets[informationDock] = true;

  desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
  desk->tabifyDockWidget(objectInspectorDock, displayDock);
  desk->tabifyDockWidget(objectInspectorDock, informationDock);
  objectInspectorDock->raise();

  // Statistic View
  QDockWidget* statisticsViewDock  = new QDockWidget( tr( "TTL_STATISTICS_VIEW" ), desk );
  statisticsViewDock->setObjectName("statisticsViewDock");
  statisticsViewDock->setAllowedAreas(Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|
                                      Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
  desk->addDockWidget( Qt::BottomDockWidgetArea, statisticsViewDock );
  pqDataInformationWidget* aStatWidget = new pqDataInformationWidget(statisticsViewDock);
  statisticsViewDock->setWidget(aStatWidget);
  myDockWidgets[statisticsViewDock] = false; // hidden by default

  //Animation view
  QDockWidget* animationViewDock     = new QDockWidget( tr( "TTL_ANIMATION_VIEW" ), desk );
  animationViewDock->setObjectName("animationViewDock");
  desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock );
  pqPVAnimationWidget* animation_panel = new pqPVAnimationWidget(animationViewDock);
  animationViewDock->setWidget(animation_panel);
  myDockWidgets[animationViewDock] = false; // hidden by default

  desk->tabifyDockWidget(animationViewDock,  statisticsViewDock);

  // Selection view
  QDockWidget* selectionInspectorDock = new QDockWidget( tr( "TTL_SELECTION_INSPECTOR" ), desk );
  selectionInspectorDock->setObjectName("selectionInspectorDock");
  selectionInspectorDock->setAllowedAreas( Qt::AllDockWidgetAreas );
  desk->addDockWidget( Qt::LeftDockWidgetArea, selectionInspectorDock );
  pqSelectionInspectorPanel* aSelInspector = new pqSelectionInspectorWidget(selectionInspectorDock);
  selectionInspectorDock->setWidget(aSelInspector);
  myDockWidgets[selectionInspectorDock] = false; // hidden by default

  // Comparative View
  QDockWidget* comparativePanelDock  = new QDockWidget( tr( "TTL_COMPARATIVE_VIEW_INSPECTOR" ), desk );
  comparativePanelDock->setObjectName("comparativePanelDock");
  desk->addDockWidget( Qt::LeftDockWidgetArea, comparativePanelDock );
  pqComparativeVisPanel* cv_panel = new pqComparativeVisPanel( comparativePanelDock );
  comparativePanelDock->setWidget(cv_panel);
  myDockWidgets[comparativePanelDock] = false; // hidden by default

  // Collaboration view
  QDockWidget* collaborationPanelDock = new QDockWidget(tr( "TTL_COLLABORATIVE_DOCK" ), desk);
  collaborationPanelDock->setObjectName("collaborationPanelDock");
  pqCollaborationPanel* collaborationPanel = new pqCollaborationPanel();
  collaborationPanel->setObjectName("collaborationPanel");
  collaborationPanelDock->setWidget(collaborationPanel);
  desk->addDockWidget(Qt::RightDockWidgetArea, collaborationPanelDock);
  myDockWidgets[collaborationPanelDock] = false; // hidden by default
  
  // Memory inspector dock
  QDockWidget* memoryInspectorDock = new QDockWidget(tr( "TTL_MEMORY_INSPECTOR" ), desk);
  memoryInspectorDock->setObjectName("memoryInspectorDock");
  pqMemoryInspector* dockWidgetContents = new pqMemoryInspector();
  dockWidgetContents->setObjectName("dockWidgetContents");
  memoryInspectorDock->setWidget(dockWidgetContents);
  desk->addDockWidget(Qt::RightDockWidgetArea, memoryInspectorDock);
  myDockWidgets[memoryInspectorDock] = false; // hidden by default


  // Setup the statusbar ...
  pqProgressWidget* aProgress = new pqProgressWidget(desk->statusBar());
  desk->statusBar()->addPermanentWidget(aProgress);
  
  // Set up the dock window corners to give the vertical docks more room.
  desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
  desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
  
  // Setup the default dock configuration ...
  statisticsViewDock->hide();
  comparativePanelDock->hide();
  animationViewDock->hide();
  selectionInspectorDock->hide();
  collaborationPanelDock->hide();
  memoryInspectorDock->hide();


  // Setup quick-launch shortcuts.
  QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, desk);
  QObject::connect(ctrlSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch()));
  QShortcut *altSpace = new QShortcut(Qt::ALT + Qt::Key_Space, desk);
  QObject::connect(altSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch()));

}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::showHelpForProxy ( const QString &  groupname,
const QString &  proxyname 
) [private, slot]

Slot to show help for proxy.

Definition at line 590 of file PVGUI_Module.cxx.

{
  pqHelpReaction::showProxyHelp(groupname, proxyname);
}

Here is the caller graph for this function:

void PVGUI_Module::showView ( bool  toShow) [private]

Shows or hides ParaView view window.

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

Definition at line 566 of file PVGUI_Module.cxx.

{
  SalomeApp_Application* anApp = getApp();
  PVGUI_ViewManager* viewMgr =
    dynamic_cast<PVGUI_ViewManager*>( anApp->getViewManager( PVGUI_Viewer::Type(), false ) );
  if ( !viewMgr ) {
    viewMgr = new PVGUI_ViewManager( anApp->activeStudy(), anApp->desktop() );
    anApp->addViewManager( viewMgr );
    connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
             anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) );
  }

  PVGUI_ViewWindow* pvWnd = dynamic_cast<PVGUI_ViewWindow*>( viewMgr->getActiveView() );
  if ( !pvWnd ) {
    pvWnd = dynamic_cast<PVGUI_ViewWindow*>( viewMgr->createViewWindow() );
  }

  pvWnd->setShown( toShow );
  if ( toShow ) pvWnd->setFocus();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PVGUI_Module::studyClosed ( SUIT_Study *  study) [virtual, slot]

Called when study is closed.

Removes data model from the study.

Parameters:
studystudy being closed

Definition at line 765 of file PVGUI_Module.cxx.

Here is the call graph for this function:

void PVGUI_Module::timerEvent ( QTimerEvent *  event) [protected]

Launches a tracing of current server.

Definition at line 443 of file PVGUI_Module.cxx.

{
#ifndef WNT
  PyInterp_Dispatcher* aDispatcher = PyInterp_Dispatcher::Get();
  if ( !aDispatcher->IsBusy() ) {
    pqPythonManager* manager = qobject_cast<pqPythonManager*>
      ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) );
    if ( manager )  {
      pqPythonDialog* pyDiag = manager->pythonShellDialog();
      if ( pyDiag ) {
       pqPythonShell* shell = pyDiag->shell();
       if ( shell ) {
         QString script = "from paraview import smtrace\nsmtrace.start_trace()\n";
         shell->executeScript(script);
         killTimer( te->timerId() );
       }
      }
    }
  }
#endif
}
void PVGUI_Module::updateMacros ( ) [private]

update macros state

Definition at line 465 of file PVGUI_Module.cxx.

{
  pqPythonManager* aPythonManager = pqPVApplicationCore::instance()->pythonManager();
  if(!aPythonManager)  {
    return;
  }
  
  QString aRootDir = getenv("PARAVIS_ROOT_DIR");

  QString aSourcePath = aRootDir + "/bin/salome/Macro";

  QStringList aFilter;
  aFilter << "*.py";

  QDir aSourceDir(aSourcePath);
  QStringList aSourceFiles = aSourceDir.entryList(aFilter, QDir::Files);
  foreach (QString aStr, aSourceFiles) {
    aPythonManager->addMacro(aSourcePath + "/" + aStr);
  }
}

Here is the caller graph for this function:

void PVGUI_Module::windows ( QMap< int, int > &  m) const [virtual]

Get list of compliant dockable GUI elements.

Parameters:
mmap to be filled in ("type":"default_position")

Definition at line 491 of file PVGUI_Module.cxx.

{
  m.insert( LightApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
  m.insert( LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
  // ParaView diagnostic output redirected here
  m.insert( LightApp_Application::WT_LogWindow, Qt::BottomDockWidgetArea );
}

Member Data Documentation

pqImplementation* PVGUI_Module::Implementation [private]

Definition at line 250 of file PVGUI_Module.h.

pqPVApplicationCore * PVGUI_Module::MyCoreApp = 0 [static, private]

Definition at line 275 of file PVGUI_Module.h.

Definition at line 261 of file PVGUI_Module.h.

Definition at line 255 of file PVGUI_Module.h.

Definition at line 257 of file PVGUI_Module.h.

QtMsgHandler PVGUI_Module::myOldMsgHandler [private]

Definition at line 267 of file PVGUI_Module.h.

Definition at line 258 of file PVGUI_Module.h.

Definition at line 253 of file PVGUI_Module.h.

Definition at line 254 of file PVGUI_Module.h.

Definition at line 273 of file PVGUI_Module.h.

QStringList PVGUI_Module::myTemporaryFiles [private]

Definition at line 265 of file PVGUI_Module.h.

Definition at line 263 of file PVGUI_Module.h.

Definition at line 262 of file PVGUI_Module.h.

Definition at line 256 of file PVGUI_Module.h.

pqPythonScriptEditor* PVGUI_Module::myTraceWindow [private]

Definition at line 271 of file PVGUI_Module.h.

vtkEventQtSlotConnect* PVGUI_Module::VTKConnect [private]

Definition at line 269 of file PVGUI_Module.h.


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