2df785d7 |
1 | puts "========" |
2 | puts "OCC28044" |
3 | puts "========" |
4 | puts "" |
5 | #################################################### |
6 | # Implement data structures in OCAF for Saved Views. |
7 | #################################################### |
8 | |
9 | pload OCAF |
10 | |
11 | # Create document with View |
12 | box b 0 0 0 1 1 1 |
13 | box bb 2 2 2 1 1 1 |
14 | NewDocument D_First BinXCAF |
15 | XAddShape D_First b |
16 | # 0:1:1:1 |
17 | XAddShape D_First bb |
18 | # 0:1:1:2 |
19 | explode b e |
20 | XAddShape D_First b_1 |
21 | XAddDimension D_First b_1 |
22 | #0:1:4:1 |
23 | XSetDimensionType D_First 0:1:4:1 14 |
24 | XSetDimensionValue D_First 0:1:4:1 1 |
25 | #0:1:7:1 |
26 | XSetView D_First 0:1:1:1 0:1:1:2 0:1:4:1 |
27 | XSetViewName D_First 0:1:7:1 ALL |
28 | XSetViewType D_First 0:1:7:1 parallel |
29 | XSetViewProjectionPoint D_First 0:1:7:1 2 3 5 |
30 | XSetViewDir D_First 0:1:7:1 0 0 -1 |
31 | XSetViewUpDir D_First 0:1:7:1 0 1 0 |
32 | XSetViewZoom D_First 0:1:7:1 3 |
33 | XSetViewWindowSize D_First 0:1:7:1 480 640 |
34 | XSetViewFrontPlaneDistance D_First 0:1:7:1 10 |
35 | XSetViewVolumeSidesClipping D_First 0:1:7:1 1 |
36 | set first_view [XDumpView D_First 0:1:7:1] |
37 | # Write file |
38 | SaveAs D_First ${imagedir}/bug28044.xbf |
39 | Close D_First |
40 | # Read document |
41 | XOpen ${imagedir}/bug28044.xbf D_Second |
42 | set second_view [XDumpView D_Second 0:1:7:1] |
43 | |
44 | Close D_Second |
45 | |
46 | set ref_data {Reference shapes: 0:1:1:1 0:1:1:2 |
47 | Reference GD&Ts: 0:1:4:1 |
0c63f2f8 |
48 | Reference Clipping Planes: |
2df785d7 |
49 | Name: ALL |
50 | Type: parallel |
51 | Projection point: 2 3 5 |
52 | View Direction: 0 0 -1 |
53 | Up Direction: 0 1 0 |
54 | Zoom factor: 3 |
55 | Window Size: width 480, height 640 |
56 | Front Plane Distance: 10 |
57 | Front Back Distance: 0 |
58 | View VolumeSized Clipping: 1 |
59 | } |
60 | # Results validation |
61 | set first_list [split $first_view \n] |
62 | set second_list [split $second_view \n] |
63 | set ref_list [split $ref_data \n] |
64 | set err_compare_ref "" |
65 | for { set i 0 } { $i < 12 } { incr i } { |
66 | set isOK 1 |
67 | set first [lindex $first_list $i] |
68 | set second [lindex $second_list $i] |
69 | set ref [lindex $ref_list $i] |
70 | if {$ref != $first} {set isOK 0} |
71 | if {$ref != $second} {set isOK 0} |
72 | if {$isOK == 0} { |
73 | append err_compare_ref "$ref\n" |
74 | } |
75 | } |
76 | |
77 | if {[llength $err_compare_ref] > 0} { |
78 | puts "Error : differences with reference data found :\n$err_compare_ref" |
79 | } else { |
80 | puts "Comparision of current result with reference data - OK\n" |
81 | } |
82 | |
83 | puts "TEST COMPLETED" |