0024927: Getting rid of "Persistent" functionality -- Tests
[occt.git] / tests / caf / named_shape / E8
CommitLineData
efd4b232 1# =================== OCAF ======================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: E8 (ShapeOrientation is not used)
7# 1. Create box B2
8# 2. Create sectioned revolution R1 ($SRev1)
9# 3. Create sectioned revolution R2 ($SRev2)
10# 4. Create sectioned revolution R3 ($SRev3)
11# 5. ($FS1)R1 = Fuse (R1, R2)
12# 6. ($FS2)R1 = Fuse (R1, R3)
13# 7. Make selections for all sub-shapes
14# 8. Modify B2
15# 9. Recompute modeling functions
16# 10. Recompute selections
17# ===============================================
18
40093367 19#pload FULL
40093367 20erase
21Close D
24de79c3 22
e837410d 23NewDocument D BinOcaf
40093367 24
25#Drivers' nick-names:
26#Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
27# order of functions recomputation should be defined out of the tool (by end user)
28
40093367 29## Test of transformation functions
30AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol
efd4b232 31
40093367 32#1 - create box using more flexible set of commands
33NewCommand D
34isos 12
35set B2 [AddObject D]; ## add object
36set F2 [AddFunction D $B2 Box]; ## add function
37BoxDX D $B2 190; ## set argumets of this function
38BoxDY D $B2 290
39BoxDZ D $B2 390
40InitLogBook D; ## initialize (clean) internal maps of labels
41ComputeFun D $F2; ## compute the function
42GetShape D $F2:2 Box2; ## check result
43fit
44whatis Box2
45GetReference D $B2; ## referes to result NS
46
47#2 Revol Sectioned
48explode Box2 F
49explode Box2_3 E
50set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
51set SAx1 [AttachShape D Box2_3_2 ${B2} ${B2} 0]
52set SRev1 [AddRevol D $SBas1 $SAx1 120 0]
53ComputeFun D $SRev1:1
54GetShape D $SRev1:1:2 R1
55don R1
56
57
58#3
59explode R1 F
60explode R1_5 E
61set SBas2 [AttachShape D R1_5 ${SRev1} ${SRev1} 0]
62set SAx2 [AttachShape D R1_5_2 ${SRev1} ${SRev1} 0]
63set SRev2 [AddRevol D $SBas2 $SAx2 120 0]
64ComputeFun D $SRev2:1
65GetShape D $SRev2:1:2 R2
66
67#4
68explode R2 F
69explode R2_5 E
70set SBas3 [AttachShape D R2_5 ${SRev2} ${SRev2} 0]
71set SAx3 [AttachShape D R2_5_2 ${SRev2} ${SRev2} 0]
72set SRev3 [AddRevol D $SBas3 $SAx3 120 0]
73ComputeFun D $SRev3:1
74GetShape D $SRev3:1:2 R2
75
efd4b232 76#5
40093367 77AddDriver D Fuse
78set FS1 [AddFuse D $SRev1 $SRev2]
79ComputeFun D $FS1
80GetShape D $FS1:2 R1
81
efd4b232 82#6
40093367 83set FS2 [AddFuse D $SRev1 $SRev3]
84ComputeFun D $FS2
85GetShape D $FS2:2 R1
86
efd4b232 87#7
40093367 88NewCommand D
89set SL [TestSingleSelection D $B2 0]
90set SL2 [TestMultipleSelection D $B2 0]
91
efd4b232 92#8
40093367 93NewCommand D
94BoxDZ D $B2 420
95
efd4b232 96#9 order of recomputation
40093367 97NewCommand D
98InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
99ComputeFun D $F2;
100ComputeFun D $SBas1:1
101ComputeFun D $SAx1:1
102ComputeFun D $SRev1:1
103ComputeFun D $SBas2:1
104ComputeFun D $SAx2:1
105ComputeFun D $SRev2:1
106ComputeFun D $SBas3:1
107ComputeFun D $SAx3:1
108ComputeFun D $SRev3:1
109ComputeFun D $FS1
110ComputeFun D $FS2
111GetShape D $FS2:2 R1
112
efd4b232 113#10
40093367 114SolveFlatFrom D $SL
115NewCommand D
116