0027126: Create command checktrinfo to verify meshes
[occt.git] / tests / bugs / vis / bug26973
1 puts "============"
2 puts "CR26973"
3 puts "============"
4 puts ""
5
6 ##########################################################################################
7 puts "Visualization - selection of entities hidden by clipping planes is broken"
8 ##########################################################################################
9
10 pload MODELING VISUALIZATION
11
12 vinit View1
13 vclear
14 vaxo
15 vsetdispmode 1
16
17 proc OCC26973 { toTestViewPlanes toApplyTrsf theImgIdr theCaseName} {
18   if {$toApplyTrsf == "1"} {
19     box b -100 -100 -100 1 1 1
20     ttranslate b 100 100 100
21   } else {
22     box b 1 1 1
23   }
24
25   vdisplay b
26   vfit
27   vselmode b 4 1
28
29   vclipplane create pln
30   if {$toTestViewPlanes == "1"} {
31     vclipplane set pln view Driver1/Viewer1/View1
32   } else {
33     vclipplane set pln object b
34   }
35   vclipplane change pln equation 0 1 0 -0.5
36
37   vselect 200 140
38   set aTestInfo "Test case: "
39   append aTestInfo "clipping planes applied to "
40   set aDumpFileName $theImgIdr/${theCaseName}
41   if {$toTestViewPlanes == "1"} {
42     append aTestInfo "view, "
43     append aDumpFileName "_view"
44   } else {
45     append aTestInfo "object, "
46     append aDumpFileName "_obj"
47   }
48   append aTestInfo "object trsf is "
49   if {$toApplyTrsf == "1"} {
50     append aTestInfo "on"
51     append aDumpFileName "_with_trsf.png"
52   } else {
53     append aTestInfo "off"
54     append aDumpFileName "_wo_trsf.png"
55   }
56
57   if {[vnbselected] != 1} {
58     puts "ERROR: can not select face."
59     puts $aTestInfo
60   }
61   set aSelectedFace [string trim [lindex [split [vstate] "\n"] 1] ]
62   if {$aSelectedFace != "Face #1"} {
63     puts "ERROR: wrong face is selected."
64     puts "Actually seleced face: $aSelectedFace"
65     puts $aTestInfo
66   }
67
68   vdump $aDumpFileName
69   vremove -all
70   vclipplane delete pln
71 }
72
73 # check global clipping planes selection
74 OCC26973 1 0 $imagedir $casename
75 OCC26973 1 1 $imagedir $casename
76
77 # check object clipping planes selection
78 OCC26973 0 0 $imagedir $casename
79 OCC26973 0 1 $imagedir $casename