Adjusting testing cases for current state of OCCT
[occt.git] / tests / caf / named_shape / E4
1 # =================== OCAF ======================
2 # Naming
3 #
4 # Testing purpose: Naming selection mechanism 
5 #
6 # Test case: E4 (ShapeOrientation is not  used)
7 # 1. Create box B2
8 # 2. Create cylinder Cyl
9 # 3. Translate Cyl along XYZ
10 # 4. CS = Cut (B2, Cyl)
11 # 5. Make selection for all sub-shapes
12 # 6. Modify B2
13 # 7. Recompute modeling functions
14 # 8. Recompute selections
15 # ===============================================
16 #pload FULL
17
18 erase 
19 Close D 
20
21 NewDocument D MDTV-Standard
22
23 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
24
25 #1 Create Box
26 NewCommand D
27 set B2 [AddObject D];                   ## add object
28 set F2 [AddFunction D $B2 Box];         ## add function
29 BoxDX D $B2 190;                        ## set argumets of this function
30 BoxDY D $B2 290
31 BoxDZ D $B2 390
32 InitLogBook D;                          ## initialize (clean) internal maps of labels
33 ComputeFun D $F2;                       ## compute the function
34 GetShape D $F2:2 Box2;                  ## check result
35 whatis Box2
36 GetReference D $B2
37
38 #2 Create Cylinder
39 NewCommand D
40 explode Box2 F
41 explode Box2_1 E
42 set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment
43 ## AddDriver D Attach Cyl
44 set Cyl [AddCyl D 70 515 ${Sel1}]
45 ComputeFun D $Cyl:1
46 GetShape D $Cyl:1:2 CylS
47
48 #3 Translate Cylinder
49 NewCommand D
50 set FTr1 [PTranslateDXYZ D $Cyl 100 0 0]
51 ComputeFun D $FTr1
52 GetShape D $Cyl:2:2 CylS
53
54 #4 Cut Box Cyl
55 NewCommand D
56 set CS [AddCut D $B2 $Cyl]
57 ComputeFun D $CS
58 erase
59 GetShape D $CS:2 S
60 don S
61 NewCommand D
62
63 #5 test Naming
64 set SL [TestSingleSelection D $B2 0]
65 set SL2 [TestMultipleSelection D $B2 0]
66
67 #6 Modification
68 NewCommand D
69 BoxDX D $B2 250
70
71 #7 recompute
72 NewCommand D
73 InitLogBook D
74 ComputeFun D $F2
75 ComputeFun D $Sel1:1
76 ComputeFun D $Cyl:1
77 ComputeFun D $FTr1
78 ComputeFun D $CS
79 erase
80 GetShape D $CS:2 S
81 don S
82
83 #8 Recompute selections
84 SolveFlatFrom D $SL
85 NewCommand D
86