#include <Precision.hxx>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
//static int ZValueIncrement = 0;
HYDROGUI_PolylineOp::HYDROGUI_PolylineOp( HYDROGUI_Module* theModule, bool theIsEdit )
void HYDROGUI_PolylineOp::startOperation()
{
+ if( myIsEdit )
+ {
+ myEditedObject = Handle(HYDROData_PolylineXY)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ if ( !myEditedObject.IsNull() && !myEditedObject->IsEditable() )
+ {
+ // Polyline is imported from GEOM module an is not recognized as
+ // polyline or spline and exist only as shape presentation
+ SUIT_MessageBox::critical( module()->getApp()->desktop(),
+ tr( "POLYLINE_IS_UNEDITABLE_TLT" ),
+ tr( "POLYLINE_IS_UNEDITABLE_MSG" ) );
+ abort();
+ return;
+ }
+ }
+
if( myCurve )
delete myCurve;
dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
aPanel->setOCCViewer( myViewManager ? myViewManager->getOCCViewer() : 0 );
- if( myIsEdit )
- myEditedObject = Handle(HYDROData_PolylineXY)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
-
QString aPolylineName;
if( !myEditedObject.IsNull() )
{
}
}
+ if ( !myIsEdit )
+ {
+ aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
+ }
+
// Update the wire of polyline
aPolylineObj->Update();
+ module()->setIsToUpdate( aPolylineObj );
// the viewer should be release from the widget before the module update it
// because it has an opened local context and updated presentation should not be displayed in it
// the polyline should be rebuild in all viewers, where it is displayed
theUpdateFlags |= UF_Viewer | UF_GV_Forced;
theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced;
+ theUpdateFlags |= UF_VTKViewer;
size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
if ( anActiveViewId == 0 )