0024927: Getting rid of "Persistent" functionality -- Tests
[occt.git] / tests / caf / named_shape / E7
1 # =================== OCAF ======================
2 # Naming
3 #
4 # Testing purpose: Naming selection mechanism 
5 #
6 # Test case: E7 (ShapeOrientation is not  used)
7 # 1. Create box B2
8 # 2. Create prism Pr ($Prism)
9 # 3. Create full revolution R1
10 # 4. Translate R1 along XYZ
11 # 5. FS = Fuse (Pr, R1)
12 # 6. Create sectioned revolution R2
13 # 7. FS2 = Fuse (B2, R2)
14 # 8. FS3 = Fuse (B2, Prism)
15 # 9. Make  selections for all sub-shapes
16 # 10. Modify B2
17 # 11. Recompute modeling functions
18 # 12. Recompute selections
19 # ===============================================
20
21 #pload FULL
22 erase
23 Close D
24
25 NewDocument D BinOcaf
26
27 #Drivers' nick-names:
28 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
29 # order of functions recomputation should be defined out of the tool (by end user)
30 ## Test of transformation functions
31 AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol
32
33 #1 - create box using more flexible set of commands
34 NewCommand D
35 isos 12
36 set B2 [AddObject D];                   ## add object
37 set F2 [AddFunction D $B2 Box];         ## add function
38 BoxDX D $B2 190;                        ## set argumets of this function
39 BoxDY D $B2 290
40 BoxDZ D $B2 390
41 InitLogBook D;                          ## initialize (clean) internal maps of labels
42 ComputeFun D $F2;                       ## compute the function
43 GetShape D $F2:2 Box2;                  ## check result
44 fit
45 whatis Box2
46 GetReference D $B2;                     ## referes to result NS
47
48
49 #2 Prism  (after step #1)
50 explode Box2 F
51 set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
52 set Prism [AddPrism D $Sel1 300 0]
53 ComputeFun D $Prism:1
54 GetShape D $Prism:1:2 Pr
55
56 PrismHeight D $Prism 500
57 ComputeFun D $Prism:1
58 GetShape D $Prism:1:2 Pr
59 fit
60
61
62 #3 Revol Full
63 explode Box2 F
64 explode Box2_3 E
65 set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
66 set SAx1 [AttachShape D Box2_3_3 ${B2} ${B2} 0]
67 set FRev [AddRevol D $SBas1  $SAx1]
68 ComputeFun D $FRev:1
69 GetShape D $FRev:1:2 R1           
70
71 #4
72 NewCommand D
73 set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
74 ComputeFun D $FTr1;                     ## function recomputation
75 GetShape D $FTr1:2 R1;          ## get modified result
76
77 #5 => fuse
78 AddDriver D Fuse
79 set FS1 [AddFuse D $Prism $FRev]
80 ComputeFun D $FS1
81 GetShape D $FS1:2 Pr
82
83
84
85 #6 Revol Sectioned
86 GetShape D $F2:2 Box2;
87 explode Box2 F
88 explode Box2_2 E
89 set SBas2 [AttachShape D Box2_2 ${B2} ${B2} 0]
90 set SAx2 [AttachShape D Box2_2_3 ${B2} ${B2} 0]
91 set SRev [AddRevol D $SBas2  $SAx2 120 0]
92 ComputeFun D $SRev:1
93 GetShape D $SRev:1:2 R2
94
95 #7
96 set FS2 [AddFuse D $B2 $SRev]
97 ComputeFun D $FS2
98 GetShape D $FS2:2 Box2
99
100 #8
101 set FS3 [AddFuse D $B2 $Prism]
102 ComputeFun D $FS3
103 GetShape D $FS3:2 Box2
104
105 #9
106 NewCommand D 
107 set SL [TestSingleSelection D $B2 0]
108 set SL2 [TestMultipleSelection D $B2 0]
109 # both have failed units!!!
110
111 #10
112 NewCommand D
113 BoxDZ D $B2 420
114
115 #11 order of recomputation
116 NewCommand D
117 InitLogBook D;          ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
118 ComputeFun D $F2;       
119 ComputeFun D $Sel1:1
120 ComputeFun D $Prism:1
121 ComputeFun D $SBas1:1
122 ComputeFun D $SAx1:1
123 ComputeFun D $FRev:1
124 ComputeFun D $FTr1
125 ComputeFun D $FS1
126 ComputeFun D $SBas2:1
127 ComputeFun D $SAx2:1
128 ComputeFun D $SRev:1
129 ComputeFun D $FS2
130 ComputeFun D $FS3
131 GetShape D $FS3:2 Box2
132
133 #12
134 SolveFlatFrom D $SL
135 NewCommand D
136