source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/Visualization/visTutor/exN03Vis11_mac.html

Last change on this file was 904, checked in by garnier, 17 years ago

ajout de la doc

File size: 6.5 KB
Line 
1<pre>
2#######################################################################
3# MACRO FILE NAME: exN03Vis11.mac #
4# #
5# AUTHOR(S): Guy Barrand dd #
6# #
7# DATE: #
8# April 08, 2004 #
9# #
10# CONTENTS: A basic macro for visualization of detector geometry #
11# #
12# USAGE: % gmake visclean #
13# % $G4BINDIR/exampleN03 #
14# Idle> /control/execute visTutor/exN03Vis11.mac #
15# #
16# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
17# DAWN (version 3.85 or after) #
18# gv (Ghostview), Tcl/Tk #
19# #
20# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
21# (See geant4/source/visualization/README for details.) #
22# #
23# % setenv OGLHOME ... (e.g. /usr/X11R6) #
24# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
25# #
26# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
27# (See geant4/source/visualization/README for details.) #
28# #
29# % setenv G4VIS_USE_OPENGLX 1 #
30# #
31# ADDITIONAL NOTES: #
32# The compound command "/vis/open <vis-driver-name>" #
33# is equivalent to the following set of commands: #
34# #
35# /vis/sceneHandler/create $1 #
36# /vis/viewer/create #
37# #
38# The compound command "/vis/drawVolume <physical-volume-name>" #
39# is equivalent to the following set of commands: #
40# #
41# /vis/scene/create #
42# /vis/scene/add/volume $1 #
43# /vis/sceneHandler/attach #
44# #
45#######################################################################
46
47###########################################
48# Visualization of detector geometry
49# with the OGLSXm (OpenGL Stored Motif) driver
50###########################################
51
52# Invoke the OGLSXm driver
53/vis/open OGLSXm
54
55# Bird's-eye view of the detector geometry
56#
57# viewpoint : (theta,phi) = (20*deg, 70*deg),
58# zoom factor: 0.8 of the full screen size
59#
60/vis/viewer/reset
61/vis/viewer/set/viewpointThetaPhi 20 70
62/vis/viewer/zoom 0.8
63/vis/drawVolume
64
65# The following two commands "flush"
66# the action of the current viewer.
67# They are required for the post-processing drivers
68# such as DAWNFILE, VRMLFILE, HepRep drivers, etc.
69# For OpenGL drivers, these commands are not required
70# but harmless even if they are described.
71/vis/viewer/flush
72
73##########################################################
74# Visualization with the DAWNFILE driver
75#
76# * Each visualized view is saved to a file "g4_XX.eps"
77# with the "vectorized" PostScript format.
78#
79# * Set an environmental variable if you wish to
80# skip DAWN GUI:
81# % setenv G4DAWNFILE_VIEWER "dawn -d"
82##########################################################
83
84# Invoke the DAWNFILE driver
85/vis/open DAWNFILE
86
87# Bird's-eye view of a detector component (Absorber)
88# viewpoint : (theta,phi) = (35*deg, 35*deg),
89# zoom factor: 1.1 of the full screen size
90# coordinate axes:
91# x-axis:red, y-axis:green, z-axis:blue
92# origin: (0,0,0), length: 500
93# Scale: length = 10 cm, Orientation = z, color = red,
94# placing_algorithm = manual,
95# center = (-2.5 cm , -5 cm, 0 cm)
96#
97/vis/viewer/reset
98/vis/viewer/zoom 1.1
99/vis/viewer/set/viewpointThetaPhi 35 35
100/vis/drawVolume Absorber
101/vis/scene/add/axes 0 0 0 500 mm
102/vis/scene/add/text 0 0 0 mm 40 -100 -140 Absorber
103/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm
104
105# "Flush the action of all the existing viewers.
106# Note: You should execute these commands, e.g.,
107# when the current scene is modified.
108/vis/scene/notifyHandlers
109/vis/viewer/update
110
111# FOR FUTURE UPDATION
112#/vis/viewer/flushAll
113
114# Bird's-eye view of a detector component (Gap)
115/vis/viewer/reset
116/vis/viewer/zoom 1.1
117/vis/viewer/set/viewpointThetaPhi 35 35
118/vis/drawVolume Gap
119/vis/scene/add/axes 0 0 0 500 mm
120/vis/scene/add/text 0 0 0 mm 50 -100 -140 Gap
121/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm
122
123# "Flush the action of all the existing viewers.
124/vis/scene/notifyHandlers
125/vis/viewer/update
126
127# FOR FUTURE UPDATION
128#/vis/viewer/flushAll
129
130
131# Bird's-eye view of the whole detector components (world)
132# * The argument "world" of the command
133# "/vis/scene/add/volume" is omittable.
134# * "/vis/viewer/set/culling false" makes the invisible
135# world volume visible.
136# (The invisibility of the world volume is set
137# in ExN03DetectorConstruction.cc.)
138/vis/viewer/reset
139/vis/viewer/zoom 1.1
140/vis/viewer/set/viewpointThetaPhi 35 35
141/vis/viewer/set/culling global false
142/vis/drawVolume
143/vis/scene/add/axes 0 0 0 500 mm
144/vis/scene/add/text 0 0 0 mm 50 -100 -240 World
145/vis/scene/add/scale 10 cm x 1 0 0
146
147# "Flush the action of all the existing viewers.
148/vis/scene/notifyHandlers
149/vis/viewer/update
150
151# FOR FUTURE UPDATION
152#/vis/viewer/flushAll
153
154
155# Make the culling on for next visualization
156# Note: You may also use "/vis/viewer/reset"
157# for this initialization.
158/vis/viewer/set/culling global true
159</pre>
Note: See TracBrowser for help on using the repository browser.