0026734: Visualization, D3DHost_View - drop outdated UserDraw interfaces
[occt.git] / samples / tcl / xde.tcl
CommitLineData
a347ef35 1# Simple sample demonstrating work with assemblies in XDE, and assignment of
2# names and colors to components vs. instances
3
5bffb882 4#Category: XDE
ab91ab6f 5#Title: Work with assemblies, colors etc. in XDE
6
a347ef35 7pload MODELING
8pload OCAF
9pload XDE
10
11puts "Make a link as assembly made of a pin and two instances of the same nut"
12pcylinder pin 1 10
13pcylinder nut 2 2
14compound nut nut nuts
15explode nuts
16ttranslate nuts_1 0 0 7
17ttranslate nuts_2 0 0 1
18compound pin nuts_1 nuts_2 link
19
20puts "Add link assembly in XCAF document, and add names and colors:"
21NewDocument D XCAF
22XAddShape D link
23SetName D [XFindShape D pin] "Pin"
24SetName D [XFindShape D nut] "Nut"
25SetName D [XFindShape D link] "Link"
26SetName D [XFindShape D link]:1 "Pin instance"
27SetName D [XFindShape D link]:2 "Nut instance 1"
28SetName D [XFindShape D link]:3 "Nut instance 2"
29
30puts "- Pin will be white"
31XSetColor D [XFindShape D pin] 1 1 1
32puts "- Nut itself will be dark gray"
33XSetColor D [XFindShape D nut] 0.1 0.1 0.1
34puts "- Nut instance #1 will be red"
35XSetColor D [XFindShape D link]:2 1 0 0
36puts "- Nut instance #2 will be green"
37XSetColor D [XFindShape D link]:3 0 1 0
38
39puts "Starting DF browser..."
40DFBrowse D
41puts "Expand the document tree to see its structure and assigned names"
42
43puts "Showing assembly in 3d view..."
44XShow D
45vfit
46vsetdispmode 1