anOwner->State (0);
if (anOwner == anObject->GlobalSelOwner())
{
- Handle(AIS_GlobalStatus) aStatus = myObjects (anObject);
- aStatus->SetHilightStatus (Standard_False);
- aStatus->SetHilightColor (Quantity_NOC_WHITE);
- anObject->State (0);
+ myObjects.ChangeFind (anObject)->SetHilightStatus (Standard_False);
}
if (!anOwner->IsAutoHilight())
{
Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner == anObj->GlobalSelOwner())
{
- anObj->State (1);
+ Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObj);
+ aState->SetHilightStatus (Standard_True);
+ aState->SetHilightColor (mySelectionColor);
}
anOwner->State (1);
if (!anOwner->IsAutoHilight())
Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner == anObj->GlobalSelOwner())
{
- anObj->State (0);
+ myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
}
anOwner->State (0);
const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HasHilightMode() : 0;
Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner == anObj->GlobalSelOwner())
{
- anObj->State (0);
+ myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
}
anOwner->State (0);
if (!anOwner->IsAutoHilight())
if (theObject->HasSelection (0))
return;
- if (NbSelected() == 1 && theObject->State() == 1)
+ if (NbSelected() == 1 && myObjects (theObject)->IsHilighted())
{
Quantity_NameOfColor aHiCol;
Standard_Boolean hasHiCol = Standard_False;
Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
Unhilight (aSelectable, Standard_False);
anOwner->State (0);
- aSelectable->State (0);
+ if (anOwner == aSelectable->GlobalSelOwner())
+ {
+ myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
+ }
}
// added to avoid untimely viewer update...
Handle(SelectMgr_EntityOwner) anOwner =
Handle(SelectMgr_EntityOwner)::DownCast (aSel->Sensitive()->BaseSensitive()->OwnerId());
AIS_Selection::ClearAndSelect (anOwner);
- theObject->State (1);
anOwner->State (1);
+ if (anOwner == theObject->GlobalSelOwner())
+ {
+ Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (theObject);
+ aState->SetHilightStatus (Standard_True);
+ aState->SetHilightColor (mySelectionColor);
+ }
Quantity_NameOfColor aHiCol;
Standard_Boolean hasHiCol = Standard_False;
if (IsHilighted (theObject, hasHiCol, aHiCol))
anObjToClear.Add (anInteractive);
}
anOwner->State (0);
+ if (theOwner == anObject->GlobalSelOwner())
+ {
+ myObjects.ChangeFind (anObject)->SetHilightStatus (Standard_False);
+ }
}
while (!anObjToClear.IsEmpty())
{
highlightSelected (theOwner, mySelectionColor);
}
+ if (theOwner == anObject->GlobalSelOwner())
+ {
+ Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObject);
+ aState->SetHilightStatus (Standard_True);
+ aState->SetHilightColor (mySelectionColor);
+ }
+
if (theToUpdateViewer)
UpdateCurrentViewer();
}
const Handle(AIS_InteractiveObject) anObj =
Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
- if (isGlobal)
- anObj->State (aState);
- const Handle(AIS_GlobalStatus)& aStatus = myObjects (anObj);
+ Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
if (aState == 1)
{
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated)
return Standard_False;
- return theObj->State() == 1;
+ return myObjects (theObj)->IsHilighted();
}
//=======================================================================
--- /dev/null
+puts "========"
+puts "OCC22016"
+puts "========"
+puts ""
+#########################################################################################
+# Incorrect selection color after displaying a selected object
+#########################################################################################
+
+pload MODELING VISUALIZATION
+box b1 0 0 0 1 2 3
+box b2 3 0 0 2 3 1
+vinit View1
+vclear
+vaxo
+vdisplay -noupdate b1 b2
+vaspects b1 b2 -setWidth 4
+vfit
+vselect 0 0 500 500
+vdisplay b2
+set aColor1 [vreadpixel 104 32 rgb name]
+set aColor2 [vreadpixel 255 350 rgb name]
+
+if {$aColor1 != "GRAY80" || $aColor2 != "GRAY80" } {
+ puts "ERROR: OCC22016 is reproduced. Incorrect selection color after displaying a selected object."
+}
+
+vdump ${imagedir}/${casename}.png