Salome HOME
refs #1825 refs #1823 refs #1819
authorisn <isn@opencascade.com>
Wed, 19 Sep 2018 14:18:54 +0000 (17:18 +0300)
committerisn <isn@opencascade.com>
Wed, 19 Sep 2018 15:57:54 +0000 (18:57 +0300)
Signed-off-by: isn <isn@opencascade.com>
src/HYDROData/HYDROData_PolylineOperator.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index c89d189fbdb99c3de39fd93c618b26b20570e45f..41d0f7c831cb4731c3ae87b0c29783cb09de7814 100644 (file)
@@ -256,6 +256,8 @@ void HYDROData_PolylineOperator::GetWires(
   std::vector<TopoDS_Wire>& theWires)
 {
   TopoDS_Shape aShape = thePolyline->GetShape();
+  if (aShape.IsNull())
+    return;
   if( aShape.ShapeType()==TopAbs_WIRE )
   {
     theWires.push_back( TopoDS::Wire( aShape ) );
index fc303d0c33a3307ee11b507bfb8c3aea56ae69ad..bfb64ec4535a95ce647f323b26071d8775a58850 100644 (file)
@@ -1086,9 +1086,15 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
         aNObject = Handle(HYDROData_NaturalObject)::DownCast( anEntity );
         if ( !aNObject.IsNull() )
           createObject( aCaseNOSect, aNObject, aGuiObj->entry(), false );
-      }
+      }    
     }
 
+    LightApp_DataObject* aBoundaryPolygonSect = 
+      createObject( aGuiObj, tr( "CASE_BOUNDARY_POLYGONS" ), aGuiObj->entry() );
+    HYDROData_SequenceOfObjects aBCPolygons = aCaseObj->GetBoundaryPolygons();
+    for (int i = 1; i <= aBCPolygons.Size(); i++ )
+      createObject( aBoundaryPolygonSect, aBCPolygons(i), aGuiObj->entry(), false );
+
     LightApp_DataObject* aLandCoverMapSect = 
       createObject( aGuiObj, tr( "CASE_LAND_COVER_MAP" ), aGuiObj->entry() );
 
index 71fd99e0d585874f4ab140e74c04f882ca237831..ed80b1d248a6bf0b3c6bb6839f85f7947f7e32f2 100644 (file)
@@ -26,6 +26,8 @@
 #include "HYDROGUI_Tool2.h"
 #include "HYDROGUI_UpdateFlags.h"
 
+#include <HYDROGUI_OCCDisplayer.h>
+
 #include <HYDROData_Bathymetry.h>
 
 #include <LightApp_Application.h>
 #include <SUIT_ViewManager.h>
 #include <SVTK_ViewModel.h>
 
+#include <OCCViewer_ViewManager.h>
 #include <QFileInfo>
 #include <QSet>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Desktop.h>
+#include <HYDROGUI_ShapeBathymetry.h>
 
 
 HYDROGUI_ImportBathymetryOp::HYDROGUI_ImportBathymetryOp( HYDROGUI_Module* theModule, 
@@ -272,6 +276,19 @@ bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags,
       aVTKMgr = module()->getApp()->viewManager( SVTK_Viewer::Type() );
     }
   }
+    
+  OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>(aViewMgr);
+  OCCViewer_Viewer* occ_viewer = mgr->getOCCViewer();
+  int aViewerId = (size_t)(occ_viewer);
+
+  HYDROGUI_Shape* aObjSh = module()->getObjectShape( aViewerId, myEditedObject );
+  HYDROGUI_ShapeBathymetry* aBathSh = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aObjSh );
+  if (aBathSh)
+  {
+    aBathSh->update(false, false);
+    aBathSh->RescaleDefault();
+    module()->getOCCDisplayer()->UpdateColorScale( occ_viewer );
+  }
 
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced |
     UF_VTKViewer | UF_VTK_Forced;
index 63f70684a5d39834aebbac551e8be6b5ce5a7e5b..2eb1150f9719b012d42c3840e4c2a885258ef88a 100644 (file)
       <source>CASE_BOUNDARY</source>
       <translation>Boundary</translation>
     </message>
+    <message>
+      <source>CASE_BOUNDARY_POLYGONS</source>
+      <translation>Boundary Polygons</translation>
+    </message>
     <message>
       <source>CASE_REFERENCE_ZONES</source>
       <translation>Reference zones</translation>
@@ -258,6 +262,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>STREAM_PROFILES</source>
       <translation>Profiles</translation>
     </message>
+    <message>
+      <source>BC_POLYGON_POLYLINE</source>
+      <translation>Boundary Polyline</translation>
+    </message>
     <message>
       <source>STREAM_WARNINGS</source>
       <translation>Stream Warnings</translation>