#include <LightApp_Application.h>
#include <LightApp_UpdateFlags.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
+#include <QApplication>
+
HYDROGUI_ImmersibleZoneOp::HYDROGUI_ImmersibleZoneOp( HYDROGUI_Module* theModule,
const bool theIsEdit )
: HYDROGUI_Operation( theModule ),
if ( !aPanel )
return;
+ QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aZoneShape;
Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast(
if ( !aPolyline.IsNull() )
{
aZoneShape = HYDROData_ImmersibleZone::generateTopShape( aPolyline );
+ if( aZoneShape.IsNull() )
+ printErrorMessage( tr( "ZONE_OBJECT_CANNOT_BE_CREATED" ) );
}
LightApp_Application* anApp = module()->getApp();
}
}
- 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()