// Mark the presentation modes hidden of interactive object different from aDispMode.
// Then make sure aDispMode is displayed and maybe highlighted.
// Finally, activate selection mode <SelMode> if not yet activated.
- TColStd_ListOfInteger aModesToRemove;
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
+ const Standard_Integer anOldMode = aStatus->DisplayMode();
+ if (anOldMode != theDispMode)
{
- const Standard_Integer anOldMode = aDispModeIter.Value();
- if (anOldMode != theDispMode)
+ if(myMainPM->IsHighlighted (theIObj, anOldMode))
{
- aModesToRemove.Append (anOldMode);
- if(myMainPM->IsHighlighted (theIObj, anOldMode))
- {
- myMainPM->Unhighlight (theIObj, anOldMode);
- }
- myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
+ myMainPM->Unhighlight (theIObj, anOldMode);
}
+ myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
}
- for (TColStd_ListIteratorOfListOfInteger aRemModeIter (aModesToRemove); aRemModeIter.More(); aRemModeIter.Next())
- {
- aStatus->RemoveDisplayMode (aRemModeIter.Value());
- }
-
- if (!aStatus->IsDModeIn (theDispMode))
- {
- aStatus->AddDisplayMode (theDispMode);
- }
+ aStatus->SetDisplayMode (theDispMode);
myMainPM->Display (theIObj, theDispMode);
aStatus->SetGraphicStatus (AIS_DS_Displayed);
return AIS_DS_None;
}
-//=======================================================================
-//function : DisplayedModes
-//purpose :
-//=======================================================================
-const TColStd_ListOfInteger& AIS_InteractiveContext::DisplayedModes (const Handle(AIS_InteractiveObject)& theIObj) const
-{
- return myObjects (theIObj)->DisplayedModes();
-}
-
//=======================================================================
//function : Remove
//purpose :
{
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
if (aStatus->GraphicStatus() == AIS_DS_Displayed
- && aStatus->IsDModeIn (theMode))
+ && theIObj->DisplayMode() == theMode)
{
return Standard_True;
}
//function : SetDisplayMode
//purpose :
//=======================================================================
-void AIS_InteractiveContext::SetDisplayMode (const AIS_DisplayMode theMode,
- const Standard_Boolean theToUpdateViewer)
+void AIS_InteractiveContext::SetDisplayMode(const Standard_Integer theMode,
+ const Standard_Boolean theToUpdateViewer)
{
if (theMode == myDisplayMode)
{
}
Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
- if (aStatus->IsDModeIn (myDisplayMode))
- {
- aStatus->RemoveDisplayMode (myDisplayMode);
- }
+ aStatus->SetDisplayMode (theMode);
- aStatus->AddDisplayMode (theMode);
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
{
myMainPM->Display (anObj, theMode);
}
// erase presentations for all display modes different from <aMode>
- TColStd_ListOfInteger aModesToRemove;
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
+ const Standard_Integer anOldMode = aStatus->DisplayMode();
+ if (anOldMode != theMode)
{
- const Standard_Integer anOldMode = aDispModeIter.Value();
- if (anOldMode != theMode)
+ if (myMainPM->IsHighlighted (theIObj, anOldMode))
{
- aModesToRemove.Append (anOldMode);
- if (myMainPM->IsHighlighted (theIObj, anOldMode))
- {
- myMainPM->Unhighlight (theIObj, anOldMode);
- }
- myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
+ myMainPM->Unhighlight (theIObj, anOldMode);
}
+ myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
}
- for (TColStd_ListIteratorOfListOfInteger aRemModeIter (aModesToRemove); aRemModeIter.More(); aRemModeIter.Next())
- {
- aStatus->RemoveDisplayMode (aRemModeIter.Value());
- }
-
- if (!aStatus->IsDModeIn (theMode))
- {
- aStatus->AddDisplayMode (theMode);
- }
+ aStatus->SetDisplayMode (theMode);
myMainPM->Display (theIObj, theMode);
Standard_Integer aDispMode, aHiMode, aSelMode;
}
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
- aStatus->RemoveDisplayMode (anOldMode);
- if (!aStatus->IsDModeIn(myDisplayMode))
- {
- aStatus->AddDisplayMode (myDisplayMode);
- }
+ aStatus->SetDisplayMode (myDisplayMode);
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
{
}
theStatus += "\t| Active Display Modes in the MainViewer :\n";
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
- {
- theStatus += "\t|\t Mode ";
- theStatus += TCollection_AsciiString (aDispModeIter.Value());
- theStatus += "\n";
- }
+ theStatus += "\t|\t Mode ";
+ theStatus += TCollection_AsciiString (aStatus->DisplayMode());
+ theStatus += "\n";
+
if (IsSelected(theIObj)) theStatus +="\t| Selected\n";
theStatus += "\t| Active Selection Modes in the MainViewer :\n";
return;
}
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
+ if (aStatus->IsHilighted())
{
- if (aStatus->IsHilighted())
+ if (IsCurrent (theIObj))
{
- if (IsCurrent (theIObj))
- {
- AddOrRemoveCurrentObject (theIObj, Standard_False);
- }
- else if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
- {
- myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
- }
+ AddOrRemoveCurrentObject (theIObj, Standard_False);
+ }
+ else if (myMainPM->IsHighlighted (theIObj, aStatus->DisplayMode()))
+ {
+ myMainPM->Unhighlight (theIObj, aStatus->DisplayMode());
}
-
- myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
}
+ myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
+
if (aStatus->IsHilighted()
&& theIObj->HasHilightMode())
{
}
if (IsSelected (theIObj)
- && !aStatus->IsDModeIn (aDispMode))
+ && aStatus->DisplayMode() != aDispMode)
{
myMainPM->SetVisibility (theIObj, aDispMode, Standard_False);
}
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
unhighlightOwners (theIObj);
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
- {
- myMainPM->Erase (theIObj, aDispModeIter.Value());
- myMainPM->Clear (theIObj, aDispModeIter.Value());
- }
- if (aStatus->IsHilighted()
- && theIObj->HasHilightMode())
- {
- myMainPM->Unhighlight (theIObj, theIObj->HilightMode());
- }
+ myMainPM->Erase (theIObj, -1);
// Object removes from Detected sequence
for(Standard_Integer aDetIter = 1; aDetIter < myAISDetectedSeq.Length(); ++aDetIter)
}
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
- if (aStatus->IsDModeIn (theMode))
+ if (aStatus->DisplayMode() == theMode)
{
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
if (aDispMode == theMode
}
myMainPM->Erase (theIObj, theMode);
- myMainPM->Clear (theIObj, theMode);
}
if (aStatus->GraphicStatus() == AIS_DS_Displayed
{
mgrSelector->Add (myMainSel);
- myDefaultDrawer->SetShadingAspectGlobal (Standard_False);
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
myDefaultDrawer->ShadingAspect()->SetMaterial (aMat);