0030773: Application Framework - To allow to inherit existing attributes to reuse...
[occt.git] / tests / caf / basic / F4
CommitLineData
c99ad5d7 1#INTERFACE CAF
2# Basic attributes
3#
4# Testing attributes: TDataStd_Tick TDataStd_Directory TDataStd_NoteBook TDataXtd_Axis TDataXtd_Placement TDataXtd_Plane TDataXtd_Point TDataXtd_Shape
5#
6# Testing command: SetEmptyAttribute
7# BinOcaf format open/save with these attributes
8
9Label D 0:2
10
11set IsGood 1
12
13NewCommand D
14SetEmptyAttribute D 0:2 TDataStd_Tick
15SetEmptyAttribute D 0:2 TDataStd_Directory
16SetEmptyAttribute D 0:2 TDataStd_NoteBook
17SetEmptyAttribute D 0:2 TDataXtd_Axis
18SetEmptyAttribute D 0:2 TDataXtd_Placement
19SetEmptyAttribute D 0:2 TDataXtd_Plane
20SetEmptyAttribute D 0:2 TDataXtd_Point
21SetEmptyAttribute D 0:2 TDataXtd_Shape
22CommitCommand D
23
24set aLen1 [llength [Attributes D 0:2]]
25if { ${aLen1} != 8 } {
26 set IsGood 0
27 puts "Not all attributes were added aLen1=${aLen1}"
28}
29
30NewCommand D
31# check forget attribute by its type
32ForgetAtt D 0:2 TDataXtd_Point
33CommitCommand D
34
35set aLen2 [llength [Attributes D 0:2]]
36if { ${aLen2} != ${aLen1} - 1 } {
37 set IsGood 0
38 puts "TDataXtd_Point was not removed from the label"
39}
40
41Undo D
42Undo D
43
44set aLen3 [llength [Attributes D 0:2]]
45if { ${aLen3} != 0 } {
46 set IsGood 0
47 puts "Not all attributes were removed on Undo aLen3=${aLen3}"
48}
49
50Redo D
51
52set aLen4 [llength [Attributes D 0:2]]
53if { ${aLen4} != 8 } {
54 set IsGood 0
55 puts "Not all attributes were restored by Redo aLen4=${aLen4}"
56}
57
58set aFile ${imagedir}/caf001-F4.cbf
59file delete ${aFile}
60SaveAs D ${aFile}
61if { ![file exists ${aFile}] } {
62 puts "There is not ${aFile} file; SaveAs command: Error"
63 return
64}
65Close D
66
67Open ${aFile} DD
68
69Label DD 0:2
70
71set aLen5 [llength [Attributes DD 0:2]]
72if { ${aLen5} != 8 } {
73 set IsGood 0
74 puts "Not all attributes were restored on Open aLen4=${aLen5}"
75}
76
77if { ${IsGood} == 0} {
78 puts "Set empty attributes: Error"
79} else {
80 puts "Set empty attributes: OK"
81}