File: W5

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 (50 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (5)
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
#INTERFACE CAF
# Basic attributes
# Std documents
#
# Testing support of std format: reading standard attribute RealArray
#
# Testing command:   Open, GetRealArray.
#

puts "caf001-W5"
set QA_DUP 0

# Add an attribute to a data framework
set aSetAttr1 {1.1 1.2 1.3 1.4 1.5}
set aLabel 0:1
set aFile [locate_data_file caf001_realAr.std]
#Open a document
Open ${aFile} D

# Get a value of the attribute
set IsGood 1
set aMessage1 "Add TDataStd_RealArray attribute: Error"
set aGetAttr1 [GetRealArray D ${aLabel}]
set aLenRead [llength ${aGetAttr1}]
set aLenSet [llength ${aSetAttr1}]

if { ${aLenRead} != ${aLenSet} } {
   set IsGood 0
   puts "aLenRead=${aLenRead}"
   puts ${aMessage1}
}

if { ${IsGood} == 0}  return

for {set i 0} {$i < $aLenRead} {incr i} {
  set aGetAttr11 [lindex ${aGetAttr1} $i]
  set aGetAttr21 [lindex ${aSetAttr1} $i]
  if { ${aGetAttr11} != ${aGetAttr21} } {
     set IsGood 0;puts "i=${i}"
     puts "aGetAttr11=${aGetAttr11}"
     puts "aGetAttr21=${aGetAttr21}"
     break
     }
}

if { ${IsGood} == 0} {
  puts ${aMessage1}
} else {
  puts "Add TDataStd_RealArray attribute: OK"
}