Adjusting testing cases for current state of OCCT
[occt.git] / tests / caf / presentation / D4
1 #INTERFACE CAF
2 # Presentation attributes
3 #
4 # Testing attribute: TPrsStd_AISPresentation
5 #
6 # Testing command:   AISMaterial
7 # Testing command:   AISHasOwnMaterial
8 # Note:   Numerical control of setting material
9 #
10
11 puts "caf003-D4"
12
13 # Set NamedShape attribute
14 box aBox1 100 200 300
15 set aLabel 0:2
16 SetShape D ${aLabel} aBox1
17
18 # Initialize 3D viewer
19 AISInitViewer D
20
21 # Add AISPresentation attribute with parameter NS
22 AISSet D ${aLabel} NS
23
24 # Set shading mode
25 vsetdispmode 1
26
27 # Display presentation of NamedShape in the viewer
28 AISDisplay D ${aLabel}
29
30 # Close/Open transaction
31 NewCommand D
32
33 # Set a material of the shape as NOM_JADE
34 set JadeMaterial 18
35 AISMaterial D ${aLabel} ${JadeMaterial}
36
37 # Close/Open transaction
38 NewCommand D
39
40 # Undo
41 Undo D
42
43 # Update the viewer
44 AISRepaint D
45
46 # Redo
47 Redo D
48
49 # Update the viewer
50 AISRepaint D
51
52 # Check the material
53 #set aMaterial [lindex [AISMaterial D ${aLabel}] 0]
54 set tmpLine [AISMaterial D ${aLabel}]
55 set tmpLength [llength ${tmpLine}]
56 set aMaterial [lindex ${tmpLine} [expr ${tmpLength} - 1]]
57
58 puts "It is not necessary to have the photo for this case."
59
60 if { ${aMaterial} != ${JadeMaterial} } {
61         puts "JadeMaterial=${JadeMaterial}"
62         puts "aMaterial=${aMaterial}"
63         puts "The box's material is not NOM_JADE; AISMaterial command: Error"
64         return
65 }
66 puts "The box's material is NOM_JADE; AISMaterial command: OK"