// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Modified by XAB & Serguei Dec 97 (angle &deviation coeffts)
+#include <AIS_InteractiveContext.hxx>
-#include <AIS_ConnectedInteractive.hxx>
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
+#include <AIS_ConnectedInteractive.hxx>
#include <AIS_GlobalStatus.hxx>
-#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_LocalContext.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
-IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveContext,MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveContext, Standard_Transient)
-//#include <AIS_DataMapIteratorOfDataMapOfInteractiveInteger.hxx>
namespace
{
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)> AIS_MapOfObjectOwners;
myDefaultDrawer(new Prs3d_Drawer()),
mySelection(new AIS_Selection()),
myDefaultColor(Quantity_NOC_GOLDENROD),
-myHilightColor(Quantity_NOC_CYAN1),
-mySelectionColor(Quantity_NOC_GRAY80),
+myHiStyle(new Graphic3d_HighlightStyle (Aspect_TOHM_COLOR, Quantity_NOC_CYAN1)),
+mySelStyle(new Graphic3d_HighlightStyle (Aspect_TOHM_COLOR, Quantity_NOC_GRAY80)),
myPreselectionColor(Quantity_NOC_GREEN),
-mySubIntensity(Quantity_NOC_GRAY40),
+mySubintStyle(new Graphic3d_HighlightStyle (Aspect_TOHM_COLOR, Quantity_NOC_GRAY40)),
myDisplayMode(0),
myCurLocalIndex(0),
-myAISCurDetected(0),
+myCurDetected(0),
+myCurHighlighted(0),
myZDetectionFlag(0),
myIsAutoActivateSelMode(Standard_True)
{
InitAttributes();
}
-void AIS_InteractiveContext::Delete() const
+//=======================================================================
+//function : ~AIS_InteractiveContext
+//purpose :
+//=======================================================================
+AIS_InteractiveContext::~AIS_InteractiveContext()
{
// clear the current selection
mySelection->Clear();
anObj->CurrentSelection()->UpdateBVHStatus (SelectMgr_TBU_Renew);
}
}
- MMgt_TShared::Delete();
}
//=======================================================================
myMainVwr->Update();
}
-
-//=======================================================================
-//function : DomainOfMainViewer
-//purpose :
-//=======================================================================
-
-Standard_CString AIS_InteractiveContext::DomainOfMainViewer() const
-{
- return myMainVwr->Domain();
-
-}
-
//=======================================================================
//function : DisplayedObjects
//purpose :
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (theDispStatus == AIS_DS_Temporary
&& !HasOpenedContext())
{
{
if(myMainPM->IsHighlighted (theIObj, anOldMode))
{
- myMainPM->Unhighlight (theIObj, anOldMode);
+ unhighlightGlobal (theIObj, anOldMode);
}
myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
}
if (aStatus->IsHilighted())
{
const Standard_Integer aHiMod = theIObj->HasHilightMode() ? theIObj->HilightMode() : theDispMode;
- myMainPM->Color (theIObj, aStatus->HilightColor(), aHiMod);
+ highlightGlobal (theIObj, aStatus->HilightStyle(), aHiMod);
}
if (theSelectionMode != -1)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (HasOpenedContext())
{
myLocalContexts (myCurLocalIndex)->Load (theIObj, theToAllowDecomposition, theSelMode);
return;
}
+ if (theIObj->HasInteractiveContext())
+ {
+ if (theIObj->myCTXPtr != this)
+ {
+ Standard_ProgramError::Raise ("AIS_InteractiveContext - object has been displayed in another context!");
+ }
+ theIObj->SetContext (Handle(AIS_InteractiveContext)());
+ }
+
if (HasOpenedContext())
{
myLocalContexts (myCurLocalIndex)->Remove (theIObj);
}
//=======================================================================
-//function : Hilight
-//purpose :
+//function : HilightWithColor
+//purpose :
//=======================================================================
-void AIS_InteractiveContext::Hilight (const Handle(AIS_InteractiveObject)& theIObj,
- const Standard_Boolean theToUpdateViewer)
+void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject)& theObj,
+ const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Standard_Boolean theIsToUpdate)
{
- if (theIObj.IsNull())
- {
+ if (theObj.IsNull())
return;
- }
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
+ setContextToObject (theObj);
if (!HasOpenedContext())
{
- if (!myObjects.IsBound (theIObj))
- {
+ if (!myObjects.IsBound (theObj))
return;
- }
- Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
+ const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
aStatus->SetHilightStatus (Standard_True);
+
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
{
- Standard_Integer aHilightMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
- myMainPM->Highlight (theIObj, aHilightMode);
+ const Standard_Integer aHilightMode = theObj->HasHilightMode() ? theObj->HilightMode() : 0;
+ highlightGlobal (theObj, theStyle, aHilightMode);
+ aStatus->SetHilightStyle (theStyle);
}
}
else
{
- myLocalContexts (myCurLocalIndex)->Hilight (theIObj);
+ myLocalContexts (myCurLocalIndex)->Hilight (theObj, theStyle);
}
- if (theToUpdateViewer)
- {
+ if (theIsToUpdate)
myMainVwr->Update();
- }
-}
-//=======================================================================
-//function : Hilight
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject)& anIObj,
- const Quantity_NameOfColor aCol,
- const Standard_Boolean updateviewer)
-{
- if(anIObj.IsNull()) return;
-
- if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
-
- if (!HasOpenedContext())
- {
- if(!myObjects.IsBound(anIObj)) return;
-
- const Handle(AIS_GlobalStatus)& aStatus = myObjects(anIObj);
- aStatus->SetHilightStatus (Standard_True);
-
- if (aStatus->GraphicStatus() == AIS_DS_Displayed)
- {
- const Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
- myMainPM->Color (anIObj, aCol, aHilightMode);
- aStatus->SetHilightColor (aCol);
- }
- }
- else
- {
- myLocalContexts(myCurLocalIndex)->Hilight(anIObj,aCol);
- }
- if(updateviewer) myMainVwr->Update();
}
//=======================================================================
//function : Unhilight
//purpose :
//=======================================================================
-
void AIS_InteractiveContext::Unhilight(const Handle(AIS_InteractiveObject)& anIObj, const Standard_Boolean updateviewer)
{
if(anIObj.IsNull()) return;
const Handle(AIS_GlobalStatus)& aStatus = myObjects(anIObj);
aStatus->SetHilightStatus (Standard_False);
- aStatus->SetHilightColor(Quantity_NOC_WHITE);
+ aStatus->SetHilightStyle (new Graphic3d_HighlightStyle());
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
{
Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
- myMainPM->Unhighlight (anIObj, aHilightMode);
+ unhighlightGlobal (anIObj, aHilightMode);
}
}
else
//=======================================================================
//function : IsHilighted
-//purpose :
+//purpose : Returns true if the objects global status is set to highlighted.
//=======================================================================
-
-Standard_Boolean AIS_InteractiveContext::IsHilighted(const Handle(AIS_InteractiveObject)& anIObj) const
+Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(AIS_InteractiveObject)& theObj) const
{
- if(anIObj.IsNull()) return Standard_False;
-
- if (!HasOpenedContext()){
- if(!myObjects.IsBound(anIObj))
+ if (!HasOpenedContext())
+ {
+ if (!myObjects.IsBound (theObj))
return Standard_False;
- return myObjects(anIObj)->IsHilighted();
- }
- AIS_DataMapIteratorOfDataMapOfILC ItM(myLocalContexts);
- for(;ItM.More();ItM.Next()){
- if(ItM.Value()->IsHilighted(anIObj))
- return Standard_True;
- }
- return Standard_False;
-}
-Standard_Boolean AIS_InteractiveContext::IsHilighted(const Handle(AIS_InteractiveObject)& anIObj,
- Standard_Boolean& WithColor,
- Quantity_NameOfColor& TheHiCol) const
-{
- if(!HasOpenedContext()){
- if(myObjects.IsBound(anIObj)){
- const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
- if(STAT->IsHilighted()){
- if(STAT->HilightColor()!=Quantity_NOC_WHITE){
- WithColor=Standard_True;
- TheHiCol = STAT->HilightColor();
- }
- else
- WithColor = Standard_False;
- return Standard_True;
- }
- }
- return Standard_False;
+ return myObjects (theObj)->IsHilighted();
}
- Standard_Integer MaxIndex = HighestIndex();
- for(Standard_Integer i=MaxIndex;i>=1 ; i--){
- if(myLocalContexts.IsBound(i)){
- if(myLocalContexts(i)->IsHilighted(anIObj,WithColor,TheHiCol))
+
+ for (Standard_Integer aCtxIdx = HighestIndex(); aCtxIdx >= 1; aCtxIdx--)
+ {
+ if (myLocalContexts.IsBound (aCtxIdx))
+ {
+ if (myLocalContexts (aCtxIdx)->IsHilighted (theObj))
return Standard_True;
}
-
}
+
return Standard_False;
}
//=======================================================================
//function : IsHilighted
-//purpose : Returns true if the objects global status is set to highlighted.
-// theIsCustomColor flag defines if highlight color is not equal to OCCT's
-// default Quantity_NOC_WHITE color. If theIsCustomColor is true,
-// custom highlight color name will be stored to theCustomColorName
+//purpose : Returns true if the owner is highlighted with selection style.
//=======================================================================
-Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(SelectMgr_EntityOwner)& theOwner,
- Standard_Boolean& theIsCustomColor,
- Quantity_NameOfColor& theCustomColorName) const
+Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(SelectMgr_EntityOwner)& theOwner) const
{
if (theOwner.IsNull() || !theOwner->HasSelectable())
return Standard_False;
const Handle(AIS_InteractiveObject) anObj =
Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
- if (!myObjects.IsBound (anObj))
+ if (anObj->GlobalSelOwner() == theOwner)
+ {
+ if (!myObjects.IsBound (anObj))
+ return Standard_False;
+
+ return myObjects (anObj)->IsHilighted();
+ }
+
+ return theOwner->IsSelected();
+}
+
+//=======================================================================
+//function : HighlightStyle
+//purpose :
+//=======================================================================
+Standard_Boolean AIS_InteractiveContext::HighlightStyle (const Handle(AIS_InteractiveObject)& theObj,
+ Handle(Graphic3d_HighlightStyle)& theStyle) const
+{
+ if (HasOpenedContext())
+ myLocalContexts (myCurLocalIndex)->HighlightStyle (theObj, theStyle);
+
+ if (IsHilighted (theObj))
+ {
+ theStyle = myObjects (theObj)->HilightStyle();
+ return Standard_True;
+ }
+ else
+ {
+ theStyle.Nullify();
+ return Standard_False;
+ }
+}
+
+//=======================================================================
+//function : HighlightStyle
+//purpose :
+//=======================================================================
+Standard_Boolean AIS_InteractiveContext::HighlightStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
+ Handle(Graphic3d_HighlightStyle)& theStyle) const
+{
+ if (theOwner.IsNull() || !theOwner->HasSelectable())
return Standard_False;
- const Handle(AIS_GlobalStatus)& anObjStatus = myObjects (anObj);
- if (anObjStatus->IsHilighted())
+ if (IsHilighted (theOwner))
{
- if (anObjStatus->HilightColor() != Quantity_NOC_WHITE)
+ const Handle(AIS_InteractiveObject) anObj =
+ Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
+ if (anObj->GlobalSelOwner() == theOwner)
{
- theIsCustomColor = Standard_True;
- theCustomColorName = anObjStatus->HilightColor();
+ theStyle = myObjects (anObj)->HilightStyle();
}
else
{
- theIsCustomColor = Standard_False;
+ // since part selection style is not stored in global status,
+ // check if the object has own selection style. If not, it can
+ // only be highlighted with default selection style (because
+ // sub-intensity does not modify any selection states)
+ theStyle = getSelStyle (anObj);
}
-
return Standard_True;
}
-
- return Standard_False;
+ else
+ {
+ theStyle.Nullify();
+ return Standard_False;
+ }
}
//=======================================================================
{
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
if (aStatus->GraphicStatus() == AIS_DS_Displayed
- && theIObj->DisplayMode() == theMode)
+ && aStatus->DisplayMode() == theMode)
{
return Standard_True;
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (myObjects.IsBound (theIObj))
{
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
// if the object or its part is highlighted dynamically, it is necessary to apply location transformation
// to its highlight structure immediately
- if (!myLastPicked.IsNull() && myLastPicked->Selectable() == theIObj)
+ if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (theIObj))
{
+ const Standard_Integer aHiMod = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
myLastPicked->UpdateHighlightTrsf (myMainVwr,
myMainPM,
- theIObj->HasDisplayMode() ? theIObj->DisplayMode() : 0);
+ aHiMod);
}
}
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
{
myMainPM->Display (anObj, theMode);
- if (!myLastPicked.IsNull() && myLastPicked->Selectable() == anObj)
+ if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (anObj))
{
myMainPM->BeginImmediateDraw();
- myMainPM->Unhighlight (anObj, myDisplayMode);
+ unhighlightGlobal (anObj, myDisplayMode);
myMainPM->EndImmediateDraw (myMainVwr);
}
if (aStatus->IsSubIntensityOn())
{
- myMainPM->Color (anObj, mySubIntensity, theMode);
+ highlightWithSubintensity (anObj, theMode);
}
myMainPM->SetVisibility (anObj, myDisplayMode, Standard_False);
}
const Standard_Integer theMode,
const Standard_Boolean theToUpdateViewer)
{
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext(this);
- }
-
+ setContextToObject (theIObj);
if (!myObjects.IsBound (theIObj))
{
theIObj->SetDisplayMode (theMode);
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
if (aStatus->GraphicStatus() != AIS_DS_Displayed)
{
+ aStatus->SetDisplayMode (theMode);
theIObj->SetDisplayMode (theMode);
return;
}
{
if (myMainPM->IsHighlighted (theIObj, anOldMode))
{
- myMainPM->Unhighlight (theIObj, anOldMode);
+ unhighlightGlobal (theIObj, anOldMode);
}
myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
}
GetDefModes (theIObj, aDispMode, aHiMode, aSelMode);
if (aStatus->IsHilighted())
{
- myMainPM->Highlight (theIObj, aHiMode);
+ highlightGlobal (theIObj, getSelStyle (theIObj), aHiMode);
}
if (aStatus->IsSubIntensityOn())
{
- myMainPM->Color (theIObj, mySubIntensity, theMode);
+ highlightWithSubintensity (theIObj, theMode);
}
if (theToUpdateViewer)
{
if (myMainPM->IsHighlighted (theIObj, anOldMode))
{
- myMainPM->Unhighlight (theIObj, anOldMode);
+ unhighlightGlobal (theIObj, anOldMode);
}
myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
myMainPM->Display (theIObj, myDisplayMode);
GetDefModes (theIObj, aDispMode, aHiMode, aSelMode);
if (aStatus->IsHilighted())
{
- myMainPM->Highlight (theIObj, aHiMode);
+ highlightSelected (theIObj->GlobalSelOwner());
}
if (aStatus->IsSubIntensityOn())
{
- myMainPM->Color (theIObj, mySubIntensity, myDisplayMode);
+ highlightWithSubintensity (theIObj, myDisplayMode);
}
if (theToUpdateViewer)
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
+ setContextToObject (theIObj);
theIObj->SetColor (theColor);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// to be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Object
&& theIObj->Type() != AIS_KOI_Shape)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Object
&& theIObj->Type() != AIS_KOI_Shape)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
- if (!myLastinMain.IsNull() && myLastinMain->Selectable() == theIObj)
+ if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
{
if (myLastinMain->IsAutoHilight())
{
const Standard_Integer aHiMode =
theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
- myLastinMain->HilightWithColor (myMainPM, myLastinMain->IsSelected() ? mySelectionColor : myHilightColor, aHiMode);
+ myLastinMain->HilightWithColor (myMainPM,
+ myLastinMain->IsSelected() ? getSelStyle (theIObj) : getHiStyle (theIObj),
+ aHiMode);
}
else
{
- theIObj->HilightOwnerWithColor (myMainPM, myLastinMain->IsSelected() ? mySelectionColor : myHilightColor, myLastinMain);
+ theIObj->HilightOwnerWithColor (myMainPM,
+ myLastinMain->IsSelected() ? getSelStyle (theIObj) : getHiStyle (theIObj),
+ myLastinMain);
}
}
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetMaterial (theName);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (!theIObj->IsTransparent()
&& theValue <= 0.05)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetAttributes (theDrawer);
Update (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
+ setContextToObject (theIObj);
theIObj->UnsetAttributes();
Update (theIObj, theToUpdateViewer);
}
}
else if (myMainPM->IsHighlighted (theIObj, aStatus->DisplayMode()))
{
- myMainPM->Unhighlight (theIObj, aStatus->DisplayMode());
+ unhighlightGlobal (theIObj, aStatus->DisplayMode());
}
}
if (aStatus->IsHilighted()
&& theIObj->HasHilightMode())
{
- myMainPM->Unhighlight (theIObj, aDispMode);
+ unhighlightGlobal (theIObj, aDispMode);
}
if (!myLastPicked.IsNull()
- && myLastPicked->Selectable() == theIObj)
+ && myLastPicked->IsSameSelectable (theIObj))
{
myMainPM->ClearImmediateDraw();
}
SelectMgr_SequenceOfOwner aSeq;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
- if (aSelIter.Value()->Selectable() == theObject
+ if (aSelIter.Value()->IsSameSelectable (theObject)
&& aSelIter.Value()->IsSelected())
{
aSeq.Append (aSelIter.Value());
myMainPM->Erase (theIObj, -1);
// Object removes from Detected sequence
- for(Standard_Integer aDetIter = 1; aDetIter < myAISDetectedSeq.Length(); ++aDetIter)
+ for (Standard_Integer aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper(); ++aDetIter)
{
Handle(AIS_InteractiveObject) anObj = DetectedCurrentObject();
if (!anObj.IsNull()
&& anObj != theIObj)
{
- myAISDetectedSeq.Remove (aDetIter);
+ myDetectedSeq.Remove (aDetIter);
}
}
myObjects.UnBind (theIObj);
myMainVwr->StructureManager()->UnregisterObject (theIObj);
- for (myMainVwr->InitDefinedViews(); myMainVwr->MoreDefinedViews(); myMainVwr->NextDefinedViews())
+
+ for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
{
- myMainVwr->DefinedView()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
+ aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
- if (!myLastinMain.IsNull() && myLastinMain->Selectable() == theIObj)
- myLastinMain.Nullify();
- if (!myLastPicked.IsNull() && myLastPicked->Selectable() == theIObj)
- myLastPicked.Nullify();
- myMainPM->ClearImmediateDraw();
+ if (!myLastinMain.IsNull())
+ {
+ if (myLastinMain->IsSameSelectable (theIObj)
+ || myLastPicked->IsSameSelectable(theIObj))
+ {
+ myLastinMain.Nullify();
+ myMainPM->ClearImmediateDraw();
+ }
+ }
if (theToUpdateviewer && aStatus->GraphicStatus() == AIS_DS_Displayed)
{
if (aDispMode == theMode
&& myMainPM->IsHighlighted (theIObj, theMode))
{
- myMainPM->Unhighlight (theIObj, theMode);
+ unhighlightGlobal (theIObj, theMode);
}
myMainPM->Erase (theIObj, theMode);
//purpose :
//=======================================================================
void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
- const Graphic3d_TransModeFlags& theFlag,
- const gp_Pnt& thePoint)
+ const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
- theObject->SetTransformPersistence (theFlag, thePoint);
-
+ theObject->SetTransformPersistence (theTrsfPers);
if (!myObjects.IsBound (theObject))
{
return;
const Standard_Integer aLayerId = myObjects.Find (theObject)->GetLayerIndex();
const Handle(V3d_Viewer)& aCurViewer = CurrentViewer();
- for (aCurViewer->InitActiveViews(); aCurViewer->MoreActiveViews(); aCurViewer->NextActiveViews())
+ for (V3d_ListOfViewIterator anActiveViewIter (aCurViewer->ActiveViewIterator()); anActiveViewIter.More(); anActiveViewIter.Next())
{
- aCurViewer->ActiveView()->View()->InvalidateBVHData (aLayerId);
- aCurViewer->ActiveView()->View()->InvalidateZLayerBoundingBox (aLayerId);
+ anActiveViewIter.Value()->View()->InvalidateBVHData (aLayerId);
+ anActiveViewIter.Value()->View()->InvalidateZLayerBoundingBox (aLayerId);
}
}