From: asl Date: Mon, 22 Jun 2015 12:37:13 +0000 (+0300) Subject: refs #595: error in split/merge polylines GUI X-Git-Tag: v1.4.2~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d29b8a3e061d78d560af5617f51b03255fe4e474;p=modules%2Fhydro.git refs #595: error in split/merge polylines GUI --- diff --git a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx index 13c88f05..9b2dfc7a 100644 --- a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx @@ -164,6 +164,6 @@ Handle( HYDROData_Entity ) HYDROGUI_ObjComboBox::GetObject() const if( anIndex>=0 && anIndexGetObject() ); + if( !myMainPolyline1->GetObject().IsNull() ) + return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline1->GetObject() ); case ByTool: - return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline2->GetObject() ); + if( !myMainPolyline2->GetObject().IsNull() ) + return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline2->GetObject() ); default: return Handle( HYDROData_PolylineXY )(); } + return Handle( HYDROData_PolylineXY )(); } Handle( HYDROData_PolylineXY ) HYDROGUI_SplitPolylinesDlg::GetToolPolyline() const diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx index afb40918..73f415a8 100644 --- a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx @@ -152,14 +152,17 @@ void HYDROGUI_SplitPolylinesOp::OnUpdatePreview() { gp_Pnt2d aPnt = aPanel->GetPoint(); TopoDS_Vertex aVertex = BRepLib_MakeVertex( gp_Pnt( aPnt.X(), aPnt.Y(), 0.0 ) ); - aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() ); + if( !aPanel->GetMainPolyline().IsNull() ) + aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() ); aBB.Add( aCmp, aVertex ); break; } case HYDROGUI_SplitPolylinesDlg::ByTool: { - aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() ); - aBB.Add( aCmp, aPanel->GetToolPolyline()->GetShape() ); + if( !aPanel->GetMainPolyline().IsNull() ) + aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() ); + if( !aPanel->GetToolPolyline().IsNull() ) + aBB.Add( aCmp, aPanel->GetToolPolyline()->GetShape() ); break; } case HYDROGUI_SplitPolylinesDlg::Split: diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 41707773..ab66dc7f 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -2878,6 +2878,14 @@ Polyline should consist from one not closed curve. + + HYDROGUI_SplitPolylinesOp + + SPLIT_POLYLINES + Split polylines + + + HYDROGUI_SplitPolylinesDlg @@ -2926,6 +2934,14 @@ Polyline should consist from one not closed curve. + + HYDROGUI_MergePolylinesOp + + MERGE_POLYLINES + Merge polylines + + + HYDROGUI_ObjListBox