- theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
- module()->setObjectVisible( HYDROGUI_Tool::GetActiveGraphicsViewId( module() ), aPolylineObj, true );
+ 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
+ if ( aPanel )
+ aPanel->setOCCViewer( 0 );
+
+ theUpdateFlags = UF_Model;
+
+ // 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 )
+ {
+ anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( module() );
+ }
+
+ if( !myIsEdit )
+ {
+ module()->setObjectVisible( anActiveViewId, aPolylineObj, true );
+ QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aPolylineObj );
+ theBrowseObjectsEntries.append( anEntry );
+ }
+