source: trunk/examples/novice/N03/visTutor/exN03Vis11.mac @ 921

Last change on this file since 921 was 921, checked in by garnier, 15 years ago

en test de gl2ps. Problemes de libraries

File size: 6.6 KB
Line 
1#######################################################################
2#  MACRO FILE NAME: exN03Vis11.mac                                     #
3#                                                                     #
4#  AUTHOR(S): Guy Barrand dd                                          #
5#                                                                     #
6#  DATE:                                                              #
7#        April    08, 2004                                            #
8#                                                                     #
9#  CONTENTS: A basic macro for visualization of detector geometry     #
10#                                                                     #
11#  USAGE:  % gmake visclean                                           #
12#          % $G4BINDIR/exampleN03                                     #
13#          Idle> /control/execute visTutor/exN03Vis11.mac             #
14#                                                                     #
15#  REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL,            #
16#                                  DAWN (version 3.85 or after)       #
17#                                  gv (Ghostview), Tcl/Tk             #
18#                                                                     #
19#  ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION:               #
20#  (See geant4/source/visualization/README for details.)              #
21#                                                                     #
22#    % setenv OGLHOME     ... (e.g. /usr/X11R6)                       #
23#    % setenv G4VIS_BUILD_OPENGLX_DRIVER   1                          #
24#                                                                     #
25#  ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION:                #
26#  (See geant4/source/visualization/README for details.)              #
27#                                                                     #
28#    % setenv G4VIS_USE_OPENGLX            1                          #
29#                                                                     #
30#  ADDITIONAL NOTES:                                                  #
31#    The compound command "/vis/open <vis-driver-name>"               #
32#    is equivalent to the following set of commands:                  #
33#                                                                     #
34#      /vis/sceneHandler/create $1                                    #
35#      /vis/viewer/create                                             #
36#                                                                     #
37#    The compound command "/vis/drawVolume <physical-volume-name>"    #
38#    is equivalent to the following set of commands:                  #
39#                                                                     #
40#      /vis/scene/create                                              #
41#      /vis/scene/add/volume $1                                       #
42#      /vis/sceneHandler/attach                                       #
43#                                                                     #
44#######################################################################
45
46###########################################
47# Visualization of detector geometry
48#  with the OGLSXm (OpenGL Stored Motif) driver
49###########################################
50
51# Invoke the OGLSXm driver
52/vis/open OGLSXm
53
54# Bird's-eye view of the detector geometry
55#
56#  viewpoint  : (theta,phi) = (20*deg, 70*deg),
57#  zoom factor: 0.8 of the full screen size
58#
59/vis/viewer/reset
60/vis/viewer/scale 1 1 2
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
Note: See TracBrowser for help on using the repository browser.