From: rkv Date: Mon, 11 Nov 2013 10:08:15 +0000 (+0000) Subject: Boundary polyline presentation in the viewer is added for Calculation Case operation. X-Git-Tag: BR_hydro_v_0_3~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ac71c7f54361020e628c62cc5bc3e24739a1959e;p=modules%2Fhydro.git Boundary polyline presentation in the viewer is added for Calculation Case operation. --- diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index bfdfecd6..54241112 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -208,6 +208,23 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const void HYDROGUI_CalculationOp::onBoundarySelected ( const QString & theObjName ) { // Set the selected boundary polyline to the calculation case + Handle(HYDROData_Polyline) anObject; + HYDROGUI_Shape* aShape; + Handle(AIS_InteractiveContext) aCtx; + if ( myPreviewViewManager ) + { + if ( OCCViewer_Viewer* aViewer = myPreviewViewManager->getOCCViewer() ) + { + aCtx = aViewer->getAISContext(); + } + } + // Remove the old boundary from the operation viewer + anObject = myEditedObject->GetBoundaryPolyline(); + if ( !anObject.IsNull() ) + { + module()->removeObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, anObject ); + } + if ( theObjName.trimmed().isEmpty() ) { // No polyline is selected @@ -219,10 +236,14 @@ void HYDROGUI_CalculationOp::onBoundarySelected ( const QString & theObjName ) HYDROGUI_Tool::FindObjectByName( module(), theObjName, KIND_POLYLINE ); if ( !anEntity.IsNull() ) { - Handle(HYDROData_Polyline) anObject = Handle(HYDROData_Polyline)::DownCast( anEntity ); + anObject = Handle(HYDROData_Polyline)::DownCast( anEntity ); if ( !anObject.IsNull() ) { myEditedObject->SetBoundaryPolyline( anObject ); + if ( !aCtx.IsNull() ) + { + showObject( anEntity, aCtx ); + } } } } @@ -600,6 +621,9 @@ void HYDROGUI_CalculationOp::createPreview() } } + // Get a boundary polyline if any + aSeq.Append( myEditedObject->GetBoundaryPolyline() ); + module()->removeViewShapes( HYDROGUI_Module::VMR_PreviewCaseZones ); if ( !myActiveViewManager )