theOwner->HilightWithColor (myMainPM, myStyles[Prs3d_TypeOfHighlight_SubIntensity], theMode);
}
+//=======================================================================
+//function : isSlowHiStyle
+//purpose :
+//=======================================================================
+Standard_Boolean AIS_InteractiveContext::isSlowHiStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
+ const Handle(V3d_Viewer)& theViewer) const
+{
+ if (const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()))
+ {
+ const Handle(Prs3d_Drawer)& aHiStyle = getHiStyle (anObj, myLastPicked);
+ return aHiStyle->ZLayer() == Graphic3d_ZLayerId_UNKNOWN
+ || !theViewer->ZLayerSettings (aHiStyle->ZLayer()).IsImmediate();
+ }
+ return Standard_False;
+}
+
//=======================================================================
//function : MoveTo
//purpose :
// method call. As result it is necessary to rehighligt it with mySelectionColor.
if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
{
+ if (isSlowHiStyle (myLastPicked, theView->Viewer()))
+ {
+ theView->Viewer()->Invalidate();
+ }
+
clearDynamicHighlight();
toUpdateViewer = Standard_True;
}
// highlight detected object if it is not selected or myToHilightSelected flag is true
if (myLastPicked->HasSelectable())
{
- if (!myLastPicked->IsSelected() || myToHilightSelected)
+ if (myAutoHilight
+ && (!myLastPicked->IsSelected()
+ || myToHilightSelected))
{
+ if (isSlowHiStyle (myLastPicked, theView->Viewer()))
+ {
+ theView->Viewer()->Invalidate();
+ }
+
highlightWithColor (myLastPicked, theView->Viewer());
toUpdateViewer = Standard_True;
}
// previously detected object is unhilighted if it is not selected or hilighted
// with selection color if it is selected
aStatus = AIS_SOD_Nothing;
- if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
+ if (myAutoHilight
+ && !myLastPicked.IsNull()
+ && myLastPicked->HasSelectable())
{
+ if (isSlowHiStyle (myLastPicked, theView->Viewer()))
+ {
+ theView->Viewer()->Invalidate();
+ }
+
clearDynamicHighlight();
toUpdateViewer = Standard_True;
}
if (toUpdateViewer
&& theToRedrawOnUpdate)
{
- theView->Viewer()->Update();
+ if (theView->ComputedMode())
+ {
+ theView->Viewer()->Update();
+ }
+ else
+ {
+ if (theView->IsInvalidated())
+ {
+ theView->Viewer()->Redraw();
+ }
+ else
+ {
+ theView->Viewer()->RedrawImmediate();
+ }
+ }
}
return aStatus;
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
{
- if (myAutoHilight)
- {
- clearDynamicHighlight();
- }
if (myWasLastMain && !myLastinMain.IsNull())
{
+ if (myAutoHilight)
+ {
+ clearDynamicHighlight();
+ }
if (!myLastinMain->IsSelected()
|| myLastinMain->IsForcedHilight()
|| NbSelected() > 1)
}
else
{
- if (myAutoHilight)
- {
- unhighlightSelected (Standard_True);
- }
-
- mySelection->Clear();
- if (toUpdateViewer && myWasLastMain)
- {
- UpdateCurrentViewer();
- }
+ ClearSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
{
unhighlightSelected();
}
+ else
+ {
+ for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
+ {
+ aSelIter.Value()->SetSelected (Standard_False);
+ }
+ }
mySelection->Clear();
if (myAutoHilight)