0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
[occt.git] / tests / caf / presentation / B2
CommitLineData
40093367 1#INTERFACE CAF
2# Presentation attributes
3#
4# Testing attribute: TPrsStd_AISPresentation
5#
6# Testing command: AISColor
7# Testing command: AISHasOwnColor
8# Note: AISColor-command: set AISColor and set AISHasOwnColor = true ( int 1 )
9#
10
11puts "caf003-B2"
12
13# Set NamedShape attribute
14box aBox1 100 200 300
15set aLabel 0:2
16SetShape D ${aLabel} aBox1
17
18# Initialize 3D viewer
19AISInitViewer D
20
21# Add AISPresentation attribute with parameter NS
22AISSet D ${aLabel} NS
23
24# Display presentation of NamedShape in the viewer
25AISDisplay D ${aLabel}
26
27# Close/Open transaction
28NewCommand D
29
aaf8d6a9 30# Set a color of the shape
31AISColor D ${aLabel} GREEN
40093367 32
33# Close/Open transaction
34NewCommand D
35
36# Undo
37Undo D
38
39# Update the viewer
40AISRepaint D
41
42# Redo
43Redo D
44
45# Update the viewer
46AISRepaint D
47
48# Check own color
49set HasOwnColor [AISHasOwnColor D ${aLabel}]
50
51puts "It is not necessary to have the photo for this case."
52
53if { ${HasOwnColor} == 0 } {
54 puts "HasOwnColor=${HasOwnColor}"
55 puts "There is not own color; AISHasOwnColor command: Error"
56 return
57}
58puts "There is own color; AISHasOwnColor command: OK"