mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +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:
parent
5495fa7e65
commit
8bb96a9760
@ -459,10 +459,15 @@ is
|
||||
---Purpose: Suppress the highlighting on the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
ReComputeStructures (me: mutable);
|
||||
RecomputeStructures (me: mutable);
|
||||
-- Purpose: Recomputes all displayed structures. Used to recompute GL
|
||||
-- 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
|
||||
|
@ -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())
|
||||
{
|
||||
Handle(Graphic3d_Structure) aStructure = anIter.Key();
|
||||
anIter.Key()->Network (anIter.Key(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
|
||||
}
|
||||
|
||||
aStructure->Clear();
|
||||
aStructure->Compute();
|
||||
RecomputeStructures (aStructNetwork);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -1117,7 +1117,7 @@ void Visual3d_View::Update (const Handle(Visual3d_Layer)& AnUnderLayer, const Ha
|
||||
|
||||
if (MyGraphicDriver->IsDeviceLost())
|
||||
{
|
||||
MyViewManager->ReComputeStructures();
|
||||
MyViewManager->RecomputeStructures();
|
||||
MyGraphicDriver->ResetDeviceLostFlag();
|
||||
}
|
||||
|
||||
|
30
tests/bugs/vis/bug24358
Normal file
30
tests/bugs/vis/bug24358
Normal 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
|
Loading…
x
Reference in New Issue
Block a user