From: mzn Date: Mon, 2 Dec 2013 06:48:05 +0000 (+0000) Subject: Erase and nullify the shape for invalid profile. X-Git-Tag: BR_hydro_v_0_4~113 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=682d4abf52a431b72c6573ca8dc3365bcd92d0c5;p=modules%2Fhydro.git Erase and nullify the shape for invalid profile. --- diff --git a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx index 53128386..269cd83e 100644 --- a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx +++ b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx @@ -67,10 +67,8 @@ void HYDROGUI_GeoreferencementOp::startOperation() aPanel->reset(); if ( myInitialMode == All ) { - //@MZN aPanel->setMode( anAllMode ); onModeActivated( HYDROGUI_GeoreferencementDlg::AllProfiles ); } else if ( myInitialMode == Selected ) { - //@MZN aPanel->setMode( aSelectionMode ); onModeActivated( HYDROGUI_GeoreferencementDlg::SelectedProfiles ); } diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index f37fe900..9e36f73d 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -291,22 +291,18 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer ) Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( myObject ); + TopoDS_Wire aProfileWire; + if ( aProfile->IsValid() ) { TopoDS_Shape aProfileShape = aProfile->GetShape3D(); - if ( !aProfileShape.IsNull() ) { - if ( aProfileShape.ShapeType() == TopAbs_WIRE ) { - TopoDS_Wire aProfileWire = TopoDS::Wire( aProfileShape ); - setWire( aProfileWire, false, false ); - } else { - myTopoShape = aProfileShape; - myDisplayMode = AIS_WireFrame; - - buildShape(); - updateShape( false, false ); - } + if ( !aProfileShape.IsNull() && + aProfileShape.ShapeType() == TopAbs_WIRE ) { + aProfileWire = TopoDS::Wire( aProfileShape ); } } + + setWire( aProfileWire, false, false ); } } @@ -483,8 +479,10 @@ void HYDROGUI_Shape::buildShape() // Erase previously created shape erase(); - if ( myTopoShape.IsNull() ) + if ( myTopoShape.IsNull() ) { + myShape.Nullify(); return; + } QString aTextureFileName = getTextureFileName(); bool anIsTexture = !aTextureFileName.isEmpty();