6fdadd115b38d5fd2eb091584da31a8f648ee0c9
[occt.git] / tests / tools / dfbrowser / A5
1 pload TOPTEST
2 pload VISUALIZATION
3 pload XDE
4 pload QAcommands
5 pload DCAF
6
7 set Test "TNaming_Builder test"
8 set IsDone 1
9 set TestError ""
10
11 puts "Creating document"
12 NewDocument D MDTV-Standard
13 set TestLab 0:1
14
15 #################### PRIMITIVE EVOLUTION ####################
16 box b 100 200 300
17
18 explode b E
19 if {[catch {BuildNamedShape D $TestLab:1 PRIMITIVE b}] == 1} {
20         set IsDone 0
21         set TestError "$TestError # Can't build solid as primitive"
22 }
23 if {[catch {BuildNamedShape D [set TestLab]:1:1 PRIMITIVE b_1}] == 1} {
24         set IsDone 0
25         set TestError "$TestError # Can't build edge as alone primitive"
26 }
27 if {[catch {BuildNamedShape D [set TestLab]:1:1 PRIMITIVE b_1 b_2 b_3}] == 1} {
28         set IsDone 0
29         set TestError "$TestError # Can't build several edges as primitive over the old one"
30 }
31 if {[catch {BuildNamedShape D [set TestLab]:1:2 PRIMITIVE b_4 b_5 b_6}] == 1} {
32         set IsDone 0
33         set TestError "$TestError # Can't build several edges as primitive"
34 }
35
36
37 #################### GENERATED EVOLUTION ####################
38 box b2 200 300 400
39 explode b2 F
40 if {[catch {BuildNamedShape D $TestLab:2 GENERATED b b2}] == 1} {
41         set IsDone 0
42         set TestError "$TestError # Can't build solid as generation"
43 }
44 if {[catch {BuildNamedShape D [set TestLab]:2:1 GENERATED b_1 b2_1}] == 1} {
45         set IsDone 0
46         set TestError "$TestError # Can't build face as alone generation"
47 }
48 if {[catch {BuildNamedShape D [set TestLab]:2:2 GENERATED b_2 b2_2 b_2 b2_3 b_3 b2_4}] == 1} {
49         set IsDone 0
50         set TestError "$TestError # Can't build face as generation n:m"
51 }
52 if {[catch {BuildNamedShape D [set TestLab]:2:1 GENERATED b_3 b2_1 b_3 b2_3 b_4 b2_4}] == 1} {
53         set IsDone 0
54         set TestError "$TestError # Can't build face as generation n:m to the exists named shape"
55 }
56
57 #################### MODIFY EVOLUTION ####################
58 box b3 300 400 500
59 explode b3 F
60 if {[catch {BuildNamedShape D $TestLab:3 MODIFY b2 b3}] == 1} {
61         set IsDone 0
62         set TestError "$TestError # Can't build solid as modification"
63 }
64 if {[catch {BuildNamedShape D [set TestLab]:3:1 MODIFY b2_1 b3_1}] == 1} {
65         set IsDone 0
66         set TestError "$TestError # Can't build face as alone modification"
67 }
68 if {[catch {BuildNamedShape D [set TestLab]:3:2 MODIFY b2_5 b3_2 b2_2 b3_3 b2_3 b3_4}] == 1} {
69         set IsDone 0
70         set TestError "$TestError # Can't build face as modification n:m"
71 }
72 if {[catch {BuildNamedShape D [set TestLab]:3:1 MODIFY b2_3 b3_1 b_3 b3_3 b2_4 b3_4}] == 1} {
73         set IsDone 0
74         set TestError "$TestError # Can't build face as modification n:m to the exists named shape"
75 }
76
77 pload INSPECTOR
78 tinspector -select 0:1:3:2 TNaming_NamedShape