X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_SplitPolylinesOp.cxx;h=d6556fbafd290457137764ebfd5f4d8ef492d42c;hb=00d0017f5e951fb3dd965140d1f16d07d9a49daa;hp=afb40918ae12b7abb5dd77a85f50c5cd1a569e74;hpb=8f204f24e47154e734bbe32bc4cbf661037f6a34;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx index afb40918..d6556fba 100644 --- a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,7 @@ bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags, if ( !aPanel ) return false; + QString aName = aPanel->GetResultName(); Handle( HYDROData_PolylineXY ) aMainPolyline = aPanel->GetMainPolyline(); Handle( HYDROData_PolylineXY ) aToolPolyline = aPanel->GetToolPolyline(); HYDROData_SequenceOfObjects aPolylinesList = aPanel->GetPolylines(); @@ -87,13 +89,13 @@ bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags, switch( aPanel->GetMode() ) { case HYDROGUI_SplitPolylinesDlg::ByPoint: - anOp.Split( aMainPolyline, aPoint ); + anOp.Split( doc(), aName.toLatin1().data(), aMainPolyline, aPoint ); break; case HYDROGUI_SplitPolylinesDlg::ByTool: - anOp.Split( aMainPolyline, aToolPolyline ); + anOp.Split( doc(), aName.toLatin1().data(), aMainPolyline, aToolPolyline ); break; case HYDROGUI_SplitPolylinesDlg::Split: - anOp.Split( aPolylinesList ); + anOp.Split( doc(), aName.toLatin1().data(), aPolylinesList ); break; } @@ -152,14 +154,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: