File: bug22776

package info (click to toggle)
oce 0.17.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 297,992 kB
  • ctags: 203,291
  • sloc: cpp: 1,176,369; ansic: 67,206; sh: 11,647; tcl: 6,890; cs: 5,221; python: 2,867; java: 1,522; makefile: 338; xml: 292; perl: 37
file content (124 lines) | stat: -rw-r--r-- 2,795 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
puts "================"
puts "OCC22776"
puts "================"
puts ""
#######################################################################################
# XCAFPrs_AISObject does not support transparency
######################################################################################

catch {pload DCAF}
pload QAcommands

NewDocument D MDTV-Standard
UndoLimit D 100
NewCommand D

#Set NamedShape attribute
box Box 100 200 300
set Label 0:2
SetShape D ${Label} Box

# Initialize 3D viewer
AISInitViewer D

# Add AISPresentation attribute with parameter NS
AISSet D ${Label} NS

# Set shading mode
vsetdispmode 1

# Display presentation of NamedShape in the viewer
AISDisplay D ${Label}

# Close/Open transaction
NewCommand D

set list [OCC1031_AISMaterial D ${Label}]
regexp {Material = ([-0-9.+eE]+)} $list full AISMaterial1

# Set a material of the shape as NOM_COPPER
set CopperMaterial 2
OCC1031_AISMaterial D ${Label} ${CopperMaterial}

set list [OCC1031_AISMaterial D ${Label}]
regexp {Material = ([-0-9.+eE]+)} $list full AISMaterial2

# Close/Open transaction
NewCommand D

set list [OCC1032_AISWidth D ${Label}]
regexp {Width = ([-0-9.+eE]+)} $list full AISWidth1

# Set a width
set Width 10
OCC1032_AISWidth D ${Label} ${Width}

set list [OCC1032_AISWidth D ${Label}]
regexp {Width = ([-0-9.+eE]+)} $list full AISWidth2

# Close/Open transaction
NewCommand D

set list [OCC1029_AISTransparency D ${Label}]
regexp {Transparency = ([-0-9.+eE]+)} $list full Transparency1

# Set a transparency
set Transparency 0.9
XSetTransparency D ${Transparency} ${Label}

set list [OCC1029_AISTransparency D ${Label}]
regexp {Transparency = ([-0-9.+eE]+)} $list full Transparency2

# Update the viewer
AISRepaint D


# Check the material
puts "AISMaterial1 = ${AISMaterial1}"
puts "AISMaterial2 = ${AISMaterial2}"
set DefaultAISMaterial 0
set status 0
if { ${AISMaterial1} != ${DefaultAISMaterial} } {
	puts "Default material is wrong: Error"
	set status 1
}
if { ${AISMaterial2} != ${CopperMaterial} } {
	puts "OCC1031_AISMaterial command: Error"
	set status 1
}

# Check the width
puts "AISWidth1 = ${AISWidth1}"
puts "AISWidth2 = ${AISWidth2}"
set DefaultAISWidth 0
if { ${AISWidth1} != ${DefaultAISWidth} } {
	puts "Default width is wrong: Error"
	set status 1
}
if { ${AISWidth2} != ${Width} } {
	puts "OCC1032_AISWidth command: Error"
	set status 1
}

# Check the transparency
puts "Transparency1 = ${Transparency1}"
puts "Transparency2 = ${Transparency2}"
set DefaultAISTransparency 0
if { ${Transparency1} != ${DefaultAISTransparency} } {
	puts "Default transparency is worng: Error"
	set status 1
}

if { ${Transparency2} != ${Transparency} } {
	puts "XSetTransparency command: Error"
	set status 1
}


if { ${status} == 0} {
	puts "OK"
} else {
	puts "FAULTY"
}

set 3dviewer 1