0028095: Draw Harness, ViewerTest - use RGBA format instead of BGRA within vreadpixel
[occt.git] / tests / caf / named_shape / E7
CommitLineData
efd4b232 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
40093367 21erase
22Close D
24de79c3 23
e837410d 24NewDocument D BinOcaf
40093367 25
26#Drivers' nick-names:
27#Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
28# order of functions recomputation should be defined out of the tool (by end user)
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
48#2 Prism (after step #1)
49explode Box2 F
50set Sel1 [AttachShape D Box2_1 ${B2} ${B2} 0]
51set Prism [AddPrism D $Sel1 300 0]
52ComputeFun D $Prism:1
53GetShape D $Prism:1:2 Pr
54
55PrismHeight D $Prism 500
56ComputeFun D $Prism:1
57GetShape D $Prism:1:2 Pr
58fit
59
60
61#3 Revol Full
62explode Box2 F
63explode Box2_3 E
64set SBas1 [AttachShape D Box2_3 ${B2} ${B2} 0]
65set SAx1 [AttachShape D Box2_3_3 ${B2} ${B2} 0]
66set FRev [AddRevol D $SBas1 $SAx1]
67ComputeFun D $FRev:1
68GetShape D $FRev:1:2 R1
69
efd4b232 70#4
40093367 71NewCommand D
72set FTr1 [PTranslateDXYZ D $FRev -250 0 0]
73ComputeFun D $FTr1; ## function recomputation
74GetShape D $FTr1:2 R1; ## get modified result
75
efd4b232 76#5 => fuse
40093367 77AddDriver D Fuse
78set FS1 [AddFuse D $Prism $FRev]
79ComputeFun D $FS1
80GetShape D $FS1:2 Pr
81
82
83
efd4b232 84#6 Revol Sectioned
40093367 85GetShape D $F2:2 Box2;
86explode Box2 F
87explode Box2_2 E
88set SBas2 [AttachShape D Box2_2 ${B2} ${B2} 0]
89set SAx2 [AttachShape D Box2_2_3 ${B2} ${B2} 0]
90set SRev [AddRevol D $SBas2 $SAx2 120 0]
91ComputeFun D $SRev:1
92GetShape D $SRev:1:2 R2
93
efd4b232 94#7
40093367 95set FS2 [AddFuse D $B2 $SRev]
96ComputeFun D $FS2
97GetShape D $FS2:2 Box2
98
efd4b232 99#8
40093367 100set FS3 [AddFuse D $B2 $Prism]
101ComputeFun D $FS3
102GetShape D $FS3:2 Box2
103
efd4b232 104#9
40093367 105NewCommand D
106set SL [TestSingleSelection D $B2 0]
107set SL2 [TestMultipleSelection D $B2 0]
108# both have failed units!!!
109
efd4b232 110#10
40093367 111NewCommand D
112BoxDZ D $B2 420
113
efd4b232 114#11 order of recomputation
40093367 115NewCommand D
116InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
117ComputeFun D $F2;
118ComputeFun D $Sel1:1
119ComputeFun D $Prism:1
120ComputeFun D $SBas1:1
121ComputeFun D $SAx1:1
122ComputeFun D $FRev:1
123ComputeFun D $FTr1
124ComputeFun D $FS1
125ComputeFun D $SBas2:1
126ComputeFun D $SAx2:1
127ComputeFun D $SRev:1
128ComputeFun D $FS2
129ComputeFun D $FS3
130GetShape D $FS3:2 Box2
131
efd4b232 132#12
40093367 133SolveFlatFrom D $SL
134NewCommand D
135