1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0024358: TKV3d - connected structures are not re-computed on device lost

Graphic3d_StructureManager::ReComputeStructures() method was corrected to consider all child (connected) structures.
Corrected remarks: added image dump in test case; corrected method name.
This commit is contained in:
aba 2014-02-13 13:09:42 +04:00 committed by abv
parent 58343d7cef
commit ac29779aa9
4 changed files with 53 additions and 5 deletions

View File

@ -459,10 +459,15 @@ is
---Purpose: Suppress the highlighting on the structure <AStructure>. ---Purpose: Suppress the highlighting on the structure <AStructure>.
---Category: Private methods ---Category: Private methods
ReComputeStructures (me: mutable); RecomputeStructures (me: mutable);
-- Purpose: Recomputes all displayed structures. Used to recompute GL -- Purpose: Recomputes all displayed structures. Used to recompute GL
-- resources after the last view has been closed without removing objects. -- resources after the last view has been closed without removing objects.
RecomputeStructures (me: mutable;
theStructures : MapOfStructure from Graphic3d)
is private;
---Purpose: Recomputes all structures from theStructures.
-- --
fields fields

View File

@ -369,13 +369,26 @@ const Handle(Graphic3d_GraphicDriver)& Graphic3d_StructureManager::GraphicDriver
} }
void Graphic3d_StructureManager::ReComputeStructures() void Graphic3d_StructureManager::RecomputeStructures()
{ {
// Go through all unique structures including child (connected) ones and ensure that they are computed.
Graphic3d_MapOfStructure aStructNetwork;
for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next()) for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next())
{ {
Handle(Graphic3d_Structure) aStructure = anIter.Key(); Handle(Graphic3d_Structure) aStructure = anIter.Key();
anIter.Key()->Network (anIter.Key(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
}
aStructure->Clear(); RecomputeStructures (aStructNetwork);
aStructure->Compute(); }
void Graphic3d_StructureManager::RecomputeStructures (const Graphic3d_MapOfStructure& theStructures)
{
for (Graphic3d_MapIteratorOfMapOfStructure anIter (theStructures); anIter.More(); anIter.Next())
{
Handle(Graphic3d_Structure) aStruct = anIter.Key();
aStruct->Clear();
aStruct->Compute();
} }
} }

View File

@ -1671,7 +1671,7 @@ void Visual3d_View::Update (const Handle(Visual3d_Layer)& AnUnderLayer, const Ha
if (MyGraphicDriver->IsDeviceLost()) if (MyGraphicDriver->IsDeviceLost())
{ {
MyViewManager->ReComputeStructures(); MyViewManager->RecomputeStructures();
MyGraphicDriver->ResetDeviceLostFlag(); MyGraphicDriver->ResetDeviceLostFlag();
} }

30
tests/bugs/vis/bug24358 Normal file
View File

@ -0,0 +1,30 @@
puts "==========="
puts "OCC24358"
puts "==========="
puts ""
###########################################################################
# 0024358: TKV3d - connected structures are not re-computed on device lost
###########################################################################
set Image1 $imagedir/${casename}_1.png
set Image2 $imagedir/${casename}_2.png
pload MODELING
pload VISUALIZATION
box b1 0 0 0 1 2 3
box b2 3 0 0 3 2 1
vinit View1
vclear
vaxo
vsetdispmode 1
vconnectsh b1c -3 0 0 1 0 0 0 0 1 b1 b2
vfit
vdump $Image1
vclose View1 1
vinit View1
vdisplay b1c
vfit
vdump $Image2