1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0031440: Visualization - Impossible to make common behaviour for multi-selection in viewer

A special mode for the selecting by polygon is added to select only completely overlapping objects.

In order to track the sensitives that were included completely by defined polygon, the boundary points of the polygonal frustrum are stored in the variable myBoundaryPoints.

If an sensitive intersects with at least one of the frustrums from myFrustums, then checking whether this object intersects with borders using the isIntersectBoundary method; if not, then the sensitive were included completely by defined polygon.

Because the polygon can be concave, then to check the sensitive were included completely by defined polygon, it is not enough to check of all its points, it is necessary that the edges of the sensitive do not intersect polygonal frustrum. To do this, for polygonal selection, a call to the Overlaps method for a point was replaced by a call to a segment where necessary.

bugs/vis/bug31440: test case added
This commit is contained in:
mzernova
2020-04-15 00:54:32 +03:00
committed by bugmaster
parent 5a2f31c887
commit a24a782174
14 changed files with 281 additions and 24 deletions

View File

@@ -15,7 +15,7 @@ vsetdispmode m 2
vselmode m 8 1
vselect 0 0 409 409 0 409
if { [vnbselected] != "56748" } { puts "Error: the number of selected elements differs for mode 8" }
if { [vnbselected] != "55607" } { puts "Error: the number of selected elements differs for mode 8" }
vdump $imagedir/${casename}_mode_8.png
vselect 0 0

34
tests/bugs/vis/bug31440 Normal file
View File

@@ -0,0 +1,34 @@
puts "============"
puts "0031440: Visualization - Impossible to make common behaviour for multi-selection in viewer"
puts "============"
puts ""
vinit View1
vpoint radP1 0 0 0
vpoint radP2 50 50 0
vpoint radP3 100 0 0
vcircle circle radP1 radP2 radP3 1
vfit
vselect 50 300 150 300 150 100 50 100
if {[vreadpixel 120 200 rgb name] != "DARKGOLDENROD"} { puts "ERROR: the circle is selected with no overlap mode activated" }
vselect 0 0
vselect 50 300 360 300 360 100 50 100
if {[vreadpixel 120 200 rgb name] != "GRAY73"} { puts "ERROR: the circle is not selected" }
vselect 0 0
vclear
box b 0 0 0 1 1 1
vdisplay b
vfit
vselmode b 2 1
vviewparams -scale 500
vdrawparray line polylines v 10 9 0 v 400 9 0 v 400 209 0 v 200 109 0 v 10 209 0 v 10 9 0
vdisplay line -2d
vsetcolor line red
vselect 10 400 400 400 400 200 200 300 10 200
vdump ${imagedir}/${casename}.png