File: N1

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 (70 lines) | stat: -rw-r--r-- 1,364 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#INTERFACE CAF
# Basic attributes
#
# Testing attribute: TDataStd_Triangulation
#
# Testing command:   SetTriangulation
# Testing command:   DumpTriangulation
#

puts "caf001-N1"
set FileName_1 $imagedir/caf001-N1_1.cbf
set FileName_2 $imagedir/caf001-N1_2.cbf

# Make a box and produce triangulation
psphere s 10
explode s f
incmesh s_1 10 -a 90

# Set triangulation from the box's face
Format D BinOcaf
SetTriangulation D 0:1 s_1
CommitCommand D

# Save document on disk.
# First transaction before Undo/Redo
SaveAs D $FileName_1

incmesh s_1 1 -a 15

OpenCommand D
SetTriangulation D 0:1 s_1
CommitCommand D

# Save document on disk.
# Second transaction before Undo/Redo
SaveAs D $FileName_2

# Test Undo/Redo.
Undo D

# Print the mesh data after first transaction
set dump1_bfr [DumpTriangulation D 0:1]

Redo D

# Print the mesh data after second transaction
set dump2_bfr [DumpTriangulation D 0:1]

Close D

# Restore data after first and second transactions
Open $FileName_1 D_1
Open $FileName_2 D_2

set dump1_aft [DumpTriangulation D_1 0:1]
set dump2_aft [DumpTriangulation D_2 0:1]

Close D_1
Close D_2

# Check data
if { ${dump1_bfr}!=${dump1_aft} } {
  puts "TDataStd_Triangulation attribute: Error"
  return
}
if { ${dump2_bfr}!=${dump2_aft} } {
  puts "TDataStd_Triangulation attribute: Error"
  return
}
puts "TDataStd_Triangulation attribute: OK"