From: nds Date: Fri, 31 Jan 2014 08:00:51 +0000 (+0000) Subject: refs #330 - Immersible zone can not be created without reason for it X-Git-Tag: BR_hydro_v_1_0~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c574bf9be45eecefcbe4a45d497d1b9f64fc76f;p=modules%2Fhydro.git refs #330 - Immersible zone can not be created without reason for it --- diff --git a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx index d59e7d10..41f539a2 100644 --- a/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx @@ -39,9 +39,14 @@ #include #include +#include +#include + #include #include +#include + HYDROGUI_ImmersibleZoneOp::HYDROGUI_ImmersibleZoneOp( HYDROGUI_Module* theModule, const bool theIsEdit ) : HYDROGUI_Operation( theModule ), @@ -242,6 +247,7 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName if ( !aPanel ) return; + QApplication::setOverrideCursor( Qt::WaitCursor ); TopoDS_Shape aZoneShape; Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( @@ -249,6 +255,8 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName if ( !aPolyline.IsNull() ) { aZoneShape = HYDROData_ImmersibleZone::generateTopShape( aPolyline ); + if( aZoneShape.IsNull() ) + printErrorMessage( tr( "ZONE_OBJECT_CANNOT_BE_CREATED" ) ); } LightApp_Application* anApp = module()->getApp(); @@ -266,22 +274,24 @@ void HYDROGUI_ImmersibleZoneOp::onCreatePreview( const QString& thePolylineName } } - if ( !myViewManager || !myPreviewPrs ) - return; + if ( myViewManager && myPreviewPrs ) + { + QColor aFillingColor = HYDROData_ImmersibleZone::DefaultFillingColor(); + QColor aBorderColor = HYDROData_ImmersibleZone::DefaultBorderColor(); + if ( !myEditedObject.IsNull() ) { + aFillingColor = myEditedObject->GetFillingColor(); + aBorderColor = myEditedObject->GetBorderColor(); + } - QColor aFillingColor = HYDROData_ImmersibleZone::DefaultFillingColor(); - QColor aBorderColor = HYDROData_ImmersibleZone::DefaultBorderColor(); - if ( !myEditedObject.IsNull() ) { - aFillingColor = myEditedObject->GetFillingColor(); - aBorderColor = myEditedObject->GetBorderColor(); + myPreviewPrs->setFillingColor( aFillingColor, false, false ); + myPreviewPrs->setBorderColor( aBorderColor, false, false ); + TopoDS_Face aFace; + if( !aZoneShape.IsNull() ) + aFace = TopoDS::Face( aZoneShape ); + myPreviewPrs->setFace( aFace ); } - myPreviewPrs->setFillingColor( aFillingColor, false, false ); - myPreviewPrs->setBorderColor( aBorderColor, false, false ); - TopoDS_Face aFace; - if( !aZoneShape.IsNull() ) - aFace = TopoDS::Face( aZoneShape ); - myPreviewPrs->setFace( aFace ); + QApplication::restoreOverrideCursor(); } void HYDROGUI_ImmersibleZoneOp::closePreview()