Salome HOME
Merge changes from 'master' branch.
authorrnv <rnv@opencascade.com>
Mon, 25 Dec 2017 15:51:30 +0000 (18:51 +0300)
committerrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 13:33:47 +0000 (16:33 +0300)
110 files changed:
CMakeLists.txt
SalomeGUIConfig.cmake.in
bin/gui_setenv.py
src/CASCatch/CASCatch_Failure.cxx
src/CASCatch/CASCatch_Failure.hxx
src/DDS/DDS.h
src/DDS/DDS_DicGroup.cxx
src/DDS/DDS_DicGroup.h
src/DDS/DDS_DicItem.cxx
src/DDS/DDS_DicItem.h
src/DDS/DDS_Dictionary.cxx
src/DDS/DDS_Dictionary.h
src/DDS/DDS_KeyWords.cxx
src/DDS/DDS_KeyWords.h
src/GUI_PY/CMakeLists.txt
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_DataModel.cxx
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts
src/OBJECT/SALOME_AISObject.cxx
src/OBJECT/SALOME_AISObject.hxx
src/OBJECT/SALOME_AISShape.cxx
src/OBJECT/SALOME_AISShape.hxx
src/OBJECT/SALOME_Filter.cxx
src/OBJECT/SALOME_Filter.hxx
src/OBJECT/SALOME_InteractiveObject.cxx
src/OBJECT/SALOME_InteractiveObject.hxx
src/OBJECT/SALOME_TypeFilter.cxx
src/OBJECT/SALOME_TypeFilter.hxx
src/OCCViewer/OCCViewer_AISSelector.cxx
src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx
src/OCCViewer/OCCViewer_ClippingDlg.cxx
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx
src/OCCViewer/OCCViewer_CubeAxesDlg.cxx
src/OCCViewer/OCCViewer_EnvTextureDlg.cxx
src/OCCViewer/OCCViewer_EnvTextureDlg.h
src/OCCViewer/OCCViewer_Trihedron.cxx
src/OCCViewer/OCCViewer_Trihedron.h
src/OCCViewer/OCCViewer_Utilities.cxx
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_ViewFrame.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewPort.cxx
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/resources/OCCViewer_msg_fr.ts
src/PVViewer/CMakeLists.txt
src/PVViewer/PVViewer_Behaviors.cxx
src/PVViewer/PVViewer_Core.cxx
src/PVViewer/PVViewer_InitSingleton.cxx [new file with mode: 0644]
src/PVViewer/PVViewer_InitSingleton.h [new file with mode: 0644]
src/PVViewer/PVViewer_ViewManager.cxx
src/PVViewer/PVViewer_ViewWindow.cxx
src/PVViewer/resources/ParaViewFilters.xml
src/PVViewer/resources/ParaViewSources.xml
src/Prs/SALOME_Prs.h
src/PyViewer/resources/PyViewer_msg_fr.ts
src/PyViewer/resources/PyViewer_msg_ja.ts
src/Qtx/Qtx.cxx
src/Qtx/Qtx.h
src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt
src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SUITApp/SUITApp.cxx
src/SVTK/CMakeLists.txt
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_Actor.cxx
src/SVTK/SVTK_Actor.h
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_Hash.h [new file with mode: 0644]
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_Selector.cxx
src/SVTK/SVTK_Selector.h
src/SVTK/SVTK_SelectorDef.h
src/SalomeApp/SalomeApp_Engine_i.cxx
src/SalomeApp/SalomeApp_Engine_i.h
src/SalomeApp/SalomeApp_ExceptionHandler.cxx
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/pluginsdemo/CMakeLists.txt
src/Session/SALOME_Session_Server.cxx
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_Filter.cxx
src/VTKViewer/VTKViewer_Filter.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_OpenGLRenderer.cxx
src/ViewerData/ViewerData_AISShape.cxx
src/ViewerData/ViewerData_AISShape.hxx
tools/CMakeLists.txt
tools/PyConsole/src/PyConsole.h
tools/PyConsole/src/resources/PyConsole_msg_fr.ts
tools/PyEditor/src/resources/translations/PyEditor_msg_fr.ts
tools/PyEditor/src/resources/translations/PyEditor_msg_ja.ts
tools/RemoteFileBrowser/CMakeLists.txt [new file with mode: 0644]
tools/RemoteFileBrowser/QMachineBrowser [new file with mode: 0644]
tools/RemoteFileBrowser/QMachineBrowser.cxx [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteCopyWidget [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteCopyWidget.cxx [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteFileBrowser [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteFileBrowser.cxx [new file with mode: 0644]
tools/RemoteFileBrowser/remotefilebrowser.cxx [new file with mode: 0644]
tools/vtkEDFOverloads/CMakeLists.txt [deleted file]
tools/vtkEDFOverloads/vtkEDFCutter.cxx [deleted file]
tools/vtkEDFOverloads/vtkEDFCutter.h [deleted file]
tools/vtkEDFOverloads/vtkEDFFactory.cxx [deleted file]
tools/vtkEDFOverloads/vtkEDFFactory.h [deleted file]
tools/vtkEDFOverloads/vtkEDFOverloadsDefines.h [deleted file]

index 087ee04b91d480514bdc65e8d8dd4cd5e240f501..e307c8a94702893fedbb5a19587a03f419f91cab 100755 (executable)
@@ -33,7 +33,7 @@ ENDIF(WIN32)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
@@ -279,8 +279,6 @@ SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME
 SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
 
 # Specific to GUI:
-SET(SALOME_GUI_INSTALL_PARAVIEW_LIBS lib/paraview CACHE PATH 
-    "Install path: SALOME GUI ParaView libraries")
 SET(SALOME_GUI_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/gui" CACHE PATH 
     "Install path: SALOME GUI specific data")
 SET(SALOME_GUI_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/gui" CACHE PATH 
@@ -292,15 +290,14 @@ MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SAL
 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
 MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS  SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
 MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
-MARK_AS_ADVANCED(SALOME_GUI_INSTALL_PARAVIEW_LIBS SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS)
+MARK_AS_ADVANCED(SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS)
 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
 
 # Accumulate environment variables for GUI module
 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
-SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}
-                                                      ${CMAKE_INSTALL_PREFIX}/${SALOME_GUI_INSTALL_PARAVIEW_LIBS}) 
+SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) 
                                               
 # Sources 
 # ========
@@ -355,7 +352,7 @@ ENDIF(SALOME_USE_GLVIEWER)
 # VTK specific targets:
 IF(SALOME_USE_VTKVIEWER)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
-       VTKViewer vtkTools vtkEDFOverloads)
+       VTKViewer )
   IF(SALOME_USE_SALOMEOBJECT)
     LIST(APPEND _${PROJECT_NAME}_exposed_targets 
          SVTK)
index bcd7e3c247329d57e9720a2d67d0299b667f95aa..efe54f5a13d05edc4002750cb6b3ecff9dd5c510 100644 (file)
@@ -228,7 +228,6 @@ SET(GUI_ViewerData ViewerData)
 SET(GUI_VTKViewer VTKViewer)
 SET(GUI_PVViewer PVViewer)
 SET(GUI_PVServerService PVServerService)
-SET(GUI_vtkEDFOverloads vtkEDFOverloads)
 SET(GUI_vtkTools vtkTools)
 SET(GUI_SalomeGuiHelpers SalomeGuiHelpers)
 SET(GUI_SalomeTreeData SalomeTreeData)
index 764deddd149c829e446a75b98f79b61e7c8837bc..2b302efa2e69700a1964c2a7b78ecd5f7b7f0510 100644 (file)
@@ -25,16 +25,9 @@ import os, re
 
 def set_env( args ):
     """Add environment required for GUI module"""
-    vtk_overloads_dir = os.path.join( os.getenv( "GUI_ROOT_DIR" ), "lib", "paraview" )
-    dirs = re.split( ":|;", os.getenv( 'VTK_AUTOLOAD_PATH', vtk_overloads_dir ) )
-    if vtk_overloads_dir not in dirs: dirs[0:0] = [vtk_overloads_dir]
-    os.environ['VTK_AUTOLOAD_PATH'] = os.pathsep.join(dirs)
-    #print 'QT_PLUGIN_PATH: ', os.environ['QT_PLUGIN_PATH']
     qt_plugin_dir = os.path.join( os.getenv( "QTDIR" ), "plugins" )
     dirs = re.split( ":|;", os.getenv( 'QT_PLUGIN_PATH', qt_plugin_dir ) )
     if qt_plugin_dir not in dirs: dirs[0:0] = [qt_plugin_dir]
     dirs2 = list(set(dirs))
     os.environ['QT_PLUGIN_PATH'] = os.pathsep.join(dirs2)
-    #print 'QT_PLUGIN_PATH: ', os.environ['QT_PLUGIN_PATH']
-    #print 'QT_QPA_PLATFORM_PLUGIN_PATH: ', os.environ['QT_QPA_PLATFORM_PLUGIN_PATH']
     return
index ecdaf950c4ead06400abe04cfa309a1f2e24ac97..8d34ee2f01faffe5a3dda3a2844563e7a73bf990 100644 (file)
@@ -29,7 +29,7 @@
 #include <Standard_Type.hxx>
 #include <string.h>
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT( CASCatch_Failure, Standard_Transient )
+IMPLEMENT_STANDARD_RTTIEXT(CASCatch_Failure, Standard_Transient)
 
 #ifndef NO_CXX_EXCEPTION
 static Handle(CASCatch_Failure) RaisedError;
index 27c1f6ea6080885049ca181200a51301bf82a807..f8d5954cec931da8ca136da4032e3713c3df20f6 100644 (file)
 #ifndef CASCATCH_FAILURE_HXX
 #define CASCATCH_FAILURE_HXX
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
-DEFINE_STANDARD_HANDLE( CASCatch_Failure, Standard_Transient )
-
 #include <Standard.hxx>
 
 /*!
@@ -53,8 +49,7 @@ Standard_EXPORT static  void Raise(const Standard_CString aMessage = "") ;
 Standard_EXPORT virtual  void Throw() const;public:
 
 public:
-
-  OCCT_DEFINE_STANDARD_RTTIEXT(CASCatch_Failure,Standard_Transient)
+  DEFINE_STANDARD_RTTIEXT(CASCatch_Failure, Standard_Transient)
 
 private: 
 /*!\var myMessage
@@ -64,5 +59,6 @@ Standard_Character* myMessage;
 
 };
 
+DEFINE_STANDARD_HANDLE(CASCatch_Failure, Standard_Transient)
 
 #endif // CASCATCH_FAILURE_HXX
index f2a03e9310f145aaa463eae1b87e263d6a361077..70104b189d7022a1b34811370fabf77bea8b8cda 100644 (file)
 #ifndef DDS_H
 #define DDS_H
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <TCollection_AsciiString.hxx>
-
 #include <NCollection_DefineDataMap.hxx>
 
 #define UNIT_SYSTEM_SI "SI"
index ed5d18e5b338989666209ff03e0ea43bf981c8f8..d4ed520b71a98bdaf7e5d474208882c7823d23c1 100644 (file)
@@ -32,7 +32,7 @@
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, Standard_Transient)
 
 /*!
   \class DDS_DicGroup
@@ -47,7 +47,7 @@ OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, MMgt_TShared)
   \param name group name
 */
 DDS_DicGroup::DDS_DicGroup( const TCollection_AsciiString& name )
-: MMgt_TShared(),
+: Standard_Transient(),
   myName( name ),
   myActiveSystem( UNIT_SYSTEM_SI )
 {
index debefdbe68269c7b021ffeda43efc435f14ff77b..a592657afc76ce5ad81f6796d23802893cd9dd58 100644 (file)
 
 #include "DDS_DicItem.h"
 
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
 #include <TColStd_SequenceOfAsciiString.hxx>
 #include <NCollection_List.hxx>
 
 class LDOM_Element;
 
-DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_DicGroup, Standard_Transient)
 
-class DDS_DicGroup : public MMgt_TShared
+class DDS_DicGroup : public Standard_Transient
 {
 public:
   Standard_EXPORT DDS_DicGroup( const TCollection_AsciiString& );
@@ -89,7 +89,7 @@ private:
   friend class DDS_Dictionary;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(DDS_DicGroup,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(DDS_DicGroup, Standard_Transient)
 };
 
 typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicGroup)> DDS_IndexedDataMapOfDicGroups;
index 2ff1d1c37b071f709a94b946c935e68631bd7252..1d40d4c574c2125822c53d7ab3740a70a046d1fe 100644 (file)
@@ -30,7 +30,7 @@
 #include <UnitsAPI.hxx>
 #include <Units_Dimensions.hxx>
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, Standard_Transient)
 
 /*!
   \class DDS_DicItem
index d3f01a51724d6ed473cf1b41be72bf5d68bdd35c..26dcb53e3c6ea97a2dcdc1b9c28dbe7a6d5e8d84 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "DDS.h"
 
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
 
 #include <TCollection_AsciiString.hxx>
 
@@ -49,7 +49,7 @@ class DDS_Dictionary;
 //  optional  : format, units,
 //              min value, max value, default value.
 
-class DDS_DicItem : public MMgt_TShared
+class DDS_DicItem : public Standard_Transient
 {
 public:
   /*! Enum describes type of datum value */
@@ -253,10 +253,10 @@ private:
   friend class DDS_DicGroup;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(DDS_DicItem,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(DDS_DicItem, Standard_Transient)
 };
 
-DEFINE_STANDARD_HANDLE(DDS_DicItem, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_DicItem, Standard_Transient)
 
 typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicItem)> DDS_IndexedDataMapOfDicItems;
 
index b26dc1e6d9203c48628028180b9ad7f0a01bef58..079bb46475c70597bfae8df9b2532b8984bab576 100644 (file)
@@ -38,7 +38,7 @@
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, Standard_Transient)
 
 Handle(DDS_Dictionary) DDS_Dictionary::myDictionary = Handle(DDS_Dictionary)();
 
@@ -259,7 +259,7 @@ Handle(DDS_Dictionary) DDS_Dictionary::myDictionary = Handle(DDS_Dictionary)();
   Use Get() method instead.
 */
 DDS_Dictionary::DDS_Dictionary()
-: MMgt_TShared()
+: Standard_Transient()
 {
 }
 
index 458f13f0f4b23da76cb54f8b82fb115d0a60b283..3db4752dd87a780d449dc9d9b80d4ea59b7723d0 100644 (file)
 
 #include <LDOMString.hxx>
 
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
 
 class LDOM_Element;
 class TCollection_AsciiString;
 
-DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_Dictionary, Standard_Transient)
 
-class DDS_Dictionary : public MMgt_TShared
+class DDS_Dictionary : public Standard_Transient
 {
 public:
   Standard_EXPORT static Handle(DDS_Dictionary)  Get();
@@ -92,7 +92,7 @@ private:
   static Handle(DDS_Dictionary)                  myDictionary;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(DDS_Dictionary,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(DDS_Dictionary, Standard_Transient)
 };
 
 #endif
index f01c58b5a6e377494a30abb13fe8bd0358c0a964..db9796076b561b66a596bc23118285b86bb67a7f 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "DDS_KeyWords.h"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, Standard_Transient)
 
 /*!
   \class DDS_KeyWords
@@ -87,7 +87,7 @@ OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
   Use Get() method instead.
 */
 DDS_KeyWords::DDS_KeyWords()
-: MMgt_TShared()
+: Standard_Transient()
 {
   SetKeyWord( "D_URI",                "dictionary" );
 
index 62de5d8ff5457c9fea238bef9e76f67d6140594c..137c6efe1054fa1e927f8225b160cc893baaaa19 100644 (file)
 
 #include "DDS.h"
 
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
 
 #include <NCollection_DataMap.hxx>
 
-DEFINE_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_KeyWords, Standard_Transient)
 
 class TCollection_AsciiString;
 
-class DDS_KeyWords : public MMgt_TShared
+class DDS_KeyWords : public Standard_Transient
 {
 public:
   Standard_EXPORT static Handle(DDS_KeyWords) Get();
@@ -53,7 +53,7 @@ private:
   KeyWordMap                                  myKeyWord;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(DDS_KeyWords,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(DDS_KeyWords, Standard_Transient)
 };
 
 #endif
index 098f5b1283e540e420c916ee4cdc799e4a28810b..ed18b1075f44ed4f274be9b9e78182b11213ed22 100755 (executable)
@@ -22,7 +22,7 @@ INCLUDE(UsePyQt)
 # --- resources ---
 
 # uic files / to be processed by pyuic
-SET(_pyuic_files
+SET(_pyuic_FILES
   SelectVarsDialog.ui
   genericdialog.ui
   mytestdialog.ui
@@ -31,7 +31,7 @@ SET(_pyuic_files
 # --- scripts ---
 
 # scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 
 # scripts / static
 SET(_other_SCRIPTS 
@@ -42,6 +42,7 @@ SET(_other_SCRIPTS
   selectvars.py
   dockwidgets.py
 )
+
 SET(_bin_SCRIPTS
   test_dockwidgets.py
 )
@@ -52,11 +53,11 @@ SET(_gen_SCRIPTS
     ${CMAKE_CURRENT_BINARY_DIR}/qtsalome.py
 )
 
-# scripts / to install
-
-SET(_all_SCRIPTS ${_other_SCRIPTS} ${_pyuic_SCRIPTS})
-
 # --- rules ---
 SALOME_INSTALL_SCRIPTS("${_gen_SCRIPTS}" ${SALOME_INSTALL_PYTHON})
-SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
+SALOME_INSTALL_SCRIPTS("${_other_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
 SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA})
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
index c040db4bb5911ec867e9931cc7da43d9571c77d6..a649d14fa51657c8fda32c6e53efc907e91d1b4e 100644 (file)
@@ -244,6 +244,14 @@ static const char* imageEmptyIcon[] = {
 //since the 'toolbar marker' is not unique, find index of first occurrence of the
 //'toolbar marker' in the array and check that next string is name of the toolbar
 
+void LightAppCleanUpAppResources()
+{
+  if ( LightApp_Application::_prefs_ ) {
+    delete LightApp_Application::_prefs_;
+    LightApp_Application::_prefs_ = 0;
+  }
+}
+
 namespace
 {
   int getToolbarMarkerIndex( QByteArray input, const QStringList& aFlags ) {
@@ -429,6 +437,7 @@ LightApp_Application::~LightApp_Application()
   savePreferences();
   delete mySelMgr;
   delete myScreenHelper;
+  myPrefs = 0;
 }
 
 /*!Start application.*/
@@ -1566,7 +1575,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
                            resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ));
     vm->setInteractionStyle( resMgr->integerValue( "3DViewer", "navigation_mode", vm->interactionStyle() ) );
     vm->setProjectionType( resMgr->integerValue( "OCCViewer", "projection_mode", vm->projectionType() ) );
-  #if OCC_VERSION_LARGE > 0x06090000
     vm->setStereoType( resMgr->integerValue( "OCCViewer", "stereo_type", vm->stereoType() ) );
     vm->setAnaglyphFilter( resMgr->integerValue( "OCCViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
     vm->setStereographicFocus( resMgr->integerValue( "OCCViewer", "focus_type", vm->stereographicFocusType() ),
@@ -1577,7 +1585,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     vm->setReverseStereo( resMgr->booleanValue( "OCCViewer", "reverse_stereo", vm->isReverseStereo() ) );
     vm->setVSync( resMgr->booleanValue( "OCCViewer", "enable_vsync", vm->isVSync() ) );
     vm->setQuadBufferSupport( resMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
-  #endif
     vm->setZoomingStyle( resMgr->integerValue( "3DViewer", "zooming_mode", vm->zoomingStyle() ) );
     vm->enablePreselection( resMgr->booleanValue( "OCCViewer", "enable_preselection", vm->isPreselectionEnabled() ) );
     vm->enableSelection(    resMgr->booleanValue( "OCCViewer", "enable_selection",    vm->isSelectionEnabled() ) );
@@ -2113,6 +2120,7 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
   {
     _prefs_ = new LightApp_Preferences( resourceMgr() );
     that->createPreferences( _prefs_ );
+    qAddPostRoutine( LightAppCleanUpAppResources );
   }
 
   that->myPrefs = _prefs_;
@@ -2394,7 +2402,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   anIndicesList << 0                       << 1;
   pref->setItemProperty( "strings", aValuesList,   occProjMode );
   pref->setItemProperty( "indexes", anIndicesList, occProjMode );
-#if OCC_VERSION_LARGE > 0x06090000
+
   // .... -> Stereo group
   int stereoGroup = pref->addPreference( tr( "PREF_GROUP_STEREO" ), occGroup);
   pref->setItemProperty( "columns", 2, stereoGroup );
@@ -2465,7 +2473,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   // .... -> Enable quad-buffer support
   pref->addPreference( tr( "PREF_ENABLE_QUAD_BUFFER_SUPPORT" ), stereoGroup,
                        LightApp_Preferences::Bool, "OCCViewer", "enable_quad_buffer_support" );
-#endif
+
   // ... "Background" group <<start>>
   int bgGroup = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup );
   //  pref->setItemProperty( "columns", 2, bgGroup );
@@ -3240,7 +3248,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     }
   }
 #endif
-#if OCC_VERSION_LARGE > 0x06090000
+
 #ifndef DISABLE_OCCVIEWER
   if ( sec == QString( "OCCViewer" ) && param == QString( "stereo_type" ) )
   {
@@ -3377,7 +3385,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     }
   }
 #endif
-#endif
+
   if ( sec == QString( "3DViewer" ) && param == QString( "zooming_mode" ) )
   {
     int mode = resMgr->integerValue( "3DViewer", "zooming_mode", 0 );
index cc6ce1ea87aa0f2fa02d4a4015bbe6f04cd04339..eaef8331edbf60d1818ab2e9d697d5b196ed8209 100644 (file)
@@ -340,6 +340,8 @@ protected:
   static LightApp_Preferences*        _prefs_;
 
   QStringList                         myUserWmTypes;
+
+  friend void LightAppCleanUpAppResources();
 };
 
 #ifdef WIN32
index ccef46ec0d4e1b8fdcd8b475b6c78c79e8798f87..88a29bdb11ef259ab8078c5c6ca0b5114016d2da 100644 (file)
@@ -110,7 +110,7 @@ void LightApp_DataModel::build()
 void LightApp_DataModel::updateWidgets()
 {
   LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
-  if ( app )
+  if ( app && app->objectBrowser() )
     app->objectBrowser()->updateTree( 0, false );
 }
 
index 6cd92b3d473eea26202ebc7727a79e4d704d5a2b..a26877e5fbfec138573e6f9ef21412d4987df2af 100755 (executable)
@@ -1043,27 +1043,27 @@ Le fichier n&apos;existe pas</translation>
     </message>
     <message>
         <source>PREF_GROUP_PY_EDITOR</source>
-       <translation type="unfinished">Editor settings</translation>
+        <translation>Paramètres de l'éditeur</translation>
     </message>
     <message>
         <source>PREF_PY_COMPLETION_MODE</source>
-       <translation type="unfinished">Completion mode</translation>
+        <translation>Mode de complétion</translation>
     </message>
     <message>
         <source>PREF_PY_NONE</source>
-       <translation type="unfinished">None</translation>
+        <translation>Aucun</translation>
     </message>
     <message>
         <source>PREF_PY_AUTO</source>
-       <translation type="unfinished">Auto</translation>
+        <translation>Auto</translation>
     </message>
     <message>
         <source>PREF_PY_MANUAL</source>
-       <translation type="unfinished">Manual</translation>
+        <translation>Manuel</translation>
     </message>
     <message>
         <source>PREF_PY_ALWAYS</source>
-       <translation type="unfinished">Always</translation>
+        <translation>Toujours</translation>
     </message>
     <message>
         <source>PREF_GROUP_PY_TAB</source>
index 21df7e3660dee743cc3f1f1fd547c192d42ffa2f..52e1f25a335477dac5e530a2aa353476e8a0df48 100644 (file)
@@ -1040,28 +1040,28 @@ Pythonファイルは、文字、数字、アンダースコアが含まれて
       <translation>ライン数エリアの表示</translation>
     </message>
     <message>
-        <source>PREF_GROUP_PY_EDITOR</source>
-       <translation type="unfinished">Editor settings</translation>
+      <source>PREF_GROUP_PY_EDITOR</source>
+      <translation>エディタ設定</translation>
     </message>
     <message>
-        <source>PREF_PY_COMPLETION_MODE</source>
-       <translation type="unfinished">Completion mode</translation>
+      <source>PREF_PY_COMPLETION_MODE</source>
+      <translation>完了モード</translation>
     </message>
     <message>
-        <source>PREF_PY_NONE</source>
-       <translation type="unfinished">None</translation>
+      <source>PREF_PY_NONE</source>
+      <translation>なし</translation>
     </message>
     <message>
-        <source>PREF_PY_AUTO</source>
-       <translation type="unfinished">Auto</translation>
+      <source>PREF_PY_AUTO</source>
+      <translation>自動</translation>
     </message>
     <message>
-        <source>PREF_PY_MANUAL</source>
-       <translation type="unfinished">Manual</translation>
+      <source>PREF_PY_MANUAL</source>
+      <translation>手動</translation>
     </message>
     <message>
-        <source>PREF_PY_ALWAYS</source>
-       <translation type="unfinished">Always</translation>
+      <source>PREF_PY_ALWAYS</source>
+      <translation>常に</translation>
     </message>
     <message>
       <source>PREF_GROUP_PY_TAB</source>
index 64bcbf9c901ac4978b31af785e0f8d8574a925db..82b02f5689cc7c7e494fa2e50f33a17698e54983 100755 (executable)
@@ -22,7 +22,7 @@
 
 #include "SALOME_AISObject.hxx"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
 
 SALOME_AISObject::SALOME_AISObject()
 {
index d30ce8a86ea6b9554bc989c1bd290a43c4c2f7ec..4fea394eef97ef8a9eb76e0a6db54f3e3b280584 100755 (executable)
@@ -42,7 +42,7 @@ public:
   Standard_EXPORT virtual void setName(const Standard_CString aName) = 0;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_AISObject,AIS_InteractiveObject)
+  DEFINE_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
 };
 
 DEFINE_STANDARD_HANDLE(SALOME_AISObject, AIS_InteractiveObject)
index 7be2fd5c321e1cb3f2d1cd3a2001a66fcaa3a788..51f0c90ba3eb9f0326fac18bea11043dc6863e6e 100755 (executable)
@@ -22,7 +22,7 @@
 
 #include "SALOME_AISShape.hxx"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
 
 /*!
   Constructor
index acf22fa61e480753a197b204495f3e46373cd4c5..3c176583477e881d8610aed84dd216f7151b2527 100755 (executable)
@@ -54,7 +54,7 @@ public:
   Standard_EXPORT virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ) = 0;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_AISShape,ViewerData_AISShape)
+  DEFINE_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
 };
 
 DEFINE_STANDARD_HANDLE(SALOME_AISShape, ViewerData_AISShape)
index f52c49bce3871038c7033024597dd8e0e33c5342..f2d9ad7f527349a44d8fac1dd1829549514c1f8c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "SALOME_Filter.hxx"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_Filter, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_Filter, Standard_Transient)
 
 SALOME_Filter::SALOME_Filter()
 {
index 4f1c200cac422cf7d833d7f4aabccea73f29ca2c..1db4f6924e46ae270d2ff43a1d40c3e9d6b1eb70 100644 (file)
 #ifndef SALOME_FILTER_HXX
 #define SALOME_FILTER_HXX
 
-#include <MMgt_TShared.hxx>
 #include <Standard.hxx>
+#include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
 
 #include "SALOME_InteractiveObject.hxx"
 
-class SALOME_Filter : public MMgt_TShared
+class SALOME_Filter : public Standard_Transient
 {
 public:
   Standard_EXPORT SALOME_Filter();
@@ -38,9 +38,9 @@ public:
   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SALOME_InteractiveObject)& anObj) const = 0;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_Filter,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(SALOME_Filter, Standard_Transient)
 };
 
-DEFINE_STANDARD_HANDLE(SALOME_Filter, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(SALOME_Filter, Standard_Transient)
 
 #endif // SALOME_FILTER_HXX
index e357b0b20f49143fd9bde2d852755eae2a433aeb..3fba48c65120eeb0e3c4da93c9349e57de14e1bc 100755 (executable)
@@ -27,7 +27,7 @@
 
 #include "SALOME_InteractiveObject.hxx"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, Standard_Transient)
 
 /*!
   Default constructor
index 95a74fcea8ecadae0f4254b63eb996ac6b341bb5..af2fa716c3ce0137abb242094ad9434435c9b5e9 100755 (executable)
 #ifndef SALOME_INTERACTIVEOBJECT_HXX
 #define SALOME_INTERACTIVEOBJECT_HXX
 
-#include <MMgt_TShared.hxx>
 #include <Standard.hxx>
+#include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <string>
 
 class SALOME_InteractiveObject;
-DEFINE_STANDARD_HANDLE(SALOME_InteractiveObject, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(SALOME_InteractiveObject, Standard_Transient)
 
-class SALOME_InteractiveObject : public MMgt_TShared
+class SALOME_InteractiveObject : public Standard_Transient
 {
 public:
   Standard_EXPORT   SALOME_InteractiveObject();
@@ -71,7 +69,7 @@ protected:
   std::string myReference;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_InteractiveObject,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(SALOME_InteractiveObject, Standard_Transient)
 };
 
 #endif // SALOME_INTERACTIVEOBJECT_HXX
index b4191f10525d41eb5bef00a0eb3b00b20a3011d4..019f3a16ec3949016669589482847f78081080a1 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "SALOME_TypeFilter.hxx"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
 
 /*!
   Constructor
index a9a58f6344c8eeb381a0025d5e8ae56f54f870ed..874607e3c75799d122dba2c4eccb8805611b71dc 100644 (file)
@@ -40,7 +40,7 @@ protected:
   Standard_CString myKind;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_TypeFilter,SALOME_Filter)
+  DEFINE_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
 };
 
 DEFINE_STANDARD_HANDLE(SALOME_TypeFilter, SALOME_Filter)
index 03b001be77f3d132b58c0722ebf9c89001c210f5..831195d872edde0ea3e35649d07da4ff4b18e8e6 100755 (executable)
@@ -22,8 +22,6 @@
 
 #include "OCCViewer_AISSelector.h"
 
-#include <Basics_OCCTVersion.hxx>
-
 /*!
   Constructor
 */
@@ -72,12 +70,8 @@ void OCCViewer_AISSelector::setHilightColor ( Quantity_NameOfColor color )
 {
   myHilightColor = color;
   if ( !myAISContext.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x07000000    
     const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
     hStyle->SetColor( myHilightColor );
-#else
-  myAISContext->SetHilightColor( myHilightColor );
-#endif  
   }
 }
 
@@ -88,12 +82,8 @@ void OCCViewer_AISSelector::setSelectColor ( Quantity_NameOfColor color )
 {
   mySelectColor = color;
   if ( !myAISContext.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x07000000
     const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
     sStyle->SetColor( mySelectColor );
-#else    
-    myAISContext->SelectionColor( mySelectColor );
-#endif
   }
 }
 
@@ -104,15 +94,10 @@ void OCCViewer_AISSelector::setAISContext ( const Handle (AIS_InteractiveContext
 {
   myAISContext = aisContext;
   if ( ! myAISContext.IsNull() ) { 
-#if OCC_VERSION_LARGE > 0x07000000
     const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
     const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
     hStyle->SetColor( myHilightColor );
     sStyle->SetColor( mySelectColor );
-#else
-    myAISContext->SetHilightColor( myHilightColor );
-    myAISContext->SelectionColor( mySelectColor );
-#endif    
     myAISContext->SetSubIntensityColor( Quantity_NOC_CYAN1 );
   }
 }
index a187df5378cc6a47bfe60f566dbef457c2303b66..39d6c0a129dff14d2147199ec185caf6aab20ab1 100644 (file)
@@ -220,10 +220,10 @@ bool OCCViewer_ClipPlaneInteractor::startDragging( const QPoint& thePickPos,
 
   gp_Pnt aPickPoint = aFindPick.Point( 1 );
 
-  const gp_Dir& aPlaneN      = aPlanePln.Axis().Direction();
-  const gp_Dir& aPlaneX      = aPlanePln.XAxis().Direction();
-  const gp_Dir& aPlaneY      = aPlanePln.YAxis().Direction();
-  const gp_Pnt& aPlaneCenter = aPlanePln.Location();
+  gp_Dir aPlaneN      = aPlanePln.Axis().Direction();
+  gp_Dir aPlaneX      = aPlanePln.XAxis().Direction();
+  gp_Dir aPlaneY      = aPlanePln.YAxis().Direction();
+  gp_Pnt aPlaneCenter = aPlanePln.Location();
 
   switch ( theDragOp )
   {
@@ -615,6 +615,7 @@ bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* theEvent,
   myInteractedPlane = NULL;
   myIsDraggable     = false;
   myIsClickable     = false;
+  myViewer->getAISContext()->ClearSelected( Standard_True );
   return true;
 }
 
index 0805a55f9c108d3811903a350ede0ad2eefb2e3f..dc5767654c45874f3e0260d875d2554f2ac3faa1 100644 (file)
@@ -37,8 +37,6 @@
 #include "OCCViewer_ViewManager.h"
 #include "OCCViewer_ClipPlaneInteractor.h"
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <V3d_View.hxx>
 #include <Geom_Plane.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_InteractiveContext.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
-  #include <Prs3d_Drawer.hxx>
-#else
-  #include <AIS_Drawer.hxx>
-#endif
+#include <Prs3d_Drawer.hxx>
 #include <IntAna_IntConicQuad.hxx>
 #include <gp_Lin.hxx>
 #include <gp_Pln.hxx>
@@ -99,7 +93,6 @@ void getMinMaxFromContext( Handle(AIS_InteractiveContext) ic,
       if ( !aPrs->IsEmpty() && !aPrs->IsInfinite() ) {
         isFound = true;
         double xmin, ymin, zmin, xmax, ymax, zmax;
-#if OCC_VERSION_LARGE > 0x06070100
        Bnd_Box aBox = aPrs->MinMaxValues();
        xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
        ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
@@ -107,9 +100,6 @@ void getMinMaxFromContext( Handle(AIS_InteractiveContext) ic,
        xmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
        ymax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
        zmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
-#else
-        aPrs->MinMaxValues( xmin, ymin, zmin, xmax, ymax, zmax );
-#endif
         aXMin = qMin( aXMin, xmin );  aXMax = qMax( aXMax, xmax );
         aYMin = qMin( aYMin, ymin );  aYMax = qMax( aYMax, ymax );
         aZMin = qMin( aZMin, zmin );  aZMax = qMax( aZMax, zmax );
@@ -646,8 +636,10 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parent , OCCV
 
   OCCViewer_ViewManager* aViewMgr = (OCCViewer_ViewManager*) myModel->getViewManager();
   myInteractor = new OCCViewer_ClipPlaneInteractor( aViewMgr, this );
-  connect( myInteractor, SIGNAL( planeClicked( const Handle(AIS_Plane)& ) ), SLOT( onPlaneClicked( const Handle(AIS_Plane)& ) ) );
-  connect( myInteractor, SIGNAL( planeDragged( const Handle(AIS_Plane)& ) ), SLOT( onPlaneDragged( const Handle(AIS_Plane)& ) ) );
+  connect( myInteractor, SIGNAL( planeClicked( const Handle_AIS_Plane& ) ),
+          SLOT( onPlaneClicked( const Handle_AIS_Plane& ) ) );
+  connect( myInteractor, SIGNAL( planeDragged( const Handle_AIS_Plane& ) ),
+          SLOT( onPlaneDragged( const Handle_AIS_Plane& ) ) );
 
   myLocalPlanes = myModel->getClipPlanes();
   synchronize();
index f081f6ed051af00a5910bb2eaf29b11ac2049c50..4c4ae27b09369e94a876730f2088b5ea664ca9ac 100755 (executable)
@@ -129,9 +129,6 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem )
     
     Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
     aView3d->SetScale( myCurrentItem.scale );
-#if OCC_VERSION_LARGE <= 0x06070100
-    aView3d->SetCenter( myCurrentItem.centerX, myCurrentItem.centerY );
-#endif
     aView3d->SetProj( myCurrentItem.projX, myCurrentItem.projY, myCurrentItem.projZ );
     aView3d->SetTwist( myCurrentItem.twist );
     aView3d->SetAt( myCurrentItem.atX, myCurrentItem.atY, myCurrentItem.atZ );
index 8a8c93c28b0bd23e20518fb19a330672dfb02cc2..992e4a5d5f4212ea4a45b4a25077e5f9cbec4958 100644 (file)
 #include "QtxAction.h"
 #include "QtxIntSpinBox.h"
 
-#include <Basics_OCCTVersion.hxx>
-
-#if OCC_VERSION_LARGE > 0x06080000
 #include <Graphic3d_GraduatedTrihedron.hxx>
-#endif
 
 #include <QCheckBox>
 #include <QGroupBox>
@@ -264,7 +260,6 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
     // font support will be introduced in OCC-6.4)
     int aGap = 20;
 
-#if OCC_VERSION_LARGE > 0x06080000
     Graphic3d_GraduatedTrihedron gt;
     // main params
     gt.SetDrawGrid(Standard_True);       // to draw grid
@@ -292,60 +287,6 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
     }
     // draw trihedron
     theView->GraduatedTrihedronDisplay(gt);
-#else
-    theView->GraduatedTrihedronDisplay(
-      anAxisData[0].Name.toLatin1().constData(),
-      anAxisData[1].Name.toLatin1().constData(),
-      anAxisData[2].Name.toLatin1().constData(),
-      anAxisData[0].DrawName,
-      anAxisData[1].DrawName,
-      anAxisData[2].DrawName,
-      anAxisData[0].DrawValues,
-      anAxisData[1].DrawValues,
-      anAxisData[2].DrawValues,
-      Standard_True, // draw grid
-      Standard_False, // draw axes
-      anAxisData[0].NbValues - 1,
-      anAxisData[1].NbValues - 1,
-      anAxisData[2].NbValues - 1,
-      anAxisData[0].Offset,
-      anAxisData[1].Offset,
-      anAxisData[2].Offset,
-      anAxisData[0].Offset + aGap, // see above
-      anAxisData[1].Offset + aGap, // see above
-      anAxisData[2].Offset + aGap, // see above
-      anAxisData[0].DrawTickmarks,
-      anAxisData[1].DrawTickmarks,
-      anAxisData[2].DrawTickmarks,
-      anAxisData[0].TickmarkLength,
-      anAxisData[1].TickmarkLength,
-      anAxisData[2].TickmarkLength,
-      Quantity_NOC_WHITE, // grid color
-      Quantity_Color( anAxisData[0].NameColor.redF(),
-                      anAxisData[0].NameColor.greenF(),
-                      anAxisData[0].NameColor.blueF(),
-                      Quantity_TOC_RGB ),
-      Quantity_Color( anAxisData[1].NameColor.redF(),
-                      anAxisData[1].NameColor.greenF(),
-                      anAxisData[1].NameColor.blueF(),
-                      Quantity_TOC_RGB ),
-      Quantity_Color( anAxisData[2].NameColor.redF(),
-                      anAxisData[2].NameColor.greenF(),
-                      anAxisData[2].NameColor.blueF(),
-                      Quantity_TOC_RGB ),
-      Quantity_Color( anAxisData[0].Color.redF(),
-                      anAxisData[0].Color.greenF(),
-                      anAxisData[0].Color.blueF(),
-                      Quantity_TOC_RGB ),
-      Quantity_Color( anAxisData[1].Color.redF(),
-                      anAxisData[1].Color.greenF(),
-                      anAxisData[1].Color.blueF(),
-                      Quantity_TOC_RGB ),
-      Quantity_Color( anAxisData[2].Color.redF(),
-                      anAxisData[2].Color.greenF(),
-                      anAxisData[2].Color.blueF(),
-                      Quantity_TOC_RGB ) );
-#endif // OCC_VERSION_LARGE > 0x06080000
   }
   else
     theView->GraduatedTrihedronErase();
index b6e952481805b13c31f1469e388c348c3d292202..4ed2aab2e337c0f227505be78a3987395ab8a533 100644 (file)
@@ -169,11 +169,7 @@ void OCCViewer_EnvTextureDlg::onEnvTexture( bool theIsChecked )
     onTextureChanged();
   else {
     Handle(Graphic3d_TextureEnv) aTexture;
-#if OCC_VERSION_LARGE > 0x07000000
     setEnvTexture( aTexture );
-#else
-    setEnvTexture( aTexture, V3d_TEX_ALL );
-#endif
   }
 }
 
@@ -200,11 +196,7 @@ void OCCViewer_EnvTextureDlg::onTextureChanged()
                  << Graphic3d_NOT_ENV_LINES  << Graphic3d_NOT_ENV_ROAD;
     aTexture = new Graphic3d_TextureEnv( aTextures.at( myEnvTextureId->currentIndex() ) );
   }
-#if OCC_VERSION_LARGE > 0x07000000
   setEnvTexture( aTexture );
-#else
-  setEnvTexture( aTexture, V3d_TEX_ENVIRONMENT );
-#endif
 }
 
 /*!
@@ -232,19 +224,12 @@ void OCCViewer_EnvTextureDlg::ClickOnHelp()
 /*!
   Sets current texture environment for all view in the viewer
 */
-#if OCC_VERSION_LARGE > 0x07000000
 void OCCViewer_EnvTextureDlg::setEnvTexture( Handle(Graphic3d_TextureEnv) theTexture)
-#else
-void OCCViewer_EnvTextureDlg::setEnvTexture( Handle(Graphic3d_TextureEnv) theTexture, V3d_TypeOfSurfaceDetail theMode )
-#endif
 {
   for ( int i = OCCViewer_ViewFrame::BOTTOM_RIGHT; i <= OCCViewer_ViewFrame::TOP_RIGHT; i++ ) {
     if ( OCCViewer_ViewWindow* aViewWindow = myViewFrame->getView(i) ) {
       Handle(V3d_View) aView = aViewWindow->getViewPort()->getView();
       aView->SetTextureEnv( theTexture );
-#if OCC_VERSION_LARGE <= 0x07000000
-      aView->SetSurfaceDetail( theMode );
-#endif
       aView->Redraw();
     }
   }
index d06c6798544e7026a16839e6e1695709b2e6f7a2..2580bc12f4da5972a0afeec9f937f636e2e0524e 100644 (file)
@@ -23,7 +23,6 @@
 #include "OCCViewer.h"
 #include <QDialog>
 #include <V3d_View.hxx>
-#include <Basics_OCCTVersion.hxx>
 
 class OCCViewer_ViewWindow;
 class OCCViewer_ViewFrame;
@@ -51,11 +50,7 @@ private slots:
 
 private:
   void initParam();
-#if OCC_VERSION_LARGE > 0x07000000
   void setEnvTexture( Handle(Graphic3d_TextureEnv) );
-#else
-  void setEnvTexture( Handle(Graphic3d_TextureEnv), V3d_TypeOfSurfaceDetail );
-#endif
 
   OCCViewer_ViewFrame* myViewFrame;
   Handle(V3d_View) myView3d;
index d13af530ef417aa3f9362f5dc791fa6722dec3ab..7cce7c2cca5cf44d1f43c228cdf4f4b76cbefc6c 100644 (file)
@@ -49,7 +49,7 @@
 
 #define PI   3.14159265359
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
+IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
 
 /*!
  * Constructor
@@ -72,7 +72,6 @@ OCCViewer_Trihedron::~OCCViewer_Trihedron()
 /*!
  * Sets the bounding box (MinMax values).
  */
-#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
 void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
 {
   Graphic3d_Vec4 aMinPt (-1.f, -1.f, -1.f, 1.f);
@@ -81,20 +80,6 @@ void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
   theMinMax.Add (aMinPt);
   theMinMax.Add (aMaxPt);
 }
-#else
-void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
-{
-  Standard_Real aXMin = -1, aYMin = -1, aZMin = -1;
-  Standard_Real aXMax =  1, aYMax =  1, aZMax =  1;
-
-  if( aMinMax.XMin > aXMin ) aMinMax.XMin = aXMin;
-  if( aMinMax.YMin > aYMin ) aMinMax.YMin = aYMin;
-  if( aMinMax.ZMin > aZMin ) aMinMax.ZMin = aZMin;
-  if( aMinMax.XMax < aXMax ) aMinMax.XMax = aXMax;
-  if( aMinMax.YMax < aYMax ) aMinMax.YMax = aYMax;
-  if( aMinMax.ZMax < aZMax ) aMinMax.ZMax = aZMax;
-}
-#endif
 
 /*!
  * Redefined method. Calculates the object presentation.
index 0618e4f20a88bf49168b81cc897f533f7c3c9e1d..92e7b58760d800a71fcd698e02326dc642d8e276 100644 (file)
 #include "OCCViewer.h"
 
 #include <AIS_InteractiveObject.hxx>
-#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
-  #include <Graphic3d_BndBox4f.hxx>
-#else
-  #include <Graphic3d_CBounds.hxx>
-#endif
+#include <Graphic3d_BndBox4f.hxx>
 #include <Standard_DefineHandle.hxx>
 
 /*!
@@ -48,20 +43,16 @@ public:
   virtual void           ComputeSelection( const Handle( SelectMgr_Selection )&,
                                            const Standard_Integer );
 
-#if OCC_VERSION_LARGE > 0x06070100
   virtual void           bounds( Graphic3d_BndBox4f& ) const;
-#else
-  virtual void           bounds( Graphic3d_CBounds& ) const;
-#endif
 
   virtual void           display();
 
-  OCCT_DEFINE_STANDARD_RTTIEXT(OCCViewer_Trihedron,AIS_InteractiveObject)
+  DEFINE_STANDARD_RTTIEXT(OCCViewer_Trihedron, AIS_InteractiveObject)
 
 private:
   unsigned int           myTextList;
 };
 
-DEFINE_STANDARD_HANDLE( OCCViewer_Trihedron, AIS_InteractiveObject )
+DEFINE_STANDARD_HANDLE(OCCViewer_Trihedron, AIS_InteractiveObject)
 
-#endif
+#endif // OCCVIEWER_TRIHEDRON_H
index e88b2918286405da26f639cb72a66d6fcc3aecbe..9a560d77a6eb92028dcbd3692114b69e62dd14a7 100755 (executable)
 #include "QtxActionToolMgr.h"
 #include "QtxMultiAction.h"
 
-// KERNEL includes
-#include <Basics_OCCTVersion.hxx>
-
 // OCC includes
 #include <V3d_View.hxx>
 #include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
-#if OCC_VERSION_LARGE < 0x07000000
-#include <Visual3d_View.hxx>
-#endif
 
 // QT includes
 #include <QImage>
@@ -52,7 +46,6 @@ Handle(Image_PixMap) OCCViewer_Utilities::imageToPixmap( const QImage& anImage )
     const uchar* aImageBytes = anImage.bits();
       
     for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) {
-#if OCC_VERSION_LARGE > 0x06070100
       // convert pixels from ARGB to renderer-compatible RGBA
       for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
            Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue<Image_ColorBGRA>(aLine, aByte);
@@ -62,18 +55,6 @@ Handle(Image_PixMap) OCCViewer_Utilities::imageToPixmap( const QImage& anImage )
            aPixmapBytes.r() = (Standard_Byte) *aImageBytes++;
            aPixmapBytes.a() = (Standard_Byte) *aImageBytes++;
          }
-#else
-         Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
-       
-      // convert pixels from ARGB to renderer-compatible RGBA
-      for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
-           aPixmapBytes->b() = (Standard_Byte) *aImageBytes++;
-           aPixmapBytes->g() = (Standard_Byte) *aImageBytes++;
-           aPixmapBytes->r() = (Standard_Byte) *aImageBytes++;
-           aPixmapBytes->a() = (Standard_Byte) *aImageBytes++;
-           aPixmapBytes++;
-      }
-#endif
     }
   }
   return aPixmap;
@@ -170,7 +151,6 @@ bool OCCViewer_Utilities::computeVisibleBounds( const Handle(V3d_View) theView,
          aStructure->IsInfinite() || aStructure->CStructure()->IsForHighlight )
       continue;
     double aBounds[6];
-#if OCC_VERSION_LARGE > 0x06070100
     Bnd_Box aBox = aStructure->MinMaxValues();
     aBounds[0] = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
     aBounds[2] = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
@@ -178,10 +158,6 @@ bool OCCViewer_Utilities::computeVisibleBounds( const Handle(V3d_View) theView,
     aBounds[1] = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
     aBounds[3] = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
     aBounds[5] = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
-#else
-    aStructure->MinMaxValues( aBounds[0], aBounds[2], aBounds[4],
-                              aBounds[1], aBounds[3], aBounds[5] );
-#endif
 
     if ( aBounds[0] > -DBL_MAX && aBounds[1] < DBL_MAX &&
          aBounds[2] > -DBL_MAX && aBounds[3] < DBL_MAX &&
index a9cd79fe79c69f26fcd4a61b7acbe1208d0627fd..048b43348b2d0324045206e7da7fdeaf61735bf6 100644 (file)
 #include <V3d_Viewer.hxx>
 #include <V3d_View.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
 #include <OpenGl_GraphicDriver.hxx>
-#else
-#include <Graphic3d.hxx>
-#include <Graphic3d_GraphicDriver.hxx>
-#endif
 #include <Aspect_DisplayConnection.hxx>
 
 #if defined(WIN32)
@@ -71,11 +65,7 @@ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString na
                                                     const Standard_Boolean computedMode,
                                                     const Standard_Boolean defaultComputedMode )
 {
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
   static Handle(OpenGl_GraphicDriver) aGraphicDriver;
-#else
-  static Handle(Graphic3d_GraphicDriver) aGraphicDriver;
-#endif
   if (aGraphicDriver.IsNull())
   {
     Handle(Aspect_DisplayConnection) aDisplayConnection;
@@ -84,25 +74,10 @@ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString na
 #else
     aDisplayConnection = new Aspect_DisplayConnection();
 #endif
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
     aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
-#else
-    aGraphicDriver = Graphic3d::InitGraphicDriver( aDisplayConnection );
-#endif
   }
 
-#if OCC_VERSION_LARGE > 0x07010001
   return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
                         Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD,
                         computedMode, defaultComputedMode );
-  
-#elif OCC_VERSION_LARGE > 0x07000000
-  return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
-                        Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
-                        computedMode, defaultComputedMode );  
-#else
-  return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
-                        Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
-                        computedMode, defaultComputedMode, V3d_TEX_NONE );
-#endif
 }
index 222a292bc4c7dc0b97da84fc91ebfd9a2476b7bc..9656c64b4df07c725aad5d870fd37dd6ebe1f3a2 100644 (file)
@@ -186,9 +186,6 @@ void OCCViewer_ViewFrame::setSubViewParams( OCCViewer_ViewWindow* theView )
 
   // set environment texture parameters
   aView->SetTextureEnv( aMainView->TextureEnv() );
-#if OCC_VERSION_LARGE <= 0x07000000
-  aView->SetSurfaceDetail( aMainView->SurfaceDetail() );
-#endif
 }
 
 void OCCViewer_ViewFrame::splitSubViews()
index 0b0ce6a972ce90068697e07fc09bdc8d91d5bb4a..9de784810e69250fd77e09f0b2327e36216d7cd9 100644 (file)
@@ -37,8 +37,6 @@
 
 #include "ViewerData_AISShape.hxx"
 
-#include <Basics_OCCTVersion.hxx>
-
 #include "QtxActionToolMgr.h"
 #include "QtxBackgroundTool.h"
 
 #include <QDesktopWidget>
 
 #include <AIS_Axis.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
-  #include <Prs3d_Drawer.hxx>
-#else
-  #include <AIS_Drawer.hxx>
-#endif
+#include <Prs3d_Drawer.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
 #include <Graphic3d_Texture2Dmanual.hxx>
 #include <V3d_DirectionalLight.hxx>
 #include <V3d_AmbientLight.hxx>
 
-#if OCC_VERSION_MAJOR < 7
-  #include <Visual3d_View.hxx>
-#endif
-
 /*!
   Get data for supported background modes: gradient types, identifiers and supported image formats
 */
@@ -130,18 +120,16 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
 
   // init selector
   myAISContext = new AIS_InteractiveContext( myV3dViewer );
-#if OCC_VERSION_LARGE > 0x07010100
   myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected)->SetColor( Quantity_NOC_WHITE );
   myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_Selected)->SetColor( Quantity_NOC_WHITE );
-#elif OCC_VERSION_LARGE > 0x07000000
-  const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
-  sStyle->SetColor( Quantity_NOC_WHITE );
-#else
-  myAISContext->SelectionColor( Quantity_NOC_WHITE );
-#endif
   
   // display isoline on planar faces (box for ex.)
   myAISContext->IsoOnPlane( true );
+
+  // create color scale
+  myColorScale = new AIS_ColorScale();
+  myColorScale->SetZLayer( Graphic3d_ZLayerId_TopOSD );
+  myColorScale->SetTransformPersistence( Graphic3d_TransformPers::FromDeprecatedParams( Graphic3d_TMF_2d, gp_Pnt(-1, -1, 0) ) );
   
   /* create trihedron */
   if ( DisplayTrihedron )
@@ -154,13 +142,8 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
     //myTrihedron->SetColor( Col );
     myTrihedron->SetArrowColor( Col.Name() );
     myTrihedron->SetSize(100);
-#if OCC_VERSION_LARGE > 0x06080000
-      Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes();
-      if (drawer->HasOwnDatumAspect()) {
-#else
-      Handle(AIS_Drawer) drawer = myTrihedron->Attributes();
-      if (drawer->HasDatumAspect()) {
-#endif
+    Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes();
+    if (drawer->HasOwnDatumAspect()) {
       Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect();
       daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));
       daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB));
@@ -271,9 +254,6 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     OCCViewer_ViewPort3d* vp3d = view->getViewPort();
     if ( vp3d )
     {
-#if OCC_VERSION_LARGE <= 0x07000000
-      vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
-#endif
       // connect signal from viewport
       connect(vp3d, SIGNAL(vpClosed(OCCViewer_ViewPort3d*)), this, SLOT(onViewClosed(OCCViewer_ViewPort3d*)));
       connect(vp3d, SIGNAL(vpMapped(OCCViewer_ViewPort3d*)), this, SLOT(onViewMapped(OCCViewer_ViewPort3d*)));
@@ -1254,6 +1234,28 @@ void OCCViewer_Viewer::setTransparency( const Handle(AIS_InteractiveObject)& obj
     myV3dViewer->Update();
 }
 
+bool OCCViewer_Viewer::isColorScaleVisible() const
+{
+  return !myColorScale.IsNull() && !myAISContext.IsNull() && myAISContext->IsDisplayed( myColorScale );
+}
+
+void OCCViewer_Viewer::setColorScaleShown( const bool on )
+{
+  if ( myColorScale.IsNull() )
+    return;
+  if ( on )
+  {
+    if ( !myAISContext->IsDisplayed( myColorScale ) )
+      myAISContext->Display( myColorScale, Standard_True );
+    myAISContext->Redisplay( myColorScale, Standard_True, Standard_True );
+  }
+  else
+  {
+    if ( myAISContext->IsDisplayed( myColorScale ) )
+      myAISContext->Erase( myColorScale, Standard_True );
+  }
+}
+
 /*!
   Changes visibility of trihedron to opposite
 */
@@ -1459,7 +1461,6 @@ double OCCViewer_Viewer::computeSceneSize(const Handle(V3d_View)& view3d) const
   double aMaxSide = 0;
   double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
 
-#if OCC_VERSION_LARGE > 0x06070100
   Bnd_Box aBox = view3d->View()->MinMaxValues();
   Xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
   Ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
@@ -1467,9 +1468,6 @@ double OCCViewer_Viewer::computeSceneSize(const Handle(V3d_View)& view3d) const
   Xmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
   Ymax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
   Zmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
-#else
-  view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
-#endif
 
   if ( Xmin != RealFirst() && Ymin != RealFirst() && Zmin != RealFirst() &&
        Xmax != RealLast()  && Ymax != RealLast()  && Zmax != RealLast() )
index 329bb05bd9702c905daf3c8f9859078771af65a2..6e80da203a4445d60673929e59faf2369306c6e0 100755 (executable)
@@ -34,6 +34,7 @@
 #include "SUIT_ViewModel.h"
 
 #include <V3d_View.hxx>
+#include <AIS_ColorScale.hxx>
 #include <AIS_Trihedron.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_ListOfInteractive.hxx>
@@ -111,6 +112,9 @@ public:
   Qtx::BackgroundData             background(int theViewId) const;
   void                            setBackground( int theViewId, const Qtx::BackgroundData& );
 
+  bool                            isColorScaleVisible() const;
+  virtual void                    setColorScaleShown( const bool );
+
   //! returns true if 3d Trihedron in viewer was created
   bool                            trihedronActivated() const { return !myTrihedron.IsNull(); }
 
@@ -138,6 +142,7 @@ public:
 public:
   Handle(V3d_Viewer)              getViewer3d()    const { return myV3dViewer;}
   Handle(AIS_InteractiveContext)  getAISContext()  const { return myAISContext; }
+  Handle(AIS_ColorScale)          getColorScale()  const { return myColorScale; }
   Handle(AIS_Trihedron)           getTrihedron()   const { return myTrihedron; }
 
   int                             getTopLayerId();
@@ -240,7 +245,7 @@ protected slots:
 protected:
 
   Handle(V3d_Viewer)              myV3dViewer;
-
+  Handle(AIS_ColorScale)          myColorScale;
   Handle(AIS_Trihedron)           myTrihedron;
   Handle(AIS_InteractiveContext)  myAISContext;
 
index d0d2ce19d94539ccd0747b8e3d6b41c027cf1920..331e1ac8fd15573f0ab38c376305b934cc3d903b 100755 (executable)
@@ -218,9 +218,7 @@ void OCCViewer_ViewPort::initialize()
   setBackgroundRole( QPalette::NoRole );//NoBackground );
   // set focus policy to threat QContextMenuEvent from keyboard  
   setFocusPolicy( Qt::StrongFocus );
-#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && OCC_VERSION_LARGE < 0x07000000) || QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
   setAttribute( Qt::WA_PaintOnScreen );
-#endif
   setAttribute( Qt::WA_NoSystemBackground );
 }
 
index 784d86c0d1109440f3deeac9841221ed45a5dace..cdf1edfe98781c1d2aaa752d5d7a6589a12f2d45 100755 (executable)
 #include <QApplication>
 #include <QTimer>
 
-#if OCC_VERSION_MAJOR < 7
-  #include <Visual3d_View.hxx>
-#endif
-
-#if OCC_VERSION_LARGE > 0x06070100
 #include <V3d_View.hxx>
-#else
-#include <V3d_PerspectiveView.hxx>
-#include <V3d_OrthographicView.hxx>
-#endif
-
-#if OCC_VERSION_LARGE > 0x07010000
 #include <Quantity_Ratio.hxx>
-#endif
 
 #include "utilities.h"
 
@@ -83,18 +71,7 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V
   // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
   //selectVisualId();
 
-#if OCC_VERSION_LARGE > 0x06070100
   myActiveView = new V3d_View( viewer, type );
-#else
-  if ( type == V3d_ORTHOGRAPHIC ) {
-    myOrthoView = new V3d_OrthographicView( viewer );
-    myActiveView = myOrthoView;
-    myPerspView = 0;
-  } else {
-    myPerspView = new V3d_PerspectiveView( viewer );
-    myActiveView = myPerspView;
-  }
-#endif
 
   setDefaultParams();
 
@@ -240,44 +217,16 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
   refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
   refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
   refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
-#if OCC_VERSION_LARGE <= 0x06070100
-  refView->Center( x, y ); tgtView->SetCenter( x, y );
-#endif
   tgtView->SetScale( refView->Scale() );
   tgtView->SetTwist( refView->Twist() );
 
   /* update */
   tgtView->Update();
   tgtView->SetImmediateUpdate( Standard_True );
-#if OCC_VERSION_LARGE <= 0x07000000
-  tgtView->ZFitAll();
-#endif
-  return true;
-}
 
-#if OCC_VERSION_LARGE <= 0x07000000
-/*!
-  Returns Z-size of this view. [ public ]
-*/
-double OCCViewer_ViewPort3d::getZSize() const
-{
-  if ( !activeView().IsNull() )
-    return activeView()->ZSize();
-  return 0;
+  return true;
 }
 
-/*!
-  Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
-*/
-void OCCViewer_ViewPort3d::setZSize( double zsize )
-{
-  myActiveView->SetZSize( zsize );
-  /*    if ( !myOrthoView.IsNull() )
-        myOrthoView->SetZSize( zsize );
-        if ( !myPerspView.IsNull() )
-        myPerspView->SetZSize( zsize );*/
-}
-#endif
 
 /*!
   Get axial scale to the view
@@ -582,10 +531,6 @@ void OCCViewer_ViewPort3d::rotate( int x, int y,
 void OCCViewer_ViewPort3d::endRotation()
 {
   if ( !activeView().IsNull() ) {
-#if OCC_VERSION_LARGE <= 0x07000000
-    activeView()->ZFitAll( 1.0 );
-    activeView()->SetZSize( 0.0 );
-#endif
     activeView()->Update();
     emit vpTransformed( this );
   }
@@ -606,12 +551,7 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
     QApplication::syncX();
 #endif
     if ( !myPaintersRedrawing ) {
-#if OCC_VERSION_MAJOR < 7
-      QRect rc = e->rect();
-      activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
-#else
       activeView()->Redraw();
-#endif
     }
   }
   OCCViewer_ViewPort::paintEvent( e );
@@ -657,16 +597,8 @@ void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 
   Standard_Real margin = 0.01;
   
-#if OCC_VERSION_LARGE > 0x06070100
   activeView()->FitAll( margin, upd );
-#if OCC_VERSION_LARGE <= 0x07000000
-  if(withZ)
-    activeView()->ZFitAll();
-#endif  
-#else
-  activeView()->FitAll( margin, withZ, upd );
-  activeView()->SetZSize(0.);
-#endif
+
   emit vpTransformed( this );
 }
 
@@ -774,15 +706,7 @@ bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
     Handle(V3d_View) aView3d = getView();
     Handle(V3d_View) aRefView3d = vp3d->getView();
     aView3d->SetImmediateUpdate( Standard_False );
-#if OCC_VERSION_LARGE > 0x06070100
     aView3d->Camera()->Copy( aRefView3d->Camera() );
-#else
-    aView3d->SetViewMapping( aRefView3d->ViewMapping() );
-    aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
-#endif
-#if OCC_VERSION_LARGE <= 0x07000000
-    aView3d->ZFitAll();
-#endif
     aView3d->SetImmediateUpdate( Standard_True );
     aView3d->Update();
     blockSignals( blocked );
index 99428489804e23f294917cd1d090782ed98f5f5f..013c7db712d30b6e12e852457a756ffd5b34847f 100755 (executable)
@@ -23,8 +23,6 @@
 #ifndef OCCVIEWER_VIEWPORT3D_H
 #define OCCVIEWER_VIEWPORT3D_H
 
-#include <Basics_OCCTVersion.hxx>
-
 #include "OCCViewer_ViewPort.h"
 #include "Qtx.h"
 
@@ -65,11 +63,6 @@ public:
 //   void         setActive( V3d_TypeOfView );
   virtual bool          syncronize( const OCCViewer_ViewPort3d* );
 
-#if OCC_VERSION_LARGE <= 0x07000000
-  double                getZSize() const;
-  void                  setZSize( double );
-#endif
-
   void                  getAxialScale( double&, double&, double& );
 
   virtual void          onUpdate();
@@ -128,10 +121,6 @@ private:
   
 private:
   Handle(V3d_View)      myActiveView;
-#if OCC_VERSION_LARGE <= 0x06070100
-  Handle(V3d_View)      myOrthoView;
-  Handle(V3d_View)      myPerspView;
-#endif
   bool                  myBusy;
   double                myScale;
   bool                  myIsAdvancedZoomingEnabled;
index 060349844077a574daff8bdedaade931cca209b3..367c85151807567dc087def4d21d21378515669f 100644 (file)
@@ -52,8 +52,6 @@
 #include <QtxMultiAction.h>
 #include <QtxRubberBand.h>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <QPainter>
 #include <QTime>
 #include <QImage>
 #include <Graphic3d_MapOfStructure.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <Graphic3d_ExportFormat.hxx>
-#if OCC_VERSION_LARGE > 0x06090000
 #include <Graphic3d_StereoMode.hxx>
 #include <Graphic3d_RenderingParams.hxx>
-#endif
-
-#if OCC_VERSION_MAJOR < 7
-  #include <Visual3d_View.hxx>
-#endif
 
 #include <V3d_Plane.hxx>
 #include <V3d_Light.hxx>
@@ -410,9 +402,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
           int x1 = (int)( aEvent->x() + width()*delta/100 );
           int y1 = (int)( aEvent->y() + height()*delta/100 );
           myViewPort->zoom( x, y, x1, y1 );
-#if OCC_VERSION_LARGE <= 0x07000000
-          myViewPort->getView()->ZFitAll();
-#endif
           emit vpTransformationFinished ( ZOOMVIEW );
         }
       }
@@ -675,18 +664,11 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
   // the ones which lie within the screen limits
   Standard_Real aScreenLimits[4] = { 0.0, 0.0, 0.0, 0.0 };
 
-#if OCC_VERSION_LARGE > 0x06070100
   // NDC space screen limits
   aScreenLimits[0] = -1.0;
   aScreenLimits[1] =  1.0;
   aScreenLimits[2] = -1.0;
   aScreenLimits[3] =  1.0;
-#else
-  aView3d->View()->ViewMapping().WindowLimit( aScreenLimits[0],
-                                              aScreenLimits[1],
-                                              aScreenLimits[2],
-                                              aScreenLimits[3] );
-#endif
 
   Standard_Integer aPointsNb = 0;
 
@@ -706,7 +688,6 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     if ( aStructure->IsEmpty() || !aStructure->IsVisible() || aStructure->CStructure()->IsForHighlight )
       continue;
 
-#if OCC_VERSION_LARGE > 0x06070100
     Bnd_Box aBox = aStructure->MinMaxValues();
     aXmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
     aYmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
@@ -714,9 +695,6 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     aXmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
     aYmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
     aZmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
-#else
-    aStructure->MinMaxValues( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
-#endif
 
     // Infinite structures are skipped
     Standard_Real aLIM = ShortRealLast() - 1.0;
@@ -735,16 +713,9 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     for ( Standard_Integer aPointIt = 0; aPointIt < 8; ++aPointIt ) {
       const gp_Pnt& aBBPoint = aPoints[aPointIt];
 
-#if OCC_VERSION_LARGE > 0x06070100
       gp_Pnt aProjected = aView3d->Camera()->Project( aBBPoint );
       const Standard_Real& U = aProjected.X();
       const Standard_Real& V = aProjected.Y();
-#else
-      Standard_Real U = 0.0;
-      Standard_Real V = 0.0;
-      Standard_Real W = 0.0;
-      aView3d->View()->Projects( aBBPoint.X(), aBBPoint.Y(), aBBPoint.Z(), U, V, W );
-#endif
 
       if (U >= aScreenLimits[0]
        && U <= aScreenLimits[1]
@@ -1066,9 +1037,6 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 
   case PANVIEW:
   case ZOOMVIEW:
-#if OCC_VERSION_LARGE <= 0x07000000
-    myViewPort->getView()->ZFitAll();
-#endif
     resetState();
     break;
 
@@ -1335,7 +1303,7 @@ void OCCViewer_ViewWindow::createActions()
   aAction->setStatusTip(tr("DSC_PERSPECTIVE_MODE"));
   aAction->setCheckable(true);
   toolMgr()->registerAction( aAction, PerspectiveId );
-#if OCC_VERSION_LARGE > 0x06090000
+
   // - stereo projection
   aAction = new QtxAction(tr("MNU_STEREO_MODE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STEREO" ) ),
                           tr( "MNU_STEREO_MODE" ), 0, this);
@@ -1343,7 +1311,7 @@ void OCCViewer_ViewWindow::createActions()
   aAction->setCheckable(true);
   toolMgr()->registerAction( aAction, StereoId );
   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onStereoType(bool)));
-#endif
+
   // - add exclusive action group
   QActionGroup* aProjectionGroup = new QActionGroup( this );
   aProjectionGroup->addAction( toolMgr()->action( OrthographicId ) );
@@ -1525,9 +1493,7 @@ void OCCViewer_ViewWindow::createToolBar()
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
   aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
   aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
-#if OCC_VERSION_LARGE > 0x06090000
   aScaleAction->insertAction( toolMgr()->action( FitSelectionId ) );
-#endif
   aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
   toolMgr()->append( aScaleAction, tid );
 
@@ -1554,9 +1520,7 @@ void OCCViewer_ViewWindow::createToolBar()
 
     toolMgr()->append( OrthographicId, tid );
     toolMgr()->append( PerspectiveId, tid );
-#if OCC_VERSION_LARGE > 0x06090000
     toolMgr()->append( StereoId, tid );
-#endif
 
     toolMgr()->append( ResetId, tid );
   }
@@ -1721,12 +1685,10 @@ void OCCViewer_ViewWindow::onProjectionType( QAction* theAction )
       aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
       aCamera->SetFOVy(30.0);
     }
-#if OCC_VERSION_LARGE > 0x06090000
     if (toolMgr()->action( StereoId )->isChecked()) {
       aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
       aCamera->SetFOVy(30.0);
     }
-#endif
     aView3d->Redraw();
     onViewFitAll();
   }
@@ -1739,7 +1701,6 @@ void OCCViewer_ViewWindow::onProjectionType( QAction* theAction )
 */
 void OCCViewer_ViewWindow::onStereoType( bool activate )
 {
-#if OCC_VERSION_LARGE > 0x06090000
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
@@ -1774,7 +1735,6 @@ void OCCViewer_ViewWindow::onStereoType( bool activate )
   if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
        toolMgr()->action( StereoId )->isChecked() )
     SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
-#endif
 }
 
 /*!
@@ -1789,10 +1749,8 @@ void OCCViewer_ViewWindow::onProjectionType()
     setProjectionType( Orthographic );
   if (toolMgr()->action( PerspectiveId )->isChecked())
     setProjectionType( Perspective );
-#if OCC_VERSION_LARGE > 0x06090000
   if (toolMgr()->action( StereoId )->isChecked())
     setProjectionType( Stereo );
-#endif
   emit vpTransformationFinished( PROJECTION );
 }
 
@@ -1800,9 +1758,7 @@ void OCCViewer_ViewWindow::setProjectionType( int mode )
 {
   QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
   QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
   QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
-#endif
   switch ( mode ) {
     case Orthographic:
       onProjectionType( anOrthographicAction );
@@ -1817,17 +1773,12 @@ void OCCViewer_ViewWindow::setProjectionType( int mode )
   // update action state if method is called outside
   if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
          anOrthographicAction->setChecked( true );
-    #if OCC_VERSION_LARGE > 0x06090000
          aStereoAction->setChecked( false );
-    #endif
   }
   if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
          aPerspectiveAction->setChecked( true );
-    #if OCC_VERSION_LARGE > 0x06090000
          aStereoAction->setChecked( false );
-    #endif
   }
-#if OCC_VERSION_LARGE > 0x06090000
   if ( mode == Stereo ) {
     aStereoAction->setChecked( true );
     if ( anOrthographicAction->isEnabled() ) {
@@ -1860,7 +1811,6 @@ void OCCViewer_ViewWindow::setProjectionType( int mode )
     if ( !aPerspectiveAction->isEnabled() )
       aPerspectiveAction->setEnabled( true );
   }
-#endif
 }
 
 /*!
@@ -1879,9 +1829,7 @@ void OCCViewer_ViewWindow::onFitAll()
 void OCCViewer_ViewWindow::onFitSelection()
 {
   emit vpTransformationStarted( FITSELECTION );
-#if OCC_VERSION_LARGE > 0x06090000
   myModel->getAISContext()->FitSelected( getViewPort()->getView() );
-#endif
   emit vpTransformationFinished( FITSELECTION );
 }
 
@@ -2012,7 +1960,6 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base
   aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
   aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
 
-#if OCC_VERSION_LARGE > 0x06070100
   if ( anItem.centerX != 0.0 || anItem.centerY != 0.0 )
   {
     double anUpX = 0.0, anUpY = 0.0, anUpZ = 0.0;
@@ -2034,9 +1981,6 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base
     aView3d->SetAt( anAt.X(), anAt.Y(), anAt.Z() );
     aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
   }
-#else
-  aView3d->SetCenter( anItem.centerX, anItem.centerY );
-#endif
 
   if ( !baseParamsOnly ) {
 
@@ -2285,11 +2229,7 @@ QImage OCCViewer_ViewWindow::dumpView()
   QImage anImage( aWidth, aHeight, QImage::Format_ARGB32 );
   for ( int i = 0; i < aWidth; i++ ) {
     for ( int j = 0; j < aHeight; j++ ) {
-#if OCC_VERSION_LARGE > 0x07010001
       Quantity_Color pixel = aPix.PixelColor( i, j ).GetRGB();
-#else
-      Quantity_Color pixel = aPix.PixelColor( i, j );
-#endif
       QColor color = QColor::fromRgbF( pixel.Red(), pixel.Green(), pixel.Blue() );
       anImage.setPixelColor( i, j, color );
     }
@@ -2308,19 +2248,28 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
 {
   bool res = false;
   QApplication::setOverrideCursor( Qt::WaitCursor );
-  if ( format != "PS" && format != "EPS")
-   res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
 
-#if OCC_VERSION_MAJOR < 7
-  Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
-#else
   Handle(Graphic3d_CView) a3dView = myViewPort->getView()->View();
-#endif
 
-  if (format == "PS")
+  if (format == "PS") {
+    Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+    OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+    int prev = aCaps->ffpEnable;
+    aCaps->ffpEnable = 1;
     res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
-  else if (format == "EPS")
+    aCaps->ffpEnable = prev;
+  }
+  else if (format == "EPS") {
+    Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+    OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+    int prev = aCaps->ffpEnable;
+    aCaps->ffpEnable = 1;
     res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
+    aCaps->ffpEnable = prev;
+  }
+  else {
+    res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
+  }
 
   QApplication::restoreOverrideCursor();
   return res;
@@ -2360,15 +2309,9 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const doub
     gp_Pln pln (gp_Pnt(x, y, z), gp_Dir(dx, dy, dz));
     double a, b, c, d;
     pln.Coefficients(a, b, c, d);
-#if OCC_VERSION_LARGE > 0x07000000 
     Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
     Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
     if(aPlanes->Size() > 0 ) {
-#else
-    Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
-    Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-    if(aPlanes.Size() > 0 ) {
-#endif
       Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
       aClipPlane->SetEquation(pln);
       aClipPlane->SetOn(Standard_True);
@@ -2377,13 +2320,8 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const doub
     }
   }
   else {
-#if OCC_VERSION_LARGE > 0x07000000 
     Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
     Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
-#else
-    Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
-    Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-#endif
     for( ;anIter.More();anIter.Next() ){
       Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
       aClipPlane->SetOn(Standard_False);
@@ -2410,13 +2348,8 @@ bool OCCViewer_ViewWindow::isCuttingPlane()
 {
   Handle(V3d_View) view = myViewPort->getView();
   bool res = false;
-#if OCC_VERSION_LARGE > 0x07000000 
   Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
   Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
-#else
-    Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
-    Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-#endif
   for( ;anIter.More();anIter.Next() ) {
     Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
     if(aClipPlane->IsOn()) {
@@ -2470,10 +2403,6 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   params.isVisible= isShown;
   params.size     = size;
 
-#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1
-  aView3d->Center( params.centerX, params.centerY );
-#endif
-
   // graduated trihedron
   bool anIsVisible = false;
   OCCViewer_AxisWidget::AxisData anAxisData[3];
@@ -2534,10 +2463,6 @@ QString OCCViewer_ViewWindow::getVisualParameters()
   QStringList data;
 
   data << QString( "scale=%1" )    .arg( params.scale,   0, 'e', 12 );
-#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1
-  data << QString( "centerX=%1" )  .arg( params.centerX, 0, 'e', 12 );
-  data << QString( "centerY=%1" )  .arg( params.centerY, 0, 'e', 12 );
-#endif
   data << QString( "projX=%1" )    .arg( params.projX,   0, 'e', 12 );
   data << QString( "projY=%1" )    .arg( params.projY,   0, 'e', 12 );
   data << QString( "projZ=%1" )    .arg( params.projZ,   0, 'e', 12 );
@@ -2836,9 +2761,6 @@ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
             aTexture = new Graphic3d_TextureEnv( TCollection_AsciiString( et_paramValue.toStdString().c_str() ) );
           Handle(V3d_View) aView = this->getViewPort()->getView();
           aView->SetTextureEnv( aTexture );
-#if OCC_VERSION_LARGE <= 0x07000000
-          aView->SetSurfaceDetail( V3d_TEX_ENVIRONMENT );
-#endif
         }
       }
       else if ( paramName == "lightSource" )
@@ -3210,10 +3132,8 @@ int OCCViewer_ViewWindow::projectionType() const
       mode = Perspective;
     if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Orthographic)
       mode = Orthographic;
-  #if OCC_VERSION_LARGE > 0x06090000
     if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Stereo)
       mode = Stereo;
-  #endif
   }
   return mode;
 }
@@ -3222,10 +3142,8 @@ void OCCViewer_ViewWindow::setStereoType( int type )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     aParams->StereoMode = (Graphic3d_StereoMode)type;
-  #endif
   }
 }
 
@@ -3234,10 +3152,8 @@ int OCCViewer_ViewWindow::stereoType() const
   int type = QuadBuffer;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     type = (OCCViewer_ViewWindow::StereoType)aParams->StereoMode;
-  #endif
   }
   return type;
 }
@@ -3246,7 +3162,6 @@ void OCCViewer_ViewWindow::setAnaglyphFilter( int type )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     if (type == RedCyan)
       aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized;
@@ -3254,7 +3169,6 @@ void OCCViewer_ViewWindow::setAnaglyphFilter( int type )
       aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_YellowBlue_Optimized;
     if (type == GreenMagenta)
       aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple;
-  #endif
   }
 }
 
@@ -3263,7 +3177,6 @@ int OCCViewer_ViewWindow::anaglyphFilter() const
   int type = RedCyan;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized)
       type = RedCyan;
@@ -3271,7 +3184,6 @@ int OCCViewer_ViewWindow::anaglyphFilter() const
       type = YellowBlue;
     if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple)
       type = GreenMagenta;
-  #endif
   }
   return type;
 }
@@ -3280,10 +3192,8 @@ void OCCViewer_ViewWindow::setStereographicFocus( int type, double value )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     aCamera->SetZFocus( (Graphic3d_Camera::FocusType) type, value );
-  #endif
   }
 }
 
@@ -3292,10 +3202,8 @@ int OCCViewer_ViewWindow::stereographicFocusType() const
   int type = Relative;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     type = (OCCViewer_ViewWindow::FocusIODType)aCamera->ZFocusType();
-  #endif
   }
   return type;
 }
@@ -3305,10 +3213,8 @@ double OCCViewer_ViewWindow::stereographicFocusValue() const
   double value = 1.0;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     value = aCamera->ZFocus();
-  #endif
   }
   return value;
 }
@@ -3317,10 +3223,8 @@ void OCCViewer_ViewWindow::setInterocularDistance( int type, double value )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     aCamera->SetIOD( (Graphic3d_Camera::IODType) type, value );
-  #endif
   }
 }
 
@@ -3329,10 +3233,8 @@ int OCCViewer_ViewWindow::interocularDistanceType() const
   int type = Relative;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     type = (OCCViewer_ViewWindow::FocusIODType)aCamera->GetIODType();
-  #endif
   }
   return type;
 }
@@ -3342,10 +3244,8 @@ double OCCViewer_ViewWindow::interocularDistanceValue() const
   double value = 0.05;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
     value = aCamera->IOD();
-  #endif
   }
   return value;
 }
@@ -3354,10 +3254,8 @@ void OCCViewer_ViewWindow::setReverseStereo( bool reverse )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     aParams->ToReverseStereo = reverse;
-  #endif
   }
 }
 
@@ -3366,10 +3264,8 @@ bool OCCViewer_ViewWindow::isReverseStereo() const
   int reverse = false;
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
     reverse = aParams->ToReverseStereo;
-  #endif
   }
   return reverse;
 }
@@ -3378,11 +3274,9 @@ void OCCViewer_ViewWindow::setVSync( bool enable )
 {
   Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
   if ( !anIntCont.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
     OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
     aCaps->swapInterval = enable;
-  #endif
   }
 }
 
@@ -3391,11 +3285,9 @@ bool OCCViewer_ViewWindow::isVSync() const
   int enable = true;
   Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
   if ( !anIntCont.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
     OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
     enable = aCaps->swapInterval;
-  #endif
   }
   return enable;
 }
@@ -3404,11 +3296,9 @@ void OCCViewer_ViewWindow::setQuadBufferSupport( bool enable )
 {
   Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
   if ( !anIntCont.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
     OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
     aCaps->contextStereo = enable;
-  #endif
   }
 }
 
@@ -3417,11 +3307,9 @@ bool OCCViewer_ViewWindow::isQuadBufferSupport() const
   int enable = true;
   Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
   if ( !anIntCont.IsNull() ) {
-  #if OCC_VERSION_LARGE > 0x06090000
     Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
     OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
     enable = aCaps->contextStereo;
-  #endif
   }
   return enable;
 }
@@ -3532,7 +3420,6 @@ SUIT_CameraProperties OCCViewer_ViewWindow::cameraProperties()
   aProps.setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
   aProps.setViewUp( anUp[0], anUp[1], anUp[2] );
 
-#if OCC_VERSION_LARGE > 0x06070100
   aSourceView->Eye( anEye[0], anEye[1], anEye[2] );
 
   // store camera properties "as is": it is up to synchronized
@@ -3551,50 +3438,6 @@ SUIT_CameraProperties OCCViewer_ViewWindow::cameraProperties()
     aProps.setViewAngle( aSourceView->Camera()->FOVy() );
   }
   aProps.setMappingScale( aSourceView->Camera()->Scale() );
-#else
-  Standard_Real aCameraDepth = aSourceView->Depth() + aSourceView->ZSize() * 0.5;
-
-  // generate view orientation matrix for transforming OCC projection reference point
-  // into a camera (eye) position.
-  gp_Dir aLeftDir = gp_Dir( anUp[0], anUp[1], anUp[2] ) ^ gp_Dir( aProj[0], aProj[1], aProj[2] );
-
-  gp_GTrsf aTrsf;
-  aTrsf.SetValue( 1, 1, aLeftDir.X() );
-  aTrsf.SetValue( 2, 1, aLeftDir.Y() );
-  aTrsf.SetValue( 3, 1, aLeftDir.Z() );
-
-  aTrsf.SetValue( 1, 2, anUp[0] );
-  aTrsf.SetValue( 2, 2, anUp[1] );
-  aTrsf.SetValue( 3, 2, anUp[2] );
-
-  aTrsf.SetValue( 1, 3, aProj[0] );
-  aTrsf.SetValue( 2, 3, aProj[1] );
-  aTrsf.SetValue( 3, 3, aProj[2] );
-
-  aTrsf.SetValue( 1, 4, anAt[0] );
-  aTrsf.SetValue( 2, 4, anAt[1] );
-  aTrsf.SetValue( 3, 4, anAt[2] );
-
-  Graphic3d_Vertex aProjRef = aSourceView->ViewMapping().ProjectionReferencePoint();
-
-  // transform to world-space coordinate system
-  gp_XYZ aPosition( aProjRef.X(), aProjRef.Y(), aCameraDepth );
-  aTrsf.Transforms( aPosition );
-
-  // compute focal point
-  double aFocalPoint[3];
-
-  aFocalPoint[0] = aPosition.X() - aProj[0] * aCameraDepth;
-  aFocalPoint[1] = aPosition.Y() - aProj[1] * aCameraDepth;
-  aFocalPoint[2] = aPosition.Z() - aProj[2] * aCameraDepth;
-
-  aProps.setFocalPoint( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
-  aProps.setPosition( aPosition.X(), aPosition.Y(), aPosition.Z() );
-
-  Standard_Real aViewScale[2];
-  aSourceView->Size( aViewScale[0], aViewScale[1] );
-  aProps.setMappingScale( aViewScale[1] );
-#endif
 
   return aProps;
 }
@@ -3630,77 +3473,12 @@ void OCCViewer_ViewWindow::synchronize( SUIT_ViewWindow* theView )
   aProps.getViewUp( anUpDir[0], anUpDir[1], anUpDir[2] );
   aProps.getAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
 
-#if OCC_VERSION_LARGE > 0x06070100
   aDestView->SetAt( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
   aDestView->SetEye( aPosition[0], aPosition[1], aPosition[2] );
   aDestView->SetUp( anUpDir[0], anUpDir[1], anUpDir[2] );
   aDestView->Camera()->SetScale( aProps.getMappingScale() );
-#else
-  gp_Dir aProjDir( aPosition[0] - aFocalPoint[0],
-                   aPosition[1] - aFocalPoint[1],
-                   aPosition[2] - aFocalPoint[2] );
-
-  // get custom view translation
-  Standard_Real aTranslation[3];
-  aDestView->At( aTranslation[0], aTranslation[1], aTranslation[2] );
-
-  gp_Dir aLeftDir = gp_Dir( anUpDir[0], anUpDir[1], anUpDir[2] )
-                  ^ gp_Dir( aProjDir.X(), aProjDir.Y(), aProjDir.Z() );
-
-  gp_GTrsf aTrsf;
-  aTrsf.SetValue( 1, 1, aLeftDir.X() );
-  aTrsf.SetValue( 2, 1, aLeftDir.Y() );
-  aTrsf.SetValue( 3, 1, aLeftDir.Z() );
-
-  aTrsf.SetValue( 1, 2, anUpDir[0] );
-  aTrsf.SetValue( 2, 2, anUpDir[1] );
-  aTrsf.SetValue( 3, 2, anUpDir[2] );
-
-  aTrsf.SetValue( 1, 3, aProjDir.X() );
-  aTrsf.SetValue( 2, 3, aProjDir.Y() );
-  aTrsf.SetValue( 3, 3, aProjDir.Z() );
-
-  aTrsf.SetValue( 1, 4, aTranslation[0] );
-  aTrsf.SetValue( 2, 4, aTranslation[1] );
-  aTrsf.SetValue( 3, 4, aTranslation[2] );
-  aTrsf.Invert();
-
-  // transform to view-space coordinate system
-  gp_XYZ aProjRef( aPosition[0], aPosition[1], aPosition[2] );
-  aTrsf.Transforms( aProjRef );
-
-  // set view camera properties using low-level approach. this is done
-  // in order to avoid interference with static variables in v3d view used
-  // when rotation is in process in another view.
-  Visual3d_ViewMapping aMapping = aDestView->View()->ViewMapping();
-  Visual3d_ViewOrientation anOrientation = aDestView->View()->ViewOrientation();
-
-  Graphic3d_Vector aMappingProj( aProjDir.X(), aProjDir.Y(), aProjDir.Z() );
-  Graphic3d_Vector aMappingUp( anUpDir[0], anUpDir[1], anUpDir[2] );
-
-  aMappingProj.Normalize();
-  aMappingUp.Normalize();
-
-  anOrientation.SetViewReferencePlane( aMappingProj );
-  anOrientation.SetViewReferenceUp( aMappingUp );
-
-  aDestView->SetViewMapping( aMapping );
-  aDestView->SetViewOrientation( anOrientation );
-
-  // set panning
-  aDestView->SetCenter( aProjRef.X(), aProjRef.Y() );
-
-  // set mapping scale
-  double aMapScaling = aProps.getMappingScale();
-  Standard_Real aWidth, aHeight;
-  aDestView->Size( aWidth, aHeight );
-  aDestView->SetSize ( aWidth > aHeight ? aMapScaling * (aWidth / aHeight) : aMapScaling );
-#endif
 
   getViewPort()->setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
-#if OCC_VERSION_LARGE <= 0x07000000
-  aDestView->ZFitAll();
-#endif
   aDestView->SetImmediateUpdate( Standard_True );
   aDestView->Redraw();
 
index b75b568c89c9d50dc8c04c6b2dd95799478ee316..1aaa3ec68bf263b8abdecec0127f3932cedac2aa 100755 (executable)
     </message>
     <message>
         <source>MNU_RAY_TRACING</source>
-        <translation type="unfinished">Ray tracing</translation>
+        <translation>Ray tracing</translation>
     </message>
     <message>
         <source>DSC_RAY_TRACING</source>
-        <translation type="unfinished">Ray tracing</translation>
+        <translation>Ray tracing</translation>
     </message>
     <message>
         <source>MNU_ENV_TEXTURE</source>
-        <translation type="unfinished">Environment texture</translation>
+        <translation>Texture de l'environnement</translation>
     </message>
     <message>
         <source>DSC_ENV_TEXTURE</source>
-        <translation type="unfinished">Environment texture</translation>
+        <translation>Texture de l'environnement</translation>
     </message>
     <message>
         <source>MNU_LIGHT_SOURCE</source>
-        <translation type="unfinished">Light source</translation>
+        <translation>Source de lumière</translation>
     </message>
     <message>
         <source>DSC_LIGHT_SOURCE</source>
-        <translation type="unfinished">Light source</translation>
+        <translation>Source de lumière</translation>
     </message>
     <message>
         <source>OCC_IMAGE_FILES</source>
     <name>OCCViewer_RayTracingDlg</name>
     <message>
         <source>RAY_TRACING</source>
-        <translation type="unfinished">Ray tracing</translation>
+        <translation>Ray tracing</translation>
     </message>
     <message>
         <source>DEPTH</source>
-        <translation type="unfinished">Depth</translation>
+        <translation>Profondeur</translation>
     </message>
     <message>
         <source>SHADOW</source>
-        <translation type="unfinished">Shadows rendering</translation>
+        <translation>Rendu des ombres</translation>
     </message>
     <message>
         <source>REFLECTION</source>
-        <translation type="unfinished">Specular reflections</translation>
+        <translation>Réflexions spéculaires</translation>
     </message>
     <message>
         <source>ANTIALIASING</source>
-        <translation type="unfinished">Adaptive anti-aliasing</translation>
+        <translation>Anti-crénelage adaptatif</translation>
     </message>
     <message>
         <source>TRANSPARENT_SHADOW</source>
-        <translation type="unfinished">Transparent shadow</translation>
+        <translation>Ombres transparentes</translation>
     </message>
 </context>
 <context>
     <name>OCCViewer_EnvTextureDlg</name>
     <message>
         <source>ENV_TEXTURE</source>
-        <translation type="unfinished">Environment texture</translation>
+        <translation>Texture de l'environnement</translation>
     </message>
     <message>
         <source>ENV_CLOUDS</source>
-        <translation type="unfinished">Clouds</translation>
+        <translation>Nuages</translation>
     </message>
     <message>
         <source>ENV_CV</source>
-        <translation type="unfinished">Cv</translation>
+        <translation>Cv</translation>
     </message>
     <message>
         <source>ENV_MEDIT</source>
-        <translation type="unfinished">Medit</translation>
+        <translation>Medit</translation>
     </message>
     <message>
         <source>ENV_PEARL</source>
-        <translation type="unfinished">Pearl</translation>
+        <translation>Perle</translation>
     </message>
     <message>
         <source>ENV_SKY1</source>
-        <translation type="unfinished">Sky1</translation>
+        <translation>Ciel1</translation>
     </message>
     <message>
         <source>ENV_SKY2</source>
-        <translation type="unfinished">Sky2</translation>
+        <translation>Ciel2</translation>
     </message>
     <message>
         <source>ENV_LINES</source>
-        <translation type="unfinished">Lines</translation>
+        <translation>Lignes</translation>
     </message>
     <message>
         <source>ENV_ROAD</source>
-        <translation type="unfinished">Road</translation>
+        <translation>Route</translation>
     </message>
     <message>
         <source>ENV_CUSTOM</source>
-        <translation type="unfinished">Custom...</translation>
+        <translation>Personnalisé...</translation>
     </message>
 </context>
 <context>
     <name>OCCViewer_LightSourceDlg</name>
     <message>
         <source>LIGHT_SOURCE</source>
-        <translation type="unfinished">Light source</translation>
+        <translation>Source de lumière</translation>
     </message>
     <message>
         <source>TYPE</source>
-        <translation type="unfinished">Type</translation>
+        <translation>Type</translation>
     </message>
     <message>
         <source>DIRECTIONAL</source>
-        <translation type="unfinished">Directional</translation>
+        <translation>Directionnel</translation>
     </message>
     <message>
         <source>DIRECTION</source>
-        <translation type="unfinished">Direction</translation>
+        <translation>Direction</translation>
     </message>
     <message>
         <source>POSITIONAL</source>
-        <translation type="unfinished">Positional</translation>
+        <translation>Positionnel</translation>
     </message>
     <message>
         <source>POSITION</source>
-        <translation type="unfinished">Position</translation>
+        <translation>Position</translation>
     </message>
     <message>
         <source>COLOR</source>
-        <translation type="unfinished">Color</translation>
+        <translation>Couleur</translation>
     </message>
     <message>
         <source>HEADLIGHT</source>
-        <translation type="unfinished">Headlight</translation>
+        <translation>Lumière frontale</translation>
     </message>
     <message>
         <source>BUT_DEFAULT</source>
-        <translation type="unfinished">Default</translation>
+        <translation>Défaut</translation>
     </message>
 </context>
 </TS>
index 623550d735a9179f8485dc4f3aa548cf81349d26..05910b4817670a6f541dfbf6e15f66b6eaa35626 100644 (file)
@@ -61,6 +61,7 @@ SET(_moc_HEADERS
   PVViewer_ViewWindow.h
   PVViewer_Behaviors.h
   PVViewer_GUIElements.h
+  PVViewer_InitSingleton.h
 )
 
 # header files / no moc processing
@@ -96,6 +97,7 @@ SET(_other_SOURCES
   PVViewer_Behaviors.cxx
   PVViewer_GUIElements.cxx
   PVViewer_Core.cxx
+  PVViewer_InitSingleton.cxx
   )
   
 # sources / to compile
index d618921872f40c04349ea73cf06d6343bc905bc8..3c07d03289a667e8835f88df4d81b6d190eae934 100644 (file)
@@ -36,7 +36,6 @@
 #include <pqDataTimeStepBehavior.h>
 #include <pqDefaultViewBehavior.h>
 #include <pqObjectPickingBehavior.h>
-#include <pqPersistentMainWindowStateBehavior.h>
 #include <pqPipelineContextMenuBehavior.h>
 #include <pqPluginActionGroupBehavior.h>
 #include <pqPluginDockWidgetsBehavior.h>
@@ -76,6 +75,7 @@ void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk)
       // Load plugins distributed with application.
       pqApplicationCore::instance()->loadDistributedPlugins();
 
+      new pqPipelineContextMenuBehavior(this);
       new pqDefaultViewBehavior(this);  // shows a 3D view as soon as a server connection is made
       new pqAlwaysConnectedBehavior(this);  // client always connected to a server
       new pqVerifyRequiredPluginBehavior(this);
@@ -106,12 +106,14 @@ void PVViewer_Behaviors::instanciateAllBehaviors(QMainWindow * desk)
       //new pqQtMessageHandlerBehavior(this);   // THIS ONE TO EXCLUDE !! see comment above
       new pqDataTimeStepBehavior(this);
       new pqSpreadSheetVisibilityBehavior(this);
-      new pqPipelineContextMenuBehavior(this);
+      //new pqPipelineContextMenuBehavior(this);
       new pqUndoRedoBehavior(this);
       new pqAutoLoadPluginXMLBehavior(this);  // auto load plugins GUI stuff
       new pqPluginDockWidgetsBehavior(desk);
       new pqPluginActionGroupBehavior(desk);
-      new pqPersistentMainWindowStateBehavior(desk);
+      // rnv: Disable ParaView main window persistance mechanism,
+      //      because SALOME has own functionality for store/restore windows state.
+      //  new pqPersistentMainWindowStateBehavior(desk);
       new pqObjectPickingBehavior(desk);
       new pqCollaborationBehavior(this);
       new pqViewStreamingBehavior(this);
index 8f9abaafc193d6f6ffddc06ee47182c3900d3c3e..6e9e6920380ee8e58a4a5ff1789c2ad1566498a4 100644 (file)
@@ -29,6 +29,7 @@
 #include <QStringList>
 #include <QDir>
 #include <QMainWindow>
+#include <QStandardPaths>
 
 #include <string>
 
@@ -65,7 +66,7 @@ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindo
       char** argv = 0;
       QString aOptions = getenv("PARAVIEW_OPTIONS");
       QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts);
-      argv = new char*[aOptList.size() + 1];
+      argv = new char*[aOptList.size() + 3];
       QStringList args = QApplication::arguments();
       argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis");
       argc++;
@@ -74,6 +75,25 @@ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindo
         argv[argc] = strdup( aStr.toLatin1().constData() );
         argc++;
       }
+      argv[argc++] = strdup("--multi-servers");
+      // Make salome sharing the same server configuration than external one with "salome shell paraview"
+      QStringList li(QStandardPaths::standardLocations(QStandardPaths::ConfigLocation));
+      foreach(QString pathConfig,li)
+        {
+          QFileInfo fi(QDir(pathConfig),QString("ParaView"));
+          if(fi.exists() && fi.isDir())
+            {
+              QFileInfo fi2(fi.canonicalFilePath(),"servers.pvsc");
+              if(fi2.exists() && fi2.isFile())
+                {
+                  QString addEntry(QString("--servers-file=%1").arg(fi2.canonicalFilePath()));
+                  std::string addEntry2(addEntry.toStdString());
+                  argv[argc++] = strdup(addEntry2.c_str());
+                  break;
+                }
+            }
+        }
+      //
       MyCoreApp = new pqPVApplicationCore (argc, argv);
       if (MyCoreApp->getOptions()->GetHelpSelected() ||
           MyCoreApp->getOptions()->GetUnknownArgument() ||
diff --git a/src/PVViewer/PVViewer_InitSingleton.cxx b/src/PVViewer/PVViewer_InitSingleton.cxx
new file mode 100644 (file)
index 0000000..538e0d0
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "PVViewer_InitSingleton.h"
+#include "PVViewer_Core.h"
+#include "PVViewer_ViewManager.h"
+
+bool PVViewer_InitSingleton::IS_INIT=false;
+
+void PVViewer_InitSingleton::Init(QMainWindow *aDesktop, LogWindow *logWindow)
+{
+  if(IS_INIT)
+    return ;
+  PVViewer_Core::ParaviewInitApp(aDesktop,logWindow);
+  // Finish ParaView set up: behaviors, connection and configurations.
+  const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
+  PVViewer_Core::ParaviewInitBehaviors(true,aDesktop);
+  PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop);
+  PVViewer_Core::ParaviewLoadConfigurations(configPath);
+  IS_INIT=true;
+}
diff --git a/src/PVViewer/PVViewer_InitSingleton.h b/src/PVViewer/PVViewer_InitSingleton.h
new file mode 100644 (file)
index 0000000..93eba85
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#ifndef __PVVIEWER_INITSINGLETON_H__
+#define __PVVIEWER_INITSINGLETON_H__
+
+#include "PVViewer.h"
+
+class QMainWindow;
+class LogWindow;
+
+/**
+ * This class deals with initialization of SALOME_Session to make it a PV based application.
+ * The initialization must be done only once.
+ * It allows multi initializator ParaView visu modules other than PARAVIS.
+ */
+class PVVIEWER_EXPORT PVViewer_InitSingleton
+{
+public:
+  static void Init(QMainWindow *aDesktop, LogWindow *logWindow);
+private:
+  static bool IS_INIT;
+};
+
+#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */
index 9c0f6004c815104dc602256030f5c24be3090fb2..42a7947994b759a822a56cd4d918a45f633b0276 100644 (file)
@@ -23,6 +23,7 @@
 #include "PVViewer_ViewModel.h"
 #include "PVViewer_GUIElements.h"
 #include "PVViewer_Core.h"
+#include "PVViewer_InitSingleton.h"
 #include "PVServer_ServiceWrapper.h"
 
 #include <utilities.h>
@@ -49,7 +50,7 @@ PVViewer_ViewManager::PVViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* des
   setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
 
   // Initialize minimal paraview stuff (if not already done)
-  PVViewer_Core::ParaviewInitApp(desk, logWindow);
+  PVViewer_InitSingleton::Init(desk, logWindow);
 
   connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
            this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
index f26f9a74517891ed78cbbb2d6c37b1833398aad5..f2c7f9221c048da06bdcdf2fc62057efec6d88ec 100644 (file)
@@ -59,13 +59,6 @@ PVViewer_ViewWindow::PVViewer_ViewWindow( SUIT_Desktop* theDesktop, PVViewer_Vie
     // This is mandatory, see setParent() method in Qt 4 documentation
     myPVMgr->show();
     setCentralWidget( myPVMgr );
-
-    // Finish ParaView set up: behaviors, connection and configurations.
-    const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
-    PVViewer_Core::ParaviewInitBehaviors(true, theDesktop);
-    PVViewer_ViewManager::ConnectToExternalPVServer(theDesktop);
-    PVViewer_Core::ParaviewLoadConfigurations(configPath);
-
     // Hide toolbars
     PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(myDesktop);
     pvge->setToolBarVisible(false);
index 0f32a4fcd7d6e7ca226efd44d351bc27091a78dd..a5c68026f19c5ed9fe20e81c58f172c424365f9d 100644 (file)
@@ -15,6 +15,8 @@
   </Category>
 
   <Category name="CosmoTools" menu_label="&amp;CosmoTools" show_in_toolbar="0">
+    <Proxy group="filters" name="ANLHaloFinder" />
+    <Proxy group="filters" name="ANLSubhaloFinder" />
     <Proxy group="filters" name="LANLHaloFinder" />
     <Proxy group="filters" name="MinkowskiFilter" />
     <Proxy group="filters" name="PMergeConnected" />
@@ -46,6 +48,7 @@
             icon=":/pqWidgets/Icons/pqBoxChart16.png" omit_from_toolbar="1"/>
     <Proxy group="filters" name="ExtractBagPlots"
             icon=":/pqWidgets/Icons/pqFunctionalBagChart16.png" omit_from_toolbar="1"/>
+    <Proxy group="filters" name="ExtractLocation" omit_from_toolbar="1" />
   </Category>
 
   <Category name="Statistics" menu_label="&amp;Statistics">
   </Category>
 
   <Category name="Temporal" menu_label="&amp;Temporal">
-    <Proxy group="filters" name="ParticleTracer" />
+    <Proxy group="filters" name="ExtractTimeSteps" />
+    <Proxy group="filters" name="GroupTimeSteps" />
     <Proxy group="filters" name="ParticlePath" />
+    <Proxy group="filters" name="ParticleTracer" />
     <Proxy group="filters" name="StreakLine" />
+    <Proxy group="filters" name="SynchronizeTime" />
     <Proxy group="filters" name="TemporalCache" />
     <Proxy group="filters" name="TemporalInterpolator" />
-    <Proxy group="filters" name="TemporalSnapToTimeStep" />
     <Proxy group="filters" name="TemporalShiftScale" />
+    <Proxy group="filters" name="TemporalSnapToTimeStep" />
     <Proxy group="filters" name="TemporalStatistics" />
+    <Proxy group="filters" name="TimeStepProgressFilter" />
     <Proxy group="filters" name="TimeToTextConvertor" />
   </Category>
 
     <Proxy group="filters" name="QuadratureSchemeDictionaryGenerator" />
   </Category>
 
+  <Category name="Annotation" menu_label="Annotation">
+    <Proxy group="filters" name="AnnotateGlobalData" />
+    <Proxy group="filters" name="AnnotateAttributeData" />
+    <Proxy group="filters" name="PythonAnnotation" />
+    <Proxy group="filters" name="TimeToTextConvertor" />
+    <Proxy group="filters" name="TimeStepProgressFilter" />
+    <Proxy group="filters" name="DataSetRegionSurfaceFilter" />
+    <Proxy group="filters" name="EnvironmentAnnotation" />
+  </Category>
+
+  <Category name="Point Interpolation" menu_label="Point Interpolation">
+    <Proxy group="filters" name="PointLineInterpolator" />
+    <Proxy group="filters" name="PointPlaneInterpolator" />
+    <Proxy group="filters" name="PointVolumeInterpolator" />
+    <Proxy group="filters" name="PointDatasetInterpolator" />
+    <Proxy group="filters" name="SPHLineInterpolator" />
+    <Proxy group="filters" name="SPHPlaneInterpolator" />
+    <Proxy group="filters" name="SPHVolumeInterpolator" />
+    <Proxy group="filters" name="SPHDatasetInterpolator" />
+  </Category>
 
+  <Proxy group="filters" name="AggregateDataSet" />
+  <Proxy group="filters" name="AppendArcLength" />
+  <Proxy group="filters" name="AddFieldArrays" />
   <Proxy group="filters" name="ImageDataToAMR" />
   <Proxy group="filters" name="UniformGridPartitioner" />
-  <Proxy group="filters" name="AnnotateGlobalData" />
   <Proxy group="filters" name="Append" />
   <Proxy group="filters" name="AppendAttributes" />
   <Proxy group="filters" name="AppendPolyData" />
+  <Proxy group="filters" name="AppendReductionFilter" />
+  <Proxy group="filters" name="AngularPeriodicFilter" />
   <Proxy group="filters" name="ArbitrarySourceStreamTracer" />
   <Proxy group="filters" name="BlockIdScalars" />
   <Proxy group="filters" name="RandomAttributeGenerator" />
   <Proxy group="filters" name="CellCenters" />
   <Proxy group="filters" name="CellDataToPointData" />
   <Proxy group="filters" name="CellDerivatives"/>
+  <Proxy group="filters" name="CellSize" />
   <Proxy group="filters" name="CleanPolyData" />
   <Proxy group="filters" name="CleanUnstructuredGrid" />
   <Proxy group="filters" name="CleanUnstructuredGridCells" />
   <Proxy group="filters" name="Clip" />
   <Proxy group="filters" name="ClipClosedSurface" />
   <Proxy group="filters" name="Contour" />
+  <Proxy group="filters" name="CountCellFaces" />
+  <Proxy group="filters" name="CountCellVertices" />
   <Proxy group="filters" name="Curvatures" />
   <Proxy group="filters" name="Cut" />
   <Proxy group="filters" name="CutEverything" />
   <Proxy group="filters" name="D3" />
   <Proxy group="filters" name="DataSetSurfaceFilter" />
+  <Proxy group="filters" name="DataSetRegionSurfaceFilter" />
   <Proxy group="filters" name="DataSetTriangleFilter" />
   <Proxy group="filters" name="DecimatePro" />
   <Proxy group="filters" name="Delaunay2D" />
   <Proxy group="filters" name="Delaunay3D" />
   <Proxy group="filters" name="ElevationFilter" />
+  <Proxy group="filters" name="EvenlySpacedStreamlines2D" />
   <Proxy group="filters" name="ExtractBlock" />
   <Proxy group="filters" name="ExtractComponent" />
   <Proxy group="filters" name="ExtractEdges" />
   <Proxy group="filters" name="FFTSelectionOverTime" />
   <Proxy group="filters" name="GaussianSplatter"/>
   <Proxy group="filters" name="GenerateIdScalars"/>
+  <Proxy group="filters" name="GhostCellsGenerator" />
   <Proxy group="filters" name="Glyph" />
   <Proxy group="filters" name="GlyphWithCustomSource" />
   <Proxy group="filters" name="Gradient" />
   <Proxy group="filters" name="ImageDataToPointSet" />
   <Proxy group="filters" name="IntegrateAttributes" />
   <Proxy group="filters" name="IntegrateFlowThroughSurface" />
-  <Proxy group="filters" name="LegacyGlyph" />
   <!--  <Proxy group="filters" name="LevelIdScalars" /> -->
   <Proxy group="filters" name="LinearExtrusionFilter" />
   <Proxy group="filters" name="LoopSubdivisionFilter" />
   <Proxy group="filters" name="MeshQuality" />
   <Proxy group="filters" name="OctreeDepthLimit" />
   <Proxy group="filters" name="OctreeDepthScalars" />
+  <Proxy group="filters" name="OTKernelSmoothing" />
+  <Proxy group="filters" name="OTDensityMap" />
   <Proxy group="filters" name="OutlineCornerFilter" />
   <Proxy group="filters" name="OutlineFilter" />
   <Proxy group="filters" name="ParticlePathLines" />
   <Proxy group="filters" name="PlotOnSortedLines" />
   <Proxy group="filters" name="PointDataToCellData" />
   <Proxy group="filters" name="PolyDataNormals" />
-  <Proxy group="filters" name="Probe" />
-  <Proxy group="filters" name="ImageResampling" />
   <Proxy group="filters" name="ProbeLine" />
   <Proxy group="filters" name="ProbePoint" />
   <Proxy group="filters" name="ProcessIdScalars" />
   <Proxy group="filters" name="ProgrammableFilter" />
   <Proxy group="filters" name="PVConnectivityFilter" />
   <Proxy group="filters" name="PythonCalculator" />
-  <Proxy group="filters" name="PythonAnnotation" />
   <Proxy group="filters" name="PythonExtractSelection" />
 
   <Proxy group="filters" name="QuadricClustering" />
   <Proxy group="filters" name="RectilinearGridConnectivity" />
   <Proxy group="filters" name="RectilinearGridToPointSet" />
   <Proxy group="filters" name="ReflectionFilter" />
+  <Proxy group="filters" name="RemoveGhostInformation" />
+  <Proxy group="filters" name="ResampleToImage" />
+  <Proxy group="filters" name="ResampleWithDataset" />
   <Proxy group="filters" name="RibbonFilter" />
   <Proxy group="filters" name="RotationalExtrusionFilter" />
   <Proxy group="filters" name="ScatterPlot"/>
   <Proxy group="filters" name="TextureMapToPlane" />
   <Proxy group="filters" name="TextureMapToSphere" />
   <Proxy group="filters" name="Threshold" />
-  <Proxy group="filters" name="TimeToTextConvertor" />
   <Proxy group="filters" name="TransformFilter" />
   <Proxy group="filters" name="TriangleFilter" />
   <Proxy group="filters" name="TubeFilter" />
   <Proxy group="filters" name="GenericStreamTracer" />
   <Proxy group="filters" name="GenericGeometryFilter" />
   <Proxy group="filters" name="SliceAlongPolyLine" />
+  <Proxy group="filters" name="SliceWithPlane" />
+  <Proxy group="filters" name="RulerFilter" />
 </ParaViewFilters>
index b8b3cf8cb9da77b556039bca830caced1dde6def..2c5385a08775c53fb358bc52220ae8b436b78564 100644 (file)
   <Proxy group="sources" name="OutlineSource" />
   <Proxy group="sources" name="PlaneSource" />
   <Proxy group="sources" name="PointSource" />
+  <Proxy group="sources" name="PolyLineSource" />
   <Proxy group="sources" name="ProgrammableSource" />
+  <Proxy group="sources" name="Ruler" />
   <Proxy group="sources" name="SphereSource" />
   <Proxy group="sources" name="SplineSource" />
   <Proxy group="sources" name="SuperquadricSource" />
   <Proxy group="sources" name="TextSource" />
   <Proxy group="sources" name="TimeSource" />
-  <Proxy group="sources" name="Ruler" />
+  <Proxy group="sources" name="UnstructuredCellTypes" />
   <Proxy group="sources" name="RTAnalyticSource" />
   <Proxy group="sources" name="AMRGaussianPulseSource" />
 </ParaViewSources>
index f7f5e330fa6f672a4609a921b4bbfba4d1e4c415..10198c3cb614a614086955ac6701b02947900199 100755 (executable)
 #include <string>
 #include <list>
 
-#include <Basics_OCCTVersion.hxx>
+#include <Standard_DefineHandle.hxx>
 
 class SALOME_View;
 class SALOME_Displayer;
 class SALOME_ListIO;
-#if OCC_VERSION_MAJOR >= 7
-  class SALOME_InteractiveObject;
-#else
-  class Handle_SALOME_InteractiveObject;
-#endif
+class SALOME_InteractiveObject;
 
 /*!
  \class SALOME_Prs
index 7a52883c0318cccda83f0e597cddf8d777ef6a3a..132733b31221ec47d8877a06a7990286e72d5ce9 100644 (file)
     </message>
     <message>
       <source>ACT_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>Cherche</translation>
     </message>
     <message>
       <source>TTP_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>Cherche</translation>
     </message>
     <message>
       <source>DSC_FIND</source>
-      <translation type="unfinished">Find text</translation>
+      <translation>Cherche le text</translation>
     </message>
     <message>
       <source>ACT_REPLACE</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>Remplace</translation>
     </message>
     <message>
       <source>TTP_REPLACE</source>
-      <translation type="unfinished">Find &amp; Replace</translation>
+      <translation>Cherche &amp; Remplace</translation>
     </message>
     <message>
       <source>DSC_REPLACE</source>
-      <translation type="unfinished">Find and replace text</translation>
+      <translation>Cherche et remplace le texte</translation>
     </message>
     <message>
       <source>ACT_PREFERENCES</source>
index 35c4e054e10ce35cfbfb5cb8120e67775105a298..9d95992c0c0e68b40d8b881000f5eaeaefe635bf 100644 (file)
     </message>
     <message>
       <source>ACT_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>検索</translation>
     </message>
     <message>
       <source>TTP_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>検索</translation>
     </message>
     <message>
       <source>DSC_FIND</source>
-      <translation type="unfinished">Find text</translation>
+      <translation>テキストの検索</translation>
     </message>
     <message>
       <source>ACT_REPLACE</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>置換</translation>
     </message>
     <message>
       <source>TTP_REPLACE</source>
-      <translation type="unfinished">Find &amp; Replace</translation>
+      <translation>検索と置換</translation>
     </message>
     <message>
       <source>DSC_REPLACE</source>
-      <translation type="unfinished">Find and replace text</translation>
+      <translation>テキストの検索と置換</translation>
     </message>
     <message>
       <source>ACT_PREFERENCES</source>
index 09e879e34cbb18157376850ac6b417de0181a159..0fe626c72be3b9b63541fdce106925ac203f2d99 100755 (executable)
@@ -38,6 +38,9 @@
 #include <QApplication>
 #include <QDesktopWidget>
 #include <QtDebug>
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+#include <QSurfaceFormat>
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -2181,6 +2184,41 @@ Qt::HANDLE Qtx::getVisual()
 
 #endif // WIN32
 
+
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+/*!
+  \brief Set default QSurfaceFormat for an application.
+
+  This application property should be set before a creation of the QApplication.
+*/  
+void Qtx::initDefaultSurfaceFormat()
+{
+  // Settings from Paraview: 
+  // This piece of code was taken from QVTKOpenGLWidget::defaultFormat() method in
+  // order to avoid dependency of the SALOME_Session_Server on vtk libraries
+  QSurfaceFormat fmt;
+  fmt.setRenderableType(QSurfaceFormat::OpenGL);
+  fmt.setVersion(3, 2);
+  fmt.setProfile(QSurfaceFormat::CoreProfile);
+  fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+  fmt.setRedBufferSize(1);
+  fmt.setGreenBufferSize(1);
+  fmt.setBlueBufferSize(1);
+  fmt.setDepthBufferSize(1);
+  fmt.setStencilBufferSize(0);
+  fmt.setAlphaBufferSize(1);
+  fmt.setStereo(false);
+  fmt.setSamples(0);
+  
+  // Settings for OCCT viewer window:
+  fmt.setDepthBufferSize(16);
+  fmt.setStencilBufferSize(1);
+  //  fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
+
+  QSurfaceFormat::setDefaultFormat(fmt);
+}
+#endif
+
 /*!
   \class Qtx::CmdLineArgs
   \brief Get access to the command line arguments in the C-like manner.
index befacfb48854b19d30f332692295195d7c233a31..164b46c042dce5f94e8eeb728a9c18f4f8af8d5c 100755 (executable)
@@ -283,6 +283,10 @@ public:
   static void*       getDisplay();
   static Qt::HANDLE  getVisual();
 #endif
+
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+  static void initDefaultSurfaceFormat();
+#endif
 };
 
 #endif
index ded75b88fcc4052e14f2997cdbb6ca21cb0ca351..ee4db4cc8e0a5328593bac292be8656f1ce84155 100755 (executable)
@@ -28,8 +28,8 @@ ENDIF()
 INCLUDE_DIRECTORIES(
   ${CAS_INCLUDE_DIRS}
   ${QT_INCLUDES}
-  ${SIP_INCLUDE_DIRS}
   ${PYTHON_INCLUDE_DIRS}
+  ${SIP_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${Boost_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
index 589e537e1ab5e09b05d2ad2935f580f9a3b962eb..90208394d8161b5e5d01f33ec94dcb343a2c41e5 100755 (executable)
@@ -30,8 +30,8 @@ ENDIF()
 INCLUDE_DIRECTORIES(
   ${CAS_INCLUDE_DIRS}
   ${QT_INCLUDES}
-  ${SIP_INCLUDE_DIR}
   ${PYTHON_INCLUDE_DIRS}
+  ${SIP_INCLUDE_DIR}
   ${PTHREAD_INCLUDE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
   ${PROJECT_SOURCE_DIR}/src/CAM
index 184ad8f6316dcb82c72326e2b5747bf75db6e38b..39e8e1f77d4736df99ada097214f8346a84d8e57 100644 (file)
@@ -459,7 +459,7 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
        QStringList comps;
        aStudy->components( comps );
        foreach( QString comp, comps ) {
-         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), false );
          if ( d ) d->EraseAll( false, false, 0 );
        }
 
@@ -569,7 +569,7 @@ void SALOMEGUI_Swig::EraseAll()
        QStringList comps;
        aStudy->components( comps );
        foreach( QString comp, comps ) {
-         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), false );
          if ( d ) d->EraseAll( false, false, 0 );
        }
       }
@@ -603,7 +603,7 @@ public:
       if (!viewMgr) return;
       SUIT_ViewWindow* window = viewMgr->getActiveView();
       if ( window ) {
-        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getActiveView() );
+        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
         if ( view ) {
           SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
           myResult = !aPrs->IsNull();
@@ -633,7 +633,7 @@ void SALOMEGUI_Swig::UpdateView()
         if (!viewMgr) return;
         SUIT_ViewWindow* window = viewMgr->getActiveView();
         if ( window ) {
-          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getActiveView() );
+          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
           if ( view )
             view->Repaint();
         }
index 8c1fd4b6c84d9916e7f3dd0a8a0cff4ec81d726c..75331cfa114b068acf3216f5dad43f348a7dacb6 100644 (file)
@@ -57,9 +57,6 @@
 #include <QRegExp>
 #include <QString>
 #include <QStringList>
-#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-#include <QSurfaceFormat>
-#endif
 
 #include <stdlib.h>
 
@@ -183,12 +180,11 @@ int main( int argc, char* argv[] )
   }
 
 #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-  // initialization of the X11 visual on Linux
-  QSurfaceFormat format;
-  format.setDepthBufferSize(16);
-  format.setStencilBufferSize(1);
-  format.setProfile(QSurfaceFormat::CompatibilityProfile);
-  QSurfaceFormat::setDefaultFormat(format);
+  // RNV: setup the default format:
+  // QSurfaceFormat should be set before creation of QApplication,  
+  // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats
+  // (see void Qtx::initDefaultSurfaceFormat()) and set the resultant format here.
+  Qtx::initDefaultSurfaceFormat();
 #endif
 
   // add <qtdir>/plugins directory to the pluins search path for image plugins
index 493e5651ced4e8d99dc0affcb0cb8057a3da3edb..611319e1444e8bbd0380b036fd1839fd8b26177e 100755 (executable)
@@ -99,6 +99,7 @@ SET(_other_HEADERS
    SVTK_Selector.h
    SVTK_SpaceMouse.h
    SVTK_Utils.h
+   SVTK_Hash.h
 )
 
 # header files / no moc processing / internal
index eafd19747ba007a0da949ec9c543fabc5cb8381f..b0e88eca65708c3ee17f737cedf3d104b3712bf0 100644 (file)
@@ -84,9 +84,11 @@ int SALOME_LINE_WIDTH = 3;
 namespace
 {
   int
-  GetEdgeId(SALOME_Actor* theActor,
-            vtkPicker* thePicker, 
-            int theObjId)
+  GetEdgeAndNodesId(SALOME_Actor* theActor,
+                    vtkPicker* thePicker,
+                    int theObjId,
+                    int& theFirstNodeId,
+                    int& theSecondNodeId)
   {
     int anEdgeId = 0;
     if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
@@ -104,6 +106,8 @@ namespace
           if (aDist < aMinDist) {
             aMinDist = aDist;
             anEdgeId = -1 - i;
+            theFirstNodeId = aSelEdge->GetPointId(0);
+            theSecondNodeId = aSelEdge->GetPointId(1);
           }
         }
       }
@@ -447,15 +451,11 @@ SALOME_Actor
     if(mySelectionMode != ActorSelection){
       TColStd_IndexedMapOfInteger aMapIndex;
       mySelector->GetIndex( getIO(), aMapIndex );
-      switch( mySelectionMode ){
+      switch( mySelectionMode ) {
       case NodeSelection:
         myHighlightActor->GetProperty()->SetRepresentationToPoints();
         myHighlightActor->MapPoints( this, aMapIndex );
         break;
-      case EdgeOfCellSelection:
-        myHighlightActor->GetProperty()->SetRepresentationToWireframe();
-        myHighlightActor->MapEdge( this, aMapIndex );
-        break;
       case CellSelection:
       case EdgeSelection:
       case FaceSelection:
@@ -465,6 +465,12 @@ SALOME_Actor
         myHighlightActor->GetProperty()->SetRepresentationToSurface();
         myHighlightActor->MapCells( this, aMapIndex );
         break;
+      case EdgeOfCellSelection:
+       SVTK_IndexedMapOfIds aMapCompositeIndex;
+       mySelector->GetCompositeIndex( getIO(), aMapCompositeIndex );
+        myHighlightActor->GetProperty()->SetRepresentationToWireframe();
+       myHighlightActor->MapEdge( this, aMapCompositeIndex );
+       break;
       }
       myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
     }
@@ -597,20 +603,24 @@ SALOME_Actor
       if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) {
         int anObjId = GetElemObjId( aVtkId );
         if ( anObjId >= 0 ) {
-          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+          int aFNId, aSNId;
+          int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId);
           myIsPreselected = anEdgeId < 0;
           if(myIsPreselected){
-            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
-            int anExtent = aMapIndex.Extent();
-            anIsChanged |= (anExtent == 0 || anExtent == 1);
-            anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
-            if(anIsChanged){
-              TColStd_IndexedMapOfInteger aMapIndex;
-              aMapIndex.Add( anObjId );
-              aMapIndex.Add( anEdgeId );
-
+           int aFNObjId = GetNodeObjId( aFNId );
+           int aSNObjId = GetNodeObjId( aSNId );
+            const SVTK_IndexedMapOfIds& aMapIds = myPreHighlightActor->GetMapCompositeIndex();
+            int anExtent = aMapIds.Extent();
+            anIsChanged |= (anExtent == 0 || (anExtent > 0 && aMapIds(1).size() == 2 && 
+                                            (aFNObjId != aMapIds(1)[0] || aSNObjId != aMapIds(1)[1] ) ) );
+            if( anIsChanged ) {
+             SVTK_IndexedMapOfIds aMapIds;
+             SVTK_ListOfInteger aCompositeID;
+              aCompositeID.push_back( aFNObjId );
+              aCompositeID.push_back( aSNObjId );
+             aMapIds.Add( aCompositeID );
               myPreHighlightActor->GetProperty()->SetRepresentationToWireframe();
-              myPreHighlightActor->MapEdge( this, aMapIndex );
+              myPreHighlightActor->MapEdge( this, aMapIds );
             }
             myPreHighlightActor->SetVisibility( true );
           }
@@ -798,6 +808,50 @@ SALOME_Actor
         else if ( !anIsShift )
           mySelector->RemoveIObject( this );
       }
+      break;
+    }
+    case EdgeOfCellSelection:
+    {
+      SVTK::TPickLimiter aPickLimiter( myCellAreaPicker, this );
+      if( theSelectionEvent->myIsRectangle )
+        myCellAreaPicker->Pick( x1, y1, x2, y2, aRenderer, SVTK_AreaPicker::RectangleMode );
+      else if( theSelectionEvent->myIsPolygon )
+        myCellAreaPicker->Pick( theSelectionEvent->myPolygonPoints, aRenderer, SVTK_AreaPicker::PolygonMode );
+
+      const SVTK_AreaPicker::TVectorIdsMap& aVectorIdsMap = myCellAreaPicker->GetCellIdsMap();
+      SVTK_AreaPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
+      SVTK_IndexedMapOfIds anIndexes;
+      if(aMapIter != aVectorIdsMap.end()){
+        const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second;
+        vtkIdType anEnd = aVectorIds.size();
+        for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
+          int aCellId = aVectorIds[anId];
+          if ( !mySelector->IsValid( this, aCellId ) )
+            continue;
+
+          int anObjId = GetElemObjId( aCellId );
+          if( anObjId != -1 ) {
+            int aFNId, aSNId;
+            int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId);
+            if( anEdgeId < 0 ) {
+             SVTK_ListOfInteger aCompositeID;
+              aCompositeID.push_back( GetNodeObjId( aFNId ) );
+              aCompositeID.push_back( GetNodeObjId( aSNId ) );
+             anIndexes.Add( aCompositeID );
+            }
+          }
+        }
+      }
+
+      if ( hasIO() ) {
+        if( !anIndexes.IsEmpty() ) {
+          mySelector->AddOrRemoveCompositeIndex( myIO, anIndexes, anIsShift );
+          mySelector->AddIObject( this );
+          anIndexes.Clear();
+        }
+        else if ( !anIsShift )
+          mySelector->RemoveIObject( this );
+      }
     }
     default:
       break;
@@ -850,11 +904,14 @@ SALOME_Actor
       if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
         int anObjId = GetElemObjId( aVtkId );
         if( anObjId >= 0 ) {
-          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+          int aFNId, aSNId;
+          int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId);
           if( hasIO() && anEdgeId < 0 ) {
-            mySelector->AddOrRemoveIndex( myIO, anObjId, false );
-            mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
-            mySelector->AddIObject( this );
+           SVTK_ListOfInteger aCompositeID;
+           aCompositeID.push_back( GetNodeObjId( aFNId ) );
+           aCompositeID.push_back( GetNodeObjId( aSNId ) );
+           mySelector->AddOrRemoveCompositeIndex( myIO, aCompositeID, anIsShift );
+           mySelector->AddIObject( this );
           }
         }
       }
index a4e404ee69cbd7bd39002f4d48c5e9bda91ff20e..d410444699a73b9501d79ad78fcf5b8194d833ea 100644 (file)
@@ -103,6 +103,14 @@ SVTK_Actor
   return myMapIndex;
 }
 
+
+const SVTK_IndexedMapOfIds&
+SVTK_Actor
+::GetMapCompositeIndex() const 
+{
+  return myMapCompositeIndex;
+}
+
 void
 SVTK_Actor
 ::MapCells(SALOME_Actor* theMapActor,
@@ -213,6 +221,34 @@ SVTK_Actor
   myMapIndex = theMapIndex;
 }
 
+void
+SVTK_Actor
+::MapEdge( SALOME_Actor* theMapActor, 
+           const SVTK_IndexedMapOfIds& theMapCompositeIndex) {
+  myUnstructuredGrid->Initialize();
+  myUnstructuredGrid->Allocate();
+
+  vtkUnstructuredGrid * aSourceGrid = ( vtkUnstructuredGrid * )theMapActor->GetInput();
+  GetSource()->SetPoints( aSourceGrid->GetPoints() );
+
+  int aNbOfParts = theMapCompositeIndex.Extent();
+  for(int ind = 1; ind <= aNbOfParts; ind++){
+      std::vector<int> aNodesIds = theMapCompositeIndex( ind );
+      vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
+      ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[0] ) );
+      ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[1] ) );
+      myUnstructuredGrid->InsertNextCell(VTK_LINE,ids);
+  }
+
+  UnShrink();
+  if(theMapActor->IsShrunk()){
+    SetShrinkFactor(theMapActor->GetShrinkFactor());
+    SetShrink();
+  }
+  
+  myMapCompositeIndex = theMapCompositeIndex;
+}
+
 /*!
   To publish the actor an all its internal devices
 */
index 3b18d036b28a2c74041150b6a58ec741d7bbeb61..5b27bffebdb2f45cc5b2ed025c1957b5f9f098d4 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef SVTK_ACTOR_H
 #define SVTK_ACTOR_H
 
+#include "SVTK_Selector.h"
 #include <TColStd_IndexedMapOfInteger.hxx>
 
 class vtkRenderer;
@@ -32,7 +33,7 @@ class vtkUnstructuredGrid;
 
 #include "SVTK.h"
 #include "SVTK_DeviceActor.h"
-
+#include "SVTK_Hash.h"
 #include <vtkSmartPointer.h>
 
 class SALOME_Actor;
@@ -83,11 +84,21 @@ public:
   MapEdge(SALOME_Actor* theMapActor, 
           const TColStd_IndexedMapOfInteger& theMapIndex);
 
+//! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes using corner node ids
+  virtual void 
+  MapEdge(SALOME_Actor* theMapActor, 
+          const SVTK_IndexedMapOfIds& theMapCompositeIndex);
+  
+
   const TColStd_IndexedMapOfInteger&
   GetMapIndex() const;
 
+  const SVTK_IndexedMapOfIds&
+  GetMapCompositeIndex() const;
+
  protected:
   TColStd_IndexedMapOfInteger myMapIndex;
+  SVTK_IndexedMapOfIds        myMapCompositeIndex;
 
   vtkSmartPointer<vtkUnstructuredGrid> myUnstructuredGrid;
 
index efa906100d974096ffee624b68e5ffc665228c4d..8fefd95a8de2f810a978a6a197dbf03356b55418 100644 (file)
@@ -62,8 +62,8 @@ SVTK_DeviceActor
   myRepresentation = VTKViewer::Representation::Surface;
 
   myIsResolveCoincidentTopology = true;
-  vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                 myPolygonOffsetUnits);
+  VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+                                                     myPolygonOffsetUnits);
 
   myMapper = VTKViewer_DataSetMapper::New();
 
diff --git a/src/SVTK/SVTK_Hash.h b/src/SVTK/SVTK_Hash.h
new file mode 100644 (file)
index 0000000..4f045d5
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
+//
+
+//  SALOME SALOMEGUI : 
+//  File   : SVTK_Hash.h
+//  Author : Roman NIKOLAEV
+
+#ifndef SVTK_HASH_H
+#define SVTK_HASH_H
+
+#include <vector>
+#include <NCollection_IndexedMap.hxx>
+#include <Standard_Integer.hxx>
+
+typedef std::vector<Standard_Integer> SVTK_ListOfInteger;
+
+class SVTK_Hasher {
+
+public:
+    static Standard_Integer HashCode(const std::vector<Standard_Integer> ids,
+                                    const Standard_Integer upper) {
+        Standard_Integer seed = ids.size();
+        for( Standard_Integer i = 0; i <  (Standard_Integer) ids.size(); i++ ) {
+            Standard_Integer v = ids[i];
+            seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
+        }
+        return ::HashCode(seed,upper);
+    }
+
+    static Standard_Boolean IsEqual(const SVTK_ListOfInteger& theKey1,
+                                    const SVTK_ListOfInteger& theKey2) {
+        return theKey1 == theKey2;
+    }
+};
+
+typedef NCollection_IndexedMap<SVTK_ListOfInteger,SVTK_Hasher> SVTK_IndexedMapOfIds;
+
+#endif // SVTK_HASH_H
index c6278f7c2665cbe197a689dd12bafa7907d2a69f..c9c3858764eca5c6777b04c2b974f39bbdedd485 100644 (file)
@@ -604,10 +604,6 @@ SVTK_RenderWindowInteractor
     aStyle->SetInteractor(NULL);
     myInteractorStyles.pop();
   }
-
-  SetRenderer(NULL);
-
-  GetDevice()->SetRenderWindow(NULL);
 }
 
 /*!
index 51b32f21efb7c7cde2c229ad30b723669cd4ca5d..885f3485d4aa11c7cded36ece172caabfe9786a7 100644 (file)
@@ -23,7 +23,6 @@
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.cxx
 //  Author : Nicolas REJNERI
-
 #include "SVTK_SelectorDef.h"
 
 #include <VTKViewer_Filter.h>
@@ -106,6 +105,7 @@ SVTK_SelectorDef
   if(mySelectionMode != theMode){
     mySelectionMode = theMode;
     myMapIOSubIndex.clear();
+    myMapIOSubCompositeIndex.clear();
     this->EndPickCallback();
   }
 }
@@ -120,6 +120,7 @@ SVTK_SelectorDef
   myIO2Actors.clear();
   myIObjects.clear();
   myMapIOSubIndex.clear();
+  myMapIOSubCompositeIndex.clear();
 }
 
 /*!
@@ -206,6 +207,7 @@ SVTK_SelectorDef
   myIObjects.erase(theIO);
   myIO2Actors.erase(theIO);
   myMapIOSubIndex.erase(theIO);
+  myMapIOSubCompositeIndex.erase(theIO);
 
   return anIsIOBound;
 }
@@ -321,6 +323,29 @@ static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theI
   return anId != 0;
 }
 
+static bool removeCompositeIndex( SVTK_IndexedMapOfIds& theMapIndex, const SVTK_ListOfInteger theIds )
+{
+  int anId = theMapIndex.FindIndex( theIds ); // i==0 if Index is not in the MapIndex
+  if( anId ) {
+    // only the last key can be removed
+    SVTK_ListOfInteger aLastIds = theMapIndex.FindKey( theMapIndex.Extent() );
+    if( aLastIds == theIds )
+      theMapIndex.RemoveLast();
+    else {
+      SVTK_IndexedMapOfIds aNewMap;
+      aNewMap.ReSize(theMapIndex.Extent()-1);
+      for( int j = 1; j <= theMapIndex.Extent(); j++ ){
+        SVTK_ListOfInteger anIds = theMapIndex( j );
+        if ( anIds != theIds )
+          aNewMap.Add( anIds );
+      }
+      theMapIndex = aNewMap;
+    }
+  }
+  return anId != 0;
+}
+
+
 /*!
   Changes indices of subselection for SALOME_InteractiveObject
   \param theIO - SALOME_InteractiveObject
@@ -456,6 +481,147 @@ SVTK_SelectorDef
   myMapIOSubIndex.clear();  
 }
 
+/*!
+  \return true if the SALOME_InteractiveObject has a composite index subselection
+  \param theIO - SALOME_InteractiveObject
+*/
+bool 
+SVTK_SelectorDef
+::HasCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO ) const
+{
+  return myMapIOSubCompositeIndex.find( theIO ) != myMapIOSubCompositeIndex.end();
+}
+
+/*!
+  Gets composite indices of subselection for SALOME_InteractiveObject
+  \param theIO - SALOME_InteractiveObject
+*/
+void 
+SVTK_SelectorDef
+::GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                    SVTK_IndexedMapOfIds& theIds )
+{
+  TMapIOSubCompositeIndex::const_iterator anIter = myMapIOSubCompositeIndex.find( theIO );
+  if( anIter != myMapIOSubCompositeIndex.end() )
+    theIds = anIter->second;
+  else
+    theIds.Clear();
+}
+
+/*!
+  Changes composite indices of subselection for SALOME_InteractiveObject
+  \param theIO - SALOME_InteractiveObject
+  \param theIndices - composite id
+  \param theIsModeShift - if it is false, then map will be cleared before indices are added
+*/
+bool
+SVTK_SelectorDef
+::AddOrRemoveCompositeIndex( const Handle( SALOME_InteractiveObject )& theIO, 
+                    const SVTK_IndexedMapOfIds& theIds, 
+                    bool theIsModeShift)
+{
+  TMapIOSubCompositeIndex::iterator aMapIter = myMapIOSubCompositeIndex.find( theIO );
+  if( aMapIter == myMapIOSubCompositeIndex.end() ) {
+    SVTK_IndexedMapOfIds anEmpty;
+    aMapIter = myMapIOSubCompositeIndex.insert( TMapIOSubCompositeIndex::value_type( theIO, anEmpty ) ).first;
+  }
+  SVTK_IndexedMapOfIds& aMapIndex = aMapIter->second;
+
+  if( !theIsModeShift )
+    aMapIndex.Clear();
+  
+  for( int i = 1, iEnd = theIds.Extent(); i <= iEnd; i++ )
+    aMapIndex.Add( theIds( i ) );
+  
+  if( aMapIndex.IsEmpty() ) {
+    myMapIOSubCompositeIndex.erase( theIO );
+    return false;
+  }
+  return true;
+}
+
+/*!
+  Changes indices of subselection for SALOME_InteractiveObject
+  \param theIO - SALOME_InteractiveObject
+  \param theIds - composite ids
+  \param theIsModeShift - if it is false, then map will be cleared before indices are added
+*/
+bool 
+SVTK_SelectorDef
+::AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            SVTK_ListOfInteger theIds,
+                            bool theIsModeShift)
+{
+  TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO );
+  if( anIter == myMapIOSubCompositeIndex.end() ) {
+    SVTK_IndexedMapOfIds anEmpty;
+    anIter = myMapIOSubCompositeIndex.insert(TMapIOSubCompositeIndex::value_type( theIO,anEmpty ) ).first;
+  }
+
+  SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+
+  bool anIsContains = aMapIndex.Contains( theIds ) == Standard_True;
+  if ( anIsContains )
+    removeCompositeIndex( aMapIndex, theIds );
+  
+  if ( !theIsModeShift )
+    aMapIndex.Clear();
+  
+  if ( !anIsContains )
+    aMapIndex.Add( theIds );
+
+  if ( aMapIndex.IsEmpty() )
+    myMapIOSubIndex.erase( theIO );
+
+  return false;
+}
+
+/*!
+  Removes composite index of subselection for SALOME_InteractiveObject
+  \param theIO - SALOME_InteractiveObject
+  \param theIds - index
+*/
+void
+SVTK_SelectorDef
+::RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                       SVTK_ListOfInteger theIds )
+{
+  if(IsCompositeIndexSelected( theIO, theIds ) ) {
+    TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO );
+    SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+    removeCompositeIndex( aMapIndex,theIds );
+  }
+}
+
+/*!
+  \return true if the composite index presents in subselection 
+  \param theIO - SALOME_InteractiveObject
+  \param theIds - index
+*/
+bool
+SVTK_SelectorDef
+::IsCompositeIndexSelected( const Handle(SALOME_InteractiveObject)& theIO, 
+                           SVTK_ListOfInteger theIds ) const
+{
+  TMapIOSubCompositeIndex::const_iterator anIter = myMapIOSubCompositeIndex.find( theIO );
+  if( anIter != myMapIOSubCompositeIndex.end() ) {
+    const SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+    return aMapIndex.Contains( theIds ) == Standard_True;
+  }
+  return false;
+}
+
+/*!
+  Clears all composite indices of subselection
+*/
+void 
+SVTK_SelectorDef
+::ClearCompositeIndex()
+{
+  myMapIOSubCompositeIndex.clear();  
+}
+
+
 /*!
   To apply a filter on the selection
   \param theFilter - new filter
index c5c9831a58532832c5fc217e2d1a877a5d992f78..7b33b3d36964c9b6579b1bb4fa7678ad57c6c57e 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "SVTK.h"
 #include "SVTK_Selection.h"
+#include "SVTK_Hash.h"
+
 #include "SALOME_ListIO.hxx"
 
 #include <VTKViewer_Filter.h>
@@ -168,6 +170,48 @@ public:
   void 
   ClearIndex() = 0;
 
+  /// ! Composite indexes 
+  virtual
+  bool 
+  HasCompositeIndex(const Handle(SALOME_InteractiveObject)& theIO ) const = 0;
+
+  //! Get composite indexes of subslection for given #SALOME_InteractiveObject
+  virtual
+  void 
+  GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                    SVTK_IndexedMapOfIds& theIds ) = 0;
+        
+  //! Change composite indices of subselection for given #SALOME_InteractiveObject
+  virtual
+  bool 
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            const SVTK_IndexedMapOfIds& theIds,
+                            bool theIsModeShift) = 0;
+
+  //! Change composite index of subslection for given #SALOME_InteractiveObject
+  virtual
+  bool
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            SVTK_ListOfInteger ids, 
+                            bool theIsModeShift) = 0;
+
+  //! Change composite index of subslection for given #SALOME_InteractiveObject
+  virtual
+  void 
+  RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                       SVTK_ListOfInteger ids ) = 0;
+
+  //! Check, if the given composite index is present in subselection 
+  virtual
+  bool 
+  IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
+                          SVTK_ListOfInteger ids ) const = 0;
+
+  //! Clear composite indexes subselection
+  virtual
+  void 
+  ClearCompositeIndex() = 0;
+
   //----------------------------------------------------------------------------
   typedef int TFilterID;
 
index 2bec2075727f66b2f2cb70260b7995aee40925f8..c2e60309bc1f1ed3af0e7ab045835c56651ad873 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef SVTK_SELECTORDEF_H
 #define SVTK_SELECTORDEF_H
 
+#include "SVTK_Selector.h"
+
 #include <set>
 #include <map>
 
@@ -36,8 +38,6 @@
 
 #include "SALOME_InteractiveObject.hxx"
 
-#include "SVTK_Selector.h"
-
 class SALOME_Actor;
 
 class SVTK_Viewer;
@@ -135,6 +135,42 @@ public:
   void 
   ClearIndex();
 
+  //----------------------------------------------------------------------------
+  /// ! Composite indexes 
+  virtual
+  bool 
+  HasCompositeIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
+
+  virtual
+  void 
+  GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                    SVTK_IndexedMapOfIds& theIds );        
+  virtual
+  bool 
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            const SVTK_IndexedMapOfIds& theIds,
+                            bool theIsModeShift);
+
+  virtual
+  bool
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            SVTK_ListOfInteger theIds,
+                            bool theIsModeShift);
+
+  virtual
+  void 
+  RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                       SVTK_ListOfInteger theIds );
+
+  virtual
+  bool 
+  IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
+                          SVTK_ListOfInteger theIds ) const;
+
+  virtual
+  void 
+  ClearCompositeIndex();
+
   //----------------------------------------------------------------------------
   virtual
   void 
@@ -243,6 +279,12 @@ private:
                    TIOLessThan> TMapIOSubIndex;
   TMapIOSubIndex myMapIOSubIndex;
 
+  typedef std::map<Handle(SALOME_InteractiveObject),
+                   SVTK_IndexedMapOfIds,
+                   TIOLessThan> TMapIOSubCompositeIndex;
+  TMapIOSubCompositeIndex myMapIOSubCompositeIndex;
+
+
   typedef std::map<TFilterID,Handle(VTKViewer_Filter)> TFilters;
   TFilters myFilters;
 
index 108cee699ef84f9262bb889604f18a1f77a5694f..594ed26892c219c9dc39990ef44b81e640b19da4 100644 (file)
 
 #include "SalomeApp_Engine_i.h"
 #include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+#include "SUIT_Session.h"
+#include "CAM_Module.h"
+#include "LightApp_DataModel.h"
 
 #include <SALOME_NamingService.hxx>
 #include <SALOMEDS_Tool.hxx>
   Constructor
 */
 SalomeApp_Engine_i::SalomeApp_Engine_i( const char* theComponentName )
+  : myComponentName( theComponentName )
 {
-  myComponentName = theComponentName;
   MESSAGE("SalomeApp_Engine_i::SalomeApp_Engine_i(): myComponentName = " <<
-         myComponentName << ", this = " << this);
+         qPrintable( myComponentName ) << ", this = " << this);
 }
 
 /*!
@@ -56,7 +60,7 @@ SalomeApp_Engine_i::SalomeApp_Engine_i( const char* theComponentName )
 SalomeApp_Engine_i::~SalomeApp_Engine_i()
 {
   MESSAGE("SalomeApp_Engine_i::~SalomeApp_Engine_i(): myComponentName = " << 
-         myComponentName << ", this = " << this);
+         qPrintable( myComponentName ) << ", this = " << this);
 }
 
 SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theComponent,
@@ -65,38 +69,91 @@ SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theCompone
 {
   SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
 
+
   if (CORBA::is_nil(theComponent))
     return aStreamFile._retn();
+  
+  // Component type
+  QString componentName (theComponent->ComponentDataType());
 
+  // Error somewhere outside - Save() called with wrong SComponent instance
+  if ( myComponentName != componentName )
+    return aStreamFile._retn();
+    
   // Get a temporary directory to store a file
   //std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
 
-  std::string componentName (theComponent->ComponentDataType());
+  bool manuallySaved = false;
 
-  // Error somewhere outside - Save() called with
-  // wrong SComponent instance
-  if ( myComponentName != componentName )
-    return aStreamFile._retn();
+  if ( GetListOfFiles().empty() ) {
+
+    // Save was probably called from outside GUI, so SetListOfFiles was not called!
+    // Try to get list of files from directly from data model
+
+    MESSAGE("SalomeApp_Engine_i::Save(): myComponentName = " <<
+            qPrintable( myComponentName ) <<
+            "it seems Save() was called from outside GUI" );
+
+    // - Get app rnv
+    SalomeApp_Application* app = 
+      dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
+    if ( !app )
+      return aStreamFile._retn();
+
+    // - Get study
+    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+
+    if ( !study )
+      return aStreamFile._retn();
+    QString url = QString::fromStdString(study->studyDS()->URL());
+
+    // - Get module
+    CAM_Module* module = app->module( SalomeApp_Application::moduleTitle( componentName ) );
+    if ( !module ) // load module???
+      return aStreamFile._retn();
+    // - Get data model
+    LightApp_DataModel* dataModel = dynamic_cast<LightApp_DataModel*>( module->dataModel() );
+    if ( !dataModel )
+      return aStreamFile._retn();
+    // - Save data files
+    QStringList dataFiles;
+    // we use 'url' instead of 'theURL' as latter normally contains path to the tmp dir,
+    // but not actual study's URL
+    dataModel->saveAs( url, study, dataFiles );
+    std::vector<std::string> names;
+    foreach ( QString name, dataFiles ) {
+      if ( !name.isEmpty() )
+        names.push_back(name.toUtf8().data());
+    }
+    SetListOfFiles( names );
+    manuallySaved = true;
+  }
+
+  // Get a temporary directory to store a file
+  //std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
 
   // listOfFiles must contain temporary directory name in its first item
   // and names of files (relatively the temporary directory) in the others
   const int n = myListOfFiles.size() - 1;
-
+  
   if (n > 0) { // there are some files, containing persistent data of the component
     std::string aTmpDir = myListOfFiles[0];
-
+    
     // Create a list to store names of created files
     ListOfFiles aSeq;
     aSeq.reserve(n);
     for (int i = 0; i < n; i++)
       aSeq.push_back(CORBA::string_dup(myListOfFiles[i + 1].c_str()));
-
+    
     // Convert a file to the byte stream
     aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq, isMultiFile);
-
+    
     // Remove the files and tmp directory, created by the component storage procedure
     if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true);
   }
+  
+  if ( manuallySaved )
+    SetListOfFiles( ListOfFiles());
 
   return aStreamFile._retn();
 }
@@ -112,7 +169,7 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent,
 
   // Error somewhere outside - Load() called with
   // wrong SComponent instance
-  std::string componentName (theComponent->ComponentDataType());
+  QString componentName = theComponent->ComponentDataType();
   if ( myComponentName != componentName )
     return false;
 
@@ -154,7 +211,7 @@ Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean isPublished,
                                                                         CORBA::Boolean& isValidScript)
 {
   MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<<
-         myComponentName << ", this = " << this);
+         qPrintable( myComponentName ) << ", this = " << this);
   
   // Temporary solution: returning a non-empty sequence
   // even if there's nothing to dump, to avoid crashes in SALOMEDS
@@ -248,7 +305,7 @@ Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean isPublished,
 */
 char* SalomeApp_Engine_i::ComponentDataType()
 {
-  return const_cast<char*>( myComponentName.c_str() );
+  return CORBA::string_dup( myComponentName.toLatin1().constData() );
 }
 
 /*!
@@ -260,7 +317,7 @@ char* SalomeApp_Engine_i::getVersion()
   QString version;
   SalomeApp_Application::ModuleShortInfo version_info;
   foreach ( version_info, versions ) {
-    if ( SalomeApp_Application::moduleName( version_info.name ) == myComponentName.c_str() ) {
+    if ( SalomeApp_Application::moduleName( version_info.name ) == myComponentName ) {
       version = version_info.version;
       break;
     }
index 98412512b474d4b69021963bc90e5023fb7e4bbb..90a53b9ee12db04e42b02c5fc47d420bc57fee01 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "SALOME_Component_i.hxx"
 
+#include <QString>
 #include <vector> 
 #include <map> 
 
@@ -98,7 +99,7 @@ private:
 private:
   ListOfFiles                        myListOfFiles;
 
-  std::string                        myComponentName;
+  QString                            myComponentName;
 };
 
 #endif
index 4534dcf6bd5da930cbc2b0320635be9d40c7a6b5..36534eee57ce1d151cae817deb0c3fd82a57c3c1 100644 (file)
@@ -23,8 +23,6 @@
 #include "SalomeApp_ExceptionHandler.h"
 #include "Utils_CorbaException.hxx"
 
-#include "CASCatch.hxx"
-
 #include <OSD.hxx>
 
 #include <stdexcept>
@@ -53,16 +51,19 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
 /*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
 bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
 {
-  try {
+  bool result = true;
+
+  try
+  {
     OCC_CATCH_SIGNALS;
-    SUIT_ExceptionHandler::internalHandle( o, e );
+    result = SUIT_ExceptionHandler::internalHandle( o, e );
   }
-  catch(Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    throw Standard_Failure( aFail->GetMessageString() );
+  catch( Standard_Failure& e )
+  {
+    throw Standard_Failure( e.GetMessageString() );
   }
 
-  return true;
+  return result;
 }
 
 /*!Try to call handleSignals( o, e ), catch and show error message.*/
index 71644587752f3507615f5cdebba8e86cb0f8698e..c438b2de84c9c765660b3b26b2c5ea70aca83d67 100644 (file)
@@ -1042,6 +1042,8 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
     // for this module by LightApp_Engine_i::Load()
     bool isMultiFile = false; // TODO: decide, how to access this parameter
     RemoveTemporaryFiles( dm->module()->name().toStdString().c_str(), isMultiFile );
+    std::vector<std::string> listOfFiles   ;
+    SetListOfFiles( dm->module()->name().toStdString().c_str(), listOfFiles );
 
     // Something has been read -> create data model tree
     LightApp_DataModel* aDM = dynamic_cast<LightApp_DataModel*>( dm );
index 68319ee8a38a6aa8809a2c05781279ef7390cd75..93f64bc3e1d6dd4fc40d2e17895b22eb5a5a2a4b 100755 (executable)
@@ -31,19 +31,18 @@ INCLUDE(UsePyQt)
 # --- resources ---
 
 # uic files / to be processed by pyuic 
-SET(_pyuic_files
+SET(_pyuic_FILES
   minmax.ui
 )
 
 # scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 
 # --- scripts ---
 
 # scripts / static
 # TODO: process UIC files via PyQt pyuic tool, see UsePyQt.cmake
 SET(_plugins_SCRIPTS
-  ${_pyuic_SCRIPTS}
   minmax_plugin.py
   trihedron.py
   tubedialog_ui.py
@@ -52,11 +51,16 @@ SET(_plugins_SCRIPTS
   salome_plugins.py
   smesh_plugins.py
 )
+
 SET(_helper_SCRIPTS
   xalome.py
 )
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${_plugins_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS)
 SALOME_INSTALL_SCRIPTS("${_helper_SCRIPTS}" ${SALOME_INSTALL_PYTHON})
+SALOME_INSTALL_SCRIPTS("${_plugins_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
index c8465bfd0b5d1e01b283b6442b5466a9e85c2c91..439a516e15d5567915440c779eec235565d1a982 100755 (executable)
@@ -77,9 +77,6 @@
 #include <QWaitCondition>
 #include <QRegExp>
 #include <QTextStream>
-#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-#include <QSurfaceFormat>
-#endif
 
 /*! - read arguments, define list of server to launch with their arguments.
  * - wait for naming service
@@ -371,12 +368,13 @@ int main( int argc, char **argv )
   }
   
 #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-  // initialization of the X11 visual on Linux
-  QSurfaceFormat format;
-  format.setDepthBufferSize(16);
-  format.setStencilBufferSize(1);
-  format.setProfile(QSurfaceFormat::CompatibilityProfile);
-  QSurfaceFormat::setDefaultFormat(format);
+
+  // RNV: setup the default format:
+  // QSurfaceFormat should be set before creation of QApplication,  
+  // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats
+  // (see void Qtx::initDefaultSurfaceFormat()) and set the resultant format here.
+  Qtx::initDefaultSurfaceFormat(); 
+
 #endif
 
   // Create Qt application instance;
index 76f5d153bde1b9a64534a216f774c4ab2b6b0c82..c3f17f6e0679e60ab1e92dadecff6e2a589fd4bf 100755 (executable)
@@ -74,8 +74,8 @@ VTKViewer_Actor
   myIsPreselected(false),
   myIsHighlighted(false)
 {
-  vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                 myPolygonOffsetUnits);
+  VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+                                                    myPolygonOffsetUnits);
 
   for(int i = 0; i < 6; i++)
     myPassFilter.push_back(vtkPassThroughFilter::New());
@@ -273,6 +273,19 @@ VTKViewer_Actor
   units = myPolygonOffsetUnits;
 }
 
+/*!
+  Get polygon offset parameters
+  \param factor, units  - Opengl polygon offset parameters
+*/
+void
+VTKViewer_Actor
+::GetDefaultPolygonOffsetParameters(double& factor, 
+                                   double& units)
+{
+  factor = 2.0;
+  units = 2.0;
+}
+
 /*!
   \return shrink factor
 */
@@ -437,6 +450,17 @@ VTKViewer_Actor
   return GetInput()->GetPoint(theObjID);
 }
 
+/*!
+ Maps object index of a node to corresponding VTK index
+*/
+int
+VTKViewer_Actor
+::GetNodeVtkId( int theObjID )
+{
+  return theObjID;
+}
+
+
 /*!
   Get corresponding #vtkCell for given object index
 */
index e09c1e3e5184d211c428b4e3036aef5aeac3ce2e..4786236386c00237ea6f3d0f771c3dce526a4f93 100755 (executable)
@@ -146,6 +146,11 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   double*
   GetNodeCoord(int theObjID);
 
+  //! Maps object index of a node to corresponding VTK index
+  virtual
+  int 
+  GetNodeVtkId(int theObjID);
+
   //! Maps VTK index of a cell to corresponding object index
   virtual 
   int
@@ -257,6 +262,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   void
   GetPolygonOffsetParameters(double& factor, 
                              double& units);
+  
+  //! Get default ResolveCoincidentTopology parameters
+  static 
+  void
+  GetDefaultPolygonOffsetParameters(double& factor, 
+                                   double& units);
 
   virtual
   void
index 7aa8e69a96317992f5dbf0abdc51f674d1cbe947..63e048e2754799ec4bd1a83c3ef372801bf6d0b7 100755 (executable)
@@ -26,7 +26,7 @@
 
 #include "VTKViewer_Filter.h"
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient)
 
 /*!
  * \class       VTKViewer_Filter
index 1ccb8ed14771a4df32e6be947f1b401dcc34cc77..9926bde2d1bbd601ca1e633ce950233ddade01fd 100755 (executable)
 
 #include "VTKViewer.h"
 
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 class VTKViewer_Actor;
 
-DEFINE_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared);
+DEFINE_STANDARD_HANDLE(VTKViewer_Filter, Standard_Transient);
 
 /*
   Class       : VTKViewer_Filter
@@ -45,7 +43,7 @@ DEFINE_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared);
                 should be redefined in derived classes
 */
 
-class VTKViewer_Filter : public MMgt_TShared
+class VTKViewer_Filter : public Standard_Transient
 {
 
 public:
@@ -63,7 +61,7 @@ protected:
   VTKViewer_Actor*                             myActor;
 
 public:  
-  OCCT_DEFINE_STANDARD_RTTIEXT(VTKViewer_Filter,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient)
 };
 
 #endif
index a289dc87c2ac60cfe4457e5538e55e3e48d0eca7..cdc26ff24f1574b5f9869bf61e1dea9e8f09b03f 100755 (executable)
@@ -877,6 +877,7 @@ VTKViewer_GeometryFilter
         case VTK_QUADRATIC_HEXAHEDRON:
         case VTK_TRIQUADRATIC_HEXAHEDRON:
         case VTK_QUADRATIC_WEDGE:
+        case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
         case VTK_QUADRATIC_PYRAMID:
 
           if(!myIsWireframeMode)
@@ -939,11 +940,12 @@ VTKViewer_GeometryFilter
               {
                 int npts1 = 0;
                 switch (aCellType ){
-                case VTK_QUADRATIC_TETRA:         npts1 = 4; break;
-                case VTK_QUADRATIC_HEXAHEDRON:    npts1 = 8; break;
-                case VTK_TRIQUADRATIC_HEXAHEDRON: npts1 = 8; break;
-                case VTK_QUADRATIC_WEDGE:         npts1 = 6; break;
-                case VTK_QUADRATIC_PYRAMID:       npts1 = 5; break;
+                case VTK_QUADRATIC_TETRA:             npts1 = 4; break;
+                case VTK_QUADRATIC_HEXAHEDRON:        npts1 = 8; break;
+                case VTK_TRIQUADRATIC_HEXAHEDRON:     npts1 = 8; break;
+                case VTK_QUADRATIC_WEDGE:             npts1 = 6; break;
+                case VTK_BIQUADRATIC_QUADRATIC_WEDGE: npts1 = 6; break;
+                case VTK_QUADRATIC_PYRAMID:           npts1 = 5; break;
                 }
                 faceIdsTmp->SetNumberOfIds( npts1 );
                 if ( npts1 > 0 ) {
@@ -1086,6 +1088,7 @@ VTKViewer_GeometryFilter
             }
             case VTK_QUADRATIC_TETRA:
             case VTK_QUADRATIC_WEDGE:
+            case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
             case VTK_TRIQUADRATIC_HEXAHEDRON:
             case VTK_QUADRATIC_HEXAHEDRON:
             case VTK_QUADRATIC_PYRAMID:
index 53a65830a3f6088cc9b944bd5c5bc5ccc1ec7ec9..f99d102e143dcf0fe23b4c0cd4600d13f43d9886 100644 (file)
@@ -68,6 +68,7 @@ void VTKViewer_OpenGLRenderer::SetGradientType( const int theGradientType )
 
 void VTKViewer_OpenGLRenderer::Clear(void)
 {
+  vtkOpenGLRenderer::Clear();
 #ifdef VTK_OPENGL2
   if (this->OpenGLHelper.IsInitialized())
   {
index 4e97067eee1610fa7dc9fe69f927f7ac75d35c3b..fe91800a8cd7260aad9346026fce1643c1f95327 100644 (file)
 
 #include "ViewerData_AISShape.hxx"
 
-#ifdef USE_TEXTURED_SHAPE
-  OCCT_IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_TexturedShape)
-#else
-  OCCT_IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_Shape)
-#endif
+IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_ColoredShape)
 
 /*!
-  Constructor
-  \param shape - TopoDS shape 
+  Constructor.
+  \param shape Shape to manage.
 */
-ViewerData_AISShape::ViewerData_AISShape (const TopoDS_Shape& theShape)
-: BASE_SHAPE (theShape),
-  myIsClippable (true)
+ViewerData_AISShape::ViewerData_AISShape(const TopoDS_Shape& theShape)
+: AIS_ColoredShape(theShape),
+  myIsClippable(true)
 {
 }
 
 /*!
-  Destructor
+  Destructor.
 */
 ViewerData_AISShape::~ViewerData_AISShape()
 {
 }
-
index ed725f80ba38c15897f3db15e7f4734e12a65a3f..d45ade296d1d5bca3e49b7cce06678afafce5477 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#ifndef _ViewerData_AISShape_HeaderFile
-#define _ViewerData_AISShape_HeaderFile
-
-// When below macro is defined, AIS_TexturedShape is used as base class
-#define USE_TEXTURED_SHAPE
-
-#ifdef USE_TEXTURED_SHAPE
-  #include <AIS_TexturedShape.hxx>
-  #define BASE_SHAPE AIS_TexturedShape
-#else
-  #include <AIS_Shape.hxx>
-  #define BASE_SHAPE AIS_Shape
-#endif
+#ifndef VIEWERDATA_AISSHAPE
+#define VIEWERDATA_AISSHAPE
 
 #include <Standard.hxx>
 #include <Standard_DefineHandle.hxx>
+#include <AIS_ColoredShape.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
-class ViewerData_AISShape
-  : public BASE_SHAPE
+class ViewerData_AISShape : public AIS_ColoredShape
 {
 public:
-  Standard_EXPORT ViewerData_AISShape (const TopoDS_Shape& theShape);
+  Standard_EXPORT ViewerData_AISShape(const TopoDS_Shape&);
   Standard_EXPORT ~ViewerData_AISShape();
 
-  // checks if shape is clippable
+  //! Checks if shape is clippable.
   Standard_EXPORT inline bool IsClippable() const
   {
     return myIsClippable;
   }
 
-  // makes shape clippable/not clippable
-  Standard_EXPORT inline void SetClippable (bool isClippable)
+  //! Makes shape clippable/not clippable.
+  Standard_EXPORT inline void SetClippable(bool isClippable)
   {
     myIsClippable = isClippable;
   }
@@ -62,9 +49,9 @@ protected:
   bool myIsClippable;
 
 public:
-  OCCT_DEFINE_STANDARD_RTTIEXT(ViewerData_AISShape, BASE_SHAPE)
+  DEFINE_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_ColoredShape)
 };
 
-DEFINE_STANDARD_HANDLE(ViewerData_AISShape, BASE_SHAPE)
+DEFINE_STANDARD_HANDLE(ViewerData_AISShape, AIS_ColoredShape)
 
-#endif // _ViewerData_AISShape_HeaderFile
+#endif // VIEWERDATA_AISSHAPE
index 8d608b708b54ac1db9d729aabaede724bc55d5ae..185c427baf4a503cc8f1b2d2974d60ad2c886902 100755 (executable)
 
 ADD_SUBDIRECTORY(dlgfactory)
 
-IF(SALOME_USE_VTKVIEWER)
-  ADD_SUBDIRECTORY(vtkEDFOverloads)            
-ENDIF()
-
 ##
 # Python-based packages, part 1 (generic)
 ##
@@ -49,3 +45,10 @@ IF(SALOME_USE_PYVIEWER)
   ADD_SUBDIRECTORY(PyEditor)
 ENDIF(SALOME_USE_PYVIEWER)
 
+IF(COMPILER_SUPPORTS_CXX11)
+  SET(TOOLS_EXPORT_NAME ${PROJECT_NAME})
+  SET(REMOTEFILEBROWSER_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "")
+  SET(REMOTEFILEBROWSER_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "")
+  SET(REMOTEFILEBROWSER_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "")
+  ADD_SUBDIRECTORY(RemoteFileBrowser)
+ENDIF(COMPILER_SUPPORTS_CXX11)
index 4c72bdfb9d291100197b8af4d1f0494cbea743ec..a4ba14fdc4f0a152ad3297c9b04ee3bedc5fba5f 100644 (file)
@@ -39,7 +39,7 @@
 
 // ========================================================
 // avoid warning messages
-#ifdef WIN32
+#ifdef _MSC_VER
 #pragma warning (disable : 4786)
 #pragma warning (disable : 4251)
 #endif
index 9eaf24482202a5bc515e895b63f9dc2cd2501eec..0c9e9dadaa4188fc9e078cd177fd991a9b2dca3a 100644 (file)
     </message>
     <message>
         <source>TOO_MANY_MATCHES</source>
-        <translation type="unfinished">Too many matches! Displaying first ones only...</translation>
+        <translation>Trop d'occurences! Affichage des premières...</translation>
     </message>
     <message>
         <source>NO_DOC_AVAILABLE</source>
-        <translation type="unfinished">no documentation available</translation>
+        <translation>pas de documentation disponible</translation>
     </message>
 </context>
 </TS>
index fc2decc6a8d4c59f50c3e1a10bc0f8ee174326a5..f8e309645137db9c03fb59ea87fcf9d5db4d05c3 100644 (file)
     </message>
     <message>
       <source>GR_EDIT_SET</source>
-      <translation type="unfinished">Editor settings</translation>
+      <translation>Paramètres de l'éditeur</translation>
     </message>
     <message>
       <source>LBL_COMPLETION_MODE</source>
-      <translation type="unfinished">Completion mode</translation>
+      <translation>Mode de complétion</translation>
     </message>
     <message>
       <source>LBL_NONE</source>
-      <translation type="unfinished">None</translation>
+      <translation>Auncun</translation>
     </message>
     <message>
       <source>LBL_AUTO</source>
-      <translation type="unfinished">Auto</translation>
+      <translation>Auto</translation>
     </message>
     <message>
       <source>LBL_MANUAL</source>
-      <translation type="unfinished">Manual</translation>
+      <translation>Manuel</translation>
     </message>
     <message>
       <source>LBL_ALWAYS</source>
-      <translation type="unfinished">Always</translation>
+      <translation>Toujours</translation>
     </message>
     <message>
       <source>GR_TAB_SET</source>
     </message>
     <message>
       <source>ACT_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>Cherche</translation>
     </message>
     <message>
       <source>TTP_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>Cherche</translation>
     </message>
     <message>
       <source>DSC_FIND</source>
-      <translation type="unfinished">Find text</translation>
+      <translation>Cherche le texte</translation>
     </message>
     <message>
       <source>ACT_REPLACE</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>Remplace</translation>
     </message>
     <message>
       <source>TTP_REPLACE</source>
-      <translation type="unfinished">Find &amp; Replace</translation>
+      <translation>Cherche &amp; Remplace</translation>
     </message>
     <message>
       <source>DSC_REPLACE</source>
-      <translation type="unfinished">Find and replace text</translation>
+      <translation>Cherche et remplace le texte</translation>
     </message>
     <message>
       <source>ACT_PREFERENCES</source>
     </message>
     <message>
       <source>FILE_PARAM_NAME</source>
-      <translation type="unfinished">file</translation>
+      <translation>fichier</translation>
     </message>
     <message>
       <source>FILE_PARAM_DESCRIPTION</source>
-      <translation type="unfinished">File to edit.</translation>
+      <translation>Fichier à éditer.</translation>
     </message>
   </context>
   <context>
     <name>PyEditor_FindTool</name>
     <message>
       <source>FIND_LABEL</source>
-      <translation type="unfinished">Find:</translation>
+      <translation>Cherche:</translation>
     </message>
     <message>
       <source>REPLACE_LABEL</source>
-      <translation type="unfinished">Replace with:</translation>
+      <translation>Remplace avec:</translation>
     </message>
     <message>
       <source>REPLACE_BTN</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>Remplace</translation>
     </message>
     <message>
       <source>REPLACE_ALL_BTN</source>
-      <translation type="unfinished">Replace All</translation>
+      <translation>Remplace tout</translation>
     </message>
     <message>
       <source>CASE_SENSITIVE_CHECK</source>
-      <translation type="unfinished">Case Sensitive</translation>
+      <translation>Sensible à la casse</translation>
     </message>
     <message>
       <source>WHOLE_WORDS_CHECK</source>
-      <translation type="unfinished">Whole Words Only</translation>
+      <translation>Mots entiers uniquement</translation>
     </message>
     <message>
       <source>REGEX_CHECK</source>
-      <translation type="unfinished">Use Regular Expressions</translation>
+      <translation>Utilise des expressions régulières</translation>
     </message>
     <message>
       <source>NB_MATCHED_LABEL</source>
-      <translation type="unfinished">%1 of %2 matches</translation>
+      <translation>%1 sur %2 correspond</translation>
     </message>
   </context>
 </TS>
index ec1846668f2baa5ef8b9455102c5570f567b199a..d34a57d0c6a1b1c0165c9cd0a30117cfba56b7b3 100644 (file)
     </message>
     <message>
       <source>GR_EDIT_SET</source>
-      <translation type="unfinished">Editor settings</translation>
+      <translation>エディタの設定</translation>
     </message>
     <message>
       <source>LBL_COMPLETION_MODE</source>
-      <translation type="unfinished">Completion mode</translation>
+      <translation>完全モード</translation>
     </message>
     <message>
       <source>LBL_NONE</source>
-      <translation type="unfinished">None</translation>
+      <translation>なし</translation>
     </message>
     <message>
       <source>LBL_AUTO</source>
-      <translation type="unfinished">Auto</translation>
+      <translation>自動</translation>
     </message>
     <message>
       <source>LBL_MANUAL</source>
-      <translation type="unfinished">Manual</translation>
+      <translation>手動</translation>
     </message>
     <message>
       <source>LBL_ALWAYS</source>
-      <translation type="unfinished">Always</translation>
+      <translation>常時</translation>
     </message>
     <message>
       <source>GR_TAB_SET</source>
     </message>
     <message>
       <source>ACT_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>検索</translation>
     </message>
     <message>
       <source>TTP_FIND</source>
-      <translation type="unfinished">Find</translation>
+      <translation>検索</translation>
     </message>
     <message>
       <source>DSC_FIND</source>
-      <translation type="unfinished">Find text</translation>
+      <translation>テキストの検索</translation>
     </message>
     <message>
       <source>ACT_REPLACE</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>置換</translation>
     </message>
     <message>
       <source>TTP_REPLACE</source>
-      <translation type="unfinished">Find &amp; Replace</translation>
+      <translation>検索と置換</translation>
     </message>
     <message>
       <source>DSC_REPLACE</source>
-      <translation type="unfinished">Find and replace text</translation>
+      <translation>テキストの検索と置換</translation>
     </message>
     <message>
       <source>ACT_PREFERENCES</source>
     </message>
     <message>
       <source>WRN_READ_FILE</source>
-      <translation>ファイルが読めません %1:
-%2.</translation>
+      <translation>ファイルが読めません %1:\n%2.</translation>
     </message>
     <message>
       <source>WRN_WRITE_FILE</source>
-      <translation>ファイルが書き込めません %1:
-%2.</translation>
+      <translation>ファイルが書き込めません %1:\n%2.</translation>
     </message>
     <message>
       <source>STS_READY</source>
     <name>PyEditor</name>
     <message>
       <source>PROGRAM_DESCRIPTION</source>
-      <translation>Pythonのエディタ</translation>
+      <translation>簡易 Python エディタ</translation>
     </message>
     <message>
       <source>FILE_PARAM_NAME</source>
-      <translation type="unfinished">file</translation>
+      <translation>ファイル</translation>
     </message>
     <message>
       <source>FILE_PARAM_DESCRIPTION</source>
-      <translation type="unfinished">File to edit.</translation>
+      <translation>ファイルの編集</translation>
     </message>
   </context>
   <context>
     <name>PyEditor_FindTool</name>
     <message>
       <source>FIND_LABEL</source>
-      <translation type="unfinished">Find:</translation>
+      <translation>Find:</translation>
     </message>
     <message>
       <source>REPLACE_LABEL</source>
-      <translation type="unfinished">Replace with:</translation>
+      <translation>Replace with:</translation>
     </message>
     <message>
       <source>REPLACE_BTN</source>
-      <translation type="unfinished">Replace</translation>
+      <translation>置換</translation>
     </message>
     <message>
       <source>REPLACE_ALL_BTN</source>
-      <translation type="unfinished">Replace All</translation>
+      <translation>全て置換</translation>
     </message>
     <message>
       <source>CASE_SENSITIVE_CHECK</source>
-      <translation type="unfinished">Case Sensitive</translation>
+      <translation>大文字と小文字を区別</translation>
     </message>
     <message>
       <source>WHOLE_WORDS_CHECK</source>
-      <translation type="unfinished">Whole Words Only</translation>
+      <translation>完全に同一な単語のみ</translation>
     </message>
     <message>
       <source>REGEX_CHECK</source>
-      <translation type="unfinished">Use Regular Expressions</translation>
+      <translation>正規表現を使用</translation>
     </message>
     <message>
       <source>NB_MATCHED_LABEL</source>
-      <translation type="unfinished">%1 of %2 matches</translation>
+      <translation>%1 of %2 matches</translation>
     </message>
   </context>
 </TS>
diff --git a/tools/RemoteFileBrowser/CMakeLists.txt b/tools/RemoteFileBrowser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..28b51be
--- /dev/null
@@ -0,0 +1,82 @@
+# Copyright (C) 2017  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
+#
+# Author : Anthony GEAY (EDF R&D)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+PROJECT(RemoteFileBrowser CXX)
+
+CMAKE_POLICY(SET CMP0003 NEW)
+
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+  LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+  INCLUDE(SalomeMacros)
+ELSE()
+  MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
+
+SET(REMOTEFILEBROWSER_INSTALL_BINS bin CACHE PATH "Install path: RemoteFileBrowser binaries")
+SET(REMOTEFILEBROWSER_INSTALL_LIBS lib CACHE PATH "Install path: RemoteFileBrowser libraries")
+SET(REMOTEFILEBROWSER_INSTALL_HEADERS include CACHE PATH "Install path: RemoteFileBrowser headers")
+
+INCLUDE(SalomeSetupPlatform)
+SET(BUILD_SHARED_LIBS TRUE)
+INCLUDE(SalomeMacros)
+FIND_PACKAGE(SalomeQt5 REQUIRED)
+INCLUDE(UseQtExt)
+INCLUDE_DIRECTORIES(
+  ${QT_INCLUDES}
+  )
+
+ADD_DEFINITIONS(
+  ${QT_DEFINITIONS}
+  )
+
+SET(qremotefilebrowser_SOURCES
+  QRemoteFileBrowser.cxx
+  QMachineBrowser.cxx
+  QRemoteCopyWidget.cxx
+  )
+
+SET(qremotefilebrowser_HEADERS
+  QRemoteFileBrowser
+  QRemoteCopyWidget
+  QMachineBrowser
+  )
+
+SET(qremotefilebrowser_LIBRARIES
+  "Qt5::Core;Qt5::Widgets"
+  )
+
+SET(_moc_HEADERS
+  QRemoteFileBrowser
+  QMachineBrowser
+  QRemoteCopyWidget
+  )
+
+# sources / moc wrappings
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
+
+ADD_LIBRARY(qremotefilebrowser ${qremotefilebrowser_SOURCES} ${_moc_SOURCES})
+TARGET_LINK_LIBRARIES(qremotefilebrowser ${qremotefilebrowser_LIBRARIES})
+ADD_EXECUTABLE(remotefilebrowser remotefilebrowser.cxx)
+TARGET_LINK_LIBRARIES(remotefilebrowser qremotefilebrowser)
+INSTALL(TARGETS remotefilebrowser DESTINATION ${REMOTEFILEBROWSER_INSTALL_BINS})
+INSTALL(TARGETS qremotefilebrowser DESTINATION ${REMOTEFILEBROWSER_INSTALL_LIBS})
+INSTALL(FILES ${_moc_HEADERS} DESTINATION ${REMOTEFILEBROWSER_INSTALL_HEADERS})
diff --git a/tools/RemoteFileBrowser/QMachineBrowser b/tools/RemoteFileBrowser/QMachineBrowser
new file mode 100644 (file)
index 0000000..f5c7f85
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#ifndef __QMACHINEBROWSER__
+#define __QMACHINEBROWSER__
+
+#include <QWidget>
+#include <QComboBox>
+
+class QPushButton;
+class QLineEdit;
+
+class QMachineSelector : public QComboBox
+{
+  Q_OBJECT
+public:
+  QMachineSelector(QWidget *parent);
+  void initLocation();
+public slots:
+  void appendEntry(const QString& entry);
+private:
+  void fillMachines();
+  void fillMachinesFromCatalog();
+  void fillMachinesFromSettings();
+  void assignToLocalhost();
+};
+
+class QMachineManager : public QWidget
+{
+  Q_OBJECT
+public:
+  QMachineManager(QWidget *parent);
+  void initLocation();
+  QString getSelectedHost() const;
+public slots:
+  void newEntryRequested();
+private:
+  QPushButton *_pb;
+  QMachineSelector *_ms;
+};
+
+class QRemoteFileSystemModel;
+class FileLoader;
+
+class QMachineBrowser : public QWidget
+{
+  Q_OBJECT
+public:
+  QMachineBrowser(QWidget *parent=NULL);
+  void initLocation();
+  QRemoteFileSystemModel *generateModel();
+  FileLoader *generateFileLoader();
+signals:
+  void locationChanged();
+private:
+  QMachineManager *_msel;
+  QLineEdit *_le;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/QMachineBrowser.cxx b/tools/RemoteFileBrowser/QMachineBrowser.cxx
new file mode 100644 (file)
index 0000000..9f5a65a
--- /dev/null
@@ -0,0 +1,210 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "QMachineBrowser"
+#include "QRemoteFileBrowser"
+
+#include "QDir"
+#include "QFileInfo"
+#include "QVBoxLayout"
+#include "QPushButton"
+#include "QMessageBox"
+#include "QInputDialog"
+#include "QXmlStreamReader"
+#include "QProcessEnvironment"
+
+#include <iostream>
+
+constexpr const char localhost[]="localhost";
+
+QMachineSelector::QMachineSelector(QWidget *parent):QComboBox(parent)
+{
+  this->fillMachines();
+}
+
+void QMachineSelector::initLocation()
+{
+  this->assignToLocalhost();
+}
+
+void QMachineSelector::fillMachines()
+{
+  this->fillMachinesFromCatalog();
+  this->fillMachinesFromSettings();
+}
+
+void QMachineSelector::appendEntry(const QString& entry)
+{
+  for(int i=0;i<this->count();i++)
+    {
+      if(this->itemText(i)==entry)
+        return ;
+    }
+  this->insertItem(this->count(),entry);
+  this->setCurrentIndex(this->count()-1);
+}
+
+void QMachineSelector::fillMachinesFromCatalog()
+{
+  constexpr const char APPLI[]="APPLI";
+  constexpr const char RESOURCES[]="CatalogResources.xml";
+  if(!QProcessEnvironment::systemEnvironment().contains(APPLI))
+    return ;
+  QString appli(QProcessEnvironment::systemEnvironment().value(APPLI));
+  QFileInfo fi(QDir::homePath(),appli);
+  if(!(fi.exists() && fi.isDir()))
+    return ;
+  QFileInfo fi2(QDir(fi.canonicalFilePath()),QString(RESOURCES));
+  if(!(fi2.exists() && fi2.isFile()))
+    return ;
+  QFile file(fi2.canonicalFilePath());
+  if(!file.open(QFile::ReadOnly | QFile::Text))
+    {
+      return ;
+    }
+  QXmlStreamReader reader;
+  reader.setDevice(&file);
+  reader.readNext();
+  while(!reader.atEnd())
+    {
+      if(reader.isStartElement())
+        {
+          if(reader.name()=="machine")
+            {
+              foreach(const QXmlStreamAttribute &attr, reader.attributes())
+                {
+                  if(attr.name().toString()==QLatin1String("name"))
+                    {
+                      this->insertItem(this->count(),attr.value().toString());
+                    }
+                }
+            }
+          reader.readNext();
+        }
+      else
+        reader.readNext();
+    }
+}
+
+void QMachineSelector::assignToLocalhost()
+{
+  int i(0);
+  for(;i<this->count();i++)
+    if(this->itemText(i)==localhost)
+      break ;
+  if(i==this->count())
+    {
+      this->insertItem(this->count(),QString(localhost));
+      this->setCurrentIndex(this->count()-1);
+    }
+  else
+    this->setCurrentIndex(i);
+}
+
+void QMachineSelector::fillMachinesFromSettings()
+{
+}
+
+QMachineManager::QMachineManager(QWidget *parent):QWidget(parent),_pb(nullptr),_ms(nullptr)
+{
+  QHBoxLayout *lay(new QHBoxLayout(this));
+  _pb=new QPushButton(this);
+  _pb->setText("Add");
+  _pb->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
+  lay->addWidget(_pb);
+  _ms=new QMachineSelector(this);
+  lay->addWidget(_ms);
+  connect(_pb,SIGNAL(clicked()),this,SLOT(newEntryRequested()));
+}
+
+void QMachineManager::initLocation()
+{
+  _ms->initLocation();
+}
+
+QString QMachineManager::getSelectedHost() const
+{
+  return _ms->currentText();
+}
+
+void QMachineManager::newEntryRequested()
+{
+  constexpr int timeEllapse=3000;
+  bool isOK(false);
+  QString newEntry(QInputDialog::getItem(this,"Append new host","Hostname",QStringList(),/*current*/0,/*editable*/true,&isOK,Qt::Tool));
+  if(!isOK)
+    return ;
+  {
+    QProcess proc;
+    {
+      QStringList st(newEntry);
+      st << "-c" << "1" << "-w" << QString::number(timeEllapse/1000);//attempt to send one packet within timeEllapse ms
+      proc.start("ping",st);
+    }
+    if(proc.waitForFinished(-1))
+      {
+        if(proc.exitCode()!=0)
+          {
+            QMessageBox::information(this,"Information",QString("host %1 ping failed !").arg(newEntry));
+            return ;
+          }
+      }
+    else
+      {
+        QMessageBox::information(this,"Information",QString("host %1 ping failed !").arg(newEntry));
+        return ;
+      }
+  }
+  _ms->appendEntry(newEntry);
+}
+
+QMachineBrowser::QMachineBrowser(QWidget *parent):QWidget(parent),_msel(nullptr),_le(nullptr)
+{
+  QVBoxLayout *lay(new QVBoxLayout(this));
+  _msel=new QMachineManager(this);
+  _le=new QLineEdit(this);
+  lay->addWidget(_msel);
+  lay->addWidget(_le);
+  connect(_le,SIGNAL(returnPressed()),this,SIGNAL(locationChanged()));
+}
+
+void QMachineBrowser::initLocation()
+{
+  _msel->initLocation();
+  _le->setText(QDir::currentPath());
+  emit this->locationChanged();
+}
+
+QRemoteFileSystemModel *QMachineBrowser::generateModel()
+{
+  FileLoader *fl(this->generateFileLoader());
+  return new QRemoteFileSystemModel(this,fl);
+}
+
+FileLoader *QMachineBrowser::generateFileLoader()
+{
+  FileLoader *fl(nullptr);
+  QString host(_msel->getSelectedHost());
+  if(host==localhost)
+    fl=new LocalFileLoader(_le->text());
+  else
+    fl=new RemoteFileLoader(host,_le->text());
+  return fl;
+}
diff --git a/tools/RemoteFileBrowser/QRemoteCopyWidget b/tools/RemoteFileBrowser/QRemoteCopyWidget
new file mode 100644 (file)
index 0000000..4814b0a
--- /dev/null
@@ -0,0 +1,128 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#ifndef __QREMOTECOPYWIDGET__
+#define __QREMOTECOPYWIDGET__
+
+#include "QDialog"
+#include "QMutex"
+#include "QThread"
+#include "QTreeView"
+#include "QTableView"
+#include "QItemDelegate"
+#include "QPointer"
+#include "QProcess"
+
+class QRemoteFileSystemModel;
+class QFilesDirsCopierModel;
+class DataStructure;
+class QTableView;
+
+void PerformCopy(QWidget *parent, QRemoteFileSystemModel *srcModel, const QModelIndexList& srcSelectedFiles, DataStructure *ds);
+
+class CopierThread : public QThread
+{
+public:
+  CopierThread(QObject *parent, QFilesDirsCopierModel *model):QThread(parent),_model(model) { }
+  void stopRequested();
+protected:
+  void run();
+private:
+  QFilesDirsCopierModel *_model;
+};
+
+class QFilesDirsCopierModel : public QAbstractListModel
+{
+  Q_OBJECT
+public:
+  QFilesDirsCopierModel(QObject *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
+  int nbOfRows() const;
+  int rowCount(const QModelIndex&) const;
+  int columnCount(const QModelIndex&) const;
+  QVariant data(const QModelIndex&, int) const;
+  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+  const QString& getErrorStr() const { return _error; }
+  int getProgressOf(int srcFileId) const;
+  QString getFullNameOf(int srcFileId) const;
+  QString getNameOf(int srcFileId) const;
+  QString getPrettyText(int srcFileId) const;
+  QSize sizeHint() const;
+  //
+  void launchCopy();
+  void stopCurrentCopy();
+public slots:
+  void newOutputAvailable();
+private:
+  void fillArgsForRSync(const DataStructure *srcFile, QStringList& args) const;
+private:
+  QList<const DataStructure *> _srcFiles;
+  //
+  mutable QMutex _mutOnProc;
+  volatile int _currentElt;
+  QPointer<QProcess> _curProc;
+  QString _error;
+  //
+  QVector<int> _progress;
+  DataStructure *_destLoc;
+public:
+  static constexpr int PROGRESS_STATUS_START=-1;
+  static constexpr int PROGRESS_STATUS_OVER=101;
+  static const char ATOMIC_STOP_MSG[];
+};
+
+class ProgressDelegate : public QItemDelegate
+{
+public:
+  ProgressDelegate(QObject *parent, QFilesDirsCopierModel *model):QItemDelegate(parent),_model(model) { }
+  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+private:
+  QFilesDirsCopierModel *_model;
+};
+
+class CopierTableView : public QTableView
+{
+public:
+  CopierTableView(QWidget *parent);
+  int sizeHintForColumn(int column) const;
+  int sizeHintForRow(int row) const;
+  void resizeEvent(QResizeEvent *event);
+  QSize sizeHint() const;
+};
+   
+class FilesDirsCopier : public QDialog
+{
+  Q_OBJECT
+public:
+  FilesDirsCopier(QWidget *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
+public slots:
+  void cancelRequested();
+  void myAccept(bool);
+  int exec();
+  const QString& getErrorStr() const { return _model->getErrorStr(); }
+signals:
+  void myAcceptSignal(bool);
+private:
+  CopierTableView *_table;
+  QPushButton *_cancel;
+  CopierThread *_th;
+  QFilesDirsCopierModel *_model;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx b/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx
new file mode 100644 (file)
index 0000000..57b2137
--- /dev/null
@@ -0,0 +1,402 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "QRemoteCopyWidget"
+#include "QRemoteFileBrowser"
+#include "QVBoxLayout"
+#include "QPushButton"
+#include "QHeaderView"
+#include "QResizeEvent"
+#include "QProcess"
+#include "QPainter"
+#include "QPaintDevice"
+#include "QMetaType"
+#include "QApplication"
+#include "QMessageBox"
+
+#include <iostream>
+
+const char QFilesDirsCopierModel::ATOMIC_STOP_MSG[]="Clean interruption";
+
+void FilterEntries(const TopDirDataStructure *tpds, QList<const DataStructure *>& listToFilter)
+{
+  for(QList<const DataStructure *>::iterator it(listToFilter.begin());it!=listToFilter.end();it++)
+    {
+      const DataStructure *elt(*it);
+      std::vector<const DataStructure *> toKill(elt->getItermediateElts(tpds));
+      for(QList<const DataStructure *>::iterator it2(listToFilter.begin());it2!=listToFilter.end();)
+        {
+          if(it==it2)
+            {
+              it2++;
+              continue;
+            }
+          if(std::find(toKill.begin(),toKill.end(),*it2)!=toKill.end())
+            it2=listToFilter.erase(it2);
+          else
+            it2++;
+        }
+    }
+}
+
+void PerformCopy(QWidget *parent, QRemoteFileSystemModel *srcModel, const QModelIndexList& srcSelectedFiles, DataStructure *ds)
+{
+  QStringList sl;
+  if(srcSelectedFiles.isEmpty())
+    return ;
+  // Filtering
+  const TopDirDataStructure *tpdsSrc(nullptr);
+  QList<const DataStructure *> listOfEntries;
+  foreach(const QModelIndex& srcItem, srcSelectedFiles)
+    {
+      quintptr pt(srcItem.internalId());
+      const DataStructure *srcDS(reinterpret_cast<const DataStructure *>(pt));
+      if(!srcDS)
+        continue;
+      if(!tpdsSrc)
+        tpdsSrc=srcDS->getRoot();
+      listOfEntries.push_back(srcDS);
+    }
+  FilterEntries(tpdsSrc,listOfEntries);
+  // End filtering
+  FilesDirsCopier fdc(parent,listOfEntries,ds);
+  int res(fdc.exec());
+  if(res!=QDialog::Accepted)
+    {
+      QMessageBox mb(QMessageBox::Warning,"Copy status",fdc.getErrorStr());
+      mb.exec();
+    }
+  
+}
+
+void CopierThread::run()
+{
+  _model->launchCopy();
+  FilesDirsCopier *par(qobject_cast<FilesDirsCopier *>(parent()));
+  if(!par)
+    return ;
+  emit par->myAcceptSignal(_model->getErrorStr().isEmpty());//emit signal to notify main thread. Not direct invocation because executed in different thread
+}
+
+void CopierThread::stopRequested()
+{
+  _model->stopCurrentCopy();
+  requestInterruption();
+}
+
+QFilesDirsCopierModel::QFilesDirsCopierModel(QObject *parent2, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc):QAbstractListModel(parent2),_srcFiles(srcFiles),_currentElt(0),_curProc(nullptr),_destLoc(destLoc),_progress(_srcFiles.size(),0)
+{
+  QTableView *par(qobject_cast<QTableView *>(parent()));
+  par->resizeColumnToContents(0);
+  qRegisterMetaType<QVector<int>>();//to be able to send 3th arg on dataChanged signal
+}
+
+int QFilesDirsCopierModel::nbOfRows() const
+{
+  return _srcFiles.size();
+}
+
+int QFilesDirsCopierModel::rowCount(const QModelIndex&) const
+{
+  return nbOfRows();
+}
+
+int QFilesDirsCopierModel::columnCount(const QModelIndex&) const
+{
+  return 1;
+}
+
+QVariant QFilesDirsCopierModel::data(const QModelIndex& index, int role) const
+{
+  if(!index.isValid())
+    return QVariant();
+  if(role==Qt::DisplayRole || role==Qt::EditRole)
+    {
+      return _srcFiles[index.row()]->fullName();
+    }
+  return QVariant();
+}
+
+QVariant QFilesDirsCopierModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+  if(role==Qt::DisplayRole || role==Qt::EditRole)
+    {
+      if(orientation==Qt::Horizontal)
+        {
+          return QString("Files to be copied");
+        }
+    }
+  return QAbstractListModel::headerData(section,orientation,role);
+}
+
+int QFilesDirsCopierModel::getProgressOf(int srcFileId) const
+{
+  QMutexLocker locker(&_mutOnProc);
+  return _progress[srcFileId];
+}
+
+QString QFilesDirsCopierModel::getFullNameOf(int srcFileId) const
+{
+  return _srcFiles[srcFileId]->fullName();
+}
+
+QString QFilesDirsCopierModel::getNameOf(int srcFileId) const
+{
+  return _srcFiles[srcFileId]->name();
+}
+
+QString QFilesDirsCopierModel::getPrettyText(int srcFileId) const
+{
+  int progress(getProgressOf(srcFileId));
+  QString name(getNameOf(srcFileId));
+  switch(progress)
+    {
+    case PROGRESS_STATUS_START:
+      return QString("Copy of %1 has started").arg(name);
+    case PROGRESS_STATUS_OVER:
+      return QString("Copy of %1 has finished").arg(name);
+    default:
+      return QString("%1 (%2%)").arg(name).arg(progress);
+    }
+}
+
+QSize QFilesDirsCopierModel::sizeHint() const
+{
+  int w(0),h(0);
+  for(int zePos=0;zePos<_srcFiles.size();zePos++)
+    {
+      int progress(getProgressOf(zePos));
+      QString txt(getPrettyText(zePos));
+      QFont ft;
+      QFontMetrics fm(ft);
+      QSize sz(fm.boundingRect(txt).size());
+      w=std::max(sz.width(),w);
+      h+=sz.height();
+    }
+  return QSize(2*w,2*h);
+}
+
+void QFilesDirsCopierModel::launchCopy()
+{
+  foreach(const DataStructure *srcFile,_srcFiles)
+    {
+      {
+        QMutexLocker locker(&_mutOnProc);
+        _progress[_currentElt]=PROGRESS_STATUS_START;
+        QModelIndex ind(this->index(_currentElt,0));
+        emit this->dataChanged(ind,ind,QVector<int>());
+      }
+      if(QThread::currentThread()->isInterruptionRequested())
+        {
+          _error=QString("%1 just before %2 (%3/%4)").arg(ATOMIC_STOP_MSG).arg(srcFile->fullName()).arg(_currentElt).arg(_srcFiles.size());
+          return ;
+        }
+      {
+        QMutexLocker locker(&_mutOnProc);
+        _curProc=new QProcess;
+        QStringList args;
+        args << "--progress" << "-r";
+        fillArgsForRSync(srcFile,args);
+        _curProc->start("rsync",args);
+        connect(_curProc,SIGNAL(readyReadStandardOutput()),this,SLOT(newOutputAvailable()));
+      }
+      bool s1(_curProc->waitForFinished(-1));
+      bool s2(_curProc->exitStatus()==QProcess::NormalExit && _curProc->exitCode()==0);
+      if(s1 && s2)
+        {
+          QMutexLocker locker(&_mutOnProc);
+          _progress[_currentElt]=PROGRESS_STATUS_OVER;
+          QModelIndex ind(this->index(_currentElt,0));
+          emit this->dataChanged(ind,ind,QVector<int>());
+        }
+      else
+        {
+          QMutexLocker locker(&_mutOnProc);
+          _error=QString("The copy of %1 has not finished correctly (%2/%3)").arg(srcFile->fullName()).arg(_currentElt).arg(_srcFiles.size());
+          return ;
+        }
+      if(QThread::currentThread()->isInterruptionRequested())
+        {
+          QMutexLocker locker(&_mutOnProc);
+          if(s1 && s2)
+            _error=QString("%1 right after %2 (%3/%4)").arg(ATOMIC_STOP_MSG).arg(srcFile->fullName()).arg(_currentElt).arg(_srcFiles.size());
+          else
+            _error=QString("Interrupted during copy of %1 (%2/%3)").arg(srcFile->fullName()).arg(_currentElt).arg(_srcFiles.size());
+          return ;
+        }
+      {
+        QMutexLocker locker(&_mutOnProc);
+        _curProc.clear();
+        _currentElt++;
+      }
+    }
+}
+        
+void QFilesDirsCopierModel::stopCurrentCopy()
+{
+  QMutexLocker locker(&_mutOnProc);
+  if(!_curProc.isNull())
+    _curProc->kill();
+}
+
+void QFilesDirsCopierModel::newOutputAvailable()
+{
+  QMutexLocker locker(&_mutOnProc);
+  QByteArray ba(_curProc->readAllStandardOutput());
+  QString str(QString::fromLocal8Bit(ba));
+  QRegularExpression re("[\\s]*([\\d\\,]+)[\\s]+([\\d]+)\\%[\\s]+([\\d]+\\.[\\d]{2}[Mk]B/s)[\\s]+([\\d]{1,2}:[\\d]{2}:[\\d]{2})");
+  QRegularExpressionMatch rem(re.match(str,0,QRegularExpression::PartialPreferFirstMatch));
+  if(rem.isValid())
+    {
+      QString s(rem.captured(2));
+      bool isOK(false);
+      int prog(s.toInt(&isOK));
+      if(isOK)
+        {
+          _progress[_currentElt]=prog;
+          QModelIndex ind(this->index(_currentElt,0));
+          emit this->dataChanged(ind,ind,QVector<int>());
+        }
+    }
+}
+
+void QFilesDirsCopierModel::fillArgsForRSync(const DataStructure *srcFile, QStringList& args) const
+{
+  QString src(srcFile->entryForRSyncSrc()),dest(_destLoc->entryForRSyncDest());
+  args << src << dest;
+}
+
+void ProgressDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+  int zePos(index.row());
+  QWidget *wid( dynamic_cast<QWidget *>(painter->device()) );
+  int progress(_model->getProgressOf(zePos));
+  QString txt(_model->getPrettyText(zePos));
+  QRect refRect(option.rect);
+  QFont ft(wid->font());
+  QFontMetrics fm(ft);
+  QSize refRect2(fm.boundingRect(txt).size());
+  if(progress==QFilesDirsCopierModel::PROGRESS_STATUS_OVER)
+    {
+      QFont ft2(ft);
+      ft.setBold(true);
+      painter->setFont(ft);
+      QPen p(painter->pen());
+      painter->setPen(QPen(Qt::green));
+      painter->drawText(QPoint(refRect.x()+(refRect.width()-refRect2.width())/2,
+                               refRect.y()+refRect.height()/2+refRect2.height()/2-fm.descent()),txt);
+      painter->setPen(p);
+      painter->setFont(ft2);
+      return ;
+    }
+  if(progress==QFilesDirsCopierModel::PROGRESS_STATUS_START)
+    {
+      QFont ft2(ft);
+      ft.setBold(true);
+      painter->setFont(ft);
+      QPen p(painter->pen());
+      painter->setPen(QPen(Qt::red));
+      QString txt2(QString("Copy in progress of %1").arg(txt));
+      painter->drawText(QPoint(refRect.x()+(refRect.width()-refRect2.width())/2,
+                               refRect.y()+refRect.height()/2+refRect2.height()/2-fm.descent()),txt);
+      painter->setPen(p);
+      painter->setFont(ft2);
+      return ;
+    }
+  {
+    QBrush brush(Qt::green),b2(painter->brush());
+    painter->setBrush(brush);
+    painter->drawRect(refRect.x(),refRect.y(),int((float)refRect.width()*float(progress/100.f)),refRect.height());
+    painter->drawText(QPoint(refRect.x()+(refRect.width()-refRect2.width())/2,
+                             refRect.y()+refRect.height()/2+refRect2.height()/2-fm.descent()),txt);
+    painter->setBrush(b2);
+  }
+}
+
+CopierTableView::CopierTableView(QWidget *parent):QTableView(parent)
+{
+  setSelectionMode(QAbstractItemView::NoSelection);
+  setFocusPolicy(Qt::NoFocus);
+}
+
+int CopierTableView::sizeHintForColumn(int column) const
+{
+  return width();
+}
+
+int CopierTableView::sizeHintForRow(int row) const
+{
+  QFilesDirsCopierModel *mod(qobject_cast<QFilesDirsCopierModel *>(model()));
+  int nbElts(mod->nbOfRows());
+  int sz((height()-horizontalHeader()->height())/(nbElts>0?nbElts:1));
+  return sz;
+}
+
+void CopierTableView::resizeEvent(QResizeEvent *event)
+{
+  resizeColumnToContents(0);
+  resizeRowsToContents();
+  QTableView::resizeEvent(event);
+}
+
+QSize CopierTableView::sizeHint() const
+{
+  QFilesDirsCopierModel *model2(qobject_cast<QFilesDirsCopierModel *>(model()));
+  if(model2)
+    return model2->sizeHint();
+  return CopierTableView::sizeHint();
+}
+
+FilesDirsCopier::FilesDirsCopier(QWidget *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc):QDialog(parent),_table(new CopierTableView(this)),_cancel(new QPushButton(this)),_model(nullptr)
+{
+  QVBoxLayout *vb(new QVBoxLayout(this));
+  _cancel->setText("Cancel");
+  vb->addWidget(_table);
+  vb->addWidget(_cancel);
+  _model=new QFilesDirsCopierModel(_table,srcFiles,destLoc);
+  _th=new CopierThread(this,_model);
+  _table->setModel(_model);
+  _table->setShowGrid(false);
+  _table->setItemDelegate(new ProgressDelegate(_table,_model));
+  connect(_cancel,SIGNAL(clicked()),this,SLOT(cancelRequested()));
+  connect(this,SIGNAL(myAcceptSignal(bool)),this,SLOT(myAccept(bool)));
+}
+
+void FilesDirsCopier::cancelRequested()
+{
+  _th->stopRequested();
+  _th->wait();
+  reject();
+}
+
+void FilesDirsCopier::myAccept(bool isOK)
+{
+  _th->wait();
+  if(isOK)
+    accept();
+  else
+    reject();
+}
+
+int FilesDirsCopier::exec()
+{
+  _th->start();
+  return QDialog::exec();
+}
diff --git a/tools/RemoteFileBrowser/QRemoteFileBrowser b/tools/RemoteFileBrowser/QRemoteFileBrowser
new file mode 100644 (file)
index 0000000..6474a33
--- /dev/null
@@ -0,0 +1,302 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#ifndef __QREMOTEFILEBROWSER__
+#define __QREMOTEFILEBROWSER__
+
+#include "QWidget"
+#include "QTreeView"
+#include "QMimeData"
+#include "QThread"
+
+class AnotherTreeView;
+class QMachineBrowser;
+class QRemoteFileSystemModel;
+class TopDirDataStructure;
+
+class LoadingThread : public QThread
+{
+  Q_OBJECT
+public:
+  LoadingThread(QThread *th, QMachineBrowser *mb):_fatherThread(th),_mb(mb),_model(nullptr) { }
+  void setGeneratedModel(QRemoteFileSystemModel *model) { _model=model; }
+  QRemoteFileSystemModel *generatedModel() const { return _model; }
+signals:
+  void letsGenerateModel(TopDirDataStructure *fds);
+protected:
+  void run();
+private:
+  QThread *_fatherThread;
+  QMachineBrowser *_mb;
+  QRemoteFileSystemModel *_model;
+};
+
+class QRemoteFileBrowser : public QWidget
+{
+  Q_OBJECT
+public:
+  QRemoteFileBrowser(QWidget *parent);
+  QMachineBrowser *machineBrower() const { return _mb; }
+public slots:
+  void onLocationChanged();
+  void locationHasBeenChanged();
+private:
+  AnotherTreeView *_treeView;
+  QMachineBrowser *_mb;
+};
+
+class QRemoteFileTransfer : public QWidget
+{
+public:
+  QRemoteFileTransfer(QWidget *parent=0);
+private:
+  QRemoteFileBrowser *_left;
+  QRemoteFileBrowser *_right;
+};
+
+class DirDataStructure;
+class TopDirDataStructure;
+
+class DataStructure : public QObject
+{
+  Q_OBJECT
+public:
+  DataStructure(QObject *parent, const QString& name):QObject(parent),_name(name),_selected(false) { }
+  void select() { _selected=true; }
+  void unselect() { _selected=false; }
+  bool isSelected() const { return _selected; }
+  virtual bool isFile() const = 0;
+  virtual QString nameOnDrop() const = 0;
+  const DirDataStructure *getDirParent() const;
+  bool isRoot() const { return getDirParent()==NULL; }
+  const TopDirDataStructure *getRoot() const;
+  std::vector<const DataStructure *> getItermediateElts(const TopDirDataStructure *tpds) const;
+  virtual int size() const = 0;
+  QString entryForRSyncSrc() const;
+  virtual QString entryForRSyncDest() const = 0;
+  QString name() const;
+  const QString& fullName() const { return _name; }
+  void removeFileArgs(QString& prg, QStringList& args) const;
+private:
+  QString _name;
+  bool _selected;
+};
+
+class FileDataStructure : public DataStructure
+{
+public:
+  FileDataStructure(DirDataStructure *dds, const QString& name);
+  bool isFile() const { return true; }
+  int size() const { return 0; }
+  QString entryForRSyncDest() const;
+  QString nameOnDrop() const;
+};
+
+class DirDataStructure : public DataStructure
+{
+public:
+  DirDataStructure(DirDataStructure *dds, const QString& name):DataStructure(dds,name),_is_loaded(false),_is_expanded(false) { }
+  DirDataStructure(QObject *dds, const QString& name):DataStructure(dds,name),_is_loaded(false) { }
+  bool isFile() const { return false; }
+  int size() const { load(); return children().size(); }
+  QString entryForRSyncDest() const;
+  QString nameOnDrop() const { return name(); }
+  const DataStructure *operator[](int pos) const;
+  int posOf(const DataStructure *ds) const;
+  bool load() const;
+  void markAsLoaded() const { _is_loaded=true; }
+  void setExpanded(bool status) { _is_expanded=status; }
+  bool isExpanded() const { return _is_expanded; }
+private:
+  mutable bool _is_loaded;
+  mutable bool _is_expanded;
+};
+
+class FileLoader;
+
+class TopDirDataStructure : public DirDataStructure
+{
+public:
+  TopDirDataStructure(QObject *dds, FileLoader *fl);
+  virtual ~TopDirDataStructure();
+  FileLoader *getLoader() const { return _fl; }
+  bool isOK() const { return _isOK; }
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgsImpl(const QString& filePath, QString& prg, QStringList& args) const;
+private:
+  FileLoader *_fl;
+  bool _isOK;
+};
+
+class QRemoteFileSystemModel;
+
+class MyTreeView : public QTreeView
+{
+  Q_OBJECT
+public:
+  MyTreeView(QWidget *parent);
+  void mousePressEvent(QMouseEvent *event);
+  void mouseReleaseEvent(QMouseEvent *event);
+  void mouseMoveEvent(QMouseEvent *event);
+  void keyPressEvent(QKeyEvent *event);
+  void dragEnterEvent(QDragEnterEvent *event);
+  void dragMoveEvent(QDragMoveEvent *event);
+  void dragLeaveEvent(QDragLeaveEvent *event);
+  void dropEvent(QDropEvent *event);
+  QRemoteFileSystemModel *zeModel();
+  void emitResetModel();
+public slots:
+  void itemExpanded(const QModelIndex &index);
+  void itemCollapsed(const QModelIndex &index);
+signals:
+  void somethingChangedDueToFileModif();
+private:
+  void itemExpandedStatus(const QModelIndex &index, bool status);
+  void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const;
+  void paintEvent(QPaintEvent *event);
+private:
+  QPoint _start_pos;
+  // during drag drop _sel is the element under the mouse on the drop site
+  DataStructure *_sel;
+  // during drag drop _slider_pos is the pos of vertical slider on drop site
+  int _slider_pos;
+};
+
+class AnotherTreeView;
+
+class AnotherTreeViewPainter
+{
+public:
+  virtual void paint(AnotherTreeView *atv, QPaintEvent *event) const = 0;
+};
+
+class AnotherTreeViewWaitPainter : public AnotherTreeViewPainter
+{
+public:
+  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
+};
+
+class AnotherTreeViewNothingPainter : public AnotherTreeViewPainter
+{
+public:
+  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
+};
+
+class AnotherTreeView : public QWidget
+{
+  Q_OBJECT
+public:
+  AnotherTreeView(QWidget *parent);
+  void generateModel(QMachineBrowser *mb);
+  QSize sizeHint() const;
+  QSize minimumSizeHint() const;
+  int getAngle() const { return _angle; }
+  ~AnotherTreeView();
+public slots:
+  void goGenerate(TopDirDataStructure *fds);
+  void modelHasBeenGenerated();
+signals:
+  void modelHasBeenGeneratedSignal(bool isOK);
+  void somethingChangedDueToFileModif();
+protected:
+  void paintEvent(QPaintEvent *event);
+  void timerEvent(QTimerEvent *e);
+private:
+  int _timerId;
+  int _angle;
+  AnotherTreeViewPainter *_painter;
+  MyTreeView *_tw;
+  LoadingThread *_th;
+};
+
+class FileLoader
+{
+protected:
+  FileLoader(const QString& dirName):_dirName(dirName) { }
+public:
+  QString getDirName() const { return _dirName; }
+  virtual bool load(DirDataStructure *parent) const = 0;
+  virtual QString prettyPrint() const = 0;
+  virtual QString entryForRSync(const QString& fn) const = 0;
+  virtual QString getMachine() const = 0;
+  virtual void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const = 0;
+  virtual ~FileLoader() { }
+private:
+  QString _dirName;
+};
+
+class LocalFileLoader : public FileLoader
+{
+public:
+  LocalFileLoader(const QString& dirName):FileLoader(dirName) { }
+  bool load(DirDataStructure *parent) const;
+  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
+  QString prettyPrint() const;
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
+};
+
+class RemoteFileLoader : public FileLoader
+{
+public:
+  RemoteFileLoader(const QString& machine,const QString& dirName):FileLoader(dirName),_machine(machine) { }
+  bool load(DirDataStructure *parent) const;
+  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
+  QString prettyPrint() const;
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
+private:
+  QString _machine;
+};
+
+class SelectionMimeData : public QMimeData
+{
+  Q_OBJECT
+public:
+  SelectionMimeData(const QModelIndexList& los):_los(los) { }
+  const QModelIndexList& getSelection() const { return _los; }
+private:
+  QModelIndexList _los;
+};
+
+class QRemoteFileSystemModel : public QAbstractItemModel
+{
+  Q_OBJECT
+public:
+  QRemoteFileSystemModel(QObject *parent, FileLoader *fl);
+  QRemoteFileSystemModel(QObject *parent, TopDirDataStructure *fds);
+  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+  QModelIndex parent(const QModelIndex&) const;
+  QModelIndex index(int, int, const QModelIndex&) const;
+  int rowCount(const QModelIndex&) const;
+  int columnCount(const QModelIndex&) const;
+  QVariant data(const QModelIndex&, int) const;
+  void emitResetModel();
+  FileLoader *getLoader() const { return _fds->getLoader(); }
+  bool isOK() const { return _fds->isOK(); }
+  QString getMachine() const { return _fds->getMachine(); }
+private:
+  TopDirDataStructure *_fds;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx b/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx
new file mode 100644 (file)
index 0000000..8d28a8e
--- /dev/null
@@ -0,0 +1,892 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "QRemoteFileBrowser"
+#include "QMachineBrowser"
+#include "QRemoteCopyWidget"
+
+#include "QDirModel"
+#include "QFileSystemModel"
+#include "QVBoxLayout"
+#include "QTreeView"
+#include "QProcess"
+#include "QMouseEvent"
+#include "QApplication"
+#include "QDrag"
+#include "QScrollBar"
+#include "QThread"
+#include "QPainter"
+#include "QMessageBox"
+
+#include <iostream> 
+
+class DirDataStructure;
+
+void ListOfDir(DirDataStructure *parent);
+
+QRemoteFileBrowser::QRemoteFileBrowser(QWidget *parent):QWidget(parent),_treeView(nullptr),_mb(nullptr)
+{
+  _treeView=new AnotherTreeView(this);
+  QVBoxLayout *lay(new QVBoxLayout(this));
+  _mb=new QMachineBrowser(this);
+  lay->addWidget(_mb);
+  lay->addWidget(_treeView);
+  connect(_mb,SIGNAL(locationChanged()),this,SLOT(onLocationChanged()));
+  connect(_treeView,SIGNAL(modelHasBeenGeneratedSignal(bool)),this,SLOT(locationHasBeenChanged()));
+  connect(_treeView,SIGNAL(somethingChangedDueToFileModif()),this,SLOT(onLocationChanged()));
+  _mb->initLocation();
+}
+
+void LoadingThread::run()
+{
+  //std::cout << "start" << std::endl;
+  FileLoader *fl(_mb->generateFileLoader());
+  TopDirDataStructure *fds(new TopDirDataStructure(nullptr,fl));//costly
+  fds->moveToThread(_fatherThread);
+  emit this->letsGenerateModel(fds);
+  //std::cout << "end" << std::endl;
+}
+
+void QRemoteFileBrowser::onLocationChanged()
+{
+  _mb->setEnabled(false);
+  _treeView->generateModel(_mb);
+}
+
+void QRemoteFileBrowser::locationHasBeenChanged()
+{
+  _mb->setEnabled(true);
+}
+
+QRemoteFileTransfer::QRemoteFileTransfer(QWidget *parent):QWidget(parent),_left(nullptr),_right(nullptr)
+{
+  QHBoxLayout *lay(new QHBoxLayout(this));
+  _left=new QRemoteFileBrowser(this);
+  _right=new QRemoteFileBrowser(this);
+  lay->addWidget(_left);
+  lay->addWidget(_right);
+}
+
+QString DataStructure::name() const
+{
+  QDir qd(_name);
+  return qd.dirName();
+}
+
+void DataStructure::removeFileArgs(QString& prg, QStringList& args) const
+{
+  const TopDirDataStructure *root(getRoot());
+  root->removeFileArgsImpl(fullName(),prg,args);
+}
+
+QString DataStructure::entryForRSyncSrc() const
+{
+  const TopDirDataStructure *root(getRoot());
+  return root->entryForRSync(fullName());
+}
+
+QString FileDataStructure::entryForRSyncDest() const
+{
+  const TopDirDataStructure *root(getRoot());
+  return root->entryForRSync(getDirParent()->fullName());
+}
+
+QString DirDataStructure::entryForRSyncDest() const
+{
+  const TopDirDataStructure *root(getRoot());
+  return root->entryForRSync(fullName());
+}
+
+class FileLoader;
+
+const TopDirDataStructure *DataStructure::getRoot() const
+{
+  if(isRoot())
+    return dynamic_cast<const TopDirDataStructure *>(this);
+  const DataStructure *work(this);
+  const DataStructure *ret(work->getDirParent());
+  while(true)
+    {
+      if(ret->isRoot())
+        return dynamic_cast<const TopDirDataStructure *>(ret);
+      work=ret;
+      ret=ret->getDirParent();
+    }
+}
+
+std::vector<const DataStructure *> DataStructure::getItermediateElts(const TopDirDataStructure *tpds) const
+{
+  std::vector<const DataStructure *> ret;
+  if(isRoot())
+    return ret;
+  const DataStructure *work(this);
+  const DataStructure *cand(work->getDirParent());
+  while(true)
+    {
+      if(cand==tpds)
+        return ret;
+      work=cand;
+      ret.push_back(cand);
+      cand=cand->getDirParent();
+    }
+}
+
+void LocalFileLoader::fillArgs(const QString& dn, QString& prg, QStringList& args) const
+{
+  prg="ls"; args << "-l" << dn;
+}
+
+QString LocalFileLoader::prettyPrint() const
+{
+  return QString("Browsing %1 local directory").arg(getDirName());
+}
+
+QString LocalFileLoader::entryForRSync(const QString& fn) const
+{
+  return fn;
+}
+
+QString LocalFileLoader::getMachine() const
+{
+  return QString("localhost");
+}
+
+void LocalFileLoader::removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const
+{
+  prg="rm";
+  args << "-rf" << filePath;
+}
+
+void RemoteFileLoader::fillArgs(const QString& dn, QString& prg, QStringList& args) const
+{
+  // find non hidden file recursive. If dn does not exist propagate the error status
+  prg="ssh"; args << _machine << QString("find %1 -maxdepth 1 -regextype egrep -regex '%1/[^\\.].*' | xargs ls -l ; test ${PIPESTATUS[0]} -eq 0").arg(dn);
+}
+
+QString RemoteFileLoader::prettyPrint() const
+{
+  return QString("Browsing files in %1 on %2").arg(getDirName()).arg(_machine);
+}
+
+QString RemoteFileLoader::entryForRSync(const QString& fn) const
+{
+  return QString("%1:%2").arg(_machine).arg(fn);
+}
+
+QString RemoteFileLoader::getMachine() const
+{
+  return _machine;
+}
+
+void RemoteFileLoader::removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const
+{
+  prg="ssh";
+  args << _machine << "rm" << "-rf" << filePath;
+}
+
+bool LocalFileLoader::load(DirDataStructure *parent) const
+{
+  QProcess *proc(new QProcess);
+  QString prg;
+  QStringList args;
+  
+  fillArgs(parent->fullName(),prg,args);
+  
+  proc->start(prg,args);
+  static const int timeEllapse(3000);
+  if(!proc->waitForFinished(timeEllapse))
+    return false;
+  if(proc->exitCode()!=0)
+    return false;
+  QByteArray arr(proc->readAll());
+  delete proc;
+  QList<QByteArray> sarr(arr.split('\n'));
+  std::size_t ii(0);
+  QRegularExpression re1("\\s+");
+  QRegularExpression re2("^(d|-)(r|-)(w|-)(x|-)(r|-)(w|-)(x|-)(r|-)(w|-)(x|-)$");
+  foreach(QByteArray arr0,sarr)
+    {
+      bool specialCase(ii==0 || ii==sarr.size()-1);
+      ii++;
+      if(specialCase)
+        continue;
+      QStringList arr1(QString(arr0).split(re1));
+      if(arr1.size()<9)
+        continue;
+      QRegularExpressionMatch match(re2.match(arr1[0]));
+      if(!match.hasMatch())
+        continue;
+      QDir qd(parent->fullName());
+      if(match.captured(1)=="d")
+        new DirDataStructure(parent,qd.absoluteFilePath(arr1[8]));
+      if(match.captured(1)=="-")
+        new FileDataStructure(parent,qd.absoluteFilePath(arr1[8]));
+    }
+  return true;
+}
+
+void readStdPart(DirDataStructure *parent, const QList<QByteArray>& arrs, int startLine, int endLine)
+{
+  QRegularExpression re1("\\s+");
+  QRegularExpression re2("^(d|-)(r|-)(w|-)(x|-)(r|-)(w|-)(x|-)(r|-)(w|-)(x|-)$");
+  for(int i=startLine;i<endLine;i++)
+    {
+      const QByteArray& arr0(arrs[i]);
+      QStringList arr1(QString(arr0).split(re1));
+      if(arr1.size()<9)
+        continue;
+      QRegularExpressionMatch match(re2.match(arr1[0]));
+      if(!match.hasMatch())
+        continue;
+      QDir qd(parent->fullName());
+      if(match.captured(1)=="d")
+        {
+          //std::cout << "Dir " << qd.absoluteFilePath(arr1[8]) << std::endl;
+          new DirDataStructure(parent,qd.absoluteFilePath(arr1[8]));
+        }
+      if(match.captured(1)=="-")
+        {
+          //std::cout << "File " << qd.absoluteFilePath(arr1[8]) << std::endl;
+          new FileDataStructure(parent,qd.absoluteFilePath(arr1[8]));
+        }
+    }
+  parent->markAsLoaded();
+}
+
+bool RemoteFileLoader::load(DirDataStructure *parent) const
+{
+  QProcess *proc(new QProcess);
+  QString prg;
+  QStringList args;
+  fillArgs(parent->fullName(),prg,args);
+  proc->start(prg,args);
+  static const int timeEllapse(3000);
+  if(!proc->waitForFinished(timeEllapse))
+    return false;
+  if(proc->exitCode()!=0)
+    return false;
+  QByteArray arr(proc->readAll());
+  delete proc;
+  QList<QByteArray> sarr(arr.split('\n'));
+  if(sarr.empty())
+    return false;
+  int sz(sarr.size()),ii(0);
+  std::vector<int> sections(1,0);
+  foreach(QByteArray arr0,sarr)
+    {
+      QString tmp(arr0);
+      if(tmp.size()==0)
+        sections.push_back(ii);
+      ii++;
+    }
+  QRegularExpression re3("^total ([0-9]+)$");
+  std::size_t nbSections(sections.size()-1);
+  for(std::size_t isec=0;isec<nbSections;isec++)
+    {
+      int startLine(sections[isec]),endLine(sections[isec+1]);
+      if(startLine==endLine)
+        continue;
+      QString firstLine(sarr[startLine]);
+      if(firstLine.size()!=0)
+        {
+          readStdPart(parent,sarr,startLine,endLine);
+          continue ;
+        }
+      if(endLine-startLine<3)
+        continue ;
+      QString almostDn(sarr[startLine+1]);
+      QRegularExpression re4(QString("%1%2(.+\\:)$").arg(parent->fullName()).arg(QDir::separator()));
+      QRegularExpressionMatch m4(re4.match(almostDn));
+      if(!m4.hasMatch())
+        continue ;
+      QString dn(almostDn.mid(0,almostDn.size()-1));
+      DirDataStructure *subParent(new DirDataStructure(parent,dn));
+      QString total(sarr[startLine+2]);
+      QRegularExpressionMatch m3(re3.match(total));
+      if(!m3.hasMatch())
+        continue;
+      readStdPart(subParent,sarr,startLine+3,endLine);
+    }
+  // sort it !
+  const QObjectList &cs(parent->children());
+  std::map< QString, QObject *> sorter;
+  foreach(QObject *child,cs)
+    {
+      DataStructure *child2(qobject_cast<DataStructure *>(child));
+      if(!child2)
+        continue ;
+      sorter[child2->name()]=child2;
+      child2->setParent(nullptr);
+    }
+  for(std::map< QString, QObject *>::const_iterator it=sorter.begin();it!=sorter.end();it++)
+    (*it).second->setParent(parent);
+  return true;
+}
+  
+bool DirDataStructure::load() const
+{
+  bool ret(true);
+  if(!_is_loaded)
+    {
+      ret=getRoot()->getLoader()->load(const_cast<DirDataStructure *>(this));
+      _is_loaded=true;
+    }
+  return ret;
+}
+
+TopDirDataStructure::TopDirDataStructure(QObject *dds, FileLoader *fl):DirDataStructure(dds,fl->getDirName()),_fl(fl),_isOK(true)
+{
+  _isOK=load();
+  //QThread::sleep(3);
+}
+
+TopDirDataStructure::~TopDirDataStructure()
+{
+  delete _fl;
+}
+
+QString TopDirDataStructure::entryForRSync(const QString& fn) const
+{
+  return _fl->entryForRSync(fn);
+}
+
+QString TopDirDataStructure::getMachine() const
+{
+  return _fl->getMachine();
+}
+
+void TopDirDataStructure::removeFileArgsImpl(const QString& filePath, QString& prg, QStringList& args) const
+{
+  _fl->removeFileArgs(filePath,prg,args);
+}
+
+const DirDataStructure *DataStructure::getDirParent() const
+{
+  const QObject *p(parent());
+  if(!p)
+    return NULL;
+  const DirDataStructure *ret(dynamic_cast<const DirDataStructure *>(p));
+  return ret;
+}
+
+int DirDataStructure::posOf(const DataStructure *ds) const
+{
+  load();
+  return children().indexOf(const_cast<DataStructure *>(ds));
+}
+
+const DataStructure *DirDataStructure::operator[](int pos) const
+{
+  load();
+  const QObject *obj(children()[pos]);
+  const DataStructure *obj2(dynamic_cast<const DataStructure *>(obj));
+  return obj2;
+}
+
+FileDataStructure::FileDataStructure(DirDataStructure *dds, const QString& name):DataStructure(dds,name)
+{
+}
+
+QString FileDataStructure::nameOnDrop() const
+{
+  const DirDataStructure *ds3(getDirParent());
+  return QString("Dir %1 (%2)").arg(ds3->name()).arg(name());
+}
+
+void QRemoteFileSystemModel::emitResetModel()
+{
+  emit this->beginResetModel();
+  emit this->endResetModel();
+}
+
+QRemoteFileSystemModel::QRemoteFileSystemModel(QObject *parent, FileLoader *fl):QAbstractItemModel(parent),_fds(nullptr)
+{
+  _fds=new TopDirDataStructure(this,fl);
+}
+
+QRemoteFileSystemModel::QRemoteFileSystemModel(QObject *parent, TopDirDataStructure *fds):QAbstractItemModel(parent),_fds(fds)
+{
+  if(_fds)
+    _fds->setParent(this);
+}
+
+QVariant QRemoteFileSystemModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+  if(role == Qt::DisplayRole || role == Qt::EditRole)
+    {
+      if(section==0)
+        return _fds->getLoader()->prettyPrint();
+    }
+  return QAbstractItemModel::headerData(section,orientation,role);
+}
+
+QModelIndex QRemoteFileSystemModel::parent(const QModelIndex& child) const
+{
+  if(!child.isValid())
+    return QModelIndex();
+  quintptr pt(child.internalId());
+  DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+  if(!ds)
+    return QModelIndex();
+  if(ds->isRoot())
+    return QModelIndex();
+  const DirDataStructure *father(ds->getDirParent());
+  if(father->isRoot())
+    return QModelIndex();
+  const DirDataStructure *grandFather(father->getDirParent());
+  return createIndex(grandFather->posOf(father),0,const_cast<DataStructure *>(static_cast<const DataStructure *>(father)));
+}
+
+QModelIndex QRemoteFileSystemModel::index(int row, int column, const QModelIndex& parent) const
+{
+  quintptr pt(parent.internalId());
+  if(!pt)
+    {
+      if(_fds->size()<=row)
+        return QModelIndex();
+      const DataStructure *ds((*_fds)[row]);
+      return createIndex(row,column,const_cast<DataStructure *>(ds));
+    }
+  else
+    {
+      DataStructure *ds0(reinterpret_cast<DataStructure *>(pt));
+      DirDataStructure *ds1(dynamic_cast<DirDataStructure *>(ds0));
+      const DataStructure *ds((*ds1)[row]);
+      return createIndex(row,column,const_cast<DataStructure *>(ds));
+    }
+}
+  
+int QRemoteFileSystemModel::rowCount(const QModelIndex& mi) const
+{
+  if(!mi.isValid())
+    return _fds->size();
+  quintptr pt(mi.internalId());
+  DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+  if(!ds)
+    {
+      return _fds->size();
+    }
+  else
+    {
+      return ds->size();
+    }
+}
+
+int QRemoteFileSystemModel::columnCount(const QModelIndex&) const
+{
+  return 1;
+}
+
+QVariant QRemoteFileSystemModel::data(const QModelIndex& index, int role) const
+{  
+  if(!index.isValid())
+    return QVariant();
+  if(role==Qt::DisplayRole || role==Qt::EditRole)
+    {
+      quintptr pt(index.internalId());
+      DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+      if(!ds->isSelected())
+        return ds->name();
+      return ds->nameOnDrop();
+    }
+  if(role==Qt::ForegroundRole)
+    {
+      quintptr pt(index.internalId());
+      DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+      if(!ds->isSelected())
+        return QVariant();
+      QColor red0(154,18,20);
+      return QBrush(red0);
+    }
+  return QVariant();
+}
+
+MyTreeView::MyTreeView(QWidget *parent):QTreeView(parent),_sel(NULL),_slider_pos(-1)
+{
+  setAcceptDrops(true);
+  setSelectionMode(QAbstractItemView::ContiguousSelection);
+  connect(this,SIGNAL(expanded(const QModelIndex&)),this,SLOT(itemExpanded(const QModelIndex&)));
+  connect(this,SIGNAL(collapsed(const QModelIndex&)),this,SLOT(itemCollapsed(const QModelIndex&)));
+}
+
+void MyTreeView::mousePressEvent(QMouseEvent *event)
+{
+  if(event->button() == Qt::LeftButton)
+    {
+      _start_pos=event->pos();
+    }
+  QModelIndexList elts(selectedIndexes());
+  if(elts.size()<=1)
+    QTreeView::mousePressEvent(event);
+}
+
+void MyTreeView::mouseReleaseEvent(QMouseEvent *event)
+{
+  QModelIndexList elts(selectedIndexes());
+  if(elts.size()>1)
+    QTreeView::mousePressEvent(event);
+  QTreeView::mouseReleaseEvent(event);
+}
+
+void MyTreeView::mouseMoveEvent(QMouseEvent *event)
+{
+  if(event->buttons() & Qt::LeftButton)
+    {
+      int dist(std::abs(event->pos().x()-_start_pos.x()));//.manhattanLength());
+      if(dist>=QApplication::startDragDistance())
+        {
+          QMimeData *mimeData(new SelectionMimeData(selectedIndexes()));
+          QDrag *drag(new QDrag(this));
+          drag->setMimeData(mimeData);
+          if(drag->exec(Qt::CopyAction)==Qt::CopyAction)
+            {
+            }
+          else
+            {
+            }
+        }
+    }
+  QTreeView::mouseMoveEvent(event);
+}
+
+void MyTreeView::keyPressEvent(QKeyEvent *event)
+{
+  if(event->key()==Qt::Key_Delete)
+    {
+      if(!selectedIndexes().isEmpty())
+        {
+          QString mach;
+          QRemoteFileSystemModel *mod(qobject_cast<QRemoteFileSystemModel *>(model()));
+          if(mod)
+            mach=mod->getMachine();
+          QString txt(QString("On %1 you are about to delete %2 files/dirs. Confirm it ?").arg(mach).arg(selectedIndexes().size()));
+          QMessageBox mb(QMessageBox::Warning,"Confirm deletion of files",txt,QMessageBox::Ok | QMessageBox::No,this);
+          mb.setEscapeButton(QMessageBox::No);
+          mb.setDefaultButton(QMessageBox::No);
+          if(mb.exec())
+            {
+              if(mb.buttonRole(mb.clickedButton())==QMessageBox::AcceptRole)
+                {
+                  foreach(const QModelIndex& ind,selectedIndexes())
+                    {
+                      quintptr pt(ind.internalId());
+                      DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+                      QString prg;
+                      QStringList args;
+                      ds->removeFileArgs(prg,args);
+                      QProcess proc;
+                      proc.start(prg,args);
+                      bool isOK(proc.waitForFinished());
+                      emit this->somethingChangedDueToFileModif();
+                      if(isOK && proc.exitCode()==0)
+                        {
+                          return ;
+                        }
+                    }
+                }
+            }
+        }
+    }
+  QTreeView::keyPressEvent(event);
+}
+
+void MyTreeView::dragEnterEvent(QDragEnterEvent *event)
+{
+  MyTreeView *source(qobject_cast<MyTreeView *>(event->source()));
+  if(source && source!=this)
+    {
+      _slider_pos=verticalScrollBar()->sliderPosition();
+      event->setDropAction(Qt::CopyAction);
+      event->accept();
+    }
+}
+
+void MyTreeView::dragMoveEvent(QDragMoveEvent *event)
+{
+  MyTreeView *source(qobject_cast<MyTreeView *>(event->source()));
+  if(source && source!=this)
+    {
+      QModelIndex ind(indexAt(event->pos()));
+      if(ind.isValid())
+        {
+          quintptr pt(ind.internalId());
+          DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+          if(ds)
+            {
+              if(_sel!=ds)
+                {
+                  ds->select();
+                  if(_sel)
+                    _sel->unselect();
+                  _sel=ds;
+                  this->emitResetModel();
+                }
+              event->setDropAction(Qt::CopyAction);
+              event->accept();
+              qApp->processEvents();
+            }
+        }
+    }
+}
+
+void MyTreeView::dragLeaveEvent(QDragLeaveEvent *event)
+{
+  if(_sel)
+    {
+      _sel->unselect();
+      _sel=NULL;
+    }
+  _slider_pos=-1;
+  this->emitResetModel();
+  QTreeView::dragLeaveEvent(event);
+}
+
+void MyTreeView::dropEvent(QDropEvent *event)
+{
+  MyTreeView *source(qobject_cast<MyTreeView *>(event->source()));
+  if(source && source!=this)
+    {
+      {
+        const QMimeData *data(event->mimeData());
+        const SelectionMimeData *data1(qobject_cast<const SelectionMimeData *>(data));
+        if(!data1)
+          {
+            _sel->unselect();
+            event->ignore();
+            this->emitResetModel();
+          }
+        QModelIndex ind(indexAt(event->pos()));
+        if(ind.isValid())
+          {
+            const QModelIndexList& listOfSelectedSrcFiles(data1->getSelection());
+            quintptr pt(ind.internalId());
+            DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+            QRemoteFileSystemModel *srcModel(qobject_cast<QRemoteFileSystemModel *>(source->model()));
+            PerformCopy(this,srcModel,listOfSelectedSrcFiles,ds);
+            emit this->somethingChangedDueToFileModif();
+          }
+        else
+          {
+            event->ignore();
+            this->emitResetModel();
+          }
+      }
+      //
+      _slider_pos=-1;
+      event->setDropAction(Qt::MoveAction);
+      event->accept();
+      if(_sel)
+        _sel->unselect();
+      this->emitResetModel();
+    }
+}
+
+QRemoteFileSystemModel *MyTreeView::zeModel()
+{
+  QAbstractItemModel *mod(this->model());
+  QRemoteFileSystemModel *mod2(qobject_cast<QRemoteFileSystemModel *>(mod));
+  return mod2;
+}
+
+void MyTreeView::itemExpanded(const QModelIndex &index)
+{
+  itemExpandedStatus(index,true);
+}
+
+void MyTreeView::itemCollapsed(const QModelIndex &index)
+{
+  itemExpandedStatus(index,false);
+}
+  
+void MyTreeView::itemExpandedStatus(const QModelIndex &index, bool status)
+{
+  quintptr pt(index.internalId());
+  DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+  DirDataStructure *ds1(dynamic_cast<DirDataStructure *>(ds));
+  if(!ds1)
+    return;
+  ds1->setExpanded(status);
+}
+
+void MyTreeView::drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const
+{
+  quintptr pt(index.internalId());
+  DataStructure *ds(reinterpret_cast<DataStructure *>(pt));
+  DirDataStructure *ds1(dynamic_cast<DirDataStructure *>(ds));
+  if(ds1)
+    (const_cast<MyTreeView *>(this))->setExpanded(index,ds1->isExpanded());
+  QTreeView::drawBranches(painter,rect,index);
+}
+
+void MyTreeView::paintEvent(QPaintEvent *event)
+{
+  QTreeView::paintEvent(event);
+  if(_slider_pos!=-1)
+    {
+      verticalScrollBar()->setSliderPosition(_slider_pos);
+    }
+}
+
+void MyTreeView::emitResetModel()
+{
+  this->zeModel()->emitResetModel();
+}
+
+AnotherTreeView::AnotherTreeView(QWidget *parent):QWidget(parent),_timerId(-1),_angle(0),_painter(nullptr),_tw(nullptr),_th(nullptr)
+{
+  QVBoxLayout *lay(new QVBoxLayout(this));
+  _tw=new MyTreeView(this);
+  lay->addWidget(_tw);
+  setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
+  connect(_tw,SIGNAL(somethingChangedDueToFileModif()),this,SIGNAL(somethingChangedDueToFileModif()));
+  _tw->hide();
+}
+
+void AnotherTreeView::goGenerate(TopDirDataStructure *fds)
+{
+  LoadingThread *s2(qobject_cast<LoadingThread *>(sender()));
+  if(!s2)
+    return ;
+  QRemoteFileSystemModel *model(new QRemoteFileSystemModel(_tw,fds));
+  s2->setGeneratedModel(model);
+}
+
+void AnotherTreeView::generateModel(QMachineBrowser *mb)
+{
+  _tw->hide();
+  _th=new LoadingThread(QThread::currentThread(),mb);
+  connect(_th,SIGNAL(letsGenerateModel(TopDirDataStructure *)),this,SLOT(goGenerate(TopDirDataStructure *)));
+  connect(_th,SIGNAL(finished()),this,SLOT(modelHasBeenGenerated()));
+  _timerId=this->startTimer(50);
+  delete _painter;
+  _painter=new AnotherTreeViewWaitPainter;
+  _th->start();
+}
+
+AnotherTreeView::~AnotherTreeView()
+{
+  delete _painter;
+}
+
+void AnotherTreeView::modelHasBeenGenerated()
+{
+  _th->wait();
+  QRemoteFileSystemModel *model(_th->generatedModel());
+  {
+    QAbstractItemModel *oldModel(_tw->model());
+    if(oldModel)
+      delete oldModel;
+    _tw->setModel(model);
+  }
+  delete _th;
+  _th=nullptr;
+  this->killTimer(_timerId);
+  delete _painter;
+  _painter=nullptr;
+  if(!model->isOK())
+    _painter=new AnotherTreeViewNothingPainter;
+  else
+    _tw->show();
+  emit this->modelHasBeenGeneratedSignal(model->isOK());
+  updateGeometry();
+  update();
+}
+
+void AnotherTreeViewWaitPainter::paint(AnotherTreeView *atv, QPaintEvent *event) const
+{
+  QSize sz3(atv->width(),atv->height());
+  int width0(sz3.width()),height0(sz3.height());
+  int radius(std::min(width0,height0)/2);
+  QRect refRect((width0-radius)/2,(height0-radius)/2,radius,radius);
+  QPainter painter(atv);
+  QColor red(154,18,20);
+  QRadialGradient grad(refRect.center(),radius);
+  grad.setColorAt(0.f,red);
+  grad.setColorAt(0.5f,Qt::white);
+  painter.setBrush(grad);
+  painter.drawPie(refRect,atv->getAngle(),90*16);
+}
+
+void AnotherTreeViewNothingPainter::paint(AnotherTreeView *atv, QPaintEvent *event) const
+{
+  QPainter painter(atv);
+  const int SZP(12);
+  static const int WARN_Y=176,WARN_X=200;
+  const float RATIO(float(WARN_X)/float(WARN_Y));
+  //
+  int width0(atv->width()),height0(atv->height());
+  //QPen(QColor(255,203,189)
+  if(float(width0)>RATIO*float(height0))
+    painter.setViewport(int(width0-RATIO*float(height0))/2,0,height0*RATIO,height0);
+  else
+    painter.setViewport(0,(float(height0)-width0/RATIO)/2,width0,width0/RATIO);//width-height/RATIO
+  painter.setRenderHint(QPainter::Antialiasing,true);
+  painter.setWindow(0,0,WARN_X,WARN_Y);
+  //
+  painter.setPen(QPen(QColor(255,203,189),SZP,Qt::SolidLine,Qt::RoundCap));
+  painter.drawLine(QPoint(100,13),QPoint(11,164));
+  painter.drawLine(QPoint(11,164),QPoint(185,164));
+  painter.drawLine(QPoint(185,164),QPoint(100,13));
+  QColor lightBlack(200,200,200);
+  painter.setBrush(QBrush(lightBlack));
+  painter.setPen(QPen(lightBlack,2,Qt::SolidLine,Qt::RoundCap));
+  painter.drawEllipse(87,47,24,24);
+  painter.drawEllipse(93,105,12,12);
+  painter.drawEllipse(90,129,18,18);
+  const QPoint points[4]={QPoint(87,59),QPoint(93,111),QPoint(105,111),QPoint(111,59)};
+  painter.drawPolygon(points,4);
+
+  /*int width0(atv->width()),height0(atv->height());
+  int radius(std::min(width0,height0)/2);
+  QRect refRect((width0-radius)/2,(height0-radius)/2,radius,radius);
+  QPainter painter(atv);
+  QColor red(154,18,20);
+  painter.setBrush(QBrush(red));
+  painter.drawPie(refRect,0,45*16);*/
+}
+
+QSize AnotherTreeView::sizeHint() const
+{
+  return _tw->sizeHint();
+}
+
+QSize AnotherTreeView::minimumSizeHint() const
+{
+  return sizeHint();
+}
+
+void AnotherTreeView::paintEvent(QPaintEvent *event)
+{
+  if(!_painter)
+    {
+      QWidget::paintEvent(event);
+      return ;
+    }
+  else
+    _painter->paint(this,event);
+}
+
+void AnotherTreeView::timerEvent(QTimerEvent *e)
+{
+  if(e->timerId()!=_timerId)
+    return ;
+  _angle+=16*10;
+  update();
+}
diff --git a/tools/RemoteFileBrowser/remotefilebrowser.cxx b/tools/RemoteFileBrowser/remotefilebrowser.cxx
new file mode 100644 (file)
index 0000000..af7c574
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (C) 2017  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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "QApplication"
+#include "QRemoteFileBrowser"
+
+int main(int argc, char *argv[])
+{
+  QApplication app(argc,argv);
+  QRemoteFileTransfer ft;
+  ft.show();
+  return app.exec();
+}
diff --git a/tools/vtkEDFOverloads/CMakeLists.txt b/tools/vtkEDFOverloads/CMakeLists.txt
deleted file mode 100755 (executable)
index 6d279b8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2012-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# 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(${VTK_USE_FILE})
-
-ADD_LIBRARY(vtkTools vtkEDFCutter.cxx)
-TARGET_LINK_LIBRARIES(vtkTools ${VTK_LIBRARIES})
-INSTALL(TARGETS vtkTools EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-ADD_LIBRARY(vtkEDFOverloads vtkEDFFactory.cxx)
-TARGET_LINK_LIBRARIES(vtkEDFOverloads ${VTK_LIBRARIES} vtkTools)
-INSTALL(TARGETS vtkEDFOverloads EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_GUI_INSTALL_PARAVIEW_LIBS})
-
-FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
-INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${SALOME_INSTALL_HEADERS})
diff --git a/tools/vtkEDFOverloads/vtkEDFCutter.cxx b/tools/vtkEDFOverloads/vtkEDFCutter.cxx
deleted file mode 100755 (executable)
index dcb42e1..0000000
+++ /dev/null
@@ -1,525 +0,0 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 "vtkEDFCutter.h"
-
-#include "vtkInformationVector.h"
-#include "vtkInformation.h"
-#include "vtkSmartPointer.h"
-#include "vtkGenericCell.h"
-#include "vtkPolyData.h"
-#include "vtkObjectFactory.h"
-#include "vtkIdTypeArray.h"
-#include "vtkCellData.h"
-#include "vtkCellArray.h"
-#include "vtkIdList.h"
-
-#include <list>
-#include <set>
-#include <map>
-#include <deque>
-
-class vtkEDFEdge
-{
-public :
-  vtkIdType v0;
-  vtkIdType v1;
-
-  vtkEDFEdge(vtkIdType a, vtkIdType b) : v0(a), v1(b){}
-  vtkEDFEdge(){}
-};
-
-bool operator == (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
-  return (e0.v0 == e1.v0 && e0.v1 == e1.v1) ||
-      (e0.v1 == e1.v0 && e0.v0 == e1.v1);
-}
-
-bool operator != (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
-  return !(e0==e1);
-}
-
-bool operator < (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
-  vtkEDFEdge the_e0;
-  vtkEDFEdge the_e1;
-  if(e0.v0 < e0.v1)
-    {
-    the_e0.v0 = e0.v0;
-    the_e0.v1 = e0.v1;
-    }
-  else
-    {
-    the_e0.v0 = e0.v1;
-    the_e0.v1 = e0.v0;
-    }
-  if(e1.v0 < e1.v1)
-    {
-    the_e1.v0 = e1.v0;
-    the_e1.v1 = e1.v1;
-    }
-  else
-    {
-    the_e1.v0 = e1.v1;
-    the_e1.v1 = e1.v0;
-    }
-
-  if(the_e0.v0 == the_e1.v0)
-    return (the_e0.v1 < the_e1.v1);
-
-  return the_e0.v0 < the_e1.v0;
-}
-
-vtkStandardNewMacro(vtkEDFCutter);
-
-vtkEDFCutter::vtkEDFCutter()
-{
-  this->OriginalCellIdsName = NULL;
-}
-
-vtkEDFCutter::~vtkEDFCutter()
-{
-  this->SetOriginalCellIdsName(NULL);
-}
-
-int vtkEDFCutter::RequestData(vtkInformation * request,
-                        vtkInformationVector ** inVector,
-                        vtkInformationVector * outVector)
-{
-  // get the info objects
-  vtkInformation *inInfo = inVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outVector->GetInformationObject(0);
-
-  // get the input and output
-  vtkDataSet *input = vtkDataSet::SafeDownCast(
-    inInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-  vtkSmartPointer<vtkIdTypeArray> cellIdArray =
-      vtkSmartPointer<vtkIdTypeArray>::New();
-  cellIdArray->SetName(this->GetOriginalCellIdsName());
-  cellIdArray->SetNumberOfComponents(1);
-  cellIdArray->SetNumberOfTuples(input->GetNumberOfCells());
-  for(vtkIdType id=0; id < cellIdArray->GetNumberOfTuples(); id++)
-    {
-    cellIdArray->SetTuple1(id, id);
-    }
-  input->GetCellData()->AddArray(cellIdArray);
-
-  int ret = this->Superclass::RequestData(request, inVector, outVector);
-
-  if(ret == 0)
-    return 0;
-
-  vtkPolyData *output = vtkPolyData::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-  vtkSmartPointer<vtkPolyData> tmpOutput;
-  tmpOutput.TakeReference(output->NewInstance());
-
-  this->AssembleOutputTriangles(output, tmpOutput);
-
-  output->ShallowCopy(tmpOutput);
-
-  return ret;
-}
-
-
-void  vtkEDFCutter::AssembleOutputTriangles(vtkPolyData* inpd,
-                                            vtkPolyData* outpd)
-{
-  outpd->ShallowCopy(inpd);
-
-  vtkIdTypeArray* originalCellIds = vtkIdTypeArray::SafeDownCast(
-      inpd->GetCellData()->GetArray(this->GetOriginalCellIdsName()));
-
-  if(originalCellIds == NULL)
-    {
-    return;
-    }
-
-  outpd->GetCellData()->Initialize();
-  outpd->GetCellData()->CopyAllocate(inpd->GetCellData());
-
-  vtkSmartPointer<vtkCellArray> verts = vtkSmartPointer<vtkCellArray>::New();
-  vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
-  vtkSmartPointer<vtkCellArray> polys = vtkSmartPointer<vtkCellArray>::New();
-  vtkSmartPointer<vtkCellArray> strips = vtkSmartPointer<vtkCellArray>::New();
-  outpd->SetVerts(verts);
-  outpd->SetLines(lines);
-  outpd->SetPolys(polys);
-  outpd->SetStrips(strips);
-
-  for(vtkIdType cellId=0; cellId<inpd->GetNumberOfCells(); cellId++)
-    {
-    unsigned char type = inpd->GetCellType(cellId);
-    if(type != VTK_TRIANGLE)
-      {
-      vtkIdType npts;
-      vtkIdType* pts = NULL;
-      inpd->GetCellPoints(cellId, npts, pts);
-      vtkIdType newCellId =
-          outpd->InsertNextCell(type, npts, pts);
-      outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
-      }
-    else
-      {
-      vtkIdType cellIdEnd = cellId+1;
-      vtkIdType originalCellId = originalCellIds->GetValue(cellId);
-      while(cellIdEnd < inpd->GetNumberOfCells() &&
-            inpd->GetCellType(cellIdEnd) == VTK_TRIANGLE &&
-            originalCellIds->GetValue(cellIdEnd) == originalCellId)
-        {
-        cellIdEnd++;
-        }
-
-      // all triangles from cellId to cellIdEnd come from the same
-      // original cell.
-
-      // A batch is composed of triangles which are connected by the edges.
-      std::map<vtkIdType, std::set<vtkIdType> > connectedTriangles;
-      for(vtkIdType firstCell = cellId; firstCell < cellIdEnd-1; firstCell++)
-        {
-        vtkIdType npts;
-        vtkIdType* pts = NULL;
-        inpd->GetCellPoints(firstCell, npts, pts);
-        vtkEDFEdge fe0 = vtkEDFEdge(pts[0], pts[1]);
-        vtkEDFEdge fe1 = vtkEDFEdge(pts[1], pts[2]);
-        vtkEDFEdge fe2 = vtkEDFEdge(pts[2], pts[0]);
-        for(vtkIdType secondCell = firstCell+1; secondCell < cellIdEnd; secondCell++)
-          {
-          vtkIdType snpts;
-          vtkIdType* spts = NULL;
-          inpd->GetCellPoints(secondCell, snpts, spts);
-          vtkEDFEdge se0 = vtkEDFEdge(spts[0], spts[1]);
-          vtkEDFEdge se1 = vtkEDFEdge(spts[1], spts[2]);
-          vtkEDFEdge se2 = vtkEDFEdge(spts[2], spts[0]);
-
-          if(fe0 == se0 || fe0 == se1 || fe0 == se2 ||
-             fe1 == se0 || fe1 == se1 || fe1 == se2 ||
-             fe2 == se0 || fe2 == se1 || fe2 == se2)
-            {
-            connectedTriangles[firstCell].insert(secondCell);
-            connectedTriangles[secondCell].insert(firstCell);
-            }
-          }
-        }
-
-      std::set<vtkIdType> visitedCell;
-      for(vtkIdType id=cellId; id<cellIdEnd; id++)
-        {
-        if(visitedCell.find(id) != visitedCell.end())
-          continue;
-
-        // if this cell has not yet been visited, I create a batch of all
-        // cells connected to this one
-
-        visitedCell.insert(id);
-        std::set<vtkIdType> batch;
-        std::list<vtkIdType> cellList;
-        cellList.push_back(id);
-        while(cellList.size() > 0)
-          {
-          vtkIdType currentId = *(cellList.begin());
-          batch.insert(currentId);
-          cellList.pop_front();
-          if(connectedTriangles.find(currentId) != connectedTriangles.end())
-            {
-            const std::set<vtkIdType>& adj = connectedTriangles[currentId];
-            std::set<vtkIdType>::const_iterator it = adj.begin();
-            while(it != adj.end())
-              {
-              vtkIdType other = *it;
-              if(visitedCell.find(other) == visitedCell.end())
-                {
-                cellList.push_back(other);
-                visitedCell.insert(other);
-                }
-              it++;
-              }
-            }
-          }
-
-
-
-        // then I add this batch to the output,
-        // creating a unique cell for the whole batch.
-
-        if(batch.size() == 1)
-          {
-          vtkIdType tid = *(batch.begin());
-          vtkIdType npts;
-          vtkIdType* pts = NULL;
-          inpd->GetCellPoints(tid, npts, pts);
-          vtkIdType newCellId =
-              outpd->InsertNextCell(VTK_TRIANGLE, npts, pts);
-          outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
-          }
-        else if(batch.size() == 2)
-          { // two triangles connected together --> create a VTK_QUAD
-          vtkIdType fid = *(batch.begin());
-          vtkIdType sid = *(batch.rbegin());
-          vtkIdType fnpts;
-          vtkIdType* fpts = NULL;
-          inpd->GetCellPoints(fid, fnpts, fpts);
-          vtkIdType snpts;
-          vtkIdType* spts = NULL;
-          inpd->GetCellPoints(sid, snpts, spts);
-
-          int findex = 0;
-          vtkIdType fv = fpts[findex];
-          while(((fv == spts[0]) ||
-                 (fv == spts[1]) ||
-                 (fv == spts[2])) && findex < 3)
-            {
-            findex++;
-            fv = fpts[findex];
-            }
-          if(findex == 3)
-            {// this is a degenerate case : one of the triangles use
-            // only 2 vertices
-            findex = 0;
-            }
-          int sindex = 0;
-          vtkIdType sv = spts[sindex];
-          while(((sv == fpts[0]) ||
-                 (sv == fpts[1]) ||
-                 (sv == fpts[2])) && sindex < 3)
-            {
-            sindex++;
-            sv = spts[sindex];
-            }
-          if(sindex == 3)
-            {// this is a degenerate case : one of the triangles use
-            // only 2 vertices
-            sindex = 0;
-            }
-
-          vtkIdType pts[4];
-          pts[0] = fpts[findex];
-          pts[1] = fpts[(findex+1)%3];
-          pts[2] = spts[sindex];
-          pts[3] = fpts[(findex+2)%3];
-
-          vtkIdType newCellId = outpd->InsertNextCell(VTK_QUAD, 4, pts);
-          outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
-          }
-        else
-          {
-          std::deque<vtkEDFEdge> contour;
-
-          std::list<vtkIdType> toVisit;
-          std::set<vtkIdType> visited;
-
-          toVisit.push_back(*(batch.begin()));
-
-          std::set<vtkIdType> triedAgain;
-
-          while(toVisit.size() > 0)
-            {
-            vtkIdType currentId = *(toVisit.begin());
-            toVisit.pop_front();
-            if(visited.find(currentId) != visited.end())
-              continue;
-
-            visited.insert(currentId);
-            const std::set<vtkIdType>& adj = connectedTriangles[currentId];
-            std::set<vtkIdType>::const_iterator it = adj.begin();
-            while(it != adj.end())
-              {
-              vtkIdType adjid = *it;
-              it++;
-              if(visited.find(adjid) != visited.end())
-                continue;
-
-              toVisit.push_back(adjid);
-              }
-
-            vtkIdType npts;
-            vtkIdType* pts = NULL;
-            inpd->GetCellPoints(currentId, npts, pts);
-            vtkEDFEdge edge[3] = {vtkEDFEdge(pts[0], pts[1]),
-                                  vtkEDFEdge(pts[1], pts[2]),
-                                  vtkEDFEdge(pts[2], pts[0])};
-
-            // special case : initialization of the contour
-            if(contour.size() == 0)
-              {
-              contour.push_back(edge[0]);
-              contour.push_back(edge[1]);
-              contour.push_back(edge[2]);
-              continue;
-              }
-
-            // Find which edge of the contour
-            // is connected to the current triangle
-            int orient = 0;
-            std::deque<vtkEDFEdge>::iterator contourit = contour.begin();
-            bool found = false;
-            while(contourit != contour.end())
-              {
-              vtkEDFEdge& e = *contourit;
-              for(orient = 0; orient<3; orient++)
-                {
-                if(e == edge[orient])
-                  {
-                  found = true;
-                  break;
-                  }
-                }
-              if(found)
-                break;
-
-              contourit++;
-              }
-            if(contourit == contour.end())
-              {// this triangle is not connected to the current contour.
-              // put it back in the queue for later processing
-              if(triedAgain.find(currentId) == triedAgain.end())
-                {
-                triedAgain.insert(currentId);
-                toVisit.push_back(currentId);
-                visited.erase(currentId);
-                continue;
-                }
-              else
-                {
-                vtkDebugMacro( << "triangle " << currentId
-                  << "could not be added to the contour of the current batch");
-                continue;
-                }
-              }
-            // if I reach this point, I will add the triangle to the contour
-            // --> the contour will be modified and I can try again
-            // to add the previously rejected triangles
-            triedAgain.clear();
-
-            // Now, merge the edges of the current triangle with
-            // the contour
-            vtkEDFEdge& tbeforeedge = edge[(orient+1)%3];
-            vtkEDFEdge& tafteredge = edge[(orient+2)%3];
-
-            std::deque<vtkEDFEdge>::iterator beforeit;
-            if(contourit == contour.begin())
-              beforeit = contour.end()-1;
-            else
-              beforeit = contourit - 1;
-            vtkEDFEdge& beforeedge = *beforeit;
-
-            std::deque<vtkEDFEdge>::iterator afterit;
-            if(contourit == contour.end()-1)
-              afterit = contour.begin();
-            else
-              afterit = contourit + 1;
-            vtkEDFEdge& afteredge = *afterit;
-
-            if(beforeedge == tbeforeedge)
-              {
-              if(afteredge == tafteredge)
-                {// in this case, I am adding a triangle that is fully inside
-                // the contour. I need to remove the three edges from the
-                // contour.
-                if(contour.size() == 3)
-                  {
-                  contour.clear();
-                  }
-                else
-                  {
-                  std::deque<vtkEDFEdge>::iterator lastit;
-                  if(afterit == contour.end()-1)
-                    lastit = contour.begin();
-                  else
-                    lastit = afterit + 1;
-
-                  if(lastit < beforeit)
-                    {
-                    contour.erase(beforeit, contour.end());
-                    contour.erase(contour.begin(), lastit);
-                    }
-                  else
-                    {
-                    contour.erase(beforeit, lastit);
-                    }
-                  }
-                }
-              else
-                {// the edge before is the glued, remove the two adjacent edges
-                // and add the edge after
-                if(beforeit == contour.end()-1)
-                  {
-                  contour.erase(beforeit, contour.end());
-                  contour.erase(contour.begin(), contour.begin()+1);
-                  contour.push_back(tafteredge);
-                  }
-                else
-                  {
-                  int index = beforeit - contour.begin();
-                  contour.erase(beforeit, contourit+1);
-                  contour.insert(contour.begin()+index, tafteredge);
-                  }
-                }
-              }
-            else if(afteredge == tafteredge)
-              {// the edge after is glued, removed the two glued edges and add
-              // the edge new edge
-              if(contourit == contour.end() -1)
-                {
-                contour.erase(contour.end() - 1);
-                contour.erase(contour.begin());
-                contour.push_back(tbeforeedge);
-                }
-              else
-                {
-                int index = contourit - contour.begin();
-                contour.erase(contourit, afterit+1);
-                contour.insert(contour.begin()+index, tbeforeedge);
-                }
-              }
-            else
-              {
-              int index = contourit - contour.begin();
-              contour.erase(contourit);
-              contour.insert(contour.begin()+index, tbeforeedge);
-              contour.insert(contour.begin()+index+1, tafteredge);
-              }
-            }
-          vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
-          std::deque<vtkEDFEdge>::iterator cit = contour.begin();
-          while(cit != contour.end())
-            {
-            vtkEDFEdge& e = *cit;
-            cit++;
-            ids->InsertNextId(e.v0);
-            }
-
-          vtkIdType newCellId = outpd->InsertNextCell(VTK_POLYGON, ids);
-          outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
-          }
-        }
-      cellId = cellIdEnd - 1;
-      }
-    }
-}
-
-void  vtkEDFCutter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
-
-
diff --git a/tools/vtkEDFOverloads/vtkEDFCutter.h b/tools/vtkEDFOverloads/vtkEDFCutter.h
deleted file mode 100755 (executable)
index 6018bbd..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 __vtkEDFCutter_h__
-#define __vtkEDFCutter_h__
-
-#include "vtkEDFOverloadsDefines.h"
-#include "vtkCutter.h"
-
-class VTKTOOLS_EXPORT vtkEDFCutter : public vtkCutter
-{
-public :
-  static vtkEDFCutter* New();
-  vtkTypeMacro(vtkEDFCutter, vtkCutter);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // these ivars
-  // control the name given to the field in which the ids are written into.  If
-  // set to NULL, then vtkOriginalCellIds or vtkOriginalPointIds (the default)
-  // is used, respectively.
-  vtkSetStringMacro(OriginalCellIdsName);
-  virtual const char *GetOriginalCellIdsName() {
-    return (  this->OriginalCellIdsName
-            ? this->OriginalCellIdsName : "vtkOriginalCellIds");
-  }
-
-protected :
-  virtual int RequestData(vtkInformation *,
-                          vtkInformationVector **,
-                          vtkInformationVector *);
-
-  virtual void  AssembleOutputTriangles(vtkPolyData* inpd,
-                                        vtkPolyData* outpd);
-
-  char* OriginalCellIdsName;
-
-  vtkEDFCutter();
-  ~vtkEDFCutter();
-
-private:
-  vtkEDFCutter(const vtkEDFCutter&);  // Not implemented.
-  void operator=(const vtkEDFCutter&);  // Not implemented.
-};
-
-#endif //__vtkEDFCutter_h__
diff --git a/tools/vtkEDFOverloads/vtkEDFFactory.cxx b/tools/vtkEDFOverloads/vtkEDFFactory.cxx
deleted file mode 100755 (executable)
index 736e903..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 "vtkEDFFactory.h"
-#include "vtkVersion.h"
-#include "vtkEDFCutter.h"
-
-vtkStandardNewMacro(vtkEDFFactory);
-
-VTK_CREATE_CREATE_FUNCTION(vtkEDFCutter);
-
-vtkEDFFactory::vtkEDFFactory()
-{
-  this->RegisterOverride("vtkCutter",
-                         "vtkEDFCutter",
-                         "MergeTriangles",
-                         1,
-                         vtkObjectFactoryCreatevtkEDFCutter);
-}
-
-const char* vtkEDFFactory::GetVTKSourceVersion()
-{
-  return VTK_SOURCE_VERSION;
-}
-
-const char* vtkEDFFactory::GetDescription()
-{
-  return "VTK EDF Factory";
-}
-
-#ifdef WIN32
-  //RNV: workaround to avoid definition __declspec( dllimport )
-  //for the vtkGetFactoryCompilerUsed(), vtkGetFactoryVersion()
-  //and vtkLoad(). This happens because of a bug in the 
-  //vtkObjectFactory.h file. 
-  //This workaround will be removed in the future as soon as
-  //mentioned bug is fixed. 
-  #ifdef VTK_FACTORY_INTERFACE_IMPLEMENT
-    #undef VTK_FACTORY_INTERFACE_IMPLEMENT
-
-    #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName)  \
-    extern "C"                                      \
-    VTKEDF_OVERLOADS_EXPORT                         \
-    const char* vtkGetFactoryCompilerUsed()         \
-    {                                               \
-      return VTK_CXX_COMPILER;                      \
-    }                                               \
-    extern "C"                                      \
-    VTKEDF_OVERLOADS_EXPORT                         \
-    const char* vtkGetFactoryVersion()              \
-    {                                               \
-      return VTK_SOURCE_VERSION;                    \
-    }                                               \
-    extern "C"                                      \
-    VTKEDF_OVERLOADS_EXPORT                         \
-    vtkObjectFactory* vtkLoad()                     \
-    {                                               \
-      return factoryName ::New();                   \
-    }
-  #endif
-#endif
-
-
-VTK_FACTORY_INTERFACE_IMPLEMENT(vtkEDFFactory);
diff --git a/tools/vtkEDFOverloads/vtkEDFFactory.h b/tools/vtkEDFOverloads/vtkEDFFactory.h
deleted file mode 100755 (executable)
index ba046f0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 __vtkEDFFactory_h
-#define __vtkEDFFactory_h
-
-#include "vtkEDFOverloadsDefines.h"
-#include "vtkObjectFactory.h"
-
-class VTKEDF_OVERLOADS_EXPORT vtkEDFFactory : public vtkObjectFactory
-{
-public:
-// Methods from vtkObject
-  vtkTypeMacro(vtkEDFFactory,vtkObjectFactory);
-  static vtkEDFFactory *New();
-
-  virtual const char* GetVTKSourceVersion();
-  virtual const char* GetDescription();
-protected:
-  vtkEDFFactory();
-private:
-  vtkEDFFactory(const vtkEDFFactory&);  // Not implemented.
-  void operator=(const vtkEDFFactory&);  // Not implemented.
-};
-
-extern "C" VTK_EXPORT vtkObjectFactory* vtkLoad();
-#endif
diff --git a/tools/vtkEDFOverloads/vtkEDFOverloadsDefines.h b/tools/vtkEDFOverloads/vtkEDFOverloadsDefines.h
deleted file mode 100755 (executable)
index bb41cd4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 VTKEDF_OVERLOADS_DEFINES_H
-#define VTKEDF_OVERLOADS_DEFINES_H
-
-#if defined WIN32
-#  if defined VTKEDF_OVERLOADS_EXPORTS || defined vtkEDFOverloads_EXPORTS
-#    define VTKEDF_OVERLOADS_EXPORT __declspec( dllexport )
-#  else
-#    define VTKEDF_OVERLOADS_EXPORT __declspec( dllimport )
-#  endif
-
-#  if defined VTKTOOLS_EXPORTS || defined vtkTools_EXPORTS
-#    define VTKTOOLS_EXPORT __declspec( dllexport )
-#  else
-#    define VTKTOOLS_EXPORT __declspec( dllimport )
-#  endif
-
-#else
-#  define VTKEDF_OVERLOADS_EXPORT
-#  define VTKTOOLS_EXPORT
-#endif //WIN32
-
-#endif //VTKEDF_OVERLOADS_DEFINES_H