0032203: Draw Harness, ViewerTest - drop dependency from OpenGL
[occt.git] / tests / caf / bugs / B6
1 #INTERFACE CAF
2 #
3 #Sometimes this error is inside a log file, but it is outside in other case. The '?' character manage it.
4 #
5 puts "================"
6 puts "OCC1228"
7 puts "================"
8 puts ""
9
10 pload VISUALIZATION
11
12 # Presentation attributes
13 #
14 # Testing attribute: TPrsStd_AISPresentation
15 #
16 # Testing command:   AISSet
17 #
18
19 # ANALOG: puts "caf003-A4"
20
21 # Create a new document and set UndoLimit
22 NewDocument Doc BinOcaf
23 UndoLimit Doc 100
24
25 # Open a transaction
26 NewCommand Doc
27
28 # Set NamedShape attribute
29 box aBox1 100 200 300
30 set aLabel 0:2
31 SetShape Doc ${aLabel} aBox1
32
33 # Initialize 3D viewer
34 AISInitViewer Doc
35
36 # Add AISPresentation attribute with parameter NS
37 AISSet Doc ${aLabel} NS
38
39 # Display presentation of NamedShape in the viewer
40 AISDisplay Doc ${aLabel}
41
42 # Save the document
43 set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf
44 file delete ${aFile}
45 catch {SaveAs Doc ${aFile}}
46 if { ![file exists ${aFile}] } {
47         puts "There is not ${aFile} file; SaveAs command: Error"
48         puts "OCC1228: ERROR (case 1)"
49 }
50 #catch {exec chmod 777 ${aFile}}
51
52 # Restore the document
53 Close Doc
54 catch {Open ${aFile} DDoc}
55
56 # Initialize 3D viewer
57 catch {AISInitViewer DDoc}
58
59 ########## Add AISPresentation attribute with parameter NS
60 ##########AISSet DDoc ${aLabel} NS
61
62 # Display presentation of NamedShape in the viewer
63 set IsDone [catch {AISDisplay DDoc ${aLabel}} aResult]
64 if { ${IsDone} != 0 } {
65         puts ${aResult}
66         puts "Get a value of TPrsStd_AISPresentation attribute from restoring document: Error"
67         puts "OCC1228: ERROR (case 2)"
68 } else {
69         Close DDoc
70         puts "There is the box in the viewer"
71         puts "OCC1228: OK"
72 }