mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023654: Problem with displaying vertices in OCC view after closing all OCC views and opening new one
Fixed graphic structure recompute after closing view. Removed collector and all corresponding logic and methods from AIS_InteractiveContext. Method AIS_InteractiveContext::Erase() now hide object from viewer without deleting resources. Erased objects now properly recomputed after closing view. Samples update Removed useless method AIS_InteractiveContext::EraseMode() Documentation update Warnings fix Regressions fix
This commit is contained in:
@@ -189,7 +189,6 @@ is
|
||||
enumeration DisplayStatus is
|
||||
DS_Displayed,
|
||||
DS_Erased,
|
||||
DS_FullErased,
|
||||
DS_Temporary,
|
||||
DS_None;
|
||||
---Purpose:
|
||||
|
@@ -151,25 +151,9 @@ is
|
||||
---Purpose:
|
||||
-- Constructs the interactive context object defined by
|
||||
-- the principal viewer MainViewer.
|
||||
|
||||
Create(MainViewer,Collector: Viewer from V3d)
|
||||
returns mutable InteractiveContext from AIS;
|
||||
---Purpose:
|
||||
-- Constructs the interactive context object defined by
|
||||
-- the principal viewer MainViewer and the collector
|
||||
-- (or trash) viewer.
|
||||
|
||||
|
||||
Delete(me) is redefined;
|
||||
|
||||
IsCollectorClosed(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
CloseCollector(me:mutable);
|
||||
---C++: inline
|
||||
OpenCollector(me:mutable);
|
||||
|
||||
|
||||
|
||||
---Category: General DISPLAY SERVICES
|
||||
SetAutoActivateSelection( me: mutable; Auto : Boolean from Standard );
|
||||
GetAutoActivateSelection( me ) returns Boolean from Standard;
|
||||
@@ -242,70 +226,27 @@ is
|
||||
|
||||
Erase(me : mutable;
|
||||
aniobj : InteractiveObject from AIS;
|
||||
updateviewer : Boolean from Standard = Standard_True;
|
||||
PutInCollector : Boolean from Standard = Standard_False);
|
||||
---Purpose: To erase presentations in current local context, or
|
||||
-- failing that, in other local contexts which allow erasing.
|
||||
--
|
||||
-- If putinCollector is True, the object is erased with graphical status Erased,
|
||||
-- and put into the Collector. These objects can be retrieved
|
||||
-- from Interactive Context by ObjectsInCollector method.
|
||||
-- If putinCollector is False, the objects erased with graphical status FullErased,
|
||||
-- and not put into the Collector. These objects can be retrieved
|
||||
-- from Interactive Context by ErasedObjects method.
|
||||
--
|
||||
-- Note: objects that are put into the Collector recomute their presentation
|
||||
-- for Collector Presentation Manager.
|
||||
--
|
||||
-- If a local context is open and if updateviewer is
|
||||
-- False, the presentation of the Interactive
|
||||
-- Object activates the selection mode; the object is
|
||||
-- displayed but no viewer will be updated.
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
---Purpose: Hides the object. The object's presentations are simply
|
||||
-- flagged as invisible and therefore excluded from redrawing.
|
||||
-- To show hidden objects, use Display().
|
||||
|
||||
EraseMode(me : mutable;
|
||||
aniobj : InteractiveObject from AIS;
|
||||
aMode : Integer from Standard;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
---Purpose: Updates viewer contents and returns the display
|
||||
-- mode of each aniobj object. Use only if more than
|
||||
-- one display mode is active in the main viewer.
|
||||
-- This method works only on presentation modes other
|
||||
-- than the default mode. Nothing is done if aMode is
|
||||
-- the default presentation mode.
|
||||
-- If a local context is open and if updateviewer equals
|
||||
-- Standard_False, the presentation of the Interactive
|
||||
-- Object activates the selection mode; the object is
|
||||
-- displayed but no viewer will be updated.
|
||||
EraseAll (me : mutable;
|
||||
updateviewer: Boolean from Standard = Standard_True);
|
||||
---Purpose: Hides all objects. The object's presentations are simply
|
||||
-- flagged as invisible and therefore excluded from redrawing.
|
||||
-- To show all hidden objects, use DisplayAll().
|
||||
|
||||
DisplayAll(me : mutable;
|
||||
updateviewer: Boolean from Standard = Standard_True);
|
||||
---Purpose: Displays all hidden objects.
|
||||
|
||||
|
||||
EraseAll(me:mutable;
|
||||
PutInCollector : Boolean from Standard = Standard_False;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
---Purpose: Every erased object goes into the Collector viewer,
|
||||
-- depending on PutInCollector value.
|
||||
|
||||
DisplayAll(me : mutable;
|
||||
OnlyFromCollector : Boolean from Standard = Standard_False;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
---Purpose: Displays all erased objects or display all objects from collector
|
||||
|
||||
DisplayFromCollector(me : mutable;
|
||||
anIObj : InteractiveObject from AIS;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
---Purpose: display anIObj from the collector.
|
||||
|
||||
EraseSelected(me:mutable;
|
||||
PutInCollector:Boolean from Standard=Standard_False;
|
||||
updateviewer:Boolean from Standard = Standard_True);
|
||||
EraseSelected(me: mutable;
|
||||
updateviewer: Boolean from Standard = Standard_True);
|
||||
---Purpose:
|
||||
-- Erases selected objects if there is no open active local context.
|
||||
-- If there is no local context activated and if
|
||||
-- updateviewer equals Standard_False, the
|
||||
-- presentation of the Interactive Object activates the
|
||||
-- selection mode; the object is displayed but no viewer
|
||||
-- will be updated.
|
||||
-- If a local context is open, this method is neutral.
|
||||
-- Hides selected objects. The object's presentations are simply
|
||||
-- flagged as invisible and therefore excluded from redrawing.
|
||||
-- To show hidden objects, use Display().
|
||||
|
||||
DisplaySelected(me:mutable;updateviewer:Boolean from Standard = Standard_True);
|
||||
---Purpose: Displays selected objects if a local context is open.
|
||||
@@ -800,8 +741,7 @@ is
|
||||
---Purpose: Returns the display status of the entity anIobj.
|
||||
-- This will be one of the following:
|
||||
-- - DS_Displayed displayed in main viewer
|
||||
-- - DS_Erased erased in the Collector
|
||||
-- - DS_FullErased erased everywhere but in the Collector
|
||||
-- - DS_Erased hidden in main viewer
|
||||
-- - DS_Temporary temporarily displayed
|
||||
-- - DS_None nowhere displayed.
|
||||
|
||||
@@ -831,17 +771,12 @@ is
|
||||
-- <WithColor> will be returned TRUE
|
||||
-- <theHiCol> gives the name of the hilightcolor
|
||||
|
||||
IsInCollector(me;anIObj:InteractiveObject from AIS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns true if the entity anIobj is in the Collector viewer.
|
||||
|
||||
DisplayPriority(me;anIobj: InteractiveObject from AIS)
|
||||
returns Integer from Standard;
|
||||
---Purpose:
|
||||
-- Returns the display priority of the entity anIobj. This
|
||||
-- will be display mode of anIobj if it is in the main
|
||||
-- viewer, and the highlight mode if it is in the Collector viewer.
|
||||
-- viewer.
|
||||
|
||||
HasColor(me; aniobj: InteractiveObject from AIS)
|
||||
returns Boolean from Standard;
|
||||
@@ -875,11 +810,6 @@ is
|
||||
-- are called current objects; those selected in open
|
||||
-- local context, selected objects.
|
||||
|
||||
UpdateCollector(me:mutable);
|
||||
---Purpose: Updates the Collector viewer.
|
||||
|
||||
|
||||
|
||||
---Category: General Attributes for the session
|
||||
|
||||
DisplayMode(me) returns Integer from Standard;
|
||||
@@ -1161,7 +1091,7 @@ is
|
||||
-- is changed.
|
||||
-- When <globalChange> is FALSE , only the current group
|
||||
-- of the object presentation is changed.
|
||||
-- Updates the viewer or collector when <updateViewer> is TRUE
|
||||
-- Updates the viewer when <updateViewer> is TRUE
|
||||
---Category: Graphic attributes management
|
||||
|
||||
---Category: GRAPHIC DETECTION / SELECTION
|
||||
@@ -1963,30 +1893,9 @@ is
|
||||
-- by Default, <WhichSignature> = -1 means
|
||||
-- control only on <WhichKind>.
|
||||
|
||||
Collector(me) returns any Viewer from V3d;
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
|
||||
ObjectsInCollector (me;aListOfIO : in out ListOfInteractive from AIS);
|
||||
---Purpose:
|
||||
-- Returns the list aListOfIO of erased objects of a
|
||||
-- particular Type WhichKind and Signature WhichSignature.
|
||||
-- By Default, WhichSignature equals 1. This means
|
||||
-- that there is a check on type only.
|
||||
|
||||
ObjectsInCollector (me;
|
||||
WhichKind :KindOfInteractive from AIS;
|
||||
WhichSignature :Integer from Standard;
|
||||
aListOfIO : in out ListOfInteractive from AIS);
|
||||
---Purpose: gives the list of erased objects of a particular
|
||||
-- Type and signature
|
||||
-- by Default, <WhichSignature> = -1 means
|
||||
-- control only on <WhichKind>.
|
||||
|
||||
|
||||
ErasedObjects (me;theListOfIO : in out ListOfInteractive from AIS);
|
||||
---Purpose:
|
||||
-- Returns the list theListOfIO of erased objects (but not placed into collecter)
|
||||
-- Returns the list theListOfIO of erased objects (hidden objects)
|
||||
-- particular Type WhichKind and Signature WhichSignature.
|
||||
-- By Default, WhichSignature equals 1. This means
|
||||
-- that there is a check on type only.
|
||||
@@ -1995,7 +1904,7 @@ is
|
||||
WhichKind :KindOfInteractive from AIS;
|
||||
WhichSignature :Integer from Standard;
|
||||
theListOfIO : in out ListOfInteractive from AIS);
|
||||
---Purpose: gives the list of erased objects (but not placed into collecter)
|
||||
---Purpose: gives the list of erased objects (hidden objects)
|
||||
-- Type and signature
|
||||
-- by Default, <WhichSignature> = -1 means
|
||||
-- control only on <WhichKind>.
|
||||
@@ -2054,9 +1963,7 @@ is
|
||||
|
||||
DomainOfMainViewer(me) returns CString from Standard;
|
||||
---Purpose: Returns the domain name of the main viewer.
|
||||
DomainOfCollector(me) returns CString from Standard;
|
||||
---Purpose: Returns the domain name of the Collector viewer.
|
||||
|
||||
|
||||
---Category: Internal
|
||||
|
||||
---Category: Internal
|
||||
@@ -2078,24 +1985,13 @@ is
|
||||
MainPrsMgr (me) returns any PresentationManager3d from PrsMgr;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
CollectorPrsMgr(me) returns any PresentationManager3d from PrsMgr;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
|
||||
MainSelector(me) returns any ViewerSelector3d from StdSelect;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
LocalSelector(me) returns any ViewerSelector3d from StdSelect;
|
||||
|
||||
|
||||
CollectorSelector(me) returns any ViewerSelector3d from StdSelect;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
|
||||
|
||||
PurgeDisplay(me:mutable;CollectorToo:Boolean from Standard = Standard_False)
|
||||
PurgeDisplay(me:mutable)
|
||||
returns Integer from Standard;
|
||||
---Level: Internal
|
||||
---Purpose: Clears all the structures which don't
|
||||
@@ -2131,9 +2027,8 @@ is
|
||||
|
||||
|
||||
EraseGlobal(me : mutable;
|
||||
anObj : InteractiveObject from AIS;
|
||||
updateviewer : Boolean from Standard = Standard_True;
|
||||
PutInCollector : Boolean from Standard = Standard_False) is static private;
|
||||
anObj : InteractiveObject from AIS;
|
||||
updateviewer : Boolean from Standard = Standard_True) is static private;
|
||||
|
||||
ClearGlobal(me : mutable;
|
||||
anObj : InteractiveObject from AIS;
|
||||
@@ -2172,12 +2067,6 @@ fields
|
||||
myMainVwr : Viewer from V3d;
|
||||
myMainSel : ViewerSelector3d from StdSelect;
|
||||
|
||||
myCollectorPM : PresentationManager3d from PrsMgr;
|
||||
myCollectorVwr : Viewer from V3d;
|
||||
myCollectorSel : ViewerSelector3d from StdSelect;
|
||||
|
||||
myIsCollClosed : Boolean from Standard;
|
||||
|
||||
-- the selection and current objects.
|
||||
|
||||
mySelectionName : AsciiString from TCollection;
|
||||
@@ -2185,7 +2074,6 @@ fields
|
||||
|
||||
myLastPicked : InteractiveObject from AIS;
|
||||
myLastinMain : InteractiveObject from AIS;
|
||||
myLastinColl : InteractiveObject from AIS;
|
||||
|
||||
|
||||
myWasLastMain : Boolean from Standard;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -21,11 +21,6 @@ inline const Handle(V3d_Viewer)& AIS_InteractiveContext::CurrentViewer() const
|
||||
return myMainVwr;
|
||||
}
|
||||
|
||||
inline const Handle(V3d_Viewer)& AIS_InteractiveContext::Collector() const
|
||||
{
|
||||
return myCollectorVwr;
|
||||
}
|
||||
|
||||
inline Quantity_NameOfColor AIS_InteractiveContext::HilightColor() const
|
||||
{
|
||||
return myHilightColor;
|
||||
@@ -44,12 +39,6 @@ inline Quantity_NameOfColor AIS_InteractiveContext::PreSelectionColor() const
|
||||
inline Quantity_NameOfColor AIS_InteractiveContext::DefaultColor() const
|
||||
{ return myDefaultColor;
|
||||
}
|
||||
inline Standard_Boolean AIS_InteractiveContext::IsCollectorClosed() const
|
||||
{return myIsCollClosed;}
|
||||
|
||||
inline void AIS_InteractiveContext::CloseCollector()
|
||||
{myIsCollClosed = Standard_True;}
|
||||
|
||||
|
||||
inline Quantity_NameOfColor AIS_InteractiveContext::SubIntensityColor() const
|
||||
{
|
||||
@@ -88,10 +77,6 @@ inline const Handle(SelectMgr_SelectionManager)& AIS_InteractiveContext::Selecti
|
||||
inline const Handle(PrsMgr_PresentationManager3d)& AIS_InteractiveContext::MainPrsMgr() const
|
||||
{return myMainPM ;}
|
||||
|
||||
inline const Handle(PrsMgr_PresentationManager3d)& AIS_InteractiveContext::CollectorPrsMgr() const
|
||||
{return myCollectorPM ;}
|
||||
|
||||
|
||||
inline Standard_Boolean AIS_InteractiveContext::HasOpenedContext() const
|
||||
{return myCurLocalIndex != 0;}
|
||||
|
||||
@@ -111,9 +96,6 @@ inline void AIS_InteractiveContext::SetOkCurrent()
|
||||
inline const Handle(StdSelect_ViewerSelector3d)& AIS_InteractiveContext::MainSelector() const
|
||||
{return myMainSel;}
|
||||
|
||||
inline const Handle(StdSelect_ViewerSelector3d)& AIS_InteractiveContext::CollectorSelector() const
|
||||
{return myCollectorSel;}
|
||||
|
||||
inline void AIS_InteractiveContext::SetToHilightSelected(const Standard_Boolean toHilight)
|
||||
{
|
||||
myToHilightSelected = toHilight;
|
||||
|
@@ -146,7 +146,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo(const Standard_Integer XPix
|
||||
const Standard_Integer YPix,
|
||||
const Handle(V3d_View)& aView)
|
||||
{
|
||||
if(HasOpenedContext()&& aView->Viewer()!=myCollectorVwr){
|
||||
if(HasOpenedContext()){
|
||||
myWasLastMain = Standard_True;
|
||||
return myLocalContexts(myCurLocalIndex)->MoveTo(XPix,YPix,aView);
|
||||
}
|
||||
@@ -169,13 +169,6 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo(const Standard_Integer XPix
|
||||
myLastPicked = myLastinMain;
|
||||
myWasLastMain = Standard_True;
|
||||
}
|
||||
else if (aView->Viewer()== myCollectorVwr){
|
||||
pmgr = myCollectorPM;
|
||||
selector=myCollectorSel;
|
||||
myLastPicked = myLastinColl;
|
||||
ismain = Standard_False;
|
||||
myWasLastMain = Standard_False;
|
||||
}
|
||||
else
|
||||
return AIS_SOD_Error;
|
||||
|
||||
@@ -247,8 +240,6 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo(const Standard_Integer XPix
|
||||
|
||||
if ( ismain )
|
||||
myLastinMain = myLastPicked;
|
||||
else
|
||||
myLastinColl = myLastPicked;
|
||||
#ifdef IMP191001
|
||||
// Highlight detected object if it is not selected or myToHilightSelected flag is true
|
||||
if ( !myLastPicked.IsNull() &&
|
||||
@@ -289,8 +280,6 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo(const Standard_Integer XPix
|
||||
|
||||
if ( ismain )
|
||||
myLastinMain.Nullify();
|
||||
else
|
||||
myLastinColl.Nullify();
|
||||
}
|
||||
|
||||
if(UpdVwr) aView->Viewer()->Update();
|
||||
@@ -325,12 +314,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select(const Standard_Integer XPMin,
|
||||
if(aView->Viewer()== myMainVwr) {
|
||||
selector= myMainSel;
|
||||
myWasLastMain = Standard_True;}
|
||||
|
||||
else if (aView->Viewer()==myCollectorVwr){
|
||||
selector= myCollectorSel;
|
||||
myWasLastMain = Standard_False;}
|
||||
|
||||
|
||||
|
||||
selector->Pick(XPMin,YPMin,XPMax,YPMax,aView);
|
||||
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
|
||||
|
||||
@@ -395,12 +379,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select(const TColgp_Array1OfPnt2d& aPol
|
||||
if(aView->Viewer()== myMainVwr) {
|
||||
selector= myMainSel;
|
||||
myWasLastMain = Standard_True;}
|
||||
|
||||
else if (aView->Viewer()==myCollectorVwr){
|
||||
selector= myCollectorSel;
|
||||
myWasLastMain = Standard_False;}
|
||||
|
||||
|
||||
|
||||
selector->Pick(aPolyline,aView);
|
||||
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
|
||||
|
||||
@@ -467,12 +446,6 @@ AIS_StatusOfPick AIS_InteractiveContext::Select(const Standard_Boolean updatevie
|
||||
if(updateviewer)
|
||||
UpdateCurrentViewer();}
|
||||
}
|
||||
else if (!myWasLastMain && !myLastinColl.IsNull()){
|
||||
if(myLastinColl->State()!=1){
|
||||
SetCurrentObject(myLastinColl,Standard_False);
|
||||
if(updateviewer)
|
||||
UpdateCollector();}
|
||||
}
|
||||
else{
|
||||
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
|
||||
Handle(AIS_Selection) S = AIS_Selection::CurrentSelection();
|
||||
@@ -493,9 +466,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select(const Standard_Boolean updatevie
|
||||
AIS_Selection::Select();
|
||||
if(updateviewer){
|
||||
if(myWasLastMain)
|
||||
UpdateCurrentViewer();
|
||||
else
|
||||
UpdateCollector();
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
Standard_Integer NS = NbCurrents();
|
||||
@@ -524,10 +495,7 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect(const Standard_Boolean upda
|
||||
}
|
||||
if(myWasLastMain && !myLastinMain.IsNull())
|
||||
AddOrRemoveCurrentObject(myLastinMain,updateviewer);
|
||||
else if (!myWasLastMain && !myLastinColl.IsNull())
|
||||
AddOrRemoveCurrentObject(myLastinColl,updateviewer);
|
||||
|
||||
|
||||
|
||||
Standard_Integer NS = NbCurrents();
|
||||
if(NS==0) return AIS_SOP_NothingSelected;
|
||||
if(NS==1) return AIS_SOP_OneSelected;
|
||||
@@ -558,10 +526,6 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect(const Standard_Integer XPMi
|
||||
if(aView->Viewer()== myMainVwr) {
|
||||
selector= myMainSel;
|
||||
myWasLastMain = Standard_True;}
|
||||
|
||||
else if (aView->Viewer()==myCollectorVwr){
|
||||
selector= myCollectorSel;
|
||||
myWasLastMain = Standard_False;}
|
||||
else
|
||||
return AIS_SOP_NothingSelected;
|
||||
|
||||
@@ -605,10 +569,6 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect( const TColgp_Array1OfPnt2d
|
||||
selector= myMainSel;
|
||||
myWasLastMain = Standard_True;
|
||||
}
|
||||
else if ( aView->Viewer() == myCollectorVwr ) {
|
||||
selector= myCollectorSel;
|
||||
myWasLastMain = Standard_False;
|
||||
}
|
||||
else
|
||||
return AIS_SOP_NothingSelected;
|
||||
|
||||
|
@@ -63,7 +63,6 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
|
||||
// entities connected to dynamic selection at neutral point are set to 0.
|
||||
|
||||
myLastinMain.Nullify();
|
||||
myLastinColl.Nullify();
|
||||
myLastPicked.Nullify();
|
||||
myWasLastMain = Standard_True;
|
||||
|
||||
@@ -186,8 +185,6 @@ void AIS_InteractiveContext::CloseAllContexts(const Standard_Boolean updateviewe
|
||||
ResetOriginalState(Standard_False);
|
||||
|
||||
myMainSel->UpdateSort();
|
||||
if(!myIsCollClosed && !myCollectorSel.IsNull())
|
||||
myCollectorSel->UpdateSort();
|
||||
if(updateviewer) myMainVwr->Update();
|
||||
}
|
||||
|
||||
@@ -376,22 +373,18 @@ SubIntensityOn(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
if(GB->IsSubIntensityOn())
|
||||
return;
|
||||
GB->SubIntensityOn();
|
||||
Standard_Boolean UpdMain(Standard_False),UpdColl(Standard_False);
|
||||
Standard_Boolean UpdMain(Standard_False);
|
||||
|
||||
for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
|
||||
if(GB->GraphicStatus()==AIS_DS_Displayed){
|
||||
if (GB->GraphicStatus()==AIS_DS_Displayed)
|
||||
{
|
||||
myMainPM->Color(anIObj,mySubIntensity,It.Value());
|
||||
UpdMain = Standard_True;}
|
||||
else if(GB->GraphicStatus()==AIS_DS_Erased){
|
||||
myCollectorPM->Color(anIObj,mySubIntensity,It.Value());
|
||||
UpdColl=Standard_True;
|
||||
UpdMain = Standard_True;
|
||||
}
|
||||
}
|
||||
if(updateviewer){
|
||||
if(UpdMain)
|
||||
myMainVwr->Update();
|
||||
if(UpdColl)
|
||||
myCollectorVwr->Update();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -424,15 +417,13 @@ SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
if(!GB->IsSubIntensityOn())
|
||||
return;
|
||||
GB->SubIntensityOff();
|
||||
Standard_Boolean UpdMain(Standard_False),UpdColl(Standard_False);
|
||||
Standard_Boolean UpdMain(Standard_False);
|
||||
|
||||
for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
|
||||
if(GB->GraphicStatus()!=AIS_DS_Erased){
|
||||
if(GB->GraphicStatus()==AIS_DS_Displayed)
|
||||
{
|
||||
myMainPM->Unhighlight(anIObj,It.Value());
|
||||
UpdMain = Standard_True;}
|
||||
else {
|
||||
myCollectorPM->Unhighlight(anIObj,It.Value());
|
||||
UpdColl=Standard_True;
|
||||
UpdMain = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,8 +435,6 @@ SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
if(updateviewer){
|
||||
if(UpdMain)
|
||||
myMainVwr->Update();
|
||||
if(UpdColl)
|
||||
myCollectorVwr->Update();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -749,17 +738,11 @@ void AIS_InteractiveContext::NotUseDisplayedObjects()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_InteractiveContext::PurgeDisplay(const Standard_Boolean CollectorToo)
|
||||
Standard_Integer AIS_InteractiveContext::PurgeDisplay()
|
||||
{
|
||||
if(HasOpenedContext()) return 0;
|
||||
|
||||
Standard_Integer NbStr = PurgeViewer(myMainVwr);
|
||||
if(!myCollectorVwr.IsNull())
|
||||
if(CollectorToo){
|
||||
NbStr+=PurgeViewer(myCollectorVwr);
|
||||
if(!IsCollectorClosed())
|
||||
myCollectorVwr->Update();
|
||||
}
|
||||
myMainVwr->Update();
|
||||
return NbStr;
|
||||
|
||||
@@ -881,7 +864,7 @@ Standard_Boolean AIS_InteractiveContext::EndImmediateDraw(const Standard_Boolean
|
||||
|
||||
void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updateviewer)
|
||||
{
|
||||
Standard_Boolean upd_main(Standard_False),upd_col(Standard_False);
|
||||
Standard_Boolean upd_main(Standard_False);
|
||||
TColStd_ListIteratorOfListOfInteger itl;
|
||||
|
||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
|
||||
@@ -908,12 +891,7 @@ void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updatevie
|
||||
break;
|
||||
}
|
||||
case AIS_DS_Erased:{
|
||||
upd_col = Standard_True;
|
||||
EraseGlobal(iobj,Standard_False,Standard_True);
|
||||
break;
|
||||
}
|
||||
case AIS_DS_FullErased:{
|
||||
EraseGlobal(iobj,Standard_False,Standard_False);
|
||||
EraseGlobal(iobj,Standard_False);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -923,8 +901,6 @@ void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updatevie
|
||||
if(updateviewer){
|
||||
if(upd_main)
|
||||
myMainVwr->Update();
|
||||
if(upd_col)
|
||||
myCollectorVwr->Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,28 +25,6 @@
|
||||
#include <AIS_GlobalStatus.hxx>
|
||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||
|
||||
//=======================================================================
|
||||
//function : Erase
|
||||
//purpose : display an interactive object from the collector.
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::DisplayFromCollector(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
const Standard_Boolean updateviewer)
|
||||
{
|
||||
if ( !IsInCollector( anIObj ) ) return;
|
||||
|
||||
if ( !HasOpenedContext() ){
|
||||
|
||||
if ( DisplayStatus( anIObj ) == AIS_DS_Erased )
|
||||
Display( anIObj,Standard_False);
|
||||
|
||||
if( updateviewer ){
|
||||
myMainVwr->Update();
|
||||
if( !myCollectorVwr.IsNull() )
|
||||
myCollectorVwr->Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -317,13 +317,13 @@ Erase(const Handle(AIS_InteractiveObject)& anInteractive)
|
||||
AddOrRemoveSelected(anInteractive);
|
||||
if(myMainPM->IsHighlighted(anInteractive,STAT->HilightMode()))
|
||||
myMainPM->Unhighlight(anInteractive,STAT->HilightMode());
|
||||
myMainPM->Erase(anInteractive,STAT->DisplayMode());
|
||||
myMainPM->SetVisibility (anInteractive, STAT->DisplayMode(), Standard_False);
|
||||
STAT->SetDisplayMode(-1);
|
||||
status = Standard_True;
|
||||
}
|
||||
if(STAT->IsTemporary()){
|
||||
if(myMainPM->IsDisplayed(anInteractive,STAT->HilightMode()))
|
||||
myMainPM->Erase(anInteractive,STAT->HilightMode());
|
||||
myMainPM->SetVisibility (anInteractive, STAT->HilightMode(), Standard_False);
|
||||
}
|
||||
//selection step
|
||||
|
||||
@@ -590,13 +590,7 @@ void AIS_LocalContext::ActivateStandardMode(const TopAbs_ShapeEnum aType)
|
||||
AIS_DataMapIteratorOfDataMapOfSelStat ItM(myActiveObjects);
|
||||
|
||||
for(;ItM.More();ItM.Next()){
|
||||
#ifdef BUC60722
|
||||
AIS_DisplayStatus DS =
|
||||
myCTX->DisplayStatus(Handle(AIS_InteractiveObject)::DownCast(ItM.Key()));
|
||||
if( ItM.Value()->Decomposed() && (DS != AIS_DS_FullErased) )
|
||||
#else
|
||||
if(ItM.Value()->Decomposed())
|
||||
#endif
|
||||
myCTX->SelectionManager()->Activate(ItM.Key(),
|
||||
IMode,
|
||||
myMainVS);
|
||||
@@ -844,8 +838,8 @@ void AIS_LocalContext::Unhilight(const Handle(AIS_InteractiveObject)& anObject)
|
||||
myMainPM->Unhighlight(anObject,Att->HilightMode());
|
||||
if(Att->IsTemporary() && Att->DisplayMode()==-1)
|
||||
if(!IsSomeWhereElse)
|
||||
myMainPM->Erase(anObject,Att->HilightMode());
|
||||
|
||||
myMainPM->SetVisibility (anObject, Att->HilightMode(), Standard_False);
|
||||
|
||||
Att->SubIntensityOff();
|
||||
Att->SetHilightColor(Quantity_NOC_WHITE);
|
||||
}
|
||||
@@ -1148,31 +1142,30 @@ HasFilters(const TopAbs_ShapeEnum aType) const
|
||||
|
||||
void AIS_LocalContext::ClearDetected()
|
||||
{
|
||||
for(Standard_Integer I=1;I<=myMapOfOwner.Extent();I++){
|
||||
|
||||
if(!myMapOfOwner(I).IsNull()){
|
||||
for(Standard_Integer I=1;I<=myMapOfOwner.Extent();I++)
|
||||
{
|
||||
if(!myMapOfOwner(I).IsNull())
|
||||
{
|
||||
if(myMapOfOwner(I)->IsHilighted(myMainPM))
|
||||
myMapOfOwner(I)->Unhilight(myMainPM);
|
||||
else if (myMapOfOwner(I)->IsHilighted(myCTX->CollectorPrsMgr()))
|
||||
myMapOfOwner(I)->Unhilight(myCTX->CollectorPrsMgr());
|
||||
|
||||
else{
|
||||
const Handle(SelectMgr_SelectableObject)& SO =
|
||||
myMapOfOwner.FindKey(I)->Selectable();
|
||||
if(myActiveObjects.IsBound(SO)){
|
||||
const Handle(AIS_LocalStatus)& Att = myActiveObjects(SO);
|
||||
|
||||
if(Att->IsTemporary() &&
|
||||
Att->DisplayMode()==-1 &&
|
||||
Att->SelectionModes().IsEmpty()){
|
||||
myMapOfOwner(I)->Clear(myMainPM);
|
||||
//myMapOfOwner(I)->Clear();//rob-jmi...
|
||||
}
|
||||
}
|
||||
myMapOfOwner(I)->Unhilight(myMainPM);
|
||||
else
|
||||
{
|
||||
const Handle(SelectMgr_SelectableObject)& SO =
|
||||
myMapOfOwner.FindKey(I)->Selectable();
|
||||
if(myActiveObjects.IsBound(SO))
|
||||
{
|
||||
const Handle(AIS_LocalStatus)& Att = myActiveObjects(SO);
|
||||
|
||||
if(Att->IsTemporary() &&
|
||||
Att->DisplayMode()==-1 &&
|
||||
Att->SelectionModes().IsEmpty())
|
||||
{
|
||||
myMapOfOwner(I)->Clear(myMainPM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AIS_LocalContext::UpdateConversion()
|
||||
|
@@ -594,7 +594,7 @@ void AIS_LocalContext::Unhilight(const Handle(SelectMgr_EntityOwner)& Ownr,
|
||||
//=======================================================================
|
||||
void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
{
|
||||
Standard_Boolean updMain(Standard_False),updColl(Standard_False);
|
||||
Standard_Boolean updMain(Standard_False);
|
||||
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
|
||||
#ifdef BUC60765
|
||||
@@ -626,11 +626,7 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
|
||||
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
|
||||
IO = *((Handle(AIS_InteractiveObject)*)&SO);
|
||||
if(myCTX->IsInCollector(IO)){
|
||||
PM = myCTX->CollectorPrsMgr();
|
||||
updColl = Standard_True;}
|
||||
else
|
||||
updMain = Standard_True;
|
||||
updMain = Standard_True;
|
||||
}
|
||||
else
|
||||
updMain = Standard_True;
|
||||
@@ -661,7 +657,6 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
#else
|
||||
if(updMain) myCTX->CurrentViewer()->Update();
|
||||
#endif
|
||||
if(updColl) myCTX->Collector()->Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,7 +667,7 @@ void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
|
||||
void AIS_LocalContext::
|
||||
UnhilightPicked(const Standard_Boolean updateviewer)
|
||||
{
|
||||
Standard_Boolean updMain(Standard_False),updColl(Standard_False);
|
||||
Standard_Boolean updMain(Standard_False);
|
||||
|
||||
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
|
||||
#ifdef BUC60765
|
||||
@@ -711,11 +706,7 @@ UnhilightPicked(const Standard_Boolean updateviewer)
|
||||
Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
|
||||
HM = GetHiMod(IO);
|
||||
#endif
|
||||
if(myCTX->IsInCollector(IO)){
|
||||
PM = myCTX->CollectorPrsMgr();
|
||||
updColl = Standard_True;}
|
||||
else
|
||||
updMain = Standard_True;
|
||||
updMain = Standard_True;
|
||||
}
|
||||
else
|
||||
updMain = Standard_True;
|
||||
@@ -735,7 +726,6 @@ UnhilightPicked(const Standard_Boolean updateviewer)
|
||||
#else
|
||||
if(updMain) myCTX->CurrentViewer()->Update();
|
||||
#endif
|
||||
if(updColl) myCTX->Collector()->Update();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user