mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0029724: Visualization - add AIS_InteractiveContext::ClearDetected() undoing MoveTo() dynamic highlighting
Introduced new method AIS_InteractiveContext::ClearDetected() allowing to reset the list of detected objects and clear dynamically highlighted entity under mouse cursor after previous AIS_InteractiveContext::MoveTo(). vmoveto command has been extended with new argument -reset.
This commit is contained in:
@@ -2491,6 +2491,33 @@ void AIS_InteractiveContext::ClearGlobalPrs (const Handle(AIS_InteractiveObject)
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearDetected
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveContext::ClearDetected (Standard_Boolean theToRedrawImmediate)
|
||||
{
|
||||
myCurDetected = 0;
|
||||
myCurHighlighted = 0;
|
||||
myDetectedSeq.Clear();
|
||||
myLastPicked = myLastinMain;
|
||||
myWasLastMain = Standard_True;
|
||||
Standard_Boolean toUpdate = Standard_False;
|
||||
if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
|
||||
{
|
||||
toUpdate = Standard_True;
|
||||
clearDynamicHighlight();
|
||||
}
|
||||
myLastinMain.Nullify();
|
||||
myLastPicked.Nullify();
|
||||
myMainSel->ClearPicked();
|
||||
if (toUpdate && theToRedrawImmediate)
|
||||
{
|
||||
myMainVwr->RedrawImmediate();
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawHiddenLine
|
||||
//purpose :
|
||||
|
@@ -347,6 +347,11 @@ public: //! @name mouse picking logic (detection and dynamic highlighting of ent
|
||||
const Handle(V3d_View)& theView,
|
||||
const Standard_Boolean theToRedrawOnUpdate);
|
||||
|
||||
//! Clears the list of entities detected by MoveTo() and resets dynamic highlighting.
|
||||
//! @param theToRedrawImmediate if TRUE, the main Viewer will be redrawn on update
|
||||
//! @return TRUE if viewer needs to be updated (e.g. there were actually dynamically highlighted entities)
|
||||
Standard_EXPORT Standard_Boolean ClearDetected (Standard_Boolean theToRedrawImmediate = Standard_False);
|
||||
|
||||
//! Returns true if there is a mouse-detected entity in context.
|
||||
//! @sa DetectedOwner()/HasNextDetected()/HilightPreviousDetected()/HilightNextDetected().
|
||||
Standard_EXPORT Standard_Boolean HasDetected() const;
|
||||
|
Reference in New Issue
Block a user