-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( anAISContext->IsSelected( thePlane ) )
+ if ( anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
{
return false;
}
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( !anAISContext->IsSelected( thePlane ) )
+ if ( !anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
{
return false;
}
gp_Pnt aPickPoint = aFindPick.Point( 1 );
- const gp_Dir& aPlaneN = aPlanePln.Axis().Direction();
- const gp_Dir& aPlaneX = aPlanePln.XAxis().Direction();
- const gp_Dir& aPlaneY = aPlanePln.YAxis().Direction();
- const gp_Pnt& aPlaneCenter = aPlanePln.Location();
+ gp_Dir aPlaneN = aPlanePln.Axis().Direction();
+ gp_Dir aPlaneX = aPlanePln.XAxis().Direction();
+ gp_Dir aPlaneY = aPlanePln.YAxis().Direction();
+ gp_Pnt aPlaneCenter = aPlanePln.Location();
switch ( theDragOp )
{
thePlane->SetToUpdate();
thePlane->UpdateSelection();
- myViewer->getAISContext()->Update( thePlane );
+ myViewer->getAISContext()->Update( thePlane , Standard_True );
}
break;
thePlane->SetToUpdate();
thePlane->UpdateSelection();
- myViewer->getAISContext()->Update( thePlane );
+ myViewer->getAISContext()->Update( thePlane , Standard_True );
}
break;
}
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
// check detection of plane
- anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D );
+ anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D , Standard_True );
if ( !anAISContext->HasDetected() )
{
// process mouse click on the object
if ( myIsClickable )
{
- myViewer->getAISContext()->SetSelected( aPlane );
+ myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) , Standard_True );
emit planeClicked( aPlane );
}
myInteractedPlane = NULL;
myIsDraggable = false;
myIsClickable = false;
+ myViewer->getAISContext()->ClearSelected( Standard_True );
return true;
}