8f13d7954dc570d86712d0a05e5c81560d91dc78
[occt.git] / tests / caf / driver / A1
1 #1 - create box using more flexible set of commands
2 NewCommand D
3 set B2 [AddObject D];                   ## add object
4 set F2 [AddFunction D $B2 Box];         ## add function
5 BoxDX D $B2 190;                        ## set argumets of this function
6 BoxDY D $B2 290
7 BoxDZ D $B2 390
8 InitLogBook D;                          ## initialize (clean) internal maps of labels
9 AddDriver D Box Attach Cyl      
10 ComputeFun D $F2;                       ## compute the function
11 GetShape D $F2:2 Box2;                  ## check result
12 whatis Box2
13 GetReference D $B2;                     ## referes to result NS
14
15 #2 
16 NewCommand D
17 explode Box2 F
18 explode Box2_1 E
19 set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment
20 AddDriver D Attach Cyl
21 set Cyl [AddCyl D 30 315 ${Sel1}]
22 ComputeFun D $Cyl:1
23
24 #3 => cut
25 NewCommand D
26 AddDriver D Cut
27 set CS [AddCut D $B2 $Cyl]
28 ComputeFun D $CS
29 GetShape D $CS:2 S
30
31 #4 => Fillet
32 NewCommand D
33 explode S F
34 explode S_1 E
35 set Sel2 [AttachShape D S_1_1 ${B2} ${B2} 1]; ## set attachment for using in Fillet
36 AddDriver D Fillet
37 set Fill [AddFillet D $B2 25 $Sel2 0]
38 ComputeFun D $Fill
39 GetShape D $Fill:2 S
40
41
42 #5 test selection
43 NewCommand D
44 set SL [TestSingleSelection D $B2 0]
45 set SL2 [TestMultipleSelection D $B2 0]
46
47 #6 modification
48 NewCommand D
49 BoxDX D $B2 290
50
51 # recomputation
52 NewCommand D
53 InitLogBook D;          ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
54 ComputeFun D $F2;       
55 ComputeFun D $Sel1:1
56 ComputeFun D $Cyl:1
57 ComputeFun D $CS
58 ComputeFun D $Sel2:1
59 ComputeFun D $Fill
60 GetShape D $Fill:2 S
61 don S
62
63 SolveFlatFrom D $SL
64 NewCommand D