Salome HOME
Merge branch 'abn/port_pv42'
authorabn <adrien.bruneton@cea.fr>
Thu, 9 Oct 2014 08:09:26 +0000 (10:09 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 9 Oct 2014 08:09:26 +0000 (10:09 +0200)
Conflicts:
src/Plugins/MEDReader/IO/vtkMEDReader.cxx
src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx

20 files changed:
src/PVGUI/CMakeLists.txt
src/PVGUI/PVGUI_Module.cxx
src/PVGUI/PVGUI_Module.h
src/PVGUI/PVGUI_Module_actions.cxx
src/PVGUI/PVGUI_Module_widgets.cxx
src/PVGUI/PVGUI_ParaViewSettingsPane.cxx
src/PVGUI/PVGUI_ParaViewSettingsPane.h
src/PVGUI/resources/pqCustomSettingsWidget.ui [new file with mode: 0644]
src/PVGUI/ui_pqOptionsDialog.h [deleted file]
src/Plugins/CMakeLists.txt
src/Plugins/Filter/CMakeLists.txt [deleted file]
src/Plugins/Filter/SampleFilter.xml [deleted file]
src/Plugins/Filter/vtkMySampleFilter.cxx [deleted file]
src/Plugins/Filter/vtkMySampleFilter.h [deleted file]
src/Plugins/NavigationMode/CMakeLists.txt [deleted file]
src/Plugins/NavigationMode/pqSetModeStarter.cxx [deleted file]
src/Plugins/NavigationMode/pqSetModeStarter.h [deleted file]
src/Plugins/ToolBar/CMakeLists.txt [deleted file]
src/Plugins/ToolBar/MyToolBarActions.cxx [deleted file]
src/Plugins/ToolBar/MyToolBarActions.h [deleted file]

index fc2bcabaff3c98cfb77e27656990780e4ac79610..cc6fcf1d775a35dbfbfb9cbf164191d5777a6c69 100644 (file)
@@ -30,6 +30,7 @@ INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR}
     ${Boost_INCLUDE_DIRS}
     ${QT_INCLUDES}
     ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
     )
 
 # additional preprocessor / compiler flags
@@ -58,6 +59,12 @@ SET(_link_LIBRARIES
 
 # --- headers ---
 
+SET(_ui_files
+    resources/pqCustomSettingsWidget.ui
+    )
+
+QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files})
+
 # header files / to be processed by moc
 SET(_moc_HEADERS
   PVGUI_Module.h
@@ -79,7 +86,7 @@ SET(_other_HEADERS
 )
 
 # header files / to install
-SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
+SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS} ${_ui_FORMS_HEADERS})
 
 # --- resources ---
 
@@ -123,8 +130,8 @@ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / EDF specific stuff
-INCLUDE(vtkWrapClientServer)
-VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h)
+#INCLUDE(vtkWrapClientServer)
+#VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h)
 
 # sources / static
 SET(_other_SOURCES
@@ -165,8 +172,9 @@ SET(PVGUI_SOURCES
   ${_other_SOURCES} 
   ${_moc_SOURCES} 
   ${_rcc_SOURCES} 
-  ${vtkEDFCutter_SRCS} 
+#  ${vtkEDFCutter_SRCS} 
   ${_VTK_wrap_SOURCES}
+  ${_ui_FORMS_HEADERS}
   )
 
 # --- rules ---
index caa1fa877b4a75318fab8d415a9a09e3c4816eac..ecb3715e02e138bf8337540ff45ecc7b6dbc93c5 100644 (file)
 #include <pqCollaborationBehavior.h>
 #include <pqDataRepresentation.h>
 #include <pqPipelineRepresentation.h>
-#include <pqLookupTableManager.h>
+//#include <pqLookupTableManager.h>
 #include <pqDisplayColorWidget.h>
 #include <pqColorToolbar.h>
 #include <pqScalarBarVisibilityReaction.h>
 #include <pqStandardPropertyWidgetInterface.h>
+#include <pqStandardViewFrameActionsImplementation.h>
 #include <pqViewStreamingBehavior.h>
 
 #include <PARAVIS_version.h>
 #include <pqCrashRecoveryBehavior.h>
 #include <pqDataTimeStepBehavior.h>
 #include <pqDefaultViewBehavior.h>
-#include <pqDeleteBehavior.h>
 #include <pqObjectPickingBehavior.h>
 #include <pqPersistentMainWindowStateBehavior.h>
 #include <pqPipelineContextMenuBehavior.h>
 #include <pqPluginActionGroupBehavior.h>
 #include <pqPluginDockWidgetsBehavior.h>
 #include <pqPluginManager.h>
-#include <pqPVNewSourceBehavior.h>
 #include <pqSpreadSheetVisibilityBehavior.h>
-#include <pqStandardViewModules.h>
 #include <pqUndoRedoBehavior.h>
-#include <pqViewFrameActionsBehavior.h>
 #include <pqServerManagerObserver.h>
+#include <pqVerifyRequiredPluginBehavior.h>
+#include <pqFixPathsInStateFilesBehavior.h>
+#include <pqPluginSettingsBehavior.h>
+#include <pqPropertiesPanel.h>
+
+#include <pqApplyBehavior.h>
 
 #include <vtkClientServerInterpreterInitializer.h>
 
+// Trace related
+#include <vtkNew.h>
+#include <vtkSMTrace.h>
+#include <vtkSMSessionProxyManager.h>
+#include <vtkSMParaViewPipelineController.h>
 
 //----------------------------------------------------------------------------
 pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0;
@@ -234,25 +242,6 @@ PVGUI_Module* ParavisModule = 0;
          SALOME module wrapping ParaView GUI.
 */
 
-
-/*
-  Fix for the issue 21730: [CEA 596] Slice of polyhedron in PARAVIS returns no cell.
-  Wrap vtkEDFCutter filter.
-*/
-
-extern "C" void vtkEDFCutterCS_Initialize(vtkClientServerInterpreter*);
-static void vtkEDFHelperInit();
-
-void vtkEDFHelperInit(vtkClientServerInterpreter* interp){
-    vtkEDFCutterCS_Initialize(interp);
-}
-
-void vtkEDFHelperInit() {
-    vtkClientServerInterpreterInitializer::GetInitializer()->
-        RegisterCallback(&vtkEDFHelperInit);
-}
-
-
   _PTR(SComponent)
   ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument)
   {
@@ -406,10 +395,10 @@ void PVGUI_Module::initialize( CAM_Application* app )
     //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));
+    // Register standard types of property widgets.
     pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm));
+    // Register standard types of view-frame actions.
+    pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm));
 
     // Load plugins distributed with application.
     pqApplicationCore::instance()->loadDistributedPlugins();
@@ -417,27 +406,30 @@ void PVGUI_Module::initialize( CAM_Application* app )
     // Define application behaviors.
     //new pqQtMessageHandlerBehavior(this);
     new pqDataTimeStepBehavior(this);
-    new pqViewFrameActionsBehavior(this);
     new pqSpreadSheetVisibilityBehavior(this);
     new pqPipelineContextMenuBehavior(this);
-    new pqObjectPickingBehavior(this); // NEW in 4.1
+    new pqObjectPickingBehavior(this);
     new pqDefaultViewBehavior(this);
-    new pqAlwaysConnectedBehavior(this);
-    new pqPVNewSourceBehavior(this);
-    new pqDeleteBehavior(this);
     new pqUndoRedoBehavior(this);
+    new pqAlwaysConnectedBehavior(this);
     new pqCrashRecoveryBehavior(this);
     new pqAutoLoadPluginXMLBehavior(this);
     new pqPluginDockWidgetsBehavior(aDesktop);
-    //new pqVerifyRequiredPluginBehavior(this);
+    new pqVerifyRequiredPluginBehavior(this);
     new pqPluginActionGroupBehavior(aDesktop);
-    //new pqFixPathsInStateFilesBehavior(this);
+    new pqFixPathsInStateFilesBehavior(this);
     new pqCommandLineOptionsBehavior(this);
     new pqPersistentMainWindowStateBehavior(aDesktop);
-    new pqObjectPickingBehavior(aDesktop);
     new pqCollaborationBehavior(this);
-    //new pqMultiServerBehavior(this);
     new pqViewStreamingBehavior(this);
+    new pqPluginSettingsBehavior(this);
+
+    pqApplyBehavior* applyBehavior = new pqApplyBehavior(this);
+    foreach (pqPropertiesPanel* ppanel, aDesktop->findChildren<pqPropertiesPanel*>())
+      {
+      applyBehavior->registerPanel(ppanel);
+      }
+
 
     // Setup quick-launch shortcuts.
     QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, aDesktop);
@@ -455,13 +447,16 @@ void PVGUI_Module::initialize( CAM_Application* app )
     }
 
     // Find Plugin Menus
-    QList<QMenu*> currentMenus = aDesktop->findChildren<QMenu*>();
-    QList<QMenu*>::iterator im;
-    for (im = currentMenus.begin(); im != currentMenus.end(); ++im) {
-      if(!activeMenus.contains(*im)) {
-          myMenus.append(*im);
-      }
-    }
+    // [ABN] TODO: fix this - triggers a SEGFAULT at deactivation() time.
+//    QList<QMenu*> currentMenus = aDesktop->findChildren<QMenu*>();
+//    QList<QMenu*>::iterator im;
+//    for (im = currentMenus.begin(); im != currentMenus.end(); ++im) {
+//      if(!activeMenus.contains(*im)) {
+//          QString s = (*im)->title();
+//          std::cout << " MENU "<<  s.toStdString() << std::endl;
+//          myMenus.append(*im);
+//      }
+//    }
 
     SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
     QString aPath = resMgr->stringValue("resources", "PARAVIS", QString());
@@ -546,24 +541,24 @@ void PVGUI_Module::onFinishedAddingServer(pqServer* /*server*/)
 }
 
 void PVGUI_Module::onDataRepresentationCreated(pqDataRepresentation* data) {
-  if(!data)
-    return;
-  
-  if(!data->getLookupTable())
-    return;
-  
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-  if(!aResourceMgr)
-    return;
-
-  bool visible = aResourceMgr->booleanValue( "PARAVIS", "show_color_legend", false );
-  pqLookupTableManager* lut_mgr = pqApplicationCore::instance()->getLookupTableManager();
-  
-  if(lut_mgr) {
-    lut_mgr->setScalarBarVisibility(data,visible);
-  }
-
-  connect(data, SIGNAL(dataUpdated()), this, SLOT(onDataRepresentationUpdated()));
+//  if(!data)
+//    return;
+//
+//  if(!data->getLookupTable())
+//    return;
+//
+//  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+//  if(!aResourceMgr)
+//    return;
+//
+//  bool visible = aResourceMgr->booleanValue( "PARAVIS", "show_color_legend", false );
+//  pqLookupTableManager* lut_mgr = pqApplicationCore::instance()->getLookupTableManager();
+//
+//  if(lut_mgr) {
+//    lut_mgr->setScalarBarVisibility(data,visible);
+//  }
+//
+//  connect(data, SIGNAL(dataUpdated()), this, SLOT(onDataRepresentationUpdated()));
 }
 
 void PVGUI_Module::onDataRepresentationUpdated() {
@@ -614,54 +609,26 @@ void PVGUI_Module::onVariableChanged(pqVariableType t, const QString) {
   }
 }
 
-void PVGUI_Module::execPythonCommand(const QString& cmd, bool inSalomeConsole)
-{
-  if ( inSalomeConsole ) {
-    if ( PyInterp_Dispatcher::Get()->IsBusy() ) return;
-    SalomeApp_Application* app =
-      dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
-    PyConsole_Console* pyConsole = app->pythonConsole();
-    if (pyConsole)
-      pyConsole->exec(cmd);
-  }
-  else
-    {
-      pqPythonManager* manager = qobject_cast<pqPythonManager*>
-      ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) );
-      if ( manager )
-        {
-          pqPythonDialog* pyDiag = manager->pythonShellDialog();
-          if ( pyDiag )
-            {
-              pqPythonShell* shell = pyDiag->shell();
-              if ( shell ) {
-                  shell->executeScript(cmd);
-              }
-            }
-        }
-    }
-}
-
 /*!
   \brief Launches a tracing of current server
 */
 void PVGUI_Module::timerEvent(QTimerEvent* te )
 {
-#ifndef WNT
-  if ( PyInterp_Dispatcher::Get()->IsBusy() )
-    {
-      // Reschedule for later
-      MESSAGE("interpreter busy -> rescheduling trace start.");
-      startTimer(500);
-    }
-  else
-    {
+//#ifndef WNT
+//  if ( PyInterp_Dispatcher::Get()->IsBusy() )
+//    {
+//      // Reschedule for later
+//      MESSAGE("interpreter busy -> rescheduling trace start.");
+//      startTimer(500);
+//    }
+//  else
+//    {
       MESSAGE("about to start trace....");
-      execPythonCommand("from paraview import smtrace;smtrace.start_trace()", false);
+      startTrace();
       MESSAGE("trace STARTED....");
-    }
+//     }
   killTimer( te->timerId() );
-#endif
+//#endif
 }
   
 /*!
@@ -763,6 +730,8 @@ bool PVGUI_Module::pvInit()
     */
     // End of Initializer code
 
+    MyCoreApp->settings();
+
     vtkOutputWindow::SetInstance(PVGUI_OutputWindowAdapter::New());
     
     new pqTabbedMultiViewWidget(); // it registers as "MULTIVIEW_WIDGET on creation
@@ -1058,6 +1027,36 @@ void PVGUI_Module::openFile(const char* theName)
   pqLoadDataReaction::loadData(aFiles);
 }
 
+/**!
+ * Start trace invoking the newly introduced C++ API (PV 4.2)
+ * (inspired from pqTraceReaction::start())
+ */
+void PVGUI_Module::startTrace()
+{
+  vtkSMSessionProxyManager* pxm = pqActiveObjects::instance().activeServer()->proxyManager();
+
+  vtkSmartPointer<vtkSMProxy> proxy;
+  proxy.TakeReference(pxm->NewProxy("pythontracing", "PythonTraceOptions"));
+  if (proxy)
+    {
+      vtkNew<vtkSMParaViewPipelineController> controller;
+      controller->InitializeProxy(proxy);
+    }
+  vtkSMTrace* trace = vtkSMTrace::StartTrace();
+  if (proxy)
+    {
+      // Set manually the properties entered via the dialog box poping-up when requiring
+      // a trace start in PV4.2 (trace options)
+      trace->SetPropertiesToTraceOnCreate(vtkSMTrace::RECORD_USER_MODIFIED_PROPERTIES);
+      trace->SetFullyTraceSupplementalProxies(false);
+    }
+}
+
+void PVGUI_Module::stopTrace()
+{
+  vtkSMTrace::StopTrace();
+}
+
 void PVGUI_Module::executeScript(const char *script)
 {
 #ifndef WNT
@@ -1102,24 +1101,13 @@ static const QString MYReplaceStr("paraview.simple");
 static const QString MYReplaceImportStr("except: from pvsimple import *");
 QString PVGUI_Module::getTraceString()
 {
-  QString traceString;
-#ifndef WNT
-  {
-    PyLockWrapper lck; // Acquire GIL
-
-    const char * code = "from paraview import smtrace;"
-                        "__smtraceString = smtrace.get_trace_string()";
-    PyRun_SimpleString(code);
-    // Now get the value of __smtraceString
-    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;
-    }
-  } // release GIL
+  vtkSMTrace *tracer = vtkSMTrace::GetActiveTracer();
+  if (!tracer) // trace is not started
+    return QString("");
 
+  QString traceString(tracer->GetCurrentTrace());
+
+  // Replace import "paraview.simple" by "pvsimple"
   if ((!traceString.isNull()) && traceString.length() != 0) {
     int aPos = traceString.indexOf(MYReplaceStr);
     while (aPos != -1) {
@@ -1132,7 +1120,7 @@ QString PVGUI_Module::getTraceString()
       traceString = traceString.replace(aImportPos, MYReplaceImportStr.length(), "except:\n  import pvsimple\n  from pvsimple import *");
       }
   }
-#endif
+
   return traceString;
 }
 
@@ -1192,7 +1180,7 @@ void PVGUI_Module::onImportFromVisu(QString theEntry)
   SalomeApp_Study* activeStudy = dynamic_cast<SalomeApp_Study*>(application()->activeStudy());
   if(!activeStudy) return;
 
-  // get SALOMEDS client study 
+  // get SALOMEDS client study
   _PTR(Study) aStudy = activeStudy->studyDS();
   if(!aStudy) return;
 
@@ -1288,8 +1276,9 @@ void PVGUI_Module::createPreferences()
   setPreferenceProperty(aSaveType, "indexes", aIndices);
 
   //rnv: imp 21712: [CEA 581] Preference to display legend by default 
-  int aDispColoreLegend = addPreference( tr( "PREF_SHOW_COLOR_LEGEND" ), aParaVisSettingsTab,
-                                        LightApp_Preferences::Bool, "PARAVIS", "show_color_legend");
+  // [ABN]: now fixed in ParaView.
+//  int aDispColoreLegend = addPreference( tr( "PREF_SHOW_COLOR_LEGEND" ), aParaVisSettingsTab,
+//                                        LightApp_Preferences::Bool, "PARAVIS", "show_color_legend");
 }
 
 /*!
@@ -1382,10 +1371,8 @@ void PVGUI_Module::onShowTrace()
 */
 void PVGUI_Module::onRestartTrace()
 {
-  QString script = "from paraview import smtrace\n";
-  script += "smtrace.stop_trace()\n";
-  script += "smtrace.start_trace()\n";
-  execPythonCommand(script, false);
+  stopTrace();
+  startTrace();
 }
 
 /*!
@@ -1684,10 +1671,10 @@ extern "C" {
 
   bool flag = false;
   PVGUI_EXPORT CAM_Module* createModule() {
-    if(!flag) {
-        vtkEDFHelperInit();
-        flag = true;
-    }      
+//    if(!flag) {
+//        vtkEDFHelperInit();
+//        flag = true;
+//    }
     return new PVGUI_Module();
   }
   
index 0b30e767f72741eb8006aa13d4bc198d7a372652..9208709a3be329291c8ce72127d4842057a1e622 100644 (file)
@@ -154,6 +154,8 @@ public:
   void clearParaviewState();
 
   QString getTraceString();
+  void startTrace();
+  void stopTrace();
   void saveTrace(const char* theName);
 
   pqServer* getActiveServer();
@@ -221,9 +223,6 @@ private:
   //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
   void restoreCommonWindowsState();
 
-  //! run Python command (either in SALOME's Python interpreter, or in ParaView's Python's interpreter)
-  void execPythonCommand(const QString& cmd, bool inSalomeConsole=false);
-
 private slots:
 
   void showHelpForProxy( const QString&, const QString& );
index 638a3673eb8541faec3ac913d7bc10634b69737c..1fdefc33f7f6762c4a72de53695b7efc73663bd1 100644 (file)
@@ -41,8 +41,8 @@
 #include <pqApplicationCore.h>
 // #include <pqColorScaleToolbar.h>
 #include <pqProgressManager.h>
-#include <pqRubberBandHelper.h>
-#include <pqScalarBarVisibilityAdaptor.h>
+//#include <pqRubberBandHelper.h>
+//#include <pqScalarBarVisibilityAdaptor.h>
 #include <pqUndoStack.h>
 #include <pqVCRController.h>
 
@@ -61,7 +61,7 @@
 #include <pqDeleteReaction.h>
 #include <pqChangePipelineInputReaction.h>
 #include <pqApplicationSettingsReaction.h>
-#include <pqViewSettingsReaction.h>
+//#include <pqViewSettingsReaction.h>
 #include <pqIgnoreSourceTimeReaction.h>
 #include <pqViewMenuManager.h>
 #include <pqParaViewMenuBuilders.h>
@@ -255,11 +255,11 @@ void PVGUI_Module::pvCreateActions()
   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);
+//  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*>(
@@ -465,7 +465,7 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( separator(), aPVMnu );
 
   //createMenu( SettingsId, aPVMnu );
-  createMenu( ViewSettingsId, aPVMnu );
+  //createMenu( ViewSettingsId, aPVMnu );
   createMenu( separator(), aPVMnu );
 
   // --- Menu "View"
index 76624da9e61d7a9b0844074d85ee36933520df4d..b265093504180a30c9b21c4617ee974d88a14d18 100644 (file)
 #include <pqMultiBlockInspectorPanel.h>
 #include <pqProgressWidget.h>
 #include <pqProgressManager.h>
-#include <pqObjectInspectorWidget.h>
-#include <pqDisplayProxyEditorWidget.h>
+//#include <pqDisplayProxyEditorWidget.h>
+#include <pqPropertiesPanel.h>
 
-#include <pqAlwaysConnectedBehavior.h>
 #include <pqApplicationCore.h>
-#include <pqAutoLoadPluginXMLBehavior.h>
-#include <pqCommandLineOptionsBehavior.h>
-#include <pqCrashRecoveryBehavior.h>
-#include <pqDataTimeStepBehavior.h>
-#include <pqDefaultViewBehavior.h>
-#include <pqDeleteBehavior.h>
-#include <pqPersistentMainWindowStateBehavior.h>
-#include <pqPluginActionGroupBehavior.h>
-#include <pqPluginDockWidgetsBehavior.h>
 #include <pqPluginManager.h>
-#include <pqPVNewSourceBehavior.h>
-#include <pqSpreadSheetVisibilityBehavior.h>
-#include <pqStandardViewModules.h>
-#include <pqUndoRedoBehavior.h>
-#include <pqViewFrameActionsBehavior.h>
 #include <pqParaViewMenuBuilders.h>
 #include <pqCollaborationPanel.h>
 #include <pqMemoryInspectorPanel.h>
 #include <pqColorMapEditor.h>
+#include <pqDeleteReaction.h>
 
 class ResizeHelper : public pqPVAnimationWidget
 {
@@ -107,7 +93,8 @@ protected:
 
 /*!
   \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc.
-  ParaView pqMainWIndowCore class is fully responsible for these dock widgets' contents.
+  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
 */
 void PVGUI_Module::setupDockWidgets()
 {
@@ -126,42 +113,24 @@ void PVGUI_Module::setupDockWidgets()
   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
+  // Properties dock (previously called OBJECT_INSPECTOR)
+  QDockWidget* propertiesDock = new QDockWidget( tr( "TTL_OBJECT_INSPECTOR" ), desk );
+  propertiesDock->setObjectName("propertiesDock");
+  propertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
+  desk->addDockWidget( Qt::LeftDockWidgetArea, propertiesDock );
+
+  pqPropertiesPanel* propertiesPanel = new pqPropertiesPanel(propertiesDock);
+  propertiesDock->setObjectName("propertiesPanel");
+  propertiesDock->setWidget(propertiesPanel);
+  connect( propertiesPanel, SIGNAL( helpRequested(const QString&, const QString&) ),  this, SLOT( showHelpForProxy(const QString&, const QString&) ) );
+  //            hook delete to pqDeleteReaction.
+  QAction* tempDeleteAction = new QAction(this);
+  pqDeleteReaction* handler = new pqDeleteReaction(tempDeleteAction);
+  handler->connect(propertiesPanel, SIGNAL(deleteRequested(pqPipelineSource*)), SLOT(deleteSource(pqPipelineSource*)));
+
+  myDockWidgets[propertiesDock] = true;
+
+  // Information dock
   QDockWidget* informationDock = new QDockWidget(tr( "TTL_INFORMATION" ), desk);
   informationDock->setObjectName("informationDock");
 
@@ -187,10 +156,8 @@ void PVGUI_Module::setupDockWidgets()
   myDockWidgets[informationDock] = true;
 
   desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
-  desk->tabifyDockWidget(objectInspectorDock, displayDock);
-  desk->tabifyDockWidget(objectInspectorDock, informationDock);
-  objectInspectorDock->raise();
-
+  desk->tabifyDockWidget(informationDock, propertiesDock);
+  propertiesDock->raise();
 
   // Statistic View
   QDockWidget* statisticsViewDock  = new QDockWidget( tr( "TTL_STATISTICS_VIEW" ), desk );
@@ -296,7 +263,7 @@ void PVGUI_Module::setupDockWidgets()
   // 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();
index 6b524e3e911a98ec7346c6ba78931136336f6d75..ac9e5431d8e13899d4545a44bc1aa51ea6dad2aa 100644 (file)
 //
 
 #include "PVGUI_ParaViewSettingsPane.h"
-#include "ui_pqOptionsDialog.h"
+#include "ui_pqCustomSettingsWidget.h"
 
-#include <pqOptionsContainer.h>
-#include <pqOptionsPage.h>
-#include <pqUndoStack.h>
-#include "pqApplicationCore.h"
-#include "pqApplicationOptions.h"
-#include "pqGlobalRenderViewOptions.h"
-#include "pqPluginManager.h"
-#include "pqViewOptionsInterface.h"
-#include "pqInterfaceTracker.h"
-
-#include <QAbstractItemModel>
-#include <QHeaderView>
-#include <QList>
-#include <QMap>
-#include <QString>
-
-
-class OptionsDialogModelItem
-{
-public:
-  OptionsDialogModelItem();
-  OptionsDialogModelItem(const QString &name);
-  ~OptionsDialogModelItem();
-
-  OptionsDialogModelItem *Parent;
-  QString Name;
-  QList<OptionsDialogModelItem *> Children;
-};
-
-
-class OptionsDialogModel : public QAbstractItemModel
-{
-public:
-  OptionsDialogModel(QObject *parent=0);
-  virtual ~OptionsDialogModel();
+#include <QtxDialog.h>
 
-  virtual int rowCount(const QModelIndex &parent=QModelIndex()) const;
-  virtual int columnCount(const QModelIndex &parent=QModelIndex()) const;
-  virtual QModelIndex index(int row, int column,
-      const QModelIndex &parent=QModelIndex()) const;
-  virtual QModelIndex parent(const QModelIndex &child) const;
-
-  virtual QVariant data(const QModelIndex &index,
-      int role=Qt::DisplayRole) const;
-
-  QModelIndex getIndex(const QString &path) const;
-  QString getPath(const QModelIndex &index) const;
-  void addPath(const QString &path);
-  bool removeIndex(const QModelIndex &index);
-
-private:
-  QModelIndex getIndex(OptionsDialogModelItem *item) const;
+#include <QString>
 
-private:
-  OptionsDialogModelItem *Root;
-};
 
+#include "pqActiveObjects.h"
+#include "pqApplicationCore.h"
+#include "pqProxyWidget.h"
+#include "pqSearchBox.h"
+#include "pqServer.h"
+#include "pqSettings.h"
+#include "pqUndoStack.h"
+#include "vtkNew.h"
+#include "vtkPVXMLElement.h"
+#include "vtkSmartPointer.h"
+#include "vtkSMProperty.h"
+#include "vtkSMPropertyHelper.h"
+#include "vtkSMPropertyIterator.h"
+#include "vtkSMProxy.h"
+#include "vtkSMProxyIterator.h"
+#include "vtkSMSessionProxyManager.h"
+#include "vtkSMSettings.h"
+
+#include <QKeyEvent>
+#include <QMap>
+#include <QPushButton>
+#include <QScrollArea>
+#include <QSpacerItem>
+#include <QVBoxLayout>
+#include <QShowEvent>
+#include <QHideEvent>
 
-class OptionsDialogForm : public Ui::pqOptionsFrame
+class PVGUI_ParaViewSettingsPane::pqInternals
 {
 public:
-  OptionsDialogForm();
-  ~OptionsDialogForm();
+  Ui::CustomSettingsWidget Ui;
 
-  QMap<QString, pqOptionsPage *> Pages;
-  OptionsDialogModel *Model;
-  int ApplyUseCount;
-  //bool ApplyNeeded;
+  // Map from tab indices to stack widget indices. This is needed because there
+  // are more widgets in the stacked widgets than just what we add.
+  QMap<int, int> TabToStackedWidgets;
 };
 
+bool PVGUI_ParaViewSettingsPane::ShowRestartRequired = false;
 
 //----------------------------------------------------------------------------
-OptionsDialogModelItem::OptionsDialogModelItem()
-  : Name(), Children()
-{
-  this->Parent = 0;
-}
-
-OptionsDialogModelItem::OptionsDialogModelItem(const QString &name)
-  : Name(name), Children()
-{
-  this->Parent = 0;
-}
-
-OptionsDialogModelItem::~OptionsDialogModelItem()
-{
-  QList<OptionsDialogModelItem *>::Iterator iter = this->Children.begin();
-  for( ; iter != this->Children.end(); ++iter)
-    {
-    delete *iter;
-    }
-}
-
-
-//----------------------------------------------------------------------------
-OptionsDialogModel::OptionsDialogModel(QObject *parentObject)
-  : QAbstractItemModel(parentObject)
-{
-  this->Root = new OptionsDialogModelItem();
-}
-
-OptionsDialogModel::~OptionsDialogModel()
-{
-  delete this->Root;
-}
-
-int OptionsDialogModel::rowCount(const QModelIndex &parentIndex) const
-{
-  OptionsDialogModelItem *item = this->Root;
-  if(parentIndex.isValid())
-    {
-    item = reinterpret_cast<OptionsDialogModelItem *>(
-        parentIndex.internalPointer());
-    }
-
-  return item->Children.size();
-}
-
-int OptionsDialogModel::columnCount(const QModelIndex &) const
-{
-  return 1;
-}
-
-QModelIndex OptionsDialogModel::index(int row, int column,
-    const QModelIndex &parentIndex) const
-{
-  OptionsDialogModelItem *item = this->Root;
-  if(parentIndex.isValid())
-    {
-    item = reinterpret_cast<OptionsDialogModelItem *>(
-        parentIndex.internalPointer());
-    }
-
-  if(column == 0 && row >= 0 && row < item->Children.size())
-    {
-    return this->createIndex(row, column, item->Children[row]);
-    }
-
-  return QModelIndex();
-}
-
-QModelIndex OptionsDialogModel::parent(const QModelIndex &child) const
-{
-  if(child.isValid())
-    {
-    OptionsDialogModelItem *item =
-        reinterpret_cast<OptionsDialogModelItem *>(child.internalPointer());
-    return this->getIndex(item->Parent);
-    }
-
-  return QModelIndex();
-}
-
-QVariant OptionsDialogModel::data(const QModelIndex &idx, int role) const
-{
-  if(idx.isValid())
+PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent)
+  : QtxUserDefinedContent(widgetParent),
+    Internals (new PVGUI_ParaViewSettingsPane::pqInternals())
+{
+  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+  ui.setupUi(this);
+  ui.tabBar->setDocumentMode(false);
+  ui.tabBar->setDrawBase(false);
+  ui.tabBar->setExpanding(false);
+  ui.tabBar->setUsesScrollButtons(true);
+
+  // Hide restart message
+  ui.restartRequiredLabel->setVisible(PVGUI_ParaViewSettingsPane::ShowRestartRequired);
+
+  QList<vtkSMProxy*> proxies_to_show;
+
+  pqServer* server = pqActiveObjects::instance().activeServer();
+  vtkNew<vtkSMProxyIterator> iter;
+  iter->SetSession(server->session());
+  iter->SetModeToOneGroup();
+  for (iter->Begin("settings"); !iter->IsAtEnd(); iter->Next())
     {
-    OptionsDialogModelItem *item =
-        reinterpret_cast<OptionsDialogModelItem *>(idx.internalPointer());
-    if(role == Qt::DisplayRole || role == Qt::ToolTipRole)
+    vtkSMProxy* proxy = iter->GetProxy();
+    if (proxy)
       {
-      return QVariant(item->Name);
+      proxies_to_show.push_back(proxy);
       }
     }
 
-  return QVariant();
-}
-
-QModelIndex OptionsDialogModel::getIndex(const QString &path) const
-{
-  OptionsDialogModelItem *item = this->Root;
-  QStringList names = path.split(".");
-  QStringList::Iterator iter = names.begin();
-  for( ; item && iter != names.end(); ++iter)
+  // Add color palette.
+  if (vtkSMProxy* proxy = server->proxyManager()->GetProxy("global_properties", "ColorPalette"))
     {
-    OptionsDialogModelItem *child = 0;
-    QList<OptionsDialogModelItem *>::Iterator jter = item->Children.begin();
-    for( ; jter != item->Children.end(); ++jter)
-      {
-      if((*jter)->Name == *iter)
-        {
-        child = *jter;
-        break;
-        }
-      }
-
-    item = child;
+    proxies_to_show.push_back(proxy);
     }
 
-  if(item && item != this->Root)
+  foreach (vtkSMProxy* proxy, proxies_to_show)
     {
-    return this->getIndex(item);
+    QString proxyName = proxy->GetXMLName();
+
+    QScrollArea *scrollArea = new QScrollArea(this);
+    scrollArea->setObjectName(QString("ScrollArea%1").arg(proxyName));
+    scrollArea->setWidgetResizable(true);
+    scrollArea->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
+    scrollArea->setFrameShape(QFrame::NoFrame);
+
+    QWidget* container = new QWidget(scrollArea);
+    container->setObjectName("Container");
+    container->setContentsMargins(6, 0, 6, 0);
+
+    QVBoxLayout* vbox = new QVBoxLayout(container);
+    vbox->setMargin(0);
+    vbox->setSpacing(0);
+
+    pqProxyWidget* widget = new pqProxyWidget(proxy, container);
+    widget->setObjectName("ProxyWidget");
+    widget->setApplyChangesImmediately(false);
+    widget->setView(NULL);
+
+    widget->connect(this, SIGNAL(accepted()), SLOT(apply()));
+    widget->connect(this, SIGNAL(rejected()), SLOT(reset()));
+    this->connect(widget, SIGNAL(restartRequired()), SLOT(showRestartRequiredMessage()));
+    vbox->addWidget(widget);
+
+    QSpacerItem* spacer = new QSpacerItem(0, 0,QSizePolicy::Fixed,
+      QSizePolicy::MinimumExpanding);
+    vbox->addItem(spacer);
+
+    scrollArea->setWidget(container);
+    // show panel widgets
+    widget->updatePanel();
+
+    int tabIndex = ui.tabBar->addTab(proxy->GetXMLLabel());
+    int stackIndex = ui.stackedWidget->addWidget(scrollArea);
+    this->Internals->TabToStackedWidgets[tabIndex] = stackIndex;
+
+    this->connect(widget, SIGNAL(changeAvailable()), SLOT(onChangeAvailable()));
+    widget->connect(this, SIGNAL(filterWidgets(bool, QString)), SLOT(filterWidgets(bool, QString)));
     }
 
-  return QModelIndex();
-}
+  // Disable some buttons to start
+//  ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
+//  ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
 
-QString OptionsDialogModel::getPath(const QModelIndex &idx) const
-{
-  if(idx.isValid())
-    {
-    QString path;
-    OptionsDialogModelItem *item =
-        reinterpret_cast<OptionsDialogModelItem *>(idx.internalPointer());
-    if(item)
-      {
-      path = item->Name;
-      item = item->Parent;
-      }
+//  this->connect(ui.buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()),
+//                SLOT(onRestoreDefaults()));
+//  this->connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(clicked(QAbstractButton*)));
+  this->connect(this, SIGNAL(accepted()), SLOT(onAccepted()));
+  this->connect(this, SIGNAL(rejected()), SLOT(onRejected()));
+  this->connect(ui.tabBar, SIGNAL(currentChanged(int)), this, SLOT(onTabIndexChanged(int)));
 
-    while(item && item != this->Root)
-      {
-      path.prepend(".").prepend(item->Name);
-      item = item->Parent;
-      }
+  this->connect(ui.SearchBox, SIGNAL(advancedSearchActivated(bool)), SLOT(filterPanelWidgets()));
+  this->connect(ui.SearchBox, SIGNAL(textChanged(QString)), SLOT(filterPanelWidgets()));
 
-    return path;
-    }
+  // After all the tabs are set up, select the first
+  this->onTabIndexChanged(0);
 
-  return QString();
+  this->filterPanelWidgets();
 }
 
-void OptionsDialogModel::addPath(const QString &path)
+//-----------------------------------------------------------------------------
+PVGUI_ParaViewSettingsPane::~PVGUI_ParaViewSettingsPane()
 {
-  OptionsDialogModelItem *item = this->Root;
-  QStringList names = path.split(".");
-  QStringList::Iterator iter = names.begin();
-  for( ; iter != names.end(); ++iter)
-    {
-    OptionsDialogModelItem *child = 0;
-    QList<OptionsDialogModelItem *>::Iterator jter = item->Children.begin();
-    for( ; jter != item->Children.end(); ++jter)
-      {
-      if((*jter)->Name == *iter)
-        {
-        child = *jter;
-        break;
-        }
-      }
-
-    if(!child)
-      {
-      child = new OptionsDialogModelItem(*iter);
-      child->Parent = item;
-      QModelIndex parentIndex = this->getIndex(item);
-      int row = item->Children.size();
-      this->beginInsertRows(parentIndex, row, row);
-      item->Children.append(child);
-      this->endInsertRows();
-      }
-
-    item = child;
-    }
+  delete this->Internals;
+  this->Internals = NULL;
 }
 
-bool OptionsDialogModel::removeIndex(const QModelIndex &idx)
+void PVGUI_ParaViewSettingsPane::store(QtxResourceMgr* , QtxPreferenceMgr* )
 {
-  if(idx.isValid())
-    {
-    OptionsDialogModelItem *item =
-        reinterpret_cast<OptionsDialogModelItem *>(idx.internalPointer());
-    if(item->Children.size() == 0)
-      {
-      QModelIndex parentIndex = this->getIndex(item->Parent);
-      this->beginRemoveRows(parentIndex, idx.row(), idx.row());
-      item->Parent->Children.removeAt(idx.row());
-      this->endRemoveRows();
-      delete item;
-      return true;
-      }
-    }
-
-  return false;
+  emit this->accepted();
 }
 
-QModelIndex OptionsDialogModel::getIndex(
-    OptionsDialogModelItem *item) const
+void PVGUI_ParaViewSettingsPane::retrieve(QtxResourceMgr* , QtxPreferenceMgr* )
 {
-  if(item && item->Parent)
-    {
-    return this->createIndex(item->Parent->Children.indexOf(item), 0, item);
-    }
-
-  return QModelIndex();
+//  onRestoreDefaults();
 }
 
-
-//----------------------------------------------------------------------------
-OptionsDialogForm::OptionsDialogForm()
-  : Ui::pqOptionsFrame(), Pages()
-{
-  this->Model = new OptionsDialogModel();
-  this->ApplyUseCount = 0;
-  //this->ApplyNeeded = false;
+void PVGUI_ParaViewSettingsPane::showEvent(QShowEvent * ev)
+{
+//  // Connect SALOME's default button to ParaView's default restore.
+//  LightApp_PreferencesDlg * prefDg;
+//  QWidget *w = this->parentWidget();
+//  // UGLY!!!
+//  while (w)
+//    {
+//      LightApp_PreferencesDlg * prefDg = dynamic_cast<LightApp_PreferencesDlg *>( w );
+//      if (prefDg)
+//        break;
+//      w = w->parentWidget();
+//    }
+//  if (prefDg)
+//    prefDg->connect(btn, SIGNAL(clicked()), this, SLOT(onRestoreDefaults()));
+  ev->accept();
 }
 
-OptionsDialogForm::~OptionsDialogForm()
+void PVGUI_ParaViewSettingsPane::hideEvent(QHideEvent * ev)
 {
-  delete this->Model;
+  // Connect SALOME's default button to ParaView's default restore.
+  ev->accept();
 }
 
-
-//----------------------------------------------------------------------------
-PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent)
-  : QtxUserDefinedContent(widgetParent)
-{
-  this->Form = new OptionsDialogForm();
-  this->Form->setupUi(this);
-  this->Form->PageNames->setModel(this->Form->Model);
-
-  // Hide the tree widget header view.
-  this->Form->PageNames->header()->hide();
-
-  // Hide the apply and reset buttons until they are needed.
-  //this->Form->ApplyButton->setEnabled(false);
-  //this->Form->ResetButton->setEnabled(false);
-  //this->Form->ApplyButton->hide();
-  //this->Form->ResetButton->hide();
-
-  this->connect(this->Form->PageNames->selectionModel(),
-      SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
-      this, SLOT(changeCurrentPage()));
-  //this->connect(this->Form->ApplyButton, SIGNAL(clicked()),
-  //    this, SLOT(applyChanges()));
-  //this->connect(this->Form->ResetButton, SIGNAL(clicked()),
-  //    this, SLOT(resetChanges()));
-  //this->connect(this->Form->CloseButton, SIGNAL(clicked()),
-  //    this, SLOT(accept()));
-
-  // Code From pqApplicationOptionsDialog
-  //this->setApplyNeeded(true);
-
-  pqApplicationOptions* appOptions = new pqApplicationOptions;
-  this->addOptions(appOptions);
-  
-  pqGlobalRenderViewOptions* renOptions = new pqGlobalRenderViewOptions;
-  this->addOptions(renOptions);
-  
-  QStringList pages = appOptions->getPageList();
-  if(pages.size())
-    {
-    this->setCurrentPage(pages[0]);
-    }
-
-  /// Add panes as plugins are loaded.
-  QObject::connect(pqApplicationCore::instance()->getPluginManager(),
-    SIGNAL(guiInterfaceLoaded(QObject*)),
-    this, SLOT(pluginLoaded(QObject*)));
-
-  // Load panes from already loaded plugins.
-  foreach (QObject* plugin_interface, pqApplicationCore::instance()->interfaceTracker()->interfaces())
-           //pqApplicationCore::instance()->getPluginManager()->interfaces())
-    {
-    this->pluginLoaded(plugin_interface);
-    }
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::clicked(QAbstractButton *button)
+{
+//  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+//  QDialogButtonBox::ButtonRole role = ui.buttonBox->buttonRole(button);
+//  switch (role)
+//    {
+//  case QDialogButtonBox::AcceptRole:
+//  case QDialogButtonBox::ApplyRole:
+//    emit this->accepted();
+//    break;
+//
+//  case QDialogButtonBox::ResetRole:
+//  case QDialogButtonBox::RejectRole:
+//    emit this->rejected();
+//    break;
+//  default:
+//    break;
+//    }
 }
 
-PVGUI_ParaViewSettingsPane::~PVGUI_ParaViewSettingsPane()
-{
-  delete this->Form;
-}
-/*
-bool PVGUI_ParaViewSettingsPane::isApplyNeeded() const
-{
-  return this->Form->ApplyNeeded;
-}
-*/
-/*
-void PVGUI_ParaViewSettingsPane::setApplyNeeded(bool applyNeeded)
-{
-  if(applyNeeded != this->Form->ApplyNeeded)
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::onAccepted()
+{
+  // If there are any properties that needed to save their values in QSettings,
+  // do that. Otherwise, save to the vtkSMSettings singleton.
+  vtkSMSettings * settings = vtkSMSettings::GetInstance();
+  pqServer* server = pqActiveObjects::instance().activeServer();
+  vtkNew<vtkSMProxyIterator> iter;
+  iter->SetSession(server->session());
+  iter->SetModeToOneGroup();
+  for (iter->Begin("settings"); !iter->IsAtEnd(); iter->Next())
     {
-    if(!applyNeeded)
+    vtkSMProxy* proxy = iter->GetProxy();
+    settings->SetProxySettings(proxy);
+    vtkSmartPointer<vtkSMPropertyIterator> iter2;
+    iter2.TakeReference(proxy->NewPropertyIterator());
+    for (iter2->Begin(); !iter2->IsAtEnd(); iter2->Next())
       {
-      this->Form->ApplyNeeded = false;
-      //this->Form->ApplyButton->setEnabled(false);
-      //this->Form->ResetButton->setEnabled(false);
-      }
-    else if(this->Form->ApplyUseCount > 0)
-      {
-      this->Form->ApplyNeeded = true;
-      //this->Form->ApplyButton->setEnabled(true);
-      //this->Form->ResetButton->setEnabled(true);
+      vtkSMProperty* smproperty = iter2->GetProperty();
+      if (smproperty && smproperty->GetHints() &&
+        smproperty->GetHints()->FindNestedElementByName("SaveInQSettings"))
+        {
+        QString key = QString("%1.%2").arg(iter->GetKey()).arg(iter2->GetKey());
+        this->saveInQSettings(key.toLatin1().data(), smproperty);
+        }
       }
     }
-}
-*/
-void PVGUI_ParaViewSettingsPane::addOptions(const QString &path, pqOptionsPage *options)
-{
-  if(!options)
-    {
-    return;
-    }
-
-  // See if the page is a container.
-  pqOptionsContainer *container = qobject_cast<pqOptionsContainer *>(options);
-  if(!container && path.isEmpty())
-    {
-    return;
-    }
 
-  // See if the page/container uses the apply button.
-  if(options->isApplyUsed())
+  // Save color palette settings
+  vtkSMProxy* paletteProxy = server->proxyManager()->GetProxy("global_properties", "ColorPalette");
+  if (paletteProxy)
     {
-    this->Form->ApplyUseCount++;
-    /*if(this->Form->ApplyUseCount == 1)
-      {
-        //this->Form->ApplyButton->show();
-        //this->Form->ResetButton->show();
-        //QObject::connect(this, SIGNAL(accepted()), this, SLOT(applyChanges()));
-        }*/
-
-    //this->connect(options, SIGNAL(changesAvailable()),
-    //this, SLOT(enableButtons()));
+    settings->SetProxySettings(paletteProxy);
     }
 
-  // Add the widget to the stack.
-  this->Form->Stack->addWidget(options);
-
-  // Add the page(s) to the map and the model.
-  if(container)
-    {
-    // If the path is not empty, use it as the page prefix.
-    QString prefix;
-    if(!path.isEmpty())
-      {
-      prefix = path;
-      prefix.append(".");
-      }
-
-    container->setPagePrefix(prefix);
+  // Disable buttons
+//  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+//  ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
+//  ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
 
-    // Get the list of pages from the container.
-    QStringList pathList = container->getPageList();
-    QStringList::Iterator iter = pathList.begin();
-    for( ; iter != pathList.end(); ++iter)
-      {
-      this->Form->Pages.insert(prefix + *iter, options);
-      this->Form->Model->addPath(prefix + *iter);
-      }
-    }
-  else
-    {
-    this->Form->Pages.insert(path, options);
-    this->Form->Model->addPath(path);
-    }
+  // In theory, the above changes are undo-redo able, the only things that's not
+  // undo-able is the "serialized" values. Hence we just clear the undo stack.
+  CLEAR_UNDO_STACK();
 }
 
-void PVGUI_ParaViewSettingsPane::addOptions(pqOptionsContainer *options)
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::onRejected()
 {
-  this->addOptions(QString(), options);
+  // Disable buttons
+//  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+//  ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
+//  ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
 }
 
-void PVGUI_ParaViewSettingsPane::removeOptions(pqOptionsPage *options)
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::onRestoreDefaults()
 {
-  if(!options)
-    {
-    return;
-    }
+  pqServer* server = pqActiveObjects::instance().activeServer();
+  vtkSMSession * session = server->session();
 
-  // Remove the widget from the stack.
-  this->Form->Stack->removeWidget(options);
-
-  // See if the options use the apply button.
-  if(options->isApplyUsed())
+  vtkNew<vtkSMProxyIterator> iter;
+  iter->SetSession(session);
+  iter->SetModeToOneGroup();
+  for (iter->Begin("settings"); !iter->IsAtEnd(); iter->Next())
     {
-    this->Form->ApplyUseCount--;
-    /*if(this->Form->ApplyUseCount == 0)
+    vtkSMProxy* proxy = iter->GetProxy();
+    if (proxy)
       {
-        //this->Form->ApplyNeeded = false;
-      //this->Form->ApplyButton->setEnabled(false);
-      //this->Form->ResetButton->setEnabled(false);
-      //this->Form->ApplyButton->hide();
-      //this->Form->ResetButton->hide();
-      //QObject::disconnect(this, SIGNAL(accepted()), this, SLOT(applyChanges()));
-      }*/
-
-    this->disconnect(options, 0, this, 0);
+      proxy->ResetPropertiesToXMLDefaults();
+      }
     }
 
-  // Search the map for the paths to remove.
-  QMap<QString, pqOptionsPage *>::Iterator iter = this->Form->Pages.begin();
-  while(iter != this->Form->Pages.end())
+  vtkSMProxy* paletteProxy = server->proxyManager()->GetProxy("global_properties", "ColorPalette");
+  if (paletteProxy)
     {
-    if(*iter == options)
-      {
-      QString path = iter.key();
-      iter = this->Form->Pages.erase(iter);
-
-      // Remove the item from the tree model as well.
-      QModelIndex index = this->Form->Model->getIndex(path);
-      QPersistentModelIndex parentIndex = index.parent();
-      if(this->Form->Model->removeIndex(index))
-        {
-        // Remove any empty parent items.
-        while(parentIndex.isValid() &&
-            this->Form->Model->rowCount(parentIndex) == 0)
-          {
-          index = parentIndex;
-          parentIndex = index.parent();
-
-          // Make sure the index path isn't in the map.
-          path = this->Form->Model->getPath(index);
-          if(this->Form->Pages.find(path) == this->Form->Pages.end())
-            {
-            if(!this->Form->Model->removeIndex(index))
-              {
-              break;
-              }
-            }
-          }
-        }
-      }
-    else
-      {
-      ++iter;
-      }
+    paletteProxy->ResetPropertiesToXMLDefaults();
     }
 }
 
-void PVGUI_ParaViewSettingsPane::setCurrentPage(const QString &path)
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::onTabIndexChanged(int index)
 {
-  QModelIndex current = this->Form->Model->getIndex(path);
-  this->Form->PageNames->setCurrentIndex(current);
+  int stackWidgetIndex = this->Internals->TabToStackedWidgets[index];
+  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+  ui.stackedWidget->setCurrentIndex(stackWidgetIndex);
 }
 
-void PVGUI_ParaViewSettingsPane::applyChanges()
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::filterPanelWidgets()
 {
-  //if(this->Form->ApplyNeeded)
-  //  {
-    BEGIN_UNDO_SET("Changed View Settings");
-    emit this->aboutToApplyChanges();
-    QMap<QString, pqOptionsPage *>::Iterator iter = this->Form->Pages.begin();
-    for( ; iter != this->Form->Pages.end(); ++iter)
-      {
-      (*iter)->applyChanges();
-      }
-
-    //this->setApplyNeeded(false);
-    emit this->appliedChanges();
-    END_UNDO_SET();
-    //}
+  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+  emit this->filterWidgets(
+    ui.SearchBox->isAdvancedSearchActive(), ui.SearchBox->text());
 }
 
-void PVGUI_ParaViewSettingsPane::resetChanges()
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::onChangeAvailable()
 {
-  //if(this->Form->ApplyNeeded)
-  //{
-    QMap<QString, pqOptionsPage *>::Iterator iter = this->Form->Pages.begin();
-    for( ; iter != this->Form->Pages.end(); ++iter)
-      {
-      (*iter)->resetChanges();
-      }
+//  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+//  ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(true);
+//  ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
+}
 
-    //this->setApplyNeeded(false);
-    //}
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::showRestartRequiredMessage()
+{
+  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
+  ui.restartRequiredLabel->setVisible(true);
+  PVGUI_ParaViewSettingsPane::ShowRestartRequired = true;
 }
 
-void PVGUI_ParaViewSettingsPane::changeCurrentPage()
+//-----------------------------------------------------------------------------
+void PVGUI_ParaViewSettingsPane::saveInQSettings(
+  const char* key, vtkSMProperty* smproperty)
 {
-  // Get the current index from the view.
-  QModelIndex current = this->Form->PageNames->currentIndex();
+  pqSettings* settings = pqApplicationCore::instance()->settings();
 
-  // Look up the path for the current index.
-  QString path = this->Form->Model->getPath(current);
-  QMap<QString, pqOptionsPage *>::Iterator iter = this->Form->Pages.find(path);
-  if(iter == this->Form->Pages.end())
+  // FIXME: handle all property types. This will only work for single value
+  // properties.
+  if (smproperty->IsA("vtkSMIntVectorProperty") ||
+    smproperty->IsA("vtkSMIdTypeVectorProperty"))
     {
-    // If no page is found, show the blank page.
-    this->Form->Stack->setCurrentWidget(this->Form->BlankPage);
+    settings->setValue(key, vtkSMPropertyHelper(smproperty).GetAsInt());
     }
-  else
+  else if (smproperty->IsA("vtkSMDoubleVectorProperty"))
     {
-    this->Form->Stack->setCurrentWidget(*iter);
-    pqOptionsContainer *container = qobject_cast<pqOptionsContainer *>(*iter);
-    if(container)
-      {
-      // Get the path prefix from the container.
-      QString prefix = container->getPagePrefix();
-      if(!prefix.isEmpty())
-        {
-        // Remove the prefix from the path.
-        path.remove(0, prefix.length());
-        }
-
-      // Set the page on the container object.
-      container->setPage(path);
-      }
+    settings->setValue(key, vtkSMPropertyHelper(smproperty).GetAsDouble());
     }
-}
-
-//-----------------------------------------------------------------------------
-void PVGUI_ParaViewSettingsPane::pluginLoaded(QObject* iface)
-{
-  pqViewOptionsInterface* viewOptions =
-    qobject_cast<pqViewOptionsInterface*>(iface);
-  if (viewOptions)
+  else if (smproperty->IsA("vtkSMStringVectorProperty"))
     {
-    foreach(QString viewtype, viewOptions->viewTypes())
-      {
-      // Try to create global view options
-      pqOptionsContainer* globalOptions =
-        viewOptions->createGlobalViewOptions(viewtype, this);
-      if (globalOptions)
-        {
-        this->addOptions(globalOptions);
-        }
-      }
+    settings->setValue(key, vtkSMPropertyHelper(smproperty).GetAsString());
     }
 }
 
-void PVGUI_ParaViewSettingsPane::store(QtxResourceMgr* , QtxPreferenceMgr* )
-{
-  applyChanges();
-}
-
-void PVGUI_ParaViewSettingsPane::retrieve(QtxResourceMgr* , QtxPreferenceMgr* )
-{
-}
-
index a0fcc0d9e48b78cf5e8157b6926ac3b877845b64..31729139da5d888160419a07ad39e758ba3716c2 100644 (file)
 
 #include <QtxPagePrefMgr.h>
 
-#include <QWidget>
-
-#include "vtkPVConfig.h"
-
-class pqOptionsContainer;
-class OptionsDialogForm;
-class pqOptionsPage;
-class QString;
-
-
+class QAbstractButton;
+class vtkSMProperty;
+class QShowEvent;
+class QHideEvent;
+
+/**!
+ * Almost identical copy/paste of what is found in
+ *    <PARAVIEW>/Qt/Components/pqSettingsDialog.h
+ * This is (almost) the same, except for the inheritance to QtxUserDefinedContent providing the link
+ * to SALOME preference mechanism.
+ * The UI content of pqSettingsDialog is put in a (PARAVIS) widget called pqCustomSettingsWidget.
+ */
 class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent
 {
   Q_OBJECT
@@ -46,78 +48,45 @@ public:
   PVGUI_ParaViewSettingsPane(QWidget *parent=0);
   virtual ~PVGUI_ParaViewSettingsPane();
 
-  /// \brief
-  ///   Gets whether or not there are changes to apply.
-  /// \return
-  ///   True if there are changes to apply.
-  //bool isApplyNeeded() const;
-
-  /// \brief
-  ///   Sets whether or not there are changes to apply.
-  /// \param applyNeeded True if there are changes to apply.
-  //void setApplyNeeded(bool applyNeeded);
-
-  /// \brief
-  ///   Adds a page to the options dialog.
-  ///
-  /// When the options object is a page container, the path parameter
-  /// becomes the path prefix for the container pages.
-  ///
-  /// \param path The name hierarchy for the options page.
-  /// \param options The options page.
-  void addOptions(const QString &path, pqOptionsPage *options);
-
-  /// \brief
-  ///   Adds a container to the options dialog.
-  ///
-  /// Each page listed for the container is added to the root of the
-  /// selection tree.
-  ///
-  /// \param options The options container to add.
-  void addOptions(pqOptionsContainer *options);
-
-  /// \brief
-  ///   Removes the options page from the options dialog.
-  ///
-  /// The page name is removed from the selection tree. If the page
-  /// is an options container, all the names are removed.
-  ///
-  /// \param options The options page/container to remove.
-  void removeOptions(pqOptionsPage *options);
-
   /// Implementation of QtxUserDefinedContent interface
   virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
   virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
 
+  signals:
+    void accepted(); // emulate the initial QDialogBox signal since some stuff are connected to it.
 
-public slots:
-  /// \brief
-  ///   Sets the current options page.
-  /// \param path The name of the options page to show.
-  void setCurrentPage(const QString &path);
+protected:
+    virtual void showEvent(QShowEvent * ev);
+    virtual void hideEvent(QHideEvent * ev);
 
-  /// Calls each page to apply any changes.
-  void applyChanges();
+  // ---- From now on, this the same interface as in pqSettingsDialog
+  private slots:
+    void clicked(QAbstractButton*);
+    void onAccepted();
+    void onRejected();
+    void onRestoreDefaults();
 
-  /// Calls each page to reset any changes.
-  void resetChanges();
+    void onTabIndexChanged(int index);
+    void onChangeAvailable();
+    void showRestartRequiredMessage();
 
-signals:
-  /// Emitted before the option changes are applied.
-  void aboutToApplyChanges();
+    void filterPanelWidgets();
 
-  /// Emitted after the option changes have been applied.
-  void appliedChanges();
+  signals:
+    void filterWidgets(bool showAdvanced, const QString& text);
 
-protected slots:
-  void pluginLoaded(QObject* plugin_interface);
+  private:
+    void saveInQSettings(const char* key, vtkSMProperty* smproperty);
 
-private slots:
-  /// Changes the current page to match the user selection.
-  void changeCurrentPage();
+  private:
+    Q_DISABLE_COPY(PVGUI_ParaViewSettingsPane);
+    class pqInternals;
+    pqInternals* Internals;
 
-private:
-  OptionsDialogForm *Form; /// Stores the form and class data.
+    /// Set to true if a setting that requires a restart to take effect
+    /// is modified. Made static to persist across instantiations of
+    /// this class.
+    static bool ShowRestartRequired;
 };
 
 #endif
diff --git a/src/PVGUI/resources/pqCustomSettingsWidget.ui b/src/PVGUI/resources/pqCustomSettingsWidget.ui
new file mode 100644 (file)
index 0000000..af91e80
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CustomSettingsWidget</class>
+ <widget class="QWidget" name="CustomSettingsWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>681</width>
+    <height>599</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="SearchBoxLayout">
+     <property name="spacing">
+      <number>2</number>
+     </property>
+     <item>
+      <widget class="pqSearchBox" name="SearchBox" native="true">
+       <property name="settingKey" stdset="0">
+        <string notr="true">pqSettingsDialog/showAdvancedProperties</string>
+       </property>
+       <property name="advancedSearchEnabled" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QTabBar" name="tabBar" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QStackedWidget" name="stackedWidget">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="page"/>
+     <widget class="QWidget" name="page_2"/>
+    </widget>
+   </item>
+   <item>
+    <widget class="QLabel" name="restartRequiredLabel">
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>20</height>
+      </size>
+     </property>
+     <property name="font">
+      <font>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
+     <property name="text">
+      <string>* Restart required for some settings to take effect</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QTabBar</class>
+   <extends>QWidget</extends>
+   <header location="global">QTabBar</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>pqSearchBox</class>
+   <extends>QWidget</extends>
+   <header>pqSearchBox.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/PVGUI/ui_pqOptionsDialog.h b/src/PVGUI/ui_pqOptionsDialog.h
deleted file mode 100644 (file)
index 638f7b7..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/********************************************************************************
-** Form generated from reading ui file 'pqOptionsDialog.ui'
-**
-** Created: Wed Apr 21 12:59:58 2010
-**      by: Qt User Interface Compiler version 4.5.3
-**
-** WARNING! All changes made in this file will be lost when recompiling ui file!
-********************************************************************************/
-
-#ifndef UI_PQOPTIONSDIALOG_H
-#define UI_PQOPTIONSDIALOG_H
-
-#include <QtCore/QVariant>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QDialog>
-#include <QtGui/QFrame>
-#include <QtGui/QGridLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QHeaderView>
-#include <QtGui/QPushButton>
-#include <QtGui/QSpacerItem>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QTreeView>
-#include <QtGui/QWidget>
-
-QT_BEGIN_NAMESPACE
-
-class Ui_pqOptionsFrame
-{
-public:
-    QGridLayout *gridLayout;
-    QHBoxLayout *hboxLayout;
-    QSpacerItem *spacerItem;
-    //QPushButton *ApplyButton;
-    //QPushButton *ResetButton;
-    //QPushButton *CloseButton;
-    QStackedWidget *Stack;
-    QWidget *BlankPage;
-    QTreeView *PageNames;
-    QFrame *Separator;
-
-    void setupUi(QWidget *pqOptionsFrame)
-    {
-        if (pqOptionsFrame->objectName().isEmpty())
-            pqOptionsFrame->setObjectName(QString::fromUtf8("pqOptionsFrame"));
-        pqOptionsFrame->resize(514, 382);
-        gridLayout = new QGridLayout(pqOptionsFrame);
-#ifndef Q_OS_MAC
-        gridLayout->setSpacing(6);
-#endif
-#ifndef Q_OS_MAC
-        gridLayout->setMargin(9);
-#endif
-        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
-        hboxLayout = new QHBoxLayout();
-#ifndef Q_OS_MAC
-        hboxLayout->setSpacing(6);
-#endif
-        hboxLayout->setMargin(4);
-        hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
-        spacerItem = new QSpacerItem(0, 26, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
-        hboxLayout->addItem(spacerItem);
-
-        //ApplyButton = new QPushButton(pqOptionsFrame);
-        //ApplyButton->setObjectName(QString::fromUtf8("ApplyButton"));
-
-        //hboxLayout->addWidget(ApplyButton);
-
-        //ResetButton = new QPushButton(pqOptionsFrame);
-        //ResetButton->setObjectName(QString::fromUtf8("ResetButton"));
-
-        //hboxLayout->addWidget(ResetButton);
-
-        //CloseButton = new QPushButton(pqOptionsFrame);
-        //CloseButton->setObjectName(QString::fromUtf8("CloseButton"));
-        //CloseButton->setDefault(true);
-
-        //hboxLayout->addWidget(CloseButton);
-
-
-        gridLayout->addLayout(hboxLayout, 2, 0, 1, 2);
-
-        Stack = new QStackedWidget(pqOptionsFrame);
-        Stack->setObjectName(QString::fromUtf8("Stack"));
-        BlankPage = new QWidget();
-        BlankPage->setObjectName(QString::fromUtf8("BlankPage"));
-        Stack->addWidget(BlankPage);
-
-        gridLayout->addWidget(Stack, 0, 1, 1, 1);
-
-        PageNames = new QTreeView(pqOptionsFrame);
-        PageNames->setObjectName(QString::fromUtf8("PageNames"));
-        QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(7));
-        sizePolicy.setHorizontalStretch(0);
-        sizePolicy.setVerticalStretch(0);
-        sizePolicy.setHeightForWidth(PageNames->sizePolicy().hasHeightForWidth());
-        PageNames->setSizePolicy(sizePolicy);
-        PageNames->setMinimumSize(QSize(160, 0));
-        PageNames->setMaximumSize(QSize(160, 16777215));
-
-        gridLayout->addWidget(PageNames, 0, 0, 1, 1);
-
-        Separator = new QFrame(pqOptionsFrame);
-        Separator->setObjectName(QString::fromUtf8("Separator"));
-        Separator->setFrameShape(QFrame::HLine);
-        Separator->setFrameShadow(QFrame::Sunken);
-
-        gridLayout->addWidget(Separator, 1, 0, 1, 2);
-
-        //QWidget::setTabOrder(CloseButton, PageNames);
-        //QWidget::setTabOrder(PageNames, ApplyButton);
-        //QWidget::setTabOrder(ApplyButton, ResetButton);
-
-        retranslateUi(pqOptionsFrame);
-
-        Stack->setCurrentIndex(0);
-
-
-        QMetaObject::connectSlotsByName(pqOptionsFrame);
-    } // setupUi
-
-    void retranslateUi(QWidget *pqOptionsFrame)
-    {
-        pqOptionsFrame->setWindowTitle(QApplication::translate("pqOptionsFrame", "Options", 0, QApplication::UnicodeUTF8));
-        //ApplyButton->setText(QApplication::translate("pqOptionsFrame", "&Apply", 0, QApplication::UnicodeUTF8));
-        //ResetButton->setText(QApplication::translate("pqOptionsFrame", "&Reset", 0, QApplication::UnicodeUTF8));
-        //CloseButton->setText(QApplication::translate("pqOptionsFrame", "&Ok", 0, QApplication::UnicodeUTF8));
-#ifndef QT_NO_WHATSTHIS
-        PageNames->setWhatsThis(QApplication::translate("pqOptionsFrame", "Select a category to show the options for that category.", 0, QApplication::UnicodeUTF8));
-#endif // QT_NO_WHATSTHIS
-        Q_UNUSED(pqOptionsFrame);
-    } // retranslateUi
-
-};
-
-namespace Ui {
-    class pqOptionsFrame: public Ui_pqOptionsFrame {};
-} // namespace Ui
-
-QT_END_NAMESPACE
-
-#endif // UI_PQOPTIONSDIALOG_H
index cba2bb54415180eecec32602a90d4fdebe6eb1c9..52b6e529985881572ce5cfbeb7a55d8c442df4df 100755 (executable)
@@ -27,11 +27,8 @@ IF(WIN32)
 ENDIF() 
 
 SET(_subdirs
-  #Filter 
-  #ToolBar 
   MEDReader 
-  TableReader 
-  NavigationMode 
+#  TableReader  
   ElevationSurface
   ScaleVector
   EllipseBuilder
diff --git a/src/Plugins/Filter/CMakeLists.txt b/src/Plugins/Filter/CMakeLists.txt
deleted file mode 100755 (executable)
index af2a820..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# create a paraview plugin containing server manager xml and the server
-# manager classes to build
-# this plugin can be loaded on the server side
-
-ADD_PARAVIEW_PLUGIN(SMSampleFilter "1.0"
-  SERVER_MANAGER_XML SampleFilter.xml 
-  SERVER_MANAGER_SOURCES vtkMySampleFilter.cxx)
-
-INSTALL(
-       TARGETS SMSampleFilter 
-       DESTINATION lib/paraview
-)
diff --git a/src/Plugins/Filter/SampleFilter.xml b/src/Plugins/Filter/SampleFilter.xml
deleted file mode 100755 (executable)
index 9d7d4ca..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<ServerManagerConfiguration>
-  <ProxyGroup name="filters">
-   <SourceProxy name="SampleFilter" class="vtkMySampleFilter" label="SampleFilter">
-     <Documentation
-        long_help="Long help"
-        short_help="Short help">
-Documentation text
-     </Documentation>
-     <InputProperty
-        name="Input"
-        command="SetInputConnection">
-           <ProxyGroupDomain name="groups">
-             <Group name="sources"/>
-             <Group name="filters"/>
-           </ProxyGroupDomain>
-           <DataTypeDomain name="input_type">
-             <DataType value="vtkDataSet"/>
-           </DataTypeDomain>
-      </InputProperty>
-   </SourceProxy>
- </ProxyGroup>
-</ServerManagerConfiguration>
-
diff --git a/src/Plugins/Filter/vtkMySampleFilter.cxx b/src/Plugins/Filter/vtkMySampleFilter.cxx
deleted file mode 100644 (file)
index 3acb9f4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "vtkMySampleFilter.h"
-
-#include <vtkObjectFactory.h>
-
-//vtkCxxRevisionMacro(vtkMySampleFilter, "$Revision$");
-vtkStandardNewMacro(vtkMySampleFilter);
-
-//----------------------------------------------------------------------------
-vtkMySampleFilter::vtkMySampleFilter()
-{
-}
-
-//----------------------------------------------------------------------------
-vtkMySampleFilter::~vtkMySampleFilter()
-{
-}
-
-//----------------------------------------------------------------------------
-void vtkMySampleFilter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-}
-
diff --git a/src/Plugins/Filter/vtkMySampleFilter.h b/src/Plugins/Filter/vtkMySampleFilter.h
deleted file mode 100644 (file)
index a13a6c4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef __vtkMySampleFilter_h
-#define __vtkMySampleFilter_h
-
-#include <vtkExtractEdges.h>
-
-class vtkMySampleFilter : public vtkExtractEdges
-{
-public:
-  static vtkMySampleFilter* New();
-  vtkTypeMacro(vtkMySampleFilter, vtkExtractEdges);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-protected:
-  vtkMySampleFilter();
-  ~vtkMySampleFilter();
-
-private:
-  vtkMySampleFilter(const vtkMySampleFilter&);  // Not implemented.
-  void operator=(const vtkMySampleFilter&);  // Not implemented.
-};
-
-#endif
diff --git a/src/Plugins/NavigationMode/CMakeLists.txt b/src/Plugins/NavigationMode/CMakeLists.txt
deleted file mode 100644 (file)
index 7742acc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# NavigationMode plugin.
-# This is auto-start plugin providing navigation
-# mode in 3D viewer in Post-Pro style.
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
-if(COMMAND cmake_policy)
-    cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
-
-project(NavigationMode)
-
-# Find ParaView
-FIND_PACKAGE(ParaView REQUIRED)
-if(NOT ParaView_FOUND)
-    MESSAGE(FATAL_ERROR "Please locate ParaView." )
-ENDIF(NOT ParaView_FOUND)
-INCLUDE(${PARAVIEW_USE_FILE})
-
-# Standard CMake option for building libraries shared or static by default.
-OPTION(BUILD_SHARED_LIBS
-       "Build with shared libraries."
-       ${VTK_BUILD_SHARED_LIBS})
-
-QT4_WRAP_CPP(MOC_SRCS pqSetModeStarter.h)
-
-ADD_PARAVIEW_AUTO_START(IFACES IFACE_SRCS CLASS_NAME pqSetModeStarter
-                        STARTUP onStartup)
-
-ADD_PARAVIEW_PLUGIN(NavigationMode "1.0" 
-                    GUI_INTERFACES ${IFACES} 
-                    SOURCES pqSetModeStarter.cxx ${MOC_SRCS} ${RCS_SRCS} ${IFACE_SRCS})
-
-# Install
-INSTALL(
-    TARGETS NavigationMode
-    RUNTIME DESTINATION lib/paraview
-    LIBRARY DESTINATION lib/paraview
-    ARCHIVE DESTINATION lib/paraview
-)
\ No newline at end of file
diff --git a/src/Plugins/NavigationMode/pqSetModeStarter.cxx b/src/Plugins/NavigationMode/pqSetModeStarter.cxx
deleted file mode 100644 (file)
index 59553fe..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "pqSetModeStarter.h"
-
-#include <pqServerManagerModel.h>
-
-#include <pqApplicationCore.h>
-#include <pqRenderView.h>
-#include <pqSettings.h>
-
-
-//-----------------------------------------------------------------------------
-pqSetModeStarter::pqSetModeStarter(QObject* p/*=0*/)
-: QObject(p)
-{
-}
-
-//-----------------------------------------------------------------------------
-pqSetModeStarter::~pqSetModeStarter()
-{
-}
-
-
-//-----------------------------------------------------------------------------
-void pqSetModeStarter::onStartup()
-{
-  this->setStandardMode();
-}
-
-//-----------------------------------------------------------------------------
-void pqSetModeStarter::setStandardMode()
-{
-  pqSettings* settings = pqApplicationCore::instance()->settings();
-  settings->beginGroup("renderModule");
-  if (!settings->contains("InteractorStyle/CameraManipulators")) {
-    // Set Post-Pro-like settings
-    QStringList strs;
-    pqRenderView::ManipulatorType manips[9];
-    const pqRenderView::ManipulatorType* default3DManips = pqRenderView::getDefault3DManipulatorTypes();
-
-    // Copy default settings, make changes for Ctrl+MB and MB modes
-    for(int i=0; i<9; i++)
-    {
-      manips[i] = default3DManips[i];
-
-      // Ctrl+MB
-      if (manips[i].Shift == 0 && manips[i].Control == 1) {
-        if (manips[i].Mouse == 1)
-          manips[i].Name = QByteArray("Zoom");
-        else  if (manips[i].Mouse == 2)
-          manips[i].Name = QByteArray("Pan");
-        else  if (manips[i].Mouse == 3)
-          manips[i].Name = QByteArray("Rotate");
-      }
-
-      // MB only
-      if (manips[i].Shift == 0 && manips[i].Control == 0) {
-        if (manips[i].Mouse == 1)
-          manips[i].Name = QByteArray("Rotate");
-        else  if (manips[i].Mouse == 2)
-          manips[i].Name = QByteArray("Pan");
-        else  if (manips[i].Mouse == 3)
-          manips[i].Name = QByteArray("Zoom");
-      }
-    }
-
-    // Save settings
-    for(int i=0; i<9; i++)
-    {
-      strs << QString("Manipulator%1Mouse%2Shift%3Control%4Name%5")
-        .arg(i+1)
-        .arg(manips[i].Mouse)
-        .arg(manips[i].Shift)
-        .arg(manips[i].Control)
-        .arg(QString(manips[i].Name));
-    }
-
-    settings->setValue("InteractorStyle/CameraManipulators", strs);
-  }
-  settings->endGroup();
-
-  // Loop through render views and apply the settings
-  QList<pqRenderViewBase*> views =
-      pqApplicationCore::instance()->getServerManagerModel()->
-      findItems<pqRenderViewBase*>();
-
-  foreach(pqRenderViewBase* view, views) {
-    view->restoreSettings(true);
-  }
-}
diff --git a/src/Plugins/NavigationMode/pqSetModeStarter.h b/src/Plugins/NavigationMode/pqSetModeStarter.h
deleted file mode 100644 (file)
index 098446f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef __pqSetModeStarter_h 
-#define __pqSetModeStarter_h
-
-#include <QObject>
-
-class pqSetModeStarter : public QObject
-{
-  Q_OBJECT
-  typedef QObject Superclass;
-public:
-  pqSetModeStarter(QObject* p=0);
-  ~pqSetModeStarter();
-
-  // Callback for startup.
-  void onStartup();
-
-  // Callback for shutdown.
-  void shutdown() {}
-
-private:
-  void setStandardMode();
-
-private:
-  pqSetModeStarter(const pqSetModeStarter&); // Not implemented.
-  void operator=(const pqSetModeStarter&); // Not implemented.
-};
-
-#endif
-
-
diff --git a/src/Plugins/ToolBar/CMakeLists.txt b/src/Plugins/ToolBar/CMakeLists.txt
deleted file mode 100755 (executable)
index af3d1f4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# create a plugin that implements a sample toolbar action
-
-QT4_WRAP_CPP(MOC_SRCS MyToolBarActions.h)
-
-# we implement a pqConePanel.h for the ConeSource
-ADD_PARAVIEW_ACTION_GROUP(IFACES IFACE_SRCS CLASS_NAME MyToolBarActions 
-                          GROUP_NAME "ToolBar/MyActions")
-
-# create a plugin for this panel
-ADD_PARAVIEW_PLUGIN(GUISampleToolBar "1.0" 
-                    GUI_INTERFACES ${IFACES} 
-                    SOURCES MyToolBarActions.cxx ${MOC_SRCS} ${IFACE_SRCS})
-
-INSTALL(
-       TARGETS GUISampleToolBar 
-       DESTINATION lib/paraview
-)
diff --git a/src/Plugins/ToolBar/MyToolBarActions.cxx b/src/Plugins/ToolBar/MyToolBarActions.cxx
deleted file mode 100755 (executable)
index 201842f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "MyToolBarActions.h"
-
-#include <QApplication>
-#include <QStyle>
-#include <QMessageBox>
-
-MyToolBarActions::MyToolBarActions(QObject* p)
-  : QActionGroup(p)
-{
-  QIcon icon = qApp->style()->standardIcon(QStyle::SP_MessageBoxCritical);
-
-  QAction* a = this->addAction(new QAction(icon, "MyAction", this));
-  QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(onAction()));
-}
-
-MyToolBarActions::~MyToolBarActions()
-{
-}
-
-void MyToolBarActions::onAction()
-{
-  QMessageBox::information(NULL, "MyAction", "MyAction was invoked\n");
-}
-
diff --git a/src/Plugins/ToolBar/MyToolBarActions.h b/src/Plugins/ToolBar/MyToolBarActions.h
deleted file mode 100755 (executable)
index f641299..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <QActionGroup>
-
-class MyToolBarActions : public QActionGroup
-{
-  Q_OBJECT
-public:
-  MyToolBarActions(QObject* p);
-  ~MyToolBarActions();
-
-public slots:
-  void onAction();
-
-};
-