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

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

ajout de la doc

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