mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
Redesign of selection mechanism: - implemented 3-level BVH tree for selection; - selection now calculates in 3D space; - intersection tests were moved to SelectMgr_BaseFrustum descendants; - removed .cdl files in Select3D and .cdl related to selection in MeshVS; - SelectMgr_ViewerSelectors are now shared between local and global contexts; - transformations of sensitive entities are now stored in SelectMgr_SelectableObject only. Sensitive entities are independent from transformations, it is applied to SelectMgr_SelectingVolumeManager instance only; - connected and multiple connected interactive objects are now represented by their child objects only for SelectMgr_SelectionManager; - if interactive object has child objects, they will be stored as separate objects in SelectMgr_SelectionManager now. - test cases bugs/vis/bug24623_1, bug24623_2, bug24623_3, bug24623_4 to test performance and memory issues.
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
puts "============"
|
|
puts "OCC24623_3"
|
|
puts "============"
|
|
puts ""
|
|
#######################################################################
|
|
puts "Visualization - improve selection mechanism"
|
|
# tests memory leaks in creation of selection primitives for connected
|
|
# interactive objects: checks that there is no "dead links" in removing
|
|
# Select3D_BVHPrimitiveContent
|
|
#######################################################################
|
|
|
|
puts ""
|
|
pload MODELING VISUALIZATION
|
|
psphere s 0.5
|
|
tclean s
|
|
incmesh s 0.001
|
|
trinfo s
|
|
|
|
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} { vloadselection ss_${i}; vsetlocation -noupdate ss_${i} 0 0 s }
|
|
vfit
|
|
set aMemSel1 [meminfo h]
|
|
vclear
|
|
set aMemClear1 [meminfo h]
|
|
|
|
# display as connected instances of single presentation
|
|
vconnectto i_1 0 0 0 s -nodisplay
|
|
vloadselection i_1
|
|
for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 -nodisplay; vloadselection i_${i} }
|
|
set aMemSel2 [meminfo h]
|
|
vclear
|
|
set aMemClear2 [meminfo h]
|
|
|
|
puts "Initial memory : [expr $aMemInit / (1024 * 1024)] MiB"
|
|
puts "Compute selection (simple) : [expr $aMemSel1 / (1024 * 1024)] MiB"
|
|
puts "Clearing (simple) : [expr $aMemClear1 / (1024 * 1024)] MiB"
|
|
puts "Compute selection (connected): [expr $aMemSel2 / (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"
|
|
}
|