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
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 );
+ }
}
}
}
}
}
+ // Get a boundary polyline if any
+ aSeq.Append( myEditedObject->GetBoundaryPolyline() );
+
module()->removeViewShapes( HYDROGUI_Module::VMR_PreviewCaseZones );
if ( !myActiveViewManager )