File: F4

package info (click to toggle)
opencascade 7.9.2%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 301,924 kB
  • sloc: cpp: 1,523,264; tcl: 10,159; cs: 5,173; java: 1,554; sh: 1,342; ansic: 827; xml: 699; makefile: 30; javascript: 22
file content (81 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#INTERFACE CAF
# Basic attributes
#
# Testing attributes: TDataStd_Tick TDataStd_Directory TDataStd_NoteBook TDataXtd_Axis TDataXtd_Placement TDataXtd_Plane TDataXtd_Point TDataXtd_Shape 
#
# Testing command:   SetEmptyAttribute
# BinOcaf format open/save with these attributes

Label D 0:2

set IsGood 1

NewCommand D
SetEmptyAttribute D 0:2 TDataStd_Tick
SetEmptyAttribute D 0:2 TDataStd_Directory
SetEmptyAttribute D 0:2 TDataStd_NoteBook
SetEmptyAttribute D 0:2 TDataXtd_Axis
SetEmptyAttribute D 0:2 TDataXtd_Placement
SetEmptyAttribute D 0:2 TDataXtd_Plane
SetEmptyAttribute D 0:2 TDataXtd_Point
SetEmptyAttribute D 0:2 TDataXtd_Shape 
CommitCommand D

set aLen1 [llength [Attributes D 0:2]]
if { ${aLen1} != 8 } {
   set IsGood 0
   puts "Not all attributes were added aLen1=${aLen1}"
}

NewCommand D
# check forget attribute by its type
ForgetAtt D 0:2 TDataXtd_Point
CommitCommand D

set aLen2 [llength [Attributes D 0:2]]
if { ${aLen2} != ${aLen1} - 1 } {
   set IsGood 0
   puts "TDataXtd_Point was not removed from the label"
}

Undo D
Undo D

set aLen3 [llength [Attributes D 0:2]]
if { ${aLen3} != 0 } {
   set IsGood 0
   puts "Not all attributes were removed on Undo aLen3=${aLen3}"
}

Redo D

set aLen4 [llength [Attributes D 0:2]]
if { ${aLen4} != 8 } {
   set IsGood 0
   puts "Not all attributes were restored by Redo aLen4=${aLen4}"
}

set aFile ${imagedir}/caf001-F4.cbf
file delete ${aFile}
SaveAs D ${aFile}
if { ![file exists ${aFile}] } {
	puts "There is not ${aFile} file; SaveAs command: Error"
	return
}
Close D

Open ${aFile} DD

Label DD 0:2

set aLen5 [llength [Attributes DD 0:2]]
if { ${aLen5} != 8 } {
   set IsGood 0
   puts "Not all attributes were restored on Open aLen4=${aLen5}"
}

if { ${IsGood} == 0} {
  puts "Set empty attributes: Error"
} else {
  puts "Set empty attributes: OK"
}