From b3dd206ef8b073bebb74fbe9a2f2e404e49cfb87 Mon Sep 17 00:00:00 2001 From: isn Date: Wed, 19 Sep 2018 17:18:54 +0300 Subject: [PATCH] refs #1825 refs #1823 refs #1819 Signed-off-by: isn --- src/HYDROData/HYDROData_PolylineOperator.cxx | 2 ++ src/HYDROGUI/HYDROGUI_DataModel.cxx | 8 +++++++- src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx | 17 +++++++++++++++++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 8 ++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index c89d189f..41d0f7c8 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -256,6 +256,8 @@ void HYDROData_PolylineOperator::GetWires( std::vector& theWires) { TopoDS_Shape aShape = thePolyline->GetShape(); + if (aShape.IsNull()) + return; if( aShape.ShapeType()==TopAbs_WIRE ) { theWires.push_back( TopoDS::Wire( aShape ) ); diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index fc303d0c..bfb64ec4 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -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() ); diff --git a/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx b/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx index 71fd99e0..ed80b1d2 100644 --- a/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx @@ -26,6 +26,8 @@ #include "HYDROGUI_Tool2.h" #include "HYDROGUI_UpdateFlags.h" +#include + #include #include @@ -33,10 +35,12 @@ #include #include +#include #include #include #include #include +#include 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(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( 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; diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 63f70684..2eb1150f 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -111,6 +111,10 @@ CASE_BOUNDARY Boundary + + CASE_BOUNDARY_POLYGONS + Boundary Polygons + CASE_REFERENCE_ZONES Reference zones @@ -258,6 +262,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) STREAM_PROFILES Profiles + + BC_POLYGON_POLYLINE + Boundary Polyline + STREAM_WARNINGS Stream Warnings -- 2.39.2