+
+void HYDROGUI_SplitPolylinesOp::onMousePress(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
+{
+ OCCViewer_ViewManager* aViewManager = getPreviewManager();
+ if ( !aViewManager )
+ return;
+
+ OCCViewer_ViewWindow* aViewWindow = (OCCViewer_ViewWindow*)aViewManager->getActiveView();
+ if ( !aViewWindow )
+ return;
+
+ OCCViewer_ViewPort3d* aViewPort = aViewWindow->getViewPort();
+ if ( !aViewPort )
+ return;
+
+ Handle(V3d_View) aView = aViewPort->getView();
+ if ( aView.IsNull() )
+ return;
+
+ OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer();
+ if ( !aViewer )
+ return;
+
+ Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+ if ( aCtx.IsNull() )
+ return;
+
+ gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( theEvent->x(), theEvent->y(), aView );
+ BRep_Builder aBuilder;
+ TopoDS_Compound aShape;
+ aBuilder.MakeCompound(aShape);
+ aBuilder.Add(aShape, BRepBuilderAPI_MakeVertex( aPnt ) );
+
+ if ( mySplitPointPreview )
+ {
+ if ( aCtx->HasOpenedContext() )
+ aCtx->CloseLocalContext();
+ aCtx->Erase( mySplitPointPreview, Standard_False );
+ }
+
+ mySplitPointPreview = new AIS_Shape( aShape );
+ if ( aCtx->HasOpenedContext() )
+ aCtx->CloseLocalContext();
+ aCtx->Display( mySplitPointPreview, Standard_False );
+
+ aCtx->UpdateCurrentViewer();
+}