From: vpa Date: Tue, 21 Jul 2015 14:04:42 +0000 (+0300) Subject: 0026430: Visualization - segmentation fault in opened local context X-Git-Tag: V6_9_1_beta~48 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c6a60baab73466e8fcb8f1db54a90d55ab382600;p=occt-copy.git 0026430: Visualization - segmentation fault in opened local context - check for empty dataset in Select3D_SensitiveSet was added; - test case for issue #26430 --- diff --git a/src/Select3D/Select3D_SensitiveSet.cxx b/src/Select3D/Select3D_SensitiveSet.cxx index 9e618e25b7..02445f2bf9 100644 --- a/src/Select3D/Select3D_SensitiveSet.cxx +++ b/src/Select3D/Select3D_SensitiveSet.cxx @@ -53,8 +53,8 @@ Standard_Boolean Select3D_SensitiveSet::Matches (SelectBasics_SelectingVolumeMan thePickResult = SelectBasics_PickResult (RealLast(), RealLast()); - if (!theMgr.Overlaps (aBVH->MinPoint (0), - aBVH->MaxPoint (0))) + if (myContent->Size() < 1 || !theMgr.Overlaps (aBVH->MinPoint (0), + aBVH->MaxPoint (0))) { return Standard_False; } diff --git a/tests/bugs/vis/bug26430 b/tests/bugs/vis/bug26430 new file mode 100644 index 0000000000..9c1c8fbb0f --- /dev/null +++ b/tests/bugs/vis/bug26430 @@ -0,0 +1,46 @@ +puts "============" +puts "CR26430" +puts "============" +puts "" + +########################################################################################## +puts "Visualization - segmentation fault in opened local context" +########################################################################################## + +pload MODELING VISUALIZATION + +restore [locate_data_file bug26430.brep] aShape + +vinit View1 +vdisplay aShape +vfit +vsetdispmode aShape 1 + +vselmode aShape 1 1 +vselmode aShape 2 1 +vselmode aShape 3 1 +vselmode aShape 4 1 +vselmode aShape 5 1 + +# check selection for all problematic cases +vselect 125 155 +set aNbSelected [vnbselected] +if {$aNbSelected != 1} { + puts "ERROR: Vertex was not selected!" +} + +vselect 0 0 +vselect 121 155 130 160 +set aNbSelected [vnbselected] +if {$aNbSelected != 1} { + puts "ERROR: Vertex was not selected!" +} + +vselect 0 0 +vselect 100 100 200 200 +set aNbSelected [vnbselected] +if {$aNbSelected != 14} { + puts "ERROR: Vertex was not selected!" +} + +vdump ${imagedir}/${casename}