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:
@@ -205,15 +205,6 @@ is
|
||||
is deferred;
|
||||
---Purpose: call_togl_markercontextgroup
|
||||
|
||||
MarkerContextGroup ( me : mutable;
|
||||
ACGroup : CGroup from Graphic3d;
|
||||
NoInsert : Integer from Standard;
|
||||
AMarkWidth : Integer from Standard;
|
||||
AMarkHeight: Integer from Standard;
|
||||
ATexture : HArray1OfByte from TColStd )
|
||||
is deferred;
|
||||
---Purpose: call_togl_markercontextgroup
|
||||
|
||||
RemoveGroup ( me : mutable;
|
||||
ACGroup : CGroup from Graphic3d )
|
||||
is deferred;
|
||||
@@ -1028,10 +1019,18 @@ is
|
||||
|
||||
---Purpose: returns Handle to display connection
|
||||
|
||||
IsDeviceLost (me)
|
||||
returns Boolean from Standard;
|
||||
-- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
|
||||
|
||||
ResetDeviceLostFlag (me: mutable);
|
||||
-- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
|
||||
|
||||
fields
|
||||
|
||||
MyTraceLevel : Integer from Standard is protected;
|
||||
MySharedLibrary : SharedLibrary from OSD is protected;
|
||||
myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
|
||||
myDeviceLostFlag : Boolean from Standard is protected;
|
||||
|
||||
end GraphicDriver from Graphic3d;
|
||||
|
@@ -48,6 +48,7 @@ Graphic3d_GraphicDriver::Graphic3d_GraphicDriver (const Standard_CString AShrNam
|
||||
|
||||
SetTrace (0);
|
||||
MySharedLibrary.SetName (AShrName);
|
||||
myDeviceLostFlag = Standard_False;
|
||||
|
||||
//if (! MySharedLibrary.DlOpen (OSD_RTLD_LAZY))
|
||||
//Aspect_DriverDefinitionError::Raise (MySharedLibrary.DlError ());
|
||||
@@ -222,3 +223,13 @@ const Handle(Aspect_DisplayConnection)& Graphic3d_GraphicDriver::GetDisplayConne
|
||||
{
|
||||
return myDisplayConnection;
|
||||
}
|
||||
|
||||
Standard_Boolean Graphic3d_GraphicDriver::IsDeviceLost() const
|
||||
{
|
||||
return myDeviceLostFlag;
|
||||
}
|
||||
|
||||
void Graphic3d_GraphicDriver::ResetDeviceLostFlag()
|
||||
{
|
||||
myDeviceLostFlag = Standard_False;
|
||||
}
|
||||
|
@@ -382,6 +382,11 @@ is
|
||||
-- Category: Compute methods
|
||||
----------------------------
|
||||
|
||||
Compute (me: mutable)
|
||||
is virtual;
|
||||
---Level: Advanced
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
Compute ( me : mutable;
|
||||
aProjector : DataStructureManager from Graphic3d )
|
||||
returns Structure from Graphic3d is virtual;
|
||||
|
@@ -298,6 +298,7 @@ void Graphic3d_Structure::Display () {
|
||||
MyStructureManager->Display (this);
|
||||
}
|
||||
|
||||
MyCStructure.visible = 1;
|
||||
}
|
||||
|
||||
void Graphic3d_Structure::Display (const Standard_Integer Priority) {
|
||||
@@ -311,6 +312,7 @@ void Graphic3d_Structure::Display (const Standard_Integer Priority) {
|
||||
MyStructureManager->Display (this);
|
||||
}
|
||||
|
||||
MyCStructure.visible = 1;
|
||||
}
|
||||
|
||||
void Graphic3d_Structure::SetDisplayPriority (const Standard_Integer Priority) {
|
||||
@@ -438,11 +440,6 @@ void Graphic3d_Structure::SetVisible (const Standard_Boolean AValue) {
|
||||
|
||||
MyGraphicDriver->NameSetStructure (MyCStructure);
|
||||
|
||||
if (AValue)
|
||||
MyStructureManager->Visible (this);
|
||||
else
|
||||
MyStructureManager->Invisible (this);
|
||||
|
||||
Update ();
|
||||
|
||||
}
|
||||
@@ -651,6 +648,11 @@ void Graphic3d_Structure::GroupsWithFacet (const Standard_Integer ADelta) {
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_Structure::Compute()
|
||||
{
|
||||
// Implemented by Presentation
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Structure) Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& ) {
|
||||
|
||||
// Implemented by Presentation
|
||||
@@ -2420,11 +2422,6 @@ void Graphic3d_Structure::SetManager (const Handle(Graphic3d_StructureManager)&
|
||||
if (MyCStructure.highlight) {
|
||||
}
|
||||
|
||||
if (MyCStructure.visible) {
|
||||
MyStructureManager->Invisible (this);
|
||||
AManager->Visible (this);
|
||||
}
|
||||
|
||||
if (MyCStructure.pick) {
|
||||
MyStructureManager->Undetectable (this);
|
||||
AManager->Detectable (this);
|
||||
|
@@ -202,13 +202,6 @@ is
|
||||
-- in a visualiser <me>.
|
||||
---Category: Inquire methods, MapOfStructure
|
||||
|
||||
VisibleStructures ( me; SG: in out MapOfStructure from Graphic3d )
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the set of visible structures
|
||||
-- in a visualiser <me>.
|
||||
---Category: Inquire methods, MapOfStructure
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
@@ -418,13 +411,6 @@ is
|
||||
---Category: Private methods
|
||||
---C++: return const &
|
||||
|
||||
Invisible ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Sets invisible the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
Identification ( me )
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
@@ -477,13 +463,10 @@ is
|
||||
---Purpose: Suppress the highlighting on the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
Visible ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Sets visible the structure <AStructure>.
|
||||
-- in the manager.
|
||||
---Category: Private methods
|
||||
ReComputeStructures (me: mutable);
|
||||
-- Purpose: Recomputes all displayed structures. Used to recompute GL
|
||||
-- resources after the last view has been closed without removing objects.
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
@@ -519,10 +502,6 @@ fields
|
||||
MyHighlightedStructure : MapOfStructure from Graphic3d
|
||||
is protected;
|
||||
|
||||
-- the visible structures
|
||||
MyVisibleStructure : MapOfStructure from Graphic3d
|
||||
is protected;
|
||||
|
||||
-- the pickable structures
|
||||
MyPickStructure : MapOfStructure from Graphic3d
|
||||
is protected;
|
||||
|
@@ -66,9 +66,6 @@ static Standard_Integer StructureManager_CurrentId = 0;
|
||||
// -- les structures mises en evidence
|
||||
// MyHighlightedStructure : SequenceOfStructure;
|
||||
|
||||
// -- les structures visibles
|
||||
// MyVisibleStructure : SequenceOfStructure;
|
||||
|
||||
// -- les structures detectables
|
||||
// MyPickStructure : SequenceOfStructure;
|
||||
|
||||
@@ -80,7 +77,6 @@ static Standard_Integer StructureManager_CurrentId = 0;
|
||||
Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver):
|
||||
MyDisplayedStructure (),
|
||||
MyHighlightedStructure (),
|
||||
MyVisibleStructure (),
|
||||
MyPickStructure () {
|
||||
|
||||
Standard_Real Coef;
|
||||
@@ -145,7 +141,6 @@ void Graphic3d_StructureManager::Destroy () {
|
||||
|
||||
MyDisplayedStructure.Clear ();
|
||||
MyHighlightedStructure.Clear ();
|
||||
MyVisibleStructure.Clear ();
|
||||
MyPickStructure.Clear ();
|
||||
StructureManager_ArrayId[MyId] = 0;
|
||||
|
||||
@@ -232,18 +227,6 @@ void Graphic3d_StructureManager::Remove (const Standard_Integer AnId) {
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::Visible (const Handle(Graphic3d_Structure)& AStructure) {
|
||||
|
||||
MyVisibleStructure.Add(AStructure);
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::Invisible (const Handle(Graphic3d_Structure)& AStructure) {
|
||||
|
||||
MyVisibleStructure.Remove(AStructure);
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::Detectable (const Handle(Graphic3d_Structure)& AStructure) {
|
||||
|
||||
MyPickStructure.Add(AStructure);
|
||||
@@ -293,13 +276,6 @@ void Graphic3d_StructureManager::PickStructures (Graphic3d_MapOfStructure& SG) c
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::VisibleStructures (Graphic3d_MapOfStructure& SG) const {
|
||||
|
||||
SG.Assign(MyVisibleStructure);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
|
||||
|
||||
Standard_Boolean Flag = Standard_True;
|
||||
@@ -397,3 +373,14 @@ const Handle(Graphic3d_GraphicDriver)& Graphic3d_StructureManager::GraphicDriver
|
||||
return (MyGraphicDriver);
|
||||
|
||||
}
|
||||
|
||||
void Graphic3d_StructureManager::ReComputeStructures()
|
||||
{
|
||||
for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next())
|
||||
{
|
||||
Handle(Graphic3d_Structure) aStructure = anIter.Key();
|
||||
|
||||
aStructure->Clear();
|
||||
aStructure->Compute();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user