From c8be748cd45d75c6d25687fbbff653e0f29d8260 Mon Sep 17 00:00:00 2001 From: dbp Date: Thu, 15 Jan 2015 14:37:12 +0300 Subject: [PATCH] 0025532: Visualization - fix cross-references between AIS_ConnectedInteractive and connected presentation New test case added. --- src/AIS/AIS_ConnectedInteractive.cxx | 2 -- tests/bugs/vis/bug25532 | 54 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/vis/bug25532 diff --git a/src/AIS/AIS_ConnectedInteractive.cxx b/src/AIS/AIS_ConnectedInteractive.cxx index f80bdc2adc..74c2dc898f 100644 --- a/src/AIS/AIS_ConnectedInteractive.cxx +++ b/src/AIS/AIS_ConnectedInteractive.cxx @@ -96,8 +96,6 @@ void AIS_ConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& the { myTypeOfPresentation3d = myReference->TypeOfPresentation3d(); } - - theAnotherObj->AddChild (this); } //======================================================================= diff --git a/tests/bugs/vis/bug25532 b/tests/bugs/vis/bug25532 new file mode 100644 index 0000000000..3b39479462 --- /dev/null +++ b/tests/bugs/vis/bug25532 @@ -0,0 +1,54 @@ +puts "============" +puts "OCC25532" +puts "============" +puts "" +####################################################################### +# Visualization - fix cross-references between AIS_ConnectedInteractive +# and connected presentation +####################################################################### + +pload MODELING VISUALIZATION +psphere s 0.5 +tclean s +incmesh s 0.001 +trinfo s + +vinit View1 +vclear +vaxo +vcaps -vbo 0 +vsetdispmode 1 +vdefaults absDefl=1.0 +set aMemInit [meminfo h] + +set aNb 1000 + +# display as copies +eval compound [lrepeat $aNb s] ss +explode ss +for {set i 1} {$i <= $aNb} {incr i} { vdisplay -noupdate ss_${i}; vsetlocation -noupdate ss_${i} 0 0 s } +vfit +set aMemDisp1 [meminfo h] +vclear +set aMemClear1 [meminfo h] + +# display as connected instances of single presentation +vconnectto i_1 0 0 0 s +for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 } +set aMemDisp2 [meminfo h] +vclear +set aMemClear2 [meminfo h] + +puts "Initial memory: [expr $aMemInit / (1024 * 1024)] MiB" +puts "Displaying (simple): [expr $aMemDisp1 / (1024 * 1024)] MiB" +puts "Clearing (simple): [expr $aMemClear1 / (1024 * 1024)] MiB" +puts "Displaying (connected): [expr $aMemDisp2 / (1024 * 1024)] MiB" +puts "Clearing (connected): [expr $aMemClear2 / (1024 * 1024)] MiB" + +set aRatio [expr $aMemClear2 / double($aMemClear1)] + +# check if the memory difference is greater than 10% +if [expr $aRatio > 1.1] { + puts "Error : TEST FAILED" +} +