]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
tools refactoring on two parts (OCCT/QT and other products dependencies)
authorasl <asl@opencascade.com>
Wed, 18 Nov 2015 07:00:48 +0000 (10:00 +0300)
committerasl <asl@opencascade.com>
Wed, 18 Nov 2015 07:00:48 +0000 (10:00 +0300)
58 files changed:
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_AbstractDisplayer.cxx
src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx
src/HYDROGUI/HYDROGUI_CalculationDlg.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_ChannelOp.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DeleteOp.cxx
src/HYDROGUI/HYDROGUI_DigueOp.cxx
src/HYDROGUI/HYDROGUI_Displayer.cxx
src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx
src/HYDROGUI/HYDROGUI_ExportFileOp.cxx
src/HYDROGUI/HYDROGUI_ExportImageOp.cxx
src/HYDROGUI/HYDROGUI_GVSelector.cxx
src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx
src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx
src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx
src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx
src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx
src/HYDROGUI/HYDROGUI_ImportImageOp.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx
src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx
src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx
src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_NameValidator.cxx
src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx
src/HYDROGUI/HYDROGUI_ObjComboBox.cxx
src/HYDROGUI/HYDROGUI_ObjListBox.cxx
src/HYDROGUI/HYDROGUI_ObjSelector.cxx
src/HYDROGUI/HYDROGUI_ObserveImageOp.cxx
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Poly3DOp.cxx
src/HYDROGUI/HYDROGUI_PolylineExtractionOp.cxx
src/HYDROGUI/HYDROGUI_PolylineOp.cxx
src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx
src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx
src/HYDROGUI/HYDROGUI_ProfileOp.cxx
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
src/HYDROGUI/HYDROGUI_RemoveImageRefsOp.cxx
src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.cxx
src/HYDROGUI/HYDROGUI_SetTransparencyOp.cxx
src/HYDROGUI/HYDROGUI_ShowHideOp.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx
src/HYDROGUI/HYDROGUI_StreamDlg.cxx
src/HYDROGUI/HYDROGUI_StreamOp.cxx
src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx
src/HYDROGUI/HYDROGUI_SubmersibleOp.cxx
src/HYDROGUI/HYDROGUI_Tool2.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_Tool2.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx
src/HYDROGUI/HYDROGUI_TwoImagesOp.cxx
src/HYDROGUI/HYDROGUI_UpdateObjectOp.cxx
src/HYDROGUI/HYDROGUI_VisualStateOp.cxx
src/HYDROGUI/HYDROGUI_ZLevelsOp.cxx

index 549402caaa3e8a87aafa81a93864f3fff8a779fe..bcb457a4c9c59e9e471844a8da893b4bb040a05c 100644 (file)
@@ -96,6 +96,7 @@ set(PROJECT_HEADERS
     HYDROGUI_StricklerTypeComboBox.h
     HYDROGUI_SubmersibleOp.h
     HYDROGUI_Tool.h
+    HYDROGUI_Tool2.h
     HYDROGUI_TwoImagesDlg.h
     HYDROGUI_TwoImagesOp.h
     HYDROGUI_UpdateFlags.h
@@ -240,6 +241,7 @@ set(PROJECT_SOURCES
     HYDROGUI_SplitPolylinesOp.cxx
     HYDROGUI_SubmersibleOp.cxx
     HYDROGUI_Tool.cxx
+    HYDROGUI_Tool2.cxx
     HYDROGUI_TwoImagesDlg.cxx
     HYDROGUI_TwoImagesOp.cxx
     HYDROGUI_UpdateObjectOp.cxx
index 7ef7aec2030efdc57d32d03637af6b155c761ef5..032c9d3f6bbd4c66f91322e111d96ba2a11715b3 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <SUIT_ViewManager.h>
 #include <SUIT_ViewModel.h>
index 9369a4ae886af2891b3dbc7aaa494b661329656d..2d2f03b75b281a34378fa8ddf4289222a96d13b8 100644 (file)
@@ -18,7 +18,7 @@
 //
 
 #include <HYDROGUI_BathymetryBoundsOp.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <HYDROGUI_UpdateFlags.h>
 #include <HYDROGUI_Module.h>
 #include <HYDROGUI_DataObject.h>
index c17352746b40293b725b4f4464f057b460d1b539..778ac4311666fb01038a44833c13200a089a1ba7 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_CalculationDlg.h"
 
 #include "HYDROGUI_ObjSelector.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_DataBrowser.h"
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_ListSelector.h"
index 01b65432010e76d407feca5feb2b3cacfef804a4..b85d4c136795351bd7ada061fa24880820e1f294 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_CalculationDlg.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_Zone.h"
 #include "HYDROGUI_Region.h"
index f1613b07a406d8bf28d35f6aac76458d200136c5..99bf0cb70ca9fff56f3364274e98c3657bd11c72 100644 (file)
@@ -24,6 +24,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Iterator.h>
index 5f7f48610bcf13ebbbcccf1bacf0c911c4588c06..7f4db43868ace0ba2d2af20b364780e025b2c308 100644 (file)
@@ -21,6 +21,7 @@
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Zone.h"
 #include "HYDROGUI_Region.h"
 
index deafdfff5965dee4c9d5f26642e3e76705947202..8425cb1d8e1181f7b6c4e1d0a97a51e5545414c5 100644 (file)
@@ -21,6 +21,7 @@
 #include "HYDROGUI_DeleteDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Object.h>
@@ -84,7 +85,7 @@ void HYDROGUI_DeleteOp::startOperation()
 
   // check the back-references
   QMap<QString,HYDROData_SequenceOfObjects> aBackObjects =
-    HYDROGUI_Tool::GetObjectsBackReferences( module(), anObjNames );
+    HYDROGUI_Tool::GetObjectsBackReferences( doc(), anObjNames );
 
   QMap<QString,HYDROData_SequenceOfObjects>::const_iterator anIt = aBackObjects.begin(),
                                                             aLast = aBackObjects.end();
index 30e48c0bf7c62c3a71e9b9f10ee0231af4b31996..a65db9cd67e1dd58402c6ad290594571b8176b20 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_DigueOp.h"
 
 #include "HYDROGUI_DigueDlg.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Shape.h"
 
 #include <HYDROData_Document.h>
index c91247a5a55f7b8eb3c4b52e61c2504ab3bc863e..64bbb6e462a62dd205c32635b2c6f423b8bc3dcc 100644 (file)
@@ -24,7 +24,7 @@
 #include "HYDROGUI_PrsImageDriver.h"
 #include "HYDROGUI_PrsPolylineDriver.h"
 #include "HYDROGUI_PrsZoneDriver.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <CurveCreator_Utils.hxx>
 
index c911f1d048da8969044b861af2f61cf6ea345897..93467ea163c0cb457549bfa8ef3c3a4b4a20040f 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <HYDROData_CalculationCase.h>
 
index 9b17e6a721ede70653bd2765d073f0d4f374c927..e4bb9ee959583d878ea8776ff90f1553773baa8a 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_ExportLandCoverMapDlg.h"
 #include <HYDROData_PolylineXY.h>
 #include <HYDROData_Polyline3D.h>
index 33d61ae30b2c233310dca7f1977dec92b9b0f487..e6e3c72edbdf870ed980489667471b6b8fff5f59 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_ExportImageOp.h"
 
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <HYDROData_Image.h>
 
index d43074e183d880b6993f87d943deb542c0a371cc..11a0e7cc0c6bb9e27cfaef75eb22a55076901427 100644 (file)
@@ -22,7 +22,7 @@
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Prs.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <GraphicsView_Object.h>
 #include <GraphicsView_Selector.h>
index b20216e93917042d32c58e2eee43cee88597504a..5180be14dbbc8096ae41ed94feb50661706017b3 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "HYDROGUI_GeomObjectDlg.h"
 
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <SUIT_FileDlg.h>
 #include <SUIT_ResourceMgr.h>
index eb89f4c471b89df580dae8eeecf46d1b5ef238c1..5713af106d5e45bd85d003889f85fa719b6fdb2e 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_GeoreferencementDlg.h"
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Profile.h>
index 6a3326a974f2deb224ded09a6a735816770e8d1f..bf8ff273f62b8e797c373185f0a46397c01ffb8e 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_DataObject.h"
 
index fb8e663a1bf1d02ec1cdaf8eb85a6b3ad94adc63..d8b3abbcbed60229142e862776e673b9dd715e6c 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_ImportBathymetryDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Bathymetry.h>
index 70f4da944ee9d63ef79479db186301bc4af02b40..02df17e1b99d7e5f7480746f0672c13c8c2e0642 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Obstacle.h>
index d68840a8b22a5026b0a4858622e89a91a08861ca..15c73fdecb3b1ce405a5f5bcad2abc2dea9d841c 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_ImportImageDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_PrsImage.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Iterator.h>
index 5f35ec26ead97c9ef8f2a90cb63d78058c17399b..02c6d721c4532921a6d71455be11e37046ce1cf8 100644 (file)
@@ -25,7 +25,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_ImportLandCoverMapDlg.h"
 #include "HYDROGUI_Shape.h"
 #include <HYDROGUI_ZLayers.h>
index 3ad303ca5d530d8505c146d5d8a966c334f0c8ab..5a639978d1e1eb1117568d4c8f829e6949ec5e3f 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Obstacle.h>
index 1bf21c52f6bbaf27d2ef9008a52826573537115a..7cdbd1ed7decc6f854da5299b6d5e828aec373b8 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include <HYDROData_PolylineXY.h>
 #include <HYDROData_Polyline3D.h>
 #include <HYDROGUI_DataObject.h>
index 6b3f9eb0f06b8d25ff2448a9a4f71e6418f12e6e..d5c37eb54b2ada585b6717574c2ed463a9722e5e 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include <HYDROData_PolylineXY.h>
 #include <HYDROData_Polyline3D.h>
 #include <HYDROGUI_DataObject.h>
index 2edb94810786e9c686431708f8b23ff9e2fba23f..2b17f3e879fad1b1094a88eac325108c015e6d30 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Iterator.h>
index 213256f6de8af9fe61ebff680711517cf5dc53fa..5db4f16b8af1e875975c2313f9b4d39240d3c2f2 100644 (file)
@@ -22,7 +22,7 @@
 #include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_LandCoverMapDlg.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_ShapeLandCoverMap.h"
index 1dec04cd1f0beb1697a9584a30c3b5fd166b4970..e46d12a97ff3050162fdd72071f8bed64741c44f 100644 (file)
@@ -30,6 +30,7 @@
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_PrsImage.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_VTKPrs.h"
index 006710c07f2babc92ea7167aa0511e274f4dac55..64d45f2fae5ce8c2069306eb283bc3f51d4ab149 100644 (file)
@@ -17,7 +17,7 @@
 //
 
 #include "HYDROGUI_NameValidator.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Module.h"
 
 HYDROGUI_NameValidator::HYDROGUI_NameValidator( HYDROGUI_Module* theModule, QObject* parent )
index acbfad377df92a493000a37f511e301762ee98b2..5e75369fa92e3febdcebbdffee2624b854b113bc 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include <HYDROGUI_ShapeImage.h>
 #include <HYDROGUI_ShapeBathymetry.h>
 #include <HYDROGUI_ShapeLandCoverMap.h>
@@ -29,6 +29,7 @@
 #include "HYDROGUI_ZLayers.h"
 
 #include <HYDROData_Bathymetry.h>
+#include <HYDROData_Image.h>
 #include <HYDROData_LandCoverMap.h>
 #include <HYDROData_StricklerTable.h>
 
index 9b2dfc7a836291facb3d9d3806d3e70744c8ea2a..8d2ef26ef570d45a22acaec35d8525ee7240b936 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "HYDROGUI_ObjComboBox.h"
 
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Module.h"
 
 #include <LightApp_Application.h>
index 8547e8faf5bdd543f7519a486fbae2541effabbb..38ffb4c16dbb1261d47e29c54d513338a113b864 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <HYDROGUI_ObjListBox.h>
 #include <HYDROGUI_ObjComboBox.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <QGridLayout>
 #include <QListWidget>
 #include <QLabel>
index 22e672da603a64ccce5663000f0202a2fb3dc874..9f77261ab597f5f4f0914ffde39f4bdc4a08fbab 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <HYDROData_PolylineXY.h>
 
index af363c98b878741ff875b8657ab41c63fa8407e6..e1a70d13525cc441cd379726ac37c08cfe5d4e3f 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_PrsImage.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Image.h>
index aa689a8388f079890e7c70e1aebead0b1cf611f9..04aa55f71da27ed5b94dcc0f1603ca4581f4fa65 100644 (file)
@@ -53,7 +53,7 @@
 #include "HYDROGUI_GeoreferencementOp.h"
 #include "HYDROGUI_SetColorOp.h"
 #include "HYDROGUI_BathymetryBoundsOp.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_ZLevelsOp.h"
 #include "HYDROGUI_LocalCSOp.h"
 #include "HYDROGUI_RiverBottomOp.h"
index 9c22b419b14c26d0d0b03ad347d321620178500e..3c505853e9989e51b936271ade3eeb6665ab0030 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_Module.h"
 #include <HYDROGUI_DataObject.h>
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Poly3DDlg.h"
 #include "HYDROGUI_UpdateFlags.h"
 
index 591ae2de9d67c8c0b89a05fe0c8155641ea111be..76519f492c44734265b4c9c4e028af3c5ca30e42 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <HYDROGUI_PolylineExtractionOp.h>
 #include <HYDROGUI_Module.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <HYDROGUI_UpdateFlags.h>
 #include <HYDROData_Document.h>
 #include <HYDROData_PolylineOperator.h>
index 486b182e5d150c5ddac9831350c8fb08cd2bc4a1..9666cf7afc5e9c300cba9c3c5b71c7b87995d748 100755 (executable)
@@ -22,6 +22,7 @@
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_PolylineDlg.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index add3b8bb55537cd04b741006c4f1358ed000779d..70b3a7e206905f4eef981a971a56a18b3ca3780c 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "HYDROGUI_ProfileInterpolateDlg.h"
 
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_ObjComboBox.h"
 #include "HYDROGUI_OCCSelector.h"
index 3bfb229203d426a8ee7b993b66ac36ad8f7fd463..3ea3a5ea84cd10b67af289a4158ef828e3fa960e 100644 (file)
@@ -19,6 +19,7 @@
 #include <HYDROGUI_ProfileInterpolateOp.h>
 
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_UpdateFlags.h"
index c4c822df57515a5a9fdb4461e27b74928da49049..11a60f85217ae0411dd43c1cf4168220d1c7ce27 100644 (file)
@@ -19,7 +19,7 @@
 #include <HYDROGUI_Module.h>
 #include <HYDROGUI_ProfileOp.h>
 #include <HYDROGUI_ProfileDlg.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <HYDROGUI_UpdateFlags.h>
 #include <HYDROGUI_DataObject.h>
 #include <HYDROData_Document.h>
index c4961c39d71c503a272f74664850babf16f9bdf4..834d344b86e45d3eedf97d7644e4cd38b3af24e7 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_RecognizeContoursDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_OCCSelector.h"
 #include "HYDROGUI_ZLayers.h"
index b5e4bd881472c2dc4fbbdca024a4061be94d64a7..0cf8398778148649af197fb4cf681517436060b0 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_RemoveImageRefsOp.h"
 
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index aeaadfb52176fe0d4045d14a5340af61f9b7ea88..8311fd7b3d86fa9914cc8ee2a9bc75c003c4b426 100644 (file)
@@ -24,7 +24,7 @@
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_River.h>
index 840d219458d8244e9b174e979048257b98369dde..732635279f5e216e9a4f47c4645587ef7622f54b 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_ColorDlg.h"
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Object.h>
index 85d9d68f070cd49d21ef76f87b47c4094b3a178b..d3402089cc9babc1444323df08974c5c5673e96a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "HYDROGUI_TransparencyDlg.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <LightApp_Application.h>
index c3185734493165204c92c26363cb8b15e007a321..b5f3c595e7e321827cf915a6e46793d997aaaa51 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Iterator.h>
index eec48af774ffc9e2e1105be0bdfdc1075ae7f454..a6ce1887022474cd89291d391c76544a1d69f075 100644 (file)
@@ -19,7 +19,7 @@
 #include <HYDROGUI_SplitPolylinesDlg.h>
 #include <HYDROGUI_ObjComboBox.h>
 #include <HYDROGUI_ObjListBox.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <OCCViewer_ViewManager.h>
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
index 95f0750bda8f08194e944d5882ba655a72347a68..591e175e36c6138e5a436d8b623ac9902038da74 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_ListSelector.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_OrderedListWidget.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 
 #include <HYDROData_Profile.h>
 
index a2072046345be71268bd07eeb74fdbcfe26457c6..ca1f6e5df7c3038e9fd1f2799732eaee717f08a1 100755 (executable)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_StreamDlg.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index 2433bca6e6ef285602b853c2162c5b3172464cb8..d47540a2879479bc315565c7dc6e9fcb7b0f2e93 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index 630bf6783e547f4ecb15390f340e668933346753..47ca42f6ed19ad8bcdff834034678f1a178d254d 100644 (file)
@@ -17,7 +17,7 @@
 //
 
 #include <HYDROGUI_SubmersibleOp.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool2.h>
 #include <HYDROGUI_Module.h>
 
 HYDROGUI_SubmersibleOp::HYDROGUI_SubmersibleOp( HYDROGUI_Module* theModule )
diff --git a/src/HYDROGUI/HYDROGUI_Tool2.cxx b/src/HYDROGUI/HYDROGUI_Tool2.cxx
new file mode 100644 (file)
index 0000000..edcfd86
--- /dev/null
@@ -0,0 +1,498 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_Tool2.h>
+#include <HYDROGUI_DataModel.h>
+#include <HYDROGUI_DataObject.h>
+#include <HYDROGUI_Module.h>
+#include <HYDROGUI_Prs.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_ImmersibleZone.h>
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Tool.h>
+
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+
+#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_DataOwner.h>
+#include <LightApp_SelectionMgr.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewFrame.h>
+#include <SVTK_ViewModel.h>
+#include <GraphicsView_Viewer.h>
+#include <GraphicsView_ViewPort.h>
+#include <STD_TabDesktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+#include <QtxActionToolMgr.h>
+#include <QtxWorkstack.h>
+
+int HYDROGUI_Tool::GetActiveStudyId()
+{
+  if( SUIT_Session* aSession = SUIT_Session::session() )
+    if( SUIT_Application* anApp = aSession->activeApplication() )
+      if( SUIT_Study* aStudy = anApp->activeStudy() )
+        return aStudy->id();
+  return 0;
+}
+
+
+
+void HYDROGUI_Tool::SetActiveViewManager( HYDROGUI_Module* theModule,
+                                          SUIT_ViewManager* theViewManager )
+{
+  if( theViewManager )
+    if( SUIT_ViewWindow* aViewWindow = theViewManager->getActiveView() )
+      if( STD_TabDesktop* aTabDesktop = dynamic_cast<STD_TabDesktop*>( theModule->getApp()->desktop() ) )
+        if( QtxWorkstack* aWorkstack = aTabDesktop->workstack() )
+          aWorkstack->setActiveWindow( aViewWindow );
+}
+
+
+bool HYDROGUI_Tool::IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject,
+                                             const QString&                  theViewerType )
+{
+  if ( theObject.IsNull() )
+    return false;
+
+  ObjectKind anObjectKind = theObject->GetKind();
+  if ( theViewerType.isEmpty() || theViewerType == OCCViewer_Viewer::Type() )
+  {
+    if ( anObjectKind == KIND_IMAGE ||
+         anObjectKind == KIND_POLYLINEXY ||
+         anObjectKind == KIND_POLYLINE ||
+         anObjectKind == KIND_IMMERSIBLE_ZONE ||
+         anObjectKind == KIND_REGION ||
+         anObjectKind == KIND_ZONE ||
+         anObjectKind == KIND_OBSTACLE ||
+         anObjectKind == KIND_PROFILE ||
+         anObjectKind == KIND_STREAM ||
+         anObjectKind == KIND_CHANNEL ||
+         anObjectKind == KIND_DIGUE ||
+         anObjectKind == KIND_DUMMY_3D || 
+         anObjectKind == KIND_BATHYMETRY ||
+         anObjectKind == KIND_LAND_COVER_MAP
+#ifdef DEB_GROUPS
+         || anObjectKind == KIND_SHAPES_GROUP ||
+         anObjectKind == KIND_SPLITTED_GROUP
+#endif
+         )
+    {
+      return true;
+    }
+  }
+  
+  if ( theViewerType.isEmpty() || theViewerType == SVTK_Viewer::Type() )
+  {
+    if ( anObjectKind == KIND_BATHYMETRY )
+      return true;
+  }
+
+  if ( theViewerType.isEmpty() || theViewerType == GraphicsView_Viewer::Type() )
+  {
+    if ( anObjectKind == KIND_IMAGE ||
+         anObjectKind == KIND_POLYLINEXY )
+      return true;
+  }
+
+  return false;
+}
+
+void HYDROGUI_Tool::GetPrsSubObjects( HYDROGUI_Module* theModule,
+                                      HYDROData_SequenceOfObjects& theSeq )
+{
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+  if( !aDocument.IsNull() )
+  {
+    HYDROData_Iterator anIterator( aDocument );
+    for( ; anIterator.More(); anIterator.Next() )
+    {
+      Handle(HYDROData_Entity) anObject = anIterator.Current();
+      if ( !IsObjectHasPresentation( anObject ) )
+        continue;
+
+      theSeq.Append( anObject );
+    }
+  }
+}
+
+HYDROGUI_Prs* HYDROGUI_Tool::GetPresentation( const Handle(HYDROData_Entity)& theObj,
+                                              const GraphicsView_ObjectList& theObjects )
+{
+  if( !theObj.IsNull() )
+  {
+    GraphicsView_ObjectListIterator anIter( theObjects );
+    while( anIter.hasNext() )
+    {
+      if( HYDROGUI_Prs* aPrs = dynamic_cast<HYDROGUI_Prs*>( anIter.next() ) )
+      {
+        Handle(HYDROData_Entity) anObj = aPrs->getObject();
+        if( IsEqual( anObj, theObj ) )
+          return aPrs;
+      }
+    }
+  }
+  return NULL;
+}
+
+GraphicsView_ObjectList HYDROGUI_Tool::GetPrsList( GraphicsView_ViewPort* theViewPort )
+{
+  GraphicsView_ObjectList aList;
+  if( theViewPort )
+  {
+    GraphicsView_ObjectListIterator anIter( theViewPort->getObjects() );
+    while( anIter.hasNext() )
+      if( HYDROGUI_Prs* aPrs = dynamic_cast<HYDROGUI_Prs*>( anIter.next() ) )
+        aList.append( aPrs );
+  }
+  return aList;
+}
+
+
+
+HYDROData_SequenceOfObjects HYDROGUI_Tool::GetSelectedObjects( HYDROGUI_Module* theModule )
+{
+  HYDROData_SequenceOfObjects aSeq;
+
+  HYDROGUI_DataModel* aModel = theModule->getDataModel();
+
+  SUIT_SelectionMgr* aSelectionMgr = theModule->getApp()->selectionMgr();
+  SUIT_DataOwnerPtrList anOwners;
+  aSelectionMgr->selected( anOwners );
+
+  QStringList aCollectedNameList; // to avoid duplication
+  foreach( SUIT_DataOwner* aSUITOwner, anOwners )
+  {
+    if( LightApp_DataOwner* anOwner = dynamic_cast<LightApp_DataOwner*>( aSUITOwner ) )
+    {
+      Handle(HYDROData_Entity) anObject = aModel->objectByEntry( anOwner->entry() );
+      if( !anObject.IsNull() )
+      {
+        QString aName = anObject->GetName();
+        if( !aCollectedNameList.contains( aName ) )
+        {
+          aSeq.Append( anObject );
+          aCollectedNameList.append( aName );
+        }
+      }
+    }
+  }
+  return aSeq;
+}
+
+Handle(HYDROData_Entity) HYDROGUI_Tool::GetSelectedObject( HYDROGUI_Module* theModule )
+{
+  HYDROData_SequenceOfObjects aSeq = GetSelectedObjects( theModule );
+  if( !aSeq.IsEmpty() )
+    return aSeq.First();
+  return NULL;
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_Tool::GetGeometryObjects( HYDROGUI_Module* theModule )
+{
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+
+  HYDROData_SequenceOfObjects aResSeq;
+
+  HYDROData_Iterator anIter( aDocument );
+  for ( ; anIter.More(); anIter.Next() )
+  {
+    Handle(HYDROData_Entity) anObj = anIter.Current();
+    if ( !HYDROData_Tool::IsGeometryObject( anObj ) )
+      continue;
+
+    aResSeq.Append( anObj );
+  }
+  
+  return aResSeq;
+}
+
+ObjectKind HYDROGUI_Tool::GetSelectedPartition( HYDROGUI_Module* theModule )
+{
+  HYDROGUI_DataModel* aModel = theModule->getDataModel();
+
+  SUIT_SelectionMgr* aSelectionMgr = theModule->getApp()->selectionMgr();
+  SUIT_DataOwnerPtrList anOwners;
+  aSelectionMgr->selected( anOwners );
+
+  if( anOwners.size() != 1 )
+    return KIND_UNKNOWN;
+
+  if( LightApp_DataOwner* anOwner = dynamic_cast<LightApp_DataOwner*>( anOwners.first().operator->() ) )
+  {
+    QString anEntry = anOwner->entry();
+    QString aPrefix = HYDROGUI_DataObject::entryPrefix();
+    if( anEntry.left( aPrefix.length() ) == aPrefix )
+    {
+      anEntry.remove( aPrefix );
+      for( ObjectKind anObjectKind = KIND_UNKNOWN + 1; anObjectKind <= KIND_LAST; anObjectKind++ )
+        if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toAscii() ) == anEntry )
+          return anObjectKind;
+    }
+  }
+  return KIND_UNKNOWN;
+}
+
+
+
+
+QStringList HYDROGUI_Tool::GetSelectedGeomObjects( HYDROGUI_Module* theModule,
+                                                   QList<GEOM::shape_type> theTypes )
+{
+  QStringList anEntryList;
+
+  // Get active SalomeApp_Study
+  SalomeApp_Study* aStudy = NULL;
+  if ( theModule && theModule->getApp() ) {
+    aStudy = dynamic_cast<SalomeApp_Study*>( theModule->getApp()->activeStudy() );
+  }
+  if ( !aStudy ) {
+    return anEntryList;
+  }
+
+  // Get selection
+  SUIT_SelectionMgr* aSelectionMgr = theModule->getApp()->selectionMgr();
+  SUIT_DataOwnerPtrList anOwners;
+  aSelectionMgr->selected( anOwners );
+
+  // Check if the selected objects belong to GEOM and have a shape
+  foreach( SUIT_DataOwner* aSUITOwner, anOwners )
+  {
+    if( LightApp_DataOwner* anOwner = dynamic_cast<LightApp_DataOwner*>( aSUITOwner ) )
+    {
+      QString anEntry = anOwner->entry();
+      _PTR(SObject) aSObject( aStudy->studyDS()->FindObjectID(qPrintable(anEntry)) );
+      if (aSObject) {
+         _PTR(SComponent) aSComponent = aSObject->GetFatherComponent();
+        if ( aSComponent && aSComponent->ComponentDataType() == "GEOM" ) {
+          GEOM::GEOM_Object_var aGeomObj = 
+            GEOMBase::GetObjectFromIOR( aSObject->GetIOR().c_str() );
+
+          if ( !aGeomObj->_is_nil() && aGeomObj->IsShape() && 
+               theTypes.contains( aGeomObj->GetShapeType() ) ) {
+            anEntryList << anEntry;
+          }
+        }
+      }
+    }
+  }
+
+  return anEntryList;
+}
+
+Handle(HYDROData_Entity) HYDROGUI_Tool::FindObjectByName( HYDROGUI_Module* theModule,
+                                                          const QString&   theName,
+                                                          const ObjectKind theObjectKind )
+{
+  Handle(HYDROData_Entity) aResObj;
+  
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+  if ( !aDocument.IsNull() )
+    aResObj = aDocument->FindObjectByName( theName, theObjectKind );
+  
+  return aResObj;
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_Tool::FindObjectsByNames( HYDROGUI_Module*   theModule,
+                                                               const QStringList& theNames,
+                                                               const ObjectKind   theObjectKind )
+{
+  HYDROData_SequenceOfObjects aResSeq;
+
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+  if ( !aDocument.IsNull() )
+    aResSeq = aDocument->FindObjectsByNames( theNames, theObjectKind );
+
+  return aResSeq;
+}
+
+QString HYDROGUI_Tool::GenerateObjectName( HYDROGUI_Module*   theModule,
+                                           const QString&     thePrefix,
+                                           const QStringList& theUsedNames,
+                                           const bool         theIsTryToUsePurePrefix)
+{
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+  return HYDROData_Tool::GenerateObjectName( aDocument, thePrefix, theUsedNames, theIsTryToUsePurePrefix );
+}
+
+size_t HYDROGUI_Tool::GetActiveViewId( HYDROGUI_Module* theModule,
+                                       const QString&   theViewId )
+{
+  size_t aViewId = 0;
+  SUIT_ViewManager* aViewMgr = theModule->getApp()->activeViewManager();
+  if( !aViewMgr || ( !theViewId.isEmpty() && aViewMgr->getType() != theViewId ) )
+    return aViewId;
+
+  if( SUIT_ViewModel* aViewer = aViewMgr->getViewModel() )
+    aViewId = (size_t)aViewer;
+  return aViewId;
+}
+
+size_t HYDROGUI_Tool::GetActiveGraphicsViewId( HYDROGUI_Module* theModule )
+{
+  return GetActiveViewId( theModule, GraphicsView_Viewer::Type() );
+}
+
+size_t HYDROGUI_Tool::GetActiveOCCViewId( HYDROGUI_Module* theModule )
+{
+  return GetActiveViewId( theModule, OCCViewer_Viewer::Type() );
+}
+
+QList<size_t> getViewIdList( HYDROGUI_Module* theModule,
+                             const QString&   theViewId )
+{
+  QList<size_t> aList;
+  ViewManagerList aViewMgrs;
+  theModule->getApp()->viewManagers( theViewId, aViewMgrs );
+  QListIterator<SUIT_ViewManager*> anIter( aViewMgrs );
+  while( anIter.hasNext() )
+  {
+    if( SUIT_ViewManager* aViewMgr = anIter.next() )
+    {
+      if( SUIT_ViewModel* aViewer = aViewMgr->getViewModel() )
+        aList.append( (size_t)aViewer );
+    }
+  }
+  return aList;
+}
+
+QList<size_t> HYDROGUI_Tool::GetGraphicsViewIdList( HYDROGUI_Module* theModule )
+{
+  return getViewIdList( theModule, GraphicsView_Viewer::Type() );
+}
+
+QList<size_t> HYDROGUI_Tool::GetOCCViewIdList( HYDROGUI_Module* theModule )
+{
+  return getViewIdList( theModule, OCCViewer_Viewer::Type() );
+}
+
+void HYDROGUI_Tool::setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
+                                       const int theActionId,
+                                       const bool isShown )
+{
+  if ( !theViewFrame )
+    return;
+
+  OCCViewer_ViewWindow* aView = theViewFrame->getView( OCCViewer_ViewFrame::MAIN_VIEW );
+  if ( aView ) {
+    aView->toolMgr()->setShown( theActionId, isShown );
+    if ( theActionId == OCCViewer_ViewWindow::MaximizedId )
+      theViewFrame->onMaximizedView( aView, true );
+  }
+}
+
+void HYDROGUI_Tool::setOCCActionShown( HYDROGUI_Module* theModule,
+                                       const int theActionId,
+                                       const bool isShown )
+{
+  QList<size_t> aList;
+  ViewManagerList aViewMgrs;
+  theModule->getApp()->viewManagers( OCCViewer_Viewer::Type(), aViewMgrs );
+  QListIterator<SUIT_ViewManager*> anIter( aViewMgrs );
+  while( anIter.hasNext() )
+  {
+    if( SUIT_ViewManager* aViewMgr = anIter.next() )
+    {
+      OCCViewer_ViewFrame* aViewFrame = dynamic_cast<OCCViewer_ViewFrame*>
+                                                           ( aViewMgr->getActiveView() );
+      if ( aViewFrame )
+        setOCCActionShown( aViewFrame, theActionId, isShown );
+    }
+  }
+}
+
+
+
+QColor HYDROGUI_Tool::GenerateFillingColor( HYDROGUI_Module*   theModule,
+                                            const QStringList& theZoneNames )
+{
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
+  return GenerateFillingColor( aDocument, theZoneNames );
+}
+
+QColor HYDROGUI_Tool::GenerateFillingColor( const Handle(HYDROData_Document)& theDoc,
+                                            const QStringList&                theZoneNames )
+{
+  QColor aFillingColor( Qt::darkBlue );
+
+  int aCounter = 0;
+  int aR = 0, aG = 0, aB = 0;
+  QStringListIterator aZoneNameIter( theZoneNames );
+  while( aZoneNameIter.hasNext() )
+  {
+    const QString& aZoneName = aZoneNameIter.next();
+    Handle(HYDROData_ImmersibleZone) aRefZone = 
+      Handle(HYDROData_ImmersibleZone)::DownCast( theDoc->FindObjectByName( aZoneName, KIND_IMMERSIBLE_ZONE ) );
+    if( !aRefZone.IsNull() )
+    {
+      QColor aRefColor = aRefZone->GetFillingColor();
+      aR += aRefColor.red();
+      aG += aRefColor.green();
+      aB += aRefColor.blue();
+      aCounter++;
+    }
+  }
+  
+  if( aCounter > 0 )
+  {
+    aFillingColor = QColor( aR / aCounter, aG / aCounter, aB / aCounter );
+  }
+
+  return aFillingColor;
+}
+
+
+
+void HYDROGUI_Tool::DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries )
+{
+  QStringList anEntryList;
+
+  // Get active SalomeApp_Study
+  SalomeApp_Study* aStudy = NULL;
+  if ( theModule && theModule->getApp() ) {
+    aStudy = dynamic_cast<SalomeApp_Study*>( theModule->getApp()->activeStudy() );
+  }
+  if ( !aStudy ) {
+    return;
+  }
+  // Get GEOM engine
+  GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
+  if ( aGeomEngine->_is_nil() ) {
+    return;
+  }
+  
+  // Delete GEOM objects
+  _PTR(StudyBuilder) aStudyBuilder( aStudy->studyDS()->NewBuilder() );
+  foreach ( const QString anEntry, theEntries ) {
+    _PTR(SObject) aSObject( aStudy->studyDS()->FindObjectID( qPrintable(anEntry) ) );
+    if ( aSObject ) {
+      GEOM::GEOM_Object_var aGeomObj = 
+        GEOMBase::GetObjectFromIOR( aSObject->GetIOR().c_str() );
+
+      if ( !aGeomObj->_is_nil() ) {
+        aGeomEngine->RemoveObject( aGeomObj );
+      }
+
+      aStudyBuilder->RemoveObject( aSObject );
+    }
+  }
+}
diff --git a/src/HYDROGUI/HYDROGUI_Tool2.h b/src/HYDROGUI/HYDROGUI_Tool2.h
new file mode 100644 (file)
index 0000000..e39bc3f
--- /dev/null
@@ -0,0 +1,105 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_TOOL2_H
+#define HYDROGUI_TOOL2_H
+
+#include <HYDROData_Entity.h>
+#include <GraphicsView_Defs.h>
+#include <QStringList>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#endif
+
+class HYDROGUI_Module;
+class HYDROGUI_Prs;
+class SUIT_ViewManager;
+class GraphicsView_ViewPort;
+class OCCViewer_ViewFrame;
+class Handle_HYDROData_Document;
+
+namespace HYDROGUI_Tool
+{
+  int GetActiveStudyId();
+
+  void SetActiveViewManager( HYDROGUI_Module* theModule,
+                             SUIT_ViewManager* theViewManager );
+
+  void GetPrsSubObjects( HYDROGUI_Module* theModule,
+                         HYDROData_SequenceOfObjects& theSeq );
+
+  HYDROGUI_Prs* GetPresentation( const Handle(HYDROData_Entity)& theObj,
+                                 const GraphicsView_ObjectList& theObjects );
+
+  GraphicsView_ObjectList GetPrsList( GraphicsView_ViewPort* theViewPort );
+
+  HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule );
+
+  bool IsObjectHasPresentation( const Handle_HYDROData_Entity& theObject,
+                                const QString&                 theViewerType = "" );
+
+  Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule );
+
+  HYDROData_SequenceOfObjects GetGeometryObjects( HYDROGUI_Module* theModule );
+
+  ObjectKind GetSelectedPartition( HYDROGUI_Module* theModule );
+
+  Handle(HYDROData_Entity) FindObjectByName( HYDROGUI_Module* theModule,
+                                             const QString& theName,
+                                             const ObjectKind theObjectKind = KIND_UNKNOWN );
+
+  HYDROData_SequenceOfObjects FindObjectsByNames( HYDROGUI_Module*   theModule,
+                                                  const QStringList& theNames,
+                                                  const ObjectKind   theObjectKind = KIND_UNKNOWN );
+
+  QString GenerateObjectName( HYDROGUI_Module*   theModule,
+                              const QString&     thePrefix,
+                              const QStringList& theUsedNames = QStringList(),
+                              const bool         theIsTryToUsePurePrefix = false );
+
+  size_t GetActiveViewId( HYDROGUI_Module* theModule,
+                          const QString&   theViewId = QString() );
+
+  size_t GetActiveGraphicsViewId( HYDROGUI_Module* theModule );
+
+  size_t GetActiveOCCViewId( HYDROGUI_Module* theModule );
+
+  QList<size_t> GetGraphicsViewIdList( HYDROGUI_Module* theModule );
+
+  QList<size_t> GetOCCViewIdList( HYDROGUI_Module* theModule );
+
+  void setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
+                          const int theActionId,
+                          const bool isShown );
+
+  void setOCCActionShown( HYDROGUI_Module* theModule,
+                          const int theActionId,
+                          const bool isShown );
+
+  QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames );
+
+  QColor GenerateFillingColor( const Handle_HYDROData_Document& theDoc,
+                               const QStringList& theZoneNames );
+
+  QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
+                                      QList<GEOM::shape_type> theTypes );
+
+  void DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries );
+};
index 11104c0b00f5c19e18dfa7771336e836c674b700..f4bffe60266eb7d2877fa1911317b37d5e1647c1 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_TranslateObstacleDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_ShapesTool.h>
index ab3bbb12803e0ca030191d966d29163696e85cd1..7376c5b391e41d07844b613988bd81d670d0925d 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_TwoImagesOp.h"
 
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_TwoImagesDlg.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include <HYDROGUI_DataObject.h>
index 08a1de813863cefaf12ceb177f98c0b8fe66aca8..fb2d26664efba1f3181b8b10424c62ba92041e03 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_UpdateObjectOp.h"
 
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index ea61932778d854da71352aae2eb593d12d408dce..9c866b85cb0a16d9d9f8765223cbd9e18458b5b5 100644 (file)
@@ -19,7 +19,7 @@
 #include "HYDROGUI_VisualStateOp.h"
 
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
index 64d3c157a503e3d6bb09e47a5054e029d506f7e6..916044265214780ad2010f27a7a6e3848c4b9170 100644 (file)
@@ -21,7 +21,7 @@
 #include "HYDROGUI_ZLevelsDlg.h"
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 #include "HYDROGUI_ListSelector.h"