// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <AIS_InteractiveContext.jxx>
-#include <AIS_LocalContext.hxx>
-
-#include <AIS_GlobalStatus.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
-#include <Graphic3d_StructureManager.hxx>
-#include <Graphic3d_Structure.hxx>
-#include <Graphic3d_MapOfStructure.hxx>
-#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
+#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
+#include <AIS_GlobalStatus.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_LocalContext.hxx>
#include <AIS_Selection.hxx>
-
+#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
+#include <Graphic3d_MapOfStructure.hxx>
+#include <Graphic3d_Structure.hxx>
+#include <Graphic3d_StructureManager.hxx>
+#include <Prs3d_BasicAspect.hxx>
+#include <Prs3d_LineAspect.hxx>
+#include <Quantity_Color.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Filter.hxx>
+#include <SelectMgr_OrFilter.hxx>
+#include <SelectMgr_SelectionManager.hxx>
+#include <Standard_Transient.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopoDS_Shape.hxx>
+#include <V3d_View.hxx>
+#include <V3d_Viewer.hxx>
//=======================================================================
//function : OpenLocalContext
//purpose :
//=======================================================================
-
Standard_Integer AIS_InteractiveContext::
OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
const Standard_Boolean AllowShapeDecomposition,
{
// the entities eventually detected just before the context was opened are unhighlighted...
- if(!IsCurrent(myLastPicked)){
+ if(!IsSelected(myLastPicked)){
if(!myLastPicked.IsNull()){
- Standard_Integer HiMod = myLastPicked->HasHilightMode()?myLastPicked->HilightMode():0;
- myMainPM->Unhighlight(myLastPicked,HiMod);
+ const Handle(AIS_InteractiveObject) aLastPickedAIS =
+ Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
+ Standard_Integer HiMod = aLastPickedAIS->HasHilightMode()?aLastPickedAIS->HilightMode():0;
+ myMainPM->Unhighlight (aLastPickedAIS, HiMod);
}}
if(!mylastmoveview.IsNull()){
}
else if(debugmode)
cout<<"a No Current Local Context WasClosed"<<endl;
-
+
+ // restore activated selections of current local context
+ myLocalContexts (myCurLocalIndex)->RestoreActivatedModes();
+
if(debugmode) cout<<"Index Of CurrentLocalContext:"<<myCurLocalIndex<<endl;
}
GB->SubIntensityOn();
Standard_Boolean UpdMain(Standard_False);
- for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
- if (GB->GraphicStatus()==AIS_DS_Displayed)
- {
- myMainPM->Color(anIObj,mySubIntensity,It.Value());
- UpdMain = Standard_True;
- }
+ if (GB->GraphicStatus() == AIS_DS_Displayed)
+ {
+ myMainPM->Color (anIObj, mySubIntensity, GB->DisplayMode());
+ UpdMain = Standard_True;
}
if(updateviewer){
if(UpdMain)
if(myObjects.IsBound(anIObj)){
const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
STAT->SubIntensityOn();
- TColStd_ListIteratorOfListOfInteger ItL;
- for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
- myMainPM->Color(anIObj,mySubIntensity,ItL.Value());
+ myMainPM->Color (anIObj, mySubIntensity, STAT->DisplayMode());
}
else
myLocalContexts(myCurLocalIndex)->SubIntensityOn(anIObj);
GB->SubIntensityOff();
Standard_Boolean UpdMain(Standard_False);
- for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
- if(GB->GraphicStatus()==AIS_DS_Displayed)
- {
- myMainPM->Unhighlight(anIObj,It.Value());
- UpdMain = Standard_True;
- }
+ if(GB->GraphicStatus() == AIS_DS_Displayed)
+ {
+ myMainPM->Unhighlight (anIObj, GB->DisplayMode());
+ UpdMain = Standard_True;
}
Standard_Integer DM,HM,SM;
GetDefModes(anIObj,DM,HM,SM);
- if(AIS_Selection::IsSelected(anIObj))
+ if(IsSelected(anIObj))
myMainPM->Highlight(anIObj,HM);
if(updateviewer){
if(myObjects.IsBound(anIObj)){
const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
STAT->SubIntensityOff();
- TColStd_ListIteratorOfListOfInteger ItL;
- for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
- myMainPM->Unhighlight(anIObj,ItL.Value());
+ myMainPM->Unhighlight (anIObj, STAT->DisplayMode());
if(STAT->IsHilighted())
Hilight(anIObj);
}
if(!HasOpenedContext()) return;
AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
- TColStd_ListIteratorOfListOfInteger ItM;
for(;It.More();It.Next()){
const Handle(AIS_GlobalStatus)& STAT = It.Value();
if(STAT->GraphicStatus()==AIS_DS_Displayed)
{
STAT->SubIntensityOn();
- for(ItM.Initialize(STAT->DisplayedModes());ItM.More();ItM.Next())
- {myMainPM->Color(It.Key(),mySubIntensity,ItM.Value());}
+ myMainPM->Color (It.Key(), mySubIntensity, STAT->DisplayMode());
}
}
if(updateviewer) myMainVwr->Update();
if(!HasOpenedContext()) return;
AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
- TColStd_ListIteratorOfListOfInteger ItL;
for(;It.More();It.Next()){
const Handle(AIS_GlobalStatus)& STAT = It.Value();
if(STAT->IsSubIntensityOn())
STAT->SubIntensityOff();
- for(ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
- myMainPM->Unhighlight(It.Key());
+ myMainPM->Unhighlight (It.Key());
}
if(updateviewer) myMainVwr->Update();
//=======================================================================
Standard_Integer AIS_InteractiveContext::PurgeViewer(const Handle(V3d_Viewer)& Vwr)
{
- Handle(Graphic3d_StructureManager) GSM = Vwr->Viewer();
+ Handle(Graphic3d_StructureManager) GSM = Vwr->StructureManager();
Standard_Integer NbCleared(0);
Graphic3d_MapOfStructure SOS;
GSM->DisplayedStructures(SOS);
Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
{
return HasOpenedContext()
- && myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView);
+ && myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView->Viewer());
}
//=======================================================================
}
Handle(V3d_View) aView = myMainVwr->ActiveView();
- return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView);
+ return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView->Viewer());
}
upd_main = Standard_True;
// part display...
- for(itl.Initialize(STAT->DisplayedModes());itl.More();itl.Next())
- myMainPM->Display(iobj,itl.Value());
+ myMainPM->Display (iobj, STAT->DisplayMode());
if(STAT->IsHilighted()){
if(STAT->HilightColor()!=Quantity_NOC_WHITE)
HilightWithColor(iobj,STAT->HilightColor(),Standard_False);