myMainPM(new PrsMgr_PresentationManager3d(MainViewer->StructureManager())),
myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
-myWasLastMain(Standard_False),
myToHilightSelected(Standard_True),
mySelection(new AIS_Selection()),
myFilters(new SelectMgr_OrFilter()),
setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
theIObj->UpdatePresentations();
- if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
+ if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (theIObj))
{
- if (myLastinMain->IsAutoHilight())
+ if (myLastPicked->IsAutoHilight())
{
const Standard_Integer aHiMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
- myLastinMain->HilightWithColor (myMainPM,
- myLastinMain->IsSelected() ? getSelStyle (theIObj, myLastinMain) : getHiStyle (theIObj, myLastinMain),
+ myLastPicked->HilightWithColor (myMainPM,
+ myLastPicked->IsSelected() ? getSelStyle (theIObj, myLastPicked) : getHiStyle (theIObj, myLastPicked),
aHiMode);
}
else
{
theIObj->HilightOwnerWithColor (myMainPM,
- myLastinMain->IsSelected() ? getSelStyle (theIObj, myLastinMain) : getHiStyle (theIObj, myLastinMain),
- myLastinMain);
+ myLastPicked->IsSelected() ? getSelStyle (theIObj, myLastPicked) : getHiStyle (theIObj, myLastPicked),
+ myLastPicked);
}
}
if (theToUpdateViewer)
void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateviewer)
{
+ Handle(AIS_GlobalStatus) aStatus;
if (theIObj.IsNull()
- || !myObjects.IsBound (theIObj))
+ || !myObjects.Find (theIObj, aStatus)
+ || aStatus->GraphicStatus() == AIS_DS_Erased)
{
return;
}
- Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
-
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
- if (aStatus->GraphicStatus() == AIS_DS_Erased)
- {
- return;
- }
-
- if (aStatus->IsHilighted())
- {
- Standard_DISABLE_DEPRECATION_WARNINGS
- if (IsCurrent (theIObj))
- {
- AddOrRemoveCurrentObject (theIObj, Standard_False);
- }
- else if (myMainPM->IsHighlighted (theIObj, aStatus->DisplayMode()))
- {
- unhighlightGlobal (theIObj);
- }
- Standard_ENABLE_DEPRECATION_WARNINGS
- }
-
+ unhighlightOwners (theIObj);
myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
- if (aStatus->IsHilighted()
- && theIObj->HasHilightMode())
- {
- unhighlightGlobal (theIObj);
- }
-
if (!myLastPicked.IsNull()
&& myLastPicked->IsSameSelectable (theIObj))
{
void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateviewer)
{
+ Handle(AIS_GlobalStatus) aStatus;
if (theIObj.IsNull()
- || !myObjects.IsBound (theIObj))
+ || !myObjects.Find (theIObj, aStatus))
{
// for cases when reference shape of connected interactives was not displayed
// but its selection primitives were calculated
return;
}
- Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
unhighlightOwners (theIObj);
myMainPM->Erase (theIObj, -1);
aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
- if (!myLastinMain.IsNull())
+ if (!myLastPicked.IsNull())
{
- if (myLastinMain->IsSameSelectable (theIObj)
- || myLastPicked->IsSameSelectable(theIObj))
+ if (myLastPicked->IsSameSelectable (theIObj))
{
clearDynamicHighlight();
- myLastinMain.Nullify();
myLastPicked.Nullify();
}
}
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)
//! Removes dynamic highlight draw
void clearDynamicHighlight() const
{
- if (myLastinMain.IsNull())
+ if (myLastPicked.IsNull())
return;
- if (myLastinMain->IsAutoHilight())
+ if (myLastPicked->IsAutoHilight())
{
myMainPM->ClearImmediateDraw();
}
else
{
- myLastinMain->Selectable()->ClearDynamicHighlight (myMainPM);
+ myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
}
}
Handle(V3d_Viewer) myMainVwr;
Handle(StdSelect_ViewerSelector3d) myMainSel;
Handle(SelectMgr_EntityOwner) myLastPicked;
- Handle(SelectMgr_EntityOwner) myLastinMain;
- Standard_Boolean myWasLastMain;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;
Handle(SelectMgr_OrFilter) myFilters;
myDetectedSeq.Clear();
// preliminaires
- myLastPicked = myLastinMain;
- myWasLastMain = Standard_True;
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
Standard_Boolean toUpdateViewer = Standard_False;
// initialize myLastPicked field with currently detected object
myLastPicked = aNewPickedOwner;
- myLastinMain = myLastPicked;
// highlight detected object if it is not selected or myToHilightSelected flag is true
if (myLastPicked->HasSelectable())
toUpdateViewer = Standard_True;
}
- myLastinMain.Nullify();
myLastPicked.Nullify();
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
- myWasLastMain = Standard_True;
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
- myWasLastMain = Standard_True;
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
{
- if (myWasLastMain && !myLastinMain.IsNull())
+ if (!myLastPicked.IsNull())
{
if (myAutoHilight)
{
clearDynamicHighlight();
}
- if (!myLastinMain->IsSelected()
- || myLastinMain->IsForcedHilight()
+ if (!myLastPicked->IsSelected()
+ || myLastPicked->IsForcedHilight()
|| NbSelected() > 1)
{
- SetSelected (myLastinMain, Standard_False);
+ SetSelected (myLastPicked, Standard_False);
if(toUpdateViewer)
{
UpdateCurrentViewer();
{
clearDynamicHighlight();
}
- if (myWasLastMain && !myLastinMain.IsNull())
+ if (!myLastPicked.IsNull())
{
- AddOrRemoveSelected (myLastinMain, toUpdateViewer);
+ AddOrRemoveSelected (myLastPicked, toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
{
UnhilightSelected (Standard_False);
}
- myWasLastMain = Standard_True;
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
{
UnhilightSelected (Standard_False);
}
- myWasLastMain = Standard_True;
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
highlightWithColor (anOwner, theView->Viewer());
myLastPicked = anOwner;
- myLastinMain = myLastPicked;
if (theToRedrawImmediate)
{
highlightWithColor (anOwner, theView->Viewer());
myLastPicked = anOwner;
- myLastinMain = myLastPicked;
if (theToRedrawImmediate)
{