0031075: Application Framework - reading STEP file into TDocStd_Document leads to...
[occt.git] / tests / bugs / xde / bug28044
CommitLineData
2df785d7 1puts "========"
2puts "OCC28044"
3puts "========"
4puts ""
5####################################################
6# Implement data structures in OCAF for Saved Views.
7####################################################
8
9pload OCAF
10
11# Create document with View
12box b 0 0 0 1 1 1
13box bb 2 2 2 1 1 1
14NewDocument D_First BinXCAF
15XAddShape D_First b
16# 0:1:1:1
17XAddShape D_First bb
18# 0:1:1:2
19explode b e
20XAddShape D_First b_1
21XAddDimension D_First b_1
22#0:1:4:1
23XSetDimensionType D_First 0:1:4:1 14
24XSetDimensionValue D_First 0:1:4:1 1
25#0:1:7:1
26XSetView D_First 0:1:1:1 0:1:1:2 0:1:4:1
27XSetViewName D_First 0:1:7:1 ALL
28XSetViewType D_First 0:1:7:1 parallel
29XSetViewProjectionPoint D_First 0:1:7:1 2 3 5
30XSetViewDir D_First 0:1:7:1 0 0 -1
31XSetViewUpDir D_First 0:1:7:1 0 1 0
32XSetViewZoom D_First 0:1:7:1 3
33XSetViewWindowSize D_First 0:1:7:1 480 640
34XSetViewFrontPlaneDistance D_First 0:1:7:1 10
35XSetViewVolumeSidesClipping D_First 0:1:7:1 1
36set first_view [XDumpView D_First 0:1:7:1]
37# Write file
38SaveAs D_First ${imagedir}/bug28044.xbf
39Close D_First
40# Read document
41XOpen ${imagedir}/bug28044.xbf D_Second
42set second_view [XDumpView D_Second 0:1:7:1]
43
44Close D_Second
45
46set ref_data {Reference shapes: 0:1:1:1 0:1:1:2
47Reference GD&Ts: 0:1:4:1
0c63f2f8 48Reference Clipping Planes:
2df785d7 49Name: ALL
50Type: parallel
51Projection point: 2 3 5
52View Direction: 0 0 -1
53Up Direction: 0 1 0
54Zoom factor: 3
55Window Size: width 480, height 640
56Front Plane Distance: 10
57Front Back Distance: 0
58View VolumeSized Clipping: 1
59}
60# Results validation
61set first_list [split $first_view \n]
62set second_list [split $second_view \n]
63set ref_list [split $ref_data \n]
64set err_compare_ref ""
65for { 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
77if {[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
83puts "TEST COMPLETED"