1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>8.3. The Visualization Drivers</title><link rel="stylesheet" href="../xml/XSLCustomizationLayer/G4HTMLStylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Geant4 User's Guide for Application Developers"><link rel="up" href="ch08.html" title="Chapter 8. Visualization"><link rel="prev" href="ch08s02.html" title="8.2. Adding Visualization to Your Executable"><link rel="next" href="ch08s04.html" title="8.4. Controlling Visualization from Commands"><script language="JavaScript"> |
---|
2 | function remote_win(fName) |
---|
3 | { |
---|
4 | var url = "AllResources/Detector/geometry.src/" + fName; |
---|
5 | RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520") |
---|
6 | RemoteWin.creator=self |
---|
7 | } |
---|
8 | </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.3. |
---|
9 | The Visualization Drivers |
---|
10 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch08s02.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Chapter 8. |
---|
11 | Visualization |
---|
12 | </th><td width="20%" align="right"> <a accesskey="n" href="ch08s04.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.VisDrv"></a>8.3. |
---|
13 | The Visualization Drivers |
---|
14 | </h2></div></div></div><p> |
---|
15 | As explained in the |
---|
16 | |
---|
17 | Introduction to Visualization |
---|
18 | |
---|
19 | , Geant4 provides many different choices of |
---|
20 | visualization systems. Features and notes on each driver are |
---|
21 | briefly described here along with links to detailed web pages for |
---|
22 | the various drivers. |
---|
23 | </p><p> |
---|
24 | Details are given below for: |
---|
25 | |
---|
26 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
27 | <a href="ch08s03.html#sect.VisDrv.OpenGL" title="8.3.2. |
---|
28 | OpenGL |
---|
29 | ">Section 8.3.2</a> |
---|
30 | OpenGL |
---|
31 | </p></li><li><p> |
---|
32 | <a href="ch08s03.html#sect.VisDrv.OpenInv" title="8.3.3. |
---|
33 | OpenInventor |
---|
34 | ">Section 8.3.3</a> |
---|
35 | OpenInventor |
---|
36 | </p></li><li><p> |
---|
37 | <a href="ch08s03.html#sect.VisDrv.HepRep" title="8.3.4. |
---|
38 | HepRepFile |
---|
39 | ">Section 8.3.4</a> |
---|
40 | HepRepFile |
---|
41 | </p></li><li><p> |
---|
42 | <a href="ch08s03.html#sect.VisDrv.HepRepXML" title="8.3.5. |
---|
43 | HepRepXML |
---|
44 | ">Section 8.3.5</a> |
---|
45 | HepRepXML |
---|
46 | </p></li><li><p> |
---|
47 | <a href="ch08s03.html#sect.VisDrv.DAWN" title="8.3.6. |
---|
48 | DAWN |
---|
49 | ">Section 8.3.6</a> |
---|
50 | DAWN |
---|
51 | </p></li><li><p> |
---|
52 | <a href="ch08s03.html#sect.VisDrv.VRML" title="8.3.8. |
---|
53 | VRML |
---|
54 | ">Section 8.3.8</a> |
---|
55 | VRML |
---|
56 | </p></li><li><p> |
---|
57 | <a href="ch08s03.html#sect.VisDrv.RayTrc" title="8.3.9. |
---|
58 | RayTracer |
---|
59 | ">Section 8.3.9</a> |
---|
60 | RayTracer |
---|
61 | </p></li><li><p> |
---|
62 | <a href="ch08s03.html#sect.VisDrv.DetTree" title="8.3.10. |
---|
63 | Visualization of detector geometry tree |
---|
64 | ">Section 8.3.10</a> |
---|
65 | ASCIITree |
---|
66 | </p></li><li><p> |
---|
67 | <a href="ch08s03.html#sect.VisDrv.GAGTree" title="8.3.11. |
---|
68 | GAG Tree |
---|
69 | ">Section 8.3.11</a> |
---|
70 | GAGTree |
---|
71 | </p></li><li><p> |
---|
72 | <a href="ch08s03.html#sect.VisDrv.XMLTree" title="8.3.12. |
---|
73 | XML Tree |
---|
74 | ">Section 8.3.12</a> |
---|
75 | XMLTree |
---|
76 | </p></li><li><p> |
---|
77 | <a href="ch08s03.html#sect.VisDrv.Qt" title="8.3.13. |
---|
78 | XML Tree |
---|
79 | ">Section 8.3.13</a> |
---|
80 | Qt |
---|
81 | </p></li></ul></div><p> |
---|
82 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.Avail"></a>8.3.1. |
---|
83 | Availability of drivers on the supported systems |
---|
84 | </h3></div></div></div><p> |
---|
85 | <a href="ch08s03.html#table.VisDrv_1" title="Table 8.1. |
---|
86 | Required graphics systems and supported platforms for the various |
---|
87 | visualization drivers. |
---|
88 | ">Table 8.1</a> lists required graphics systems |
---|
89 | and supported platforms for the various visualization drivers |
---|
90 | |
---|
91 | </p><div class="table"><a name="table.VisDrv_1"></a><div class="table-contents"><table summary=" |
---|
92 | Required graphics systems and supported platforms for the various |
---|
93 | visualization drivers. |
---|
94 | " border="1"><colgroup><col><col><col></colgroup><tbody><tr><td> |
---|
95 | <span class="bold"><strong>Driver</strong></span> |
---|
96 | </td><td> |
---|
97 | <span class="bold"><strong>Required Graphics System</strong></span> |
---|
98 | </td><td> |
---|
99 | <span class="bold"><strong>Platform</strong></span> |
---|
100 | </td></tr><tr><td> |
---|
101 | OpenGL-Xlib |
---|
102 | </td><td> |
---|
103 | OpenGL |
---|
104 | </td><td> |
---|
105 | Linux, Unix, Mac with Xlib |
---|
106 | </td></tr><tr><td> |
---|
107 | OpenGL-Motif |
---|
108 | </td><td> |
---|
109 | OpenGL |
---|
110 | </td><td> |
---|
111 | Linux, UNIX, Mac with Motif |
---|
112 | </td></tr><tr><td> |
---|
113 | OpenGL-Win32 |
---|
114 | </td><td> |
---|
115 | OpenGL |
---|
116 | </td><td> |
---|
117 | Windows |
---|
118 | </td></tr><tr><td> |
---|
119 | Qt |
---|
120 | </td><td> |
---|
121 | OpenGL, Qt |
---|
122 | </td><td> |
---|
123 | Linux, UNIX, Mac, Windows with Qt |
---|
124 | </td></tr><tr><td> |
---|
125 | OpenInventor-X |
---|
126 | </td><td> |
---|
127 | OpenInventor, OpenGL |
---|
128 | </td><td> |
---|
129 | Linux, UNIX, Mac with Xlib or Motif |
---|
130 | </td></tr><tr><td> |
---|
131 | OpenInventor-Win32 |
---|
132 | </td><td> |
---|
133 | OpenInventor, OpenGL |
---|
134 | </td><td> |
---|
135 | Windows |
---|
136 | </td></tr><tr><td> |
---|
137 | HepRep |
---|
138 | </td><td> |
---|
139 | WIRED or FRED HepRep Browser |
---|
140 | </td><td> |
---|
141 | Linux, UNIX, Mac, Windows |
---|
142 | </td></tr><tr><td> |
---|
143 | DAWNFILE |
---|
144 | </td><td> |
---|
145 | Fukui Renderer DAWN |
---|
146 | </td><td> |
---|
147 | Linux, Unix, Mac, Windows |
---|
148 | </td></tr><tr><td> |
---|
149 | DAWN-Network |
---|
150 | </td><td> |
---|
151 | Fukui Renderer DAWN |
---|
152 | </td><td> |
---|
153 | Linux, UNIX |
---|
154 | </td></tr><tr><td> |
---|
155 | VRMLFILE |
---|
156 | </td><td> |
---|
157 | any VRML viewer |
---|
158 | </td><td> |
---|
159 | Linux, UNIX, Mac, Windows |
---|
160 | </td></tr><tr><td> |
---|
161 | VRML-Network |
---|
162 | </td><td> |
---|
163 | any network-enabled VRML viewer |
---|
164 | </td><td> |
---|
165 | Linux, UNIX |
---|
166 | </td></tr><tr><td> |
---|
167 | RayTracer |
---|
168 | </td><td> |
---|
169 | any JPEG viewer |
---|
170 | </td><td> |
---|
171 | Linux, UNIX, Mac, Windows |
---|
172 | </td></tr><tr><td> |
---|
173 | ASCIITree |
---|
174 | </td><td> |
---|
175 | none |
---|
176 | </td><td> |
---|
177 | Linux, UNIX, Mac, Windows |
---|
178 | </td></tr><tr><td> |
---|
179 | GAGTree |
---|
180 | </td><td> |
---|
181 | GAG |
---|
182 | </td><td> |
---|
183 | Linux, UNIX, Mac, Windows |
---|
184 | </td></tr><tr><td> |
---|
185 | XMLTree |
---|
186 | </td><td> |
---|
187 | any XML viewer |
---|
188 | </td><td> |
---|
189 | Linux, UNIX, Mac, Windows |
---|
190 | </td></tr></tbody></table></div><p class="title"><b>Table 8.1. |
---|
191 | Required graphics systems and supported platforms for the various |
---|
192 | visualization drivers. |
---|
193 | </b></p></div><p><br class="table-break"> |
---|
194 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.OpenGL"></a>8.3.2. |
---|
195 | OpenGL |
---|
196 | </h3></div></div></div><p> |
---|
197 | These drivers have been developed by John Allison and Andrew |
---|
198 | Walkden (University of Manchester). It is an interface to the de |
---|
199 | facto standard 3D graphics library, OpenGL. It is well suited for |
---|
200 | real-time fast visualization and demonstration. Fast visualization |
---|
201 | is realized with hardware acceleration, reuse of shapes stored in a |
---|
202 | display list, etc. NURBS visualization is also supported. |
---|
203 | </p><p> |
---|
204 | Several versions of the OpenGL drivers are prepared. Versions |
---|
205 | for Xlib, Motif and Win32 platforms are available by default. For |
---|
206 | each version, there are two modes: immediate mode and stored mode. |
---|
207 | The former has no limitation on data size, and the latter is fast |
---|
208 | for visualizing large data repetitively, and so is suitable for |
---|
209 | animation. |
---|
210 | </p><p> |
---|
211 | If you don't have Motif, all control is done from Geant4 |
---|
212 | commands: |
---|
213 | |
---|
214 | |
---|
215 | </p><div class="informalexample"><pre class="programlisting"> |
---|
216 | /vis/open OGLIX |
---|
217 | /vis/viewer/set/viewpointThetaPhi 70 20 |
---|
218 | /vis/viewer/zoom 2 |
---|
219 | etc. |
---|
220 | </pre></div><p> |
---|
221 | </p><p> |
---|
222 | But if you have Motif libraries, you can control Geant4 from Motif |
---|
223 | widgets: |
---|
224 | |
---|
225 | </p><div class="informalexample"><pre class="programlisting"> |
---|
226 | /vis/open OGLIXm |
---|
227 | </pre></div><p> |
---|
228 | </p><p> |
---|
229 | The OpenGL driver added Smooth shading and Transparency since |
---|
230 | Geant4 release 8.0. |
---|
231 | </p><p> |
---|
232 | <span class="bold"><strong>Further information (OpenGL and Mesa):</strong></span> |
---|
233 | |
---|
234 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
235 | <a href="http://www.opengl.org/" target="_top"> |
---|
236 | http://www.opengl.org/ |
---|
237 | </a> |
---|
238 | </p></li><li><p> |
---|
239 | <a href="http://www.mesa3d.org" target="_top"> |
---|
240 | http://www.mesa3d.org |
---|
241 | </a> |
---|
242 | </p></li><li><p> |
---|
243 | <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4OpenGLTutorial/G4OpenGLTutorial.html" target="_top"> |
---|
244 | Geant4 Visualization Tutorial |
---|
245 | </a> |
---|
246 | using the OpenGL Graphics System |
---|
247 | </p></li></ul></div><p> |
---|
248 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.OpenInv"></a>8.3.3. |
---|
249 | OpenInventor |
---|
250 | </h3></div></div></div><p> |
---|
251 | These drivers were developed by Jeff Kallenbach (FNAL) and Guy |
---|
252 | Barrand (IN2P3) based on the |
---|
253 | <a href="http://www-pat.fnal.gov/graphics/HEPVis/www" target="_top"> |
---|
254 | Hepvis class library |
---|
255 | </a> |
---|
256 | originated by Joe Boudreau (Pittsburgh University). The |
---|
257 | OpenInventor drivers and the Hepvis class library are based on the |
---|
258 | well-established OpenInventor technology for scientific |
---|
259 | visualization. They have high extendibility. They support high |
---|
260 | interactivity, e.g., attribute e diting of picked objects. Some |
---|
261 | OpenInventor viewers support "stereoscopic" effects. |
---|
262 | </p><p> |
---|
263 | It is also possible to save a visualized 3D scene as an |
---|
264 | OpenInventor-formatted file, and re-visualize the scene |
---|
265 | afterwards. |
---|
266 | </p><p> |
---|
267 | Because it is connected directly to the Geant4 kernel, using |
---|
268 | same language as that kernel (C++), OpenInventor systems can have |
---|
269 | direct access to Geant4 data (geometry, trajectories, etc.). |
---|
270 | </p><p> |
---|
271 | Because OpenInventor uses OpenGL for rendering, it supports |
---|
272 | lighting and transparency. |
---|
273 | </p><p> |
---|
274 | OpenInventor provides thumbwheel control to rotate and zoom. |
---|
275 | </p><p> |
---|
276 | OpenInventor supports picking to ask about data. [Control |
---|
277 | Clicking] on a volume turns on rendering of that volume's |
---|
278 | daughters. [Shift Clicking] a daughter turns that rendering off: If |
---|
279 | modeling opaque solid, effect is like opening a box to look |
---|
280 | inside. |
---|
281 | </p><p> |
---|
282 | <span class="bold"><strong>Further information (HEPVis and OpenScientist):</strong></span> |
---|
283 | |
---|
284 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
285 | Geant4 Inventor Visualization with OpenScientist |
---|
286 | <a href="http://openscientist.lal.in2p3.fr/v15r0/html/osc_g4_vis_ui.html" target="_top"> |
---|
287 | http://openscientist.lal.in2p3.fr/v15r0/html/osc_g4_vis_ui.html |
---|
288 | </a> |
---|
289 | </p></li><li><p> |
---|
290 | Overall OpenScientist Home |
---|
291 | <a href="http://openscientist.lal.in2p3.fr/v15r0/html/osc_g4_vis_ui.html" target="_top"> |
---|
292 | http://openscientist.lal.in2p3.fr/v15r0/html/osc_g4_vis_ui.html |
---|
293 | </a> |
---|
294 | </p></li><li><p> |
---|
295 | HEPVis |
---|
296 | <a href="http://www-pat.fnal.gov/graphics/HEPVis/www" target="_top"> |
---|
297 | http://www-pat.fnal.gov/graphics/HEPVis/www |
---|
298 | </a> |
---|
299 | </p></li></ul></div><p> |
---|
300 | </p><p> |
---|
301 | <span class="bold"><strong>Further information (OpenInventor):</strong></span> |
---|
302 | |
---|
303 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
304 | <a href="http://oss.sgi.com/projects/inventor" target="_top"> |
---|
305 | http://oss.sgi.com/projects/inventor |
---|
306 | </a> |
---|
307 | </p></li><li><p> |
---|
308 | Josie Wernecke, "The Inventor Mentor", Addison Wesley |
---|
309 | (ISBN 0-201-62495-8) |
---|
310 | </p></li><li><p> |
---|
311 | Josie Wernecke, "The Inventor Toolmaker", Addison Wesley |
---|
312 | (ISBN 0-201-62493-1) |
---|
313 | </p></li><li><p> |
---|
314 | "The Open Inventor C++ Reference Manual", Addison Wesley |
---|
315 | (ISBN 0-201-62491-5) |
---|
316 | </p></li></ul></div><p> |
---|
317 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.HepRep"></a>8.3.4. |
---|
318 | HepRepFile |
---|
319 | </h3></div></div></div><p> |
---|
320 | The HepRepFile driver creates a HepRep XML file in the HepRep1 |
---|
321 | format suitable for viewing with the |
---|
322 | <a href="http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/" target="_top"> |
---|
323 | WIRED3</a> HepRep Browser. |
---|
324 | </p><p> |
---|
325 | The HepRep graphics format is further described at |
---|
326 | <a href="http://www.slac.stanford.edu/~perl/heprep" target="_top"> |
---|
327 | http://www.slac.stanford.edu/~perl/heprep |
---|
328 | </a> |
---|
329 | . |
---|
330 | </p><p> |
---|
331 | To write just the detector geometry to this file, use the |
---|
332 | command: |
---|
333 | |
---|
334 | </p><div class="informalexample"><pre class="programlisting"> |
---|
335 | /vis/viewer/flush |
---|
336 | </pre></div><p> |
---|
337 | </p><p> |
---|
338 | Or, to also include trajectories and hits (after the appropriate |
---|
339 | /vis/viewer/add/trajectories or /vis/viewer/add/hits commands), |
---|
340 | just issue: |
---|
341 | |
---|
342 | </p><div class="informalexample"><pre class="programlisting"> |
---|
343 | /run/beamOn 1 |
---|
344 | </pre></div><p> |
---|
345 | </p><p> |
---|
346 | HepRepFile will write a file called G4Data0.heprep to the |
---|
347 | current directory. Each subsequent file will have a file name like |
---|
348 | G4Data1.heprep, G4Data2.heprep, etc. |
---|
349 | </p><p> |
---|
350 | View the file using the WIRED3 HepRep Browser, available from: |
---|
351 | </p><p> |
---|
352 | <a href="http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/" target="_top"> |
---|
353 | http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/ |
---|
354 | </a> |
---|
355 | . |
---|
356 | </p><p> |
---|
357 | WIRED3 allows you to pick on volumes, trajectories and hits to |
---|
358 | find out their associated HepRep Attributes, such as volume name, |
---|
359 | particle ID, momentum, etc. These same attributes can be displayed |
---|
360 | as labels on the relevant objects, and you can make visibility cuts |
---|
361 | based on these attributes ("show me only the photons", or "omit any |
---|
362 | volumes made of iron"). |
---|
363 | </p><p> |
---|
364 | WIRED3 can read heprep files in zipped format as well as |
---|
365 | unzipped, so you can save space by applying gzip to the heprep |
---|
366 | file. This will reduce the file to about five percent of its |
---|
367 | original size. |
---|
368 | </p><p> |
---|
369 | Several environment variables are available to override some of |
---|
370 | HepRepFile's defaults |
---|
371 | |
---|
372 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
373 | You can specify a different directory for the heprep output |
---|
374 | files by setting the environment variable G4HEPREPFILE_DIR, as in: |
---|
375 | |
---|
376 | </p><div class="informalexample"><pre class="programlisting"> |
---|
377 | export G4HEPREPFILE_DIR=someOtherDir/someOtherSubDir |
---|
378 | </pre></div><p> |
---|
379 | </p></li><li><p> |
---|
380 | You can specify a different file name (the part before the |
---|
381 | number) by setting the environment variable G4HEPREPFILE_NAME, as in: |
---|
382 | |
---|
383 | </p><div class="informalexample"><pre class="programlisting"> |
---|
384 | export G4HEPREPFILE_NAME=myFileName |
---|
385 | </pre></div><p> |
---|
386 | |
---|
387 | which will produce files named myFileName0.heprep, |
---|
388 | myFileName1.heprep, etc. |
---|
389 | </p></li><li><p> |
---|
390 | You can specify that each file should overwrite the previous |
---|
391 | file (always rewriting to the same file name) by setting the |
---|
392 | environment variable G4HEPREPFILE_OVERWRITE, as in: |
---|
393 | |
---|
394 | </p><div class="informalexample"><pre class="programlisting"> |
---|
395 | export G4HEPREPFILE_OVERWRITE=1 |
---|
396 | </pre></div><p> |
---|
397 | |
---|
398 | This may be useful in some automated applications where you always |
---|
399 | want to see the latest output file in the same location. |
---|
400 | </p></li></ul></div><p> |
---|
401 | |
---|
402 | |
---|
403 | </p><div class="itemizedlist"><ul type="disc"><li><p> |
---|
404 | Geant4 visualization supports a concept called "culling", by |
---|
405 | which certain parts of the detector can be made invisible. Since |
---|
406 | you may want to control visibility from the HepRep browser, turning |
---|
407 | on visibility of detector parts that had defaulted to be invisible, |
---|
408 | the HepRepFile driver does not omit these invisible detector parts |
---|
409 | from the HepRep file. But for very large files, if you know that |
---|
410 | you will never want to make these parts visible, you can choose to |
---|
411 | have them left entirely out of the file. Set the environment |
---|
412 | variable G4HEPREPFILE_CULL, as in: |
---|
413 | |
---|
414 | </p><div class="informalexample"><pre class="programlisting"> |
---|
415 | export G4HEPREPFILE_CULL=1 |
---|
416 | </pre></div><p> |
---|
417 | </p></li></ul></div><p> |
---|
418 | </p><p> |
---|
419 | <span class="bold"><strong>Further information:</strong></span> |
---|
420 | |
---|
421 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
422 | WIRED3 Users Home Page: |
---|
423 | </p><p> |
---|
424 | <a href="http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/" target="_top"> |
---|
425 | http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/ |
---|
426 | </a> |
---|
427 | . |
---|
428 | </p><p> |
---|
429 | </p></li><li><p> |
---|
430 | HepRep graphics format: |
---|
431 | </p><p> |
---|
432 | <a href="http://www.slac.stanford.edu/~perl/heprep" target="_top"> |
---|
433 | http://www.slac.stanford.edu/~perl/heprep |
---|
434 | </a> |
---|
435 | </p><p> |
---|
436 | </p></li><li><p> |
---|
437 | Geant4 Visualization Tutorial using the WIRED3 HepRep Browser |
---|
438 | </p><p> |
---|
439 | <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4WIREDTutorial/G4WIREDTutorial.html" target="_top"> |
---|
440 | http://geant4.slac.stanford.edu/Presentations/vis/G4WIREDTutorial/G4WIREDTutorial.html |
---|
441 | </a> |
---|
442 | </p><p> |
---|
443 | </p></li></ul></div><p> |
---|
444 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.HepRepXML"></a>8.3.5. |
---|
445 | HepRepXML |
---|
446 | </h3></div></div></div><p> |
---|
447 | The HepRepXML driver creates a HepRep file in the HepRep2 format |
---|
448 | suitable for viewing with the |
---|
449 | <a href="http://wired.freehep.org/index.html" target="_top"> |
---|
450 | WIRED4 |
---|
451 | </a> |
---|
452 | Plugin to the JAS3 Analysis System or the |
---|
453 | <a href="http://www.fisica.uniud.it/~glast/FRED/" target="_top"> |
---|
454 | FRED |
---|
455 | </a> |
---|
456 | event display. |
---|
457 | </p><p> |
---|
458 | This driver can write both Binary HepRep (.bheprep) and XML |
---|
459 | HepRep (.heprep) files. Binary HepRep files are a one-to-one |
---|
460 | translation of XML HepRep files, but they are considerably shorter |
---|
461 | and faster to parse by a HepRepViewer such as WIRED 4. |
---|
462 | </p><p> |
---|
463 | Both Binary HepRep and XML HepRep can be compressed using the |
---|
464 | standard zlib library if linked into Geant4 using G4LIB_USE_ZLIB. |
---|
465 | If a standard zlib is not available (WIN32-VC for instance) you |
---|
466 | should also set G4LIB_BUILD_ZLIB to build G4zlib included with |
---|
467 | Geant4. |
---|
468 | </p><p> |
---|
469 | HepRep files (Binary and XML) can contain multiple HepRep |
---|
470 | events/geometries. If the file contains more than one HepRep it is |
---|
471 | not strictly XML anymore. Files can be written in .heprep.zip, |
---|
472 | .heprep.gz or .heprep format and their binary versions |
---|
473 | .bheprep.zip, .bheprep.gz or .bheprep. |
---|
474 | </p><p> |
---|
475 | The .heprep.zip is the default for file output, the .heprep is |
---|
476 | the default for stdout and stderr. |
---|
477 | </p><p> |
---|
478 | (Optional) To set the filename with a particular extension such |
---|
479 | as: .heprep.zip, .heprep.gz, .heprep, .bheprep.zip, .bheprep.gz or |
---|
480 | .bheprep use for instance: |
---|
481 | |
---|
482 | </p><div class="informalexample"><pre class="programlisting"> |
---|
483 | /vis/scene/create filename.bheprep.zip |
---|
484 | </pre></div><p> |
---|
485 | </p><p> |
---|
486 | (Optional) To create separate files for each event, you can set |
---|
487 | a suffix such as "-0001" to start writing files from |
---|
488 | filename-0001.bheprep.zip to filename-9999.bheprep.zip (or up), |
---|
489 | while "-55-sub" will start write files filename-55-sub.bheprep.zip |
---|
490 | to filename-99-sub.bheprep.zip (or up). |
---|
491 | |
---|
492 | </p><div class="informalexample"><pre class="programlisting"> |
---|
493 | /vis/heprep/setEventNumberSuffix -0001 |
---|
494 | </pre></div><p> |
---|
495 | </p><p> |
---|
496 | (Note: suffix has to contain at least one digit) |
---|
497 | </p><p> |
---|
498 | (Optional) To route the HepRep XML output to stdout (or stderr), |
---|
499 | by default uncompressed, use: |
---|
500 | |
---|
501 | </p><div class="informalexample"><pre class="programlisting"> |
---|
502 | /vis/scene/create stdout |
---|
503 | </pre></div><p> |
---|
504 | </p><p> |
---|
505 | (Optional) To add attributes to each point on a trajectory, use: |
---|
506 | |
---|
507 | </p><div class="informalexample"><pre class="programlisting"> |
---|
508 | /vis/heprep/addPointAttributes 1 |
---|
509 | </pre></div><p> |
---|
510 | </p><p> |
---|
511 | Be aware that this may increase the size of the output |
---|
512 | dramatically. |
---|
513 | </p><p> |
---|
514 | (Optional) You may use the commands: |
---|
515 | |
---|
516 | </p><div class="informalexample"><pre class="programlisting"> |
---|
517 | /vis/viewer/zoom to set an initial zoom factor |
---|
518 | |
---|
519 | /vis/viewer/set/viewpointThetaPhi to set an initial view point |
---|
520 | |
---|
521 | /vis/heprep/setCoordinateSystem uvw to change the coordinate system, where uvw |
---|
522 | can be "xyz", "zxy", ... |
---|
523 | </pre></div><p> |
---|
524 | </p><p> |
---|
525 | (Optional) You may decide to write .zip files with events and |
---|
526 | geometry separated (but linked). This results in a smaller zip |
---|
527 | file, as the geometry is only written once. Use the command: |
---|
528 | |
---|
529 | </p><div class="informalexample"><pre class="programlisting"> |
---|
530 | /vis/heprep/appendGeometry false |
---|
531 | </pre></div><p> |
---|
532 | </p><p> |
---|
533 | (Optional) To close the file, remove the SceneHandler, use: |
---|
534 | |
---|
535 | </p><div class="informalexample"><pre class="programlisting"> |
---|
536 | /vis/sceneHandler/remove scene-handler-0 |
---|
537 | </pre></div><p> |
---|
538 | </p><p> |
---|
539 | Limitations: Only one SceneHandler can exist at any time, |
---|
540 | connected to a single Viewer. Since the HepRep format is a model |
---|
541 | rather than a view this is not a real limitation. In WIRED 4 you |
---|
542 | can create as many views (SceneHandlers) as you like. |
---|
543 | </p><p> |
---|
544 | <span class="bold"><strong>Further information:</strong></span> |
---|
545 | |
---|
546 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
547 | <a href="http://wired.freehep.org/index.html" target="_top"> |
---|
548 | WIRED4</a> Plugin to the JAS3 Analysis System |
---|
549 | </p></li><li><p> |
---|
550 | <a href="http://www.fisica.uniud.it/~glast/FRED/" target="_top"> |
---|
551 | FRED</a> event display |
---|
552 | </p></li><li><p> |
---|
553 | HepRep graphics format: |
---|
554 | </p><p> |
---|
555 | <a href="http://www.slac.stanford.edu/~perl/heprep" target="_top"> |
---|
556 | http://www.slac.stanford.edu/~perl/heprep |
---|
557 | </a> |
---|
558 | </p><p> |
---|
559 | </p></li></ul></div><p> |
---|
560 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.DAWN"></a>8.3.6. |
---|
561 | DAWN |
---|
562 | </h3></div></div></div><p> |
---|
563 | The DAWN drivers are interfaces to |
---|
564 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWN.html" target="_top"> |
---|
565 | Fukui Renderer DAWN</a>, which has been developed by Satoshi Tanaka, |
---|
566 | Minato Kawaguti et al (Fukui University). It is a vectorized 3D |
---|
567 | PostScript processor, and so well suited to prepare technical high |
---|
568 | quality outputs for presentation and/or documentation. It is also |
---|
569 | useful for precise debugging of detector geometry. Remote |
---|
570 | visualization, off-line re-visualization, cut view, and many other |
---|
571 | useful functions of detector simulation are supported. A DAWN |
---|
572 | process is automatically invoked as a co-process of Geant4 when |
---|
573 | visualization is performed, and 3D data are passed with |
---|
574 | inter-process communication, via a file, or the TCP/IP socket. |
---|
575 | </p><p> |
---|
576 | When Geant4 Visualization is performed with the DAWN driver, the |
---|
577 | visualized view is automatically saved to a file named |
---|
578 | <code class="literal">g4.eps</code> in the current directory, which describes a |
---|
579 | vectorized (Encapsulated) PostScript data of the view. |
---|
580 | </p><p> |
---|
581 | There are two kinds of DAWN drivers, the DAWNFILE driver and the |
---|
582 | DAWN-Network driver. The DAWNFILE driver is usually recommended, |
---|
583 | since it is faster and safer in the sense that it is not affected |
---|
584 | by network conditions. |
---|
585 | </p><p> |
---|
586 | The DAWNFILE driver sends 3D data to DAWN via an intermediate |
---|
587 | file, named <code class="literal">g4.prim</code> in the current directory. The file |
---|
588 | <code class="literal">g4.prim</code> can be re-visualized later without the help of |
---|
589 | Geant4. This is done by invoking DAWN by hand: |
---|
590 | |
---|
591 | </p><div class="informalexample"><pre class="programlisting"> |
---|
592 | % dawn g4.prim |
---|
593 | </pre></div><p> |
---|
594 | </p><p> |
---|
595 | DAWN files can also serve as input to two additional programs: |
---|
596 | |
---|
597 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
598 | A standalone program, DAWNCUT, can perform a planar cut on a |
---|
599 | DAWN image. DAWNCUT takes as input a .prim file and some cut |
---|
600 | parameters. Its output is a new .prim file to which the cut has |
---|
601 | been applied. |
---|
602 | </p></li><li><p> |
---|
603 | Another standalone program, DAVID, can show you any volume |
---|
604 | overlap errors in your geometry. DAVID takes as input a .prim file |
---|
605 | and outputs a new .prim file in which overlapping volumes have been |
---|
606 | highlighted. The use of DAVID is described in section |
---|
607 | <a href="ch04.html#sect.Geom.Overlap" title="4.1.11. |
---|
608 | Detecting Overlapping Volumes |
---|
609 | ">Section 4.1.11</a> of this manual. |
---|
610 | </p></li></ul></div><p> |
---|
611 | </p><p> |
---|
612 | The DAWN-Network driver is almost the same as the DAWNFILE |
---|
613 | driver except that |
---|
614 | |
---|
615 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
616 | 3D data are passed to DAWN via the TCP/IP the socket (default) |
---|
617 | or the named pipe, and that, |
---|
618 | </p></li></ul></div><p> |
---|
619 | </p><p> |
---|
620 | If you have not set up network configurations of your host machine, |
---|
621 | set the environment variable <code class="literal">G4DAWN_NAMED_PIPE</code> to "1", |
---|
622 | e.g., <code class="literal">% setenv G4DAWN_NAMED_PIPE 1</code>. This setting switches |
---|
623 | the default socket connection to the named-pipe connection within |
---|
624 | the same host machine. The DAWN-Network driver also saves the 3D |
---|
625 | data to the file <code class="literal">g4.prim</code> in the current directory. |
---|
626 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.RemDAWN"></a>8.3.7. |
---|
627 | Remote Visualization with the DAWN-Network Driver |
---|
628 | </h3></div></div></div><p> |
---|
629 | Visualization in Geant4 is considered to be "remote" when it is |
---|
630 | performed on a machine other than the Geant4 host. Some of the |
---|
631 | visualization drivers support this feature. |
---|
632 | </p><p> |
---|
633 | Usually, the visualization host is your local host, while the |
---|
634 | Geant4 host is a remote host where you log in, for example, with |
---|
635 | the <code class="literal">telnet</code> command. This enables distributed |
---|
636 | processing of Geant4 visualization, avoiding the transfer of large |
---|
637 | amounts of visualization data to your terminal display via the |
---|
638 | network. This section describes how to perform remote Geant4 |
---|
639 | visualization with the DAWN-Network driver. In order to do it, |
---|
640 | you must install the Fukui Renderer DAWN on your local host |
---|
641 | beforehand. |
---|
642 | </p><p> |
---|
643 | The following steps realize remote Geant4 visualization viewed |
---|
644 | by DAWN. |
---|
645 | |
---|
646 | </p><div class="orderedlist"><ol type="1" compact><li><p> |
---|
647 | Invoke DAWN with "-G" option on your local host: |
---|
648 | |
---|
649 | </p><div class="informalexample"><pre class="programlisting"> |
---|
650 | Local_Host> dawn -G |
---|
651 | </pre></div><p> |
---|
652 | |
---|
653 | This invokes DAWN with the network connection mode. |
---|
654 | </p></li><li><p> |
---|
655 | Login to the remote host where a Geant4 executable is placed. |
---|
656 | </p></li><li><p> |
---|
657 | Set an environment variable on the remote host as follows: |
---|
658 | |
---|
659 | </p><div class="informalexample"><pre class="programlisting"> |
---|
660 | Remote_Host> setenv G4DAWN_HOST_NAME local_host_name |
---|
661 | </pre></div><p> |
---|
662 | |
---|
663 | For example, if you are working in the local host named |
---|
664 | "arkoop.kek.jp", set this environment variable as follows: |
---|
665 | |
---|
666 | </p><div class="informalexample"><pre class="programlisting"> |
---|
667 | Remote_Host> setenv G4DAWN_HOST_NAME arkoop.kek.jp |
---|
668 | </pre></div><p> |
---|
669 | |
---|
670 | This tells a Geant4 process running on the remote host where Geant4 |
---|
671 | Visualization should be performed, i.e., where the visualized views |
---|
672 | should be displayed. |
---|
673 | </p></li><li><p> |
---|
674 | Invoke a Geant4 process and perform visualization with the |
---|
675 | DAWN-Network driver. For example: |
---|
676 | |
---|
677 | </p><div class="informalexample"><pre class="programlisting"> |
---|
678 | Idle> /vis/open DAWN |
---|
679 | Idle> /vis/drawVolume |
---|
680 | Idle> /vis/viewer/flush |
---|
681 | </pre></div><p> |
---|
682 | </p></li></ol></div><p> |
---|
683 | </p><p> |
---|
684 | In step 4, 3D scene data are sent from the remote host to the |
---|
685 | local host as |
---|
686 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/G4PRIM_FORMAT_24/" target="_top"> |
---|
687 | DAWN-formatted data</a>, and the local DAWN will visualize the data. The |
---|
688 | transferred data are saved as a file named <code class="literal">g4.prim</code> in the |
---|
689 | current directory of the local host. |
---|
690 | </p><p> |
---|
691 | <span class="bold"><strong>Further information:</strong></span> |
---|
692 | |
---|
693 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
694 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWN.html" target="_top"> |
---|
695 | http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWN.html |
---|
696 | </a> |
---|
697 | </p></li><li><p> |
---|
698 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/G4PRIM_FORMAT_24/" target="_top"> |
---|
699 | http://geant4.kek.jp/GEANT4/vis/DAWN/G4PRIM_FORMAT_24/ |
---|
700 | </a> |
---|
701 | </p></li></ul></div><p> |
---|
702 | </p><p> |
---|
703 | <span class="bold"><strong>Further information:</strong></span> |
---|
704 | |
---|
705 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
706 | Fukui Renderer DAWN: |
---|
707 | </p><p> |
---|
708 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWN.html" target="_top"> |
---|
709 | http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWN.html |
---|
710 | </a> |
---|
711 | </p><p> |
---|
712 | </p></li><li><p> |
---|
713 | The DAWNFILE driver: |
---|
714 | </p><p> |
---|
715 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/DAWNFILE_driver.html" target="_top"> |
---|
716 | http://geant4.kek.jp/GEANT4/vis/GEANT4/DAWNFILE_driver.html |
---|
717 | </a> |
---|
718 | </p><p> |
---|
719 | </p></li><li><p> |
---|
720 | The DAWN-Network driver: |
---|
721 | </p><p> |
---|
722 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/DAWNNET_driver.html" target="_top"> |
---|
723 | http://geant4.kek.jp/GEANT4/vis/GEANT4/DAWNNET_driver.html |
---|
724 | </a> |
---|
725 | </p><p> |
---|
726 | </p></li><li><p> |
---|
727 | Environmental variables to customize DAWN and DAWN drivers: |
---|
728 | </p><p> |
---|
729 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/DAWN_ENV.html" target="_top"> |
---|
730 | http://geant4.kek.jp/GEANT4/vis/DAWN/DAWN_ENV.html |
---|
731 | </a> |
---|
732 | </p><p> |
---|
733 | </p><p> |
---|
734 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/g4vis_on_linux.html" target="_top"> |
---|
735 | http://geant4.kek.jp/GEANT4/vis/GEANT4/g4vis_on_linux.html |
---|
736 | </a> |
---|
737 | </p><p> |
---|
738 | </p></li><li><p> |
---|
739 | DAWN format (g4.prim format) manual: |
---|
740 | </p><p> |
---|
741 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/G4PRIM_FORMAT_24/" target="_top"> |
---|
742 | http://geant4.kek.jp/GEANT4/vis/DAWN/G4PRIM_FORMAT_24/ |
---|
743 | </a> |
---|
744 | </p><p> |
---|
745 | </p></li><li><p> |
---|
746 | Geant4 Fukui University Group Home Page: |
---|
747 | </p><p> |
---|
748 | <a href="http://geant4.kek.jp/GEANT4/vis/" target="_top"> |
---|
749 | http://geant4.kek.jp/GEANT4/vis/ |
---|
750 | </a> |
---|
751 | </p><p> |
---|
752 | </p></li><li><p> |
---|
753 | DAWNCUT: |
---|
754 | </p><p> |
---|
755 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWNCUT.html" target="_top"> |
---|
756 | http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAWNCUT.html |
---|
757 | </a> |
---|
758 | </p><p> |
---|
759 | </p></li><li><p> |
---|
760 | DAVID: |
---|
761 | </p><p> |
---|
762 | <a href="http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAVID.html" target="_top"> |
---|
763 | http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAVID.html |
---|
764 | </a> |
---|
765 | </p><p> |
---|
766 | </p></li><li><p> |
---|
767 | Geant4 Visualization Tutorial using the DAWN Renderer: |
---|
768 | </p><p> |
---|
769 | <a href="http://geant4.slac.stanford.edu/Presentations/vis/GDAWNTutorial/G4DAWNTutorial.html" target="_top"> |
---|
770 | http://geant4.slac.stanford.edu/Presentations/vis/GDAWNTutorial/G4DAWNTutorial.html |
---|
771 | </a> |
---|
772 | </p><p> |
---|
773 | </p></li></ul></div><p> |
---|
774 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.VRML"></a>8.3.8. |
---|
775 | VRML |
---|
776 | </h3></div></div></div><p> |
---|
777 | These drivers were developed by Satoshi Tanaka and Yasuhide Sawada |
---|
778 | (Fukui University). They generate VRML files, which describe 3D |
---|
779 | scenes to be visualized with a proper VRML viewer, at either a |
---|
780 | local or a remote host. It realizes virtual-reality visualization |
---|
781 | with your WWW browser. There are many excellent VRML viewers, which |
---|
782 | enable one to perform interactive spinning of detectors, walking |
---|
783 | and/or flying inside detectors or particle showers, interactive |
---|
784 | investigation of detailed detector geometry etc. |
---|
785 | </p><p> |
---|
786 | There are two kinds of VRML drivers: the VRMLFILE driver, and |
---|
787 | the VRML-Network driver. The VRMLFILE driver is usually |
---|
788 | recommended, since it is faster and safer in the sense that it is |
---|
789 | not affected by network conditions. |
---|
790 | </p><p> |
---|
791 | The VRMLFILE driver sends 3D data to your VRML viewer, which is |
---|
792 | running on the same host machine as Geant4, via an intermediate |
---|
793 | file named <code class="literal">g4.wrl</code> created in the current directory. This |
---|
794 | file can be re-visualization afterwards. In visualization, the name |
---|
795 | of the VRML viewer should be specified by setting the environment |
---|
796 | variable <code class="literal">G4VRML_VIEWER</code> beforehand. For example, |
---|
797 | |
---|
798 | </p><div class="informalexample"><pre class="programlisting"> |
---|
799 | % setenv G4VRML_VIEWER "netscape" |
---|
800 | </pre></div><p> |
---|
801 | </p><p> |
---|
802 | Its default value is <code class="literal">NONE</code>, which means that no viewer |
---|
803 | is invoked and only the file <code class="literal">g4.wrl</code> is generated. |
---|
804 | </p><h5><a name="id505679"></a> |
---|
805 | Remote Visualization with the VRML-Network Driver |
---|
806 | </h5><p> |
---|
807 | Visualization in Geant4 is considered to be "remote" when it is |
---|
808 | performed on a machine other than the Geant4 host. Some of the |
---|
809 | visualization drivers support this feature. |
---|
810 | </p><p> |
---|
811 | Usually, the visualization host is your local host, while the |
---|
812 | Geant4 host is a remote host where you log in, for example, with |
---|
813 | the <code class="literal">telnet</code> command. This enables distributed processing of |
---|
814 | Geant4 visualization, avoiding the transfer of large amounts of |
---|
815 | visualization data to your terminal display via the network. |
---|
816 | </p><p> |
---|
817 | In order to perform remote visualization with the VRML-Network |
---|
818 | driver, the following must be installed on your local host |
---|
819 | beforehand: |
---|
820 | |
---|
821 | </p><div class="orderedlist"><ol type="1" compact><li><p> |
---|
822 | a VRML viewer |
---|
823 | </p></li><li><p> |
---|
824 | the Java application <code class="literal">g4vrmlview</code>. |
---|
825 | </p></li></ol></div><p> |
---|
826 | </p><p> |
---|
827 | The Java application <code class="literal">g4vrmlview</code> is included as part of the |
---|
828 | Geant4 package and is located at: |
---|
829 | |
---|
830 | </p><div class="informalexample"><pre class="programlisting"> |
---|
831 | source/visualization/VRML/g4vrmlview/ |
---|
832 | </pre></div><p> |
---|
833 | </p><p> |
---|
834 | Installation instructions for <code class="literal">g4vrmlview</code> can be found in |
---|
835 | the <code class="literal">README</code> file there, or on the WWW page below. |
---|
836 | </p><p> |
---|
837 | The following steps realize remote Geant4 visualization |
---|
838 | displayed with your local VRML browser: |
---|
839 | |
---|
840 | </p><div class="orderedlist"><ol type="1" compact><li><p> |
---|
841 | Invoke the <code class="literal">g4vrmlview</code> on your local host, giving a |
---|
842 | VRML viewer name as its argument: |
---|
843 | |
---|
844 | </p><div class="informalexample"><pre class="programlisting"> |
---|
845 | Local_Host> java g4vrmlview VRML_viewer_name |
---|
846 | </pre></div><p> |
---|
847 | |
---|
848 | For example, if you want to use the Netscape browser as your VRML |
---|
849 | viewer, execute <code class="literal">g4vrmlview</code> as follows: |
---|
850 | |
---|
851 | </p><div class="informalexample"><pre class="programlisting"> |
---|
852 | Local_Host> java g4vrmlview netscape |
---|
853 | </pre></div><p> |
---|
854 | |
---|
855 | Of course, the command path to the VRML viewer should be properly set. |
---|
856 | </p></li><li><p> |
---|
857 | Log in to the remote host where a Geant4 executable is placed. |
---|
858 | </p></li><li><p> |
---|
859 | Set an environment variable on the remote host as follows: |
---|
860 | |
---|
861 | </p><div class="informalexample"><pre class="programlisting"> |
---|
862 | Remote_Host> setenv G4VRML_HOST_NAME local_host_name |
---|
863 | </pre></div><p> |
---|
864 | |
---|
865 | For example, if you are working on the local host named |
---|
866 | "arkoop.kek.jp", set this environment variable as follows: |
---|
867 | |
---|
868 | </p><div class="informalexample"><pre class="programlisting"> |
---|
869 | Remote_Host> setenv G4VRML_HOST_NAME arkoop.kek.jp |
---|
870 | </pre></div><p> |
---|
871 | |
---|
872 | This tells a Geant4 process running on the remote host where Geant4 |
---|
873 | Visualization should be performed, i.e., where the visualized views |
---|
874 | should be displayed. |
---|
875 | </p></li><li><p> |
---|
876 | Invoke a Geant4 process and perform visualization with the |
---|
877 | VRML-Network driver. For example: |
---|
878 | |
---|
879 | </p><div class="informalexample"><pre class="programlisting"> |
---|
880 | Idle> /vis/open VRML2 |
---|
881 | Idle> /vis/drawVolume |
---|
882 | Idle> /vis/viewer/update |
---|
883 | </pre></div><p> |
---|
884 | </p></li></ol></div><p> |
---|
885 | </p><p> |
---|
886 | In step 4, 3D scene data are sent from the remote host to the |
---|
887 | local host as VRML-formatted data, and the VRML viewer specified in |
---|
888 | step 3 is invoked by the <code class="literal">g4vrmlview</code> process to visualize |
---|
889 | the VRML data. The transferred VRML data are saved as a file named |
---|
890 | <code class="literal">g4.wrl</code> in the current directory of the local host. |
---|
891 | </p><p> |
---|
892 | <span class="bold"><strong>Further information:</strong></span> |
---|
893 | |
---|
894 | |
---|
895 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
896 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_net_driver.html" target="_top"> |
---|
897 | http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_net_driver.html |
---|
898 | </a> |
---|
899 | </p></li></ul></div><p> |
---|
900 | </p><p> |
---|
901 | <span class="bold"><strong>Further information (VRML drivers):</strong></span> |
---|
902 | |
---|
903 | |
---|
904 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
905 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_file_driver.html" target="_top"> |
---|
906 | http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_file_driver.html |
---|
907 | </a> |
---|
908 | </p></li><li><p> |
---|
909 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_net_driver.html" target="_top"> |
---|
910 | http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML_net_driver.html |
---|
911 | </a> |
---|
912 | </p></li></ul></div><p> |
---|
913 | </p><p> |
---|
914 | <span class="bold"><strong>Sample VRML files:</strong></span> |
---|
915 | |
---|
916 | |
---|
917 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
918 | <a href="http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML2_FIG/" target="_top"> |
---|
919 | http://geant4.kek.jp/GEANT4/vis/GEANT4/VRML2_FIG/ |
---|
920 | </a> |
---|
921 | </p></li></ul></div><p> |
---|
922 | </p><p> |
---|
923 | <span class="bold"><strong>Further information (VRML language and browsers):</strong></span> |
---|
924 | |
---|
925 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
926 | <a href="http://www.vrmlsite.com/" target="_top">http://www.vrmlsite.com/ |
---|
927 | </a> |
---|
928 | </p></li></ul></div><p> |
---|
929 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.RayTrc"></a>8.3.9. |
---|
930 | RayTracer |
---|
931 | </h3></div></div></div><p> |
---|
932 | This driver was developed by Makoto Asai and Minamimoto (Hirosihma |
---|
933 | Instutute of Technology). It performs ray-tracing visualization |
---|
934 | using the tracking routines of Geant4. It is, therefore, available |
---|
935 | for every kinds of shapes/solids which Geant4 can handle. It is |
---|
936 | also utilized for debugging the user's geometry for the tracking |
---|
937 | routines of Geant4. It is well suited for photo-realistic high |
---|
938 | quality output for presentation, and for intuitive debugging of |
---|
939 | detector geometry. It produces a JPEG file. This driver is by |
---|
940 | default listed in the available visualization drivers of user's |
---|
941 | application. |
---|
942 | </p><p> |
---|
943 | Some pieces of geometries may fail to show up in other |
---|
944 | visualization drivers (due to algorithms those drivers use to |
---|
945 | compute visualizable shapes and polygons), but RayTracer can handle |
---|
946 | any geometry that the Geant4 navigator can handle. |
---|
947 | </p><p> |
---|
948 | Because RayTracer in essence takes over Geant4's tracking |
---|
949 | routines for its own use, RayTracer cannot be used to visualize |
---|
950 | Trajectories or hits. |
---|
951 | </p><p> |
---|
952 | An X-Window version, called RayTracerX, can be selected by |
---|
953 | setting <code class="literal">G4VIS_BUILD_RATRACERX_DRIVER</code> at Geant4 library |
---|
954 | build time and <code class="literal">G4VIS_USE_RAYTRACERX</code> at application (user |
---|
955 | code) build time (assuming you use the standard visualization |
---|
956 | manager, <code class="literal">G4VisExecutive</code>, or an equally smart vis manager). |
---|
957 | RayTracerX builds the same jpeg file as RayTracer, but |
---|
958 | simultaneously renders to screen so you can watch as rendering |
---|
959 | grows progressively smoother. |
---|
960 | </p><p> |
---|
961 | RayTracer has its own built-in commands - |
---|
962 | <code class="literal">/vis/rayTracer/</code>.... Alternatively, you can treat it as a |
---|
963 | normal vis system and use <code class="literal">/vis/viewer/</code>... commands, |
---|
964 | e.g: |
---|
965 | |
---|
966 | </p><div class="informalexample"><pre class="programlisting"> |
---|
967 | /vis/open RayTracerX |
---|
968 | /vis/drawVolume |
---|
969 | /vis/viewer/set/viewpointThetaPhi 30 30 |
---|
970 | /vis/viewer/refresh |
---|
971 | </pre></div><p> |
---|
972 | </p><p> |
---|
973 | The view parameters are translated into the necessary RayTracer |
---|
974 | parameters. |
---|
975 | </p><p> |
---|
976 | RayTracer is compute intensive. If you are unsure of a good |
---|
977 | viewing angle or zoom factor, you might be advised to choose them |
---|
978 | with a faster renderer, such as OpenGL, and transfer the view |
---|
979 | parameters with <code class="literal">/vis/viewer/set/all</code>: |
---|
980 | |
---|
981 | </p><div class="informalexample"><pre class="programlisting"> |
---|
982 | /vis/open OGLSXm # or any of the OGL options. Opens, say, viewer-0. |
---|
983 | /vis/drawVolume |
---|
984 | /vis/viewer/zoom # plus any /vis/viewer/commands that get you the view you want. |
---|
985 | /vis/open RayTracerX |
---|
986 | /vis/viewer/set/all viewer-0 |
---|
987 | /vis/viewer/refresh |
---|
988 | </pre></div><p> |
---|
989 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.DetTree"></a>8.3.10. |
---|
990 | Visualization of detector geometry tree |
---|
991 | </h3></div></div></div><p> |
---|
992 | ASCIITREE is a visualization driver that is not actually graphical |
---|
993 | but that dumps the volume hierarchy as a simple text tree. |
---|
994 | </p><p> |
---|
995 | Each call to /vis/viewer/flush or /vis/drawTree will dump the |
---|
996 | tree. |
---|
997 | </p><p> |
---|
998 | ASCIITree has command to control its verbosity, |
---|
999 | <code class="literal">/vis/ASCIITree/verbose</code>. The verbosity value controls the |
---|
1000 | amount of information available, e.g., physical volume name alone, |
---|
1001 | or also logical volume and solid names. If the volume is |
---|
1002 | "sensitive" and/or has a "readout geometry", this may also be |
---|
1003 | indicated. Also, the mass of the physical volume tree(s) can be |
---|
1004 | printed (but beware - higher verbosity levels can be |
---|
1005 | computationally intensive). |
---|
1006 | </p><p> |
---|
1007 | At verbosity level 4, ASCIITree calculates the mass of the |
---|
1008 | complete geometry tree taking into account daughters up to the |
---|
1009 | depth specified for each physical volume. The calculation involves |
---|
1010 | subtracting the mass of that part of the mother that is occupied by |
---|
1011 | each daughter and then adding the mass of the daughter, and so on |
---|
1012 | down the hierarchy. |
---|
1013 | |
---|
1014 | </p><div class="informalexample"><pre class="programlisting"> |
---|
1015 | /vis/ASCIITree/Verbose 4 |
---|
1016 | /vis/viewer/flush |
---|
1017 | "HadCalorimeterPhysical":0 / "HadCalorimeterLogical" / "HadCalorimeterBox"(G4Box), |
---|
1018 | 1.8 m3 , 11.35 g/cm3 |
---|
1019 | "HadCalColumnPhysical":-1 (10 replicas) / "HadCalColumnLogical" / "HadCalColumnBox"(G4Box), |
---|
1020 | 180000 cm3, 11.35 g/cm3 |
---|
1021 | "HadCalCellPhysical":-1 (2 replicas) / "HadCalCellLogical" / "HadCalCellBox"(G4Box), |
---|
1022 | 90000 cm3, 11.35 g/cm3 |
---|
1023 | "HadCalLayerPhysical":-1 (20 replicas) / "HadCalLayerLogical" / "HadCalLayerBox"(G4Box), |
---|
1024 | 4500 cm3, 11.35 g/cm3 |
---|
1025 | "HadCalScintiPhysical":0 / "HadCalScintiLogical" / "HadCalScintiBox"(G4Box), |
---|
1026 | 900 cm3, 1.032 g/cm3 |
---|
1027 | |
---|
1028 | Calculating mass(es)... |
---|
1029 | Overall volume of "worldPhysical":0, is 2400 m3 |
---|
1030 | Mass of tree to unlimited depth is 22260.5 kg |
---|
1031 | </pre></div><p> |
---|
1032 | </p><p> |
---|
1033 | Some more examples of ASCIITree in action: |
---|
1034 | |
---|
1035 | </p><div class="informalexample"><pre class="programlisting"> |
---|
1036 | Idle> /vis/ASCIITree/verbose 1 |
---|
1037 | Idle> /vis/drawTree |
---|
1038 | # Set verbosity with "/vis/ASCIITree/verbose |
---|
1039 | # < 10: - does not print daughters of repeated placements, does not repeat replicas. |
---|
1040 | # >= 10: prints all physical volumes. |
---|
1041 | # The level of detail is given by verbosity%10: |
---|
1042 | # for each volume: |
---|
1043 | # >= 0: physical volume name. |
---|
1044 | # >= 1: logical volume name (and names of sensitive detector and readout geometry, if any). |
---|
1045 | # >= 2: solid name and type. |
---|
1046 | # >= 3: volume and density. |
---|
1047 | # >= 5: daughter-subtracted volume and mass. |
---|
1048 | # and in the summary at the end of printing: |
---|
1049 | # >= 4: daughter-included mass of top physical volume(s) in scene to depth specified. |
---|
1050 | ..... |
---|
1051 | "Calorimeter", copy no. 0, belongs to logical volume "Calorimeter" |
---|
1052 | "Layer", copy no. -1, belongs to logical volume "Layer" (10 replicas) |
---|
1053 | "Absorber", copy no. 0, belongs to logical volume "Absorber" |
---|
1054 | "Gap", copy no. 0, belongs to logical volume "Gap" |
---|
1055 | ..... |
---|
1056 | Idle> /vis/ASCIITree/verbose 15 |
---|
1057 | Idle> /vis/drawTree |
---|
1058 | .... |
---|
1059 | "tube_phys":0 / "tube_L" / "tube"(G4Tubs), 395841 cm3, 1.782 mg/cm3, |
---|
1060 | 9.6539e-08 mm3, 1.72032e-10 mg |
---|
1061 | "divided_tube_phys":0 / "divided_tube_L" / "divided_tube"(G4Tubs), 65973.4 cm3, |
---|
1062 | 1.782 mg/cm3, 7587.54 cm3, 13.521 g |
---|
1063 | "divided_tube_inset_phys":0 / "divided_tube_inset_L" / "divided_tube_inset"(G4Tubs), |
---|
1064 | 58385.9 cm3, 1.782 mg/cm3, 6.03369e-09 mm3, 1.0752e-11 mg |
---|
1065 | "sub_divided_tube_phys":0 / "sub_divided_tube_L" / "sub_divided_tube"(G4Tubs), |
---|
1066 | 14596.5 cm3, 1.782 mg/cm3, 12196.5 cm3, 21.7341 g |
---|
1067 | ..... |
---|
1068 | Calculating mass(es)... |
---|
1069 | Overall volume of "expHall_P":0, is 8000 m3 and the daughter-included mass to unlimited depth |
---|
1070 | is 78414 kg |
---|
1071 | ..... |
---|
1072 | </pre></div><p> |
---|
1073 | </p><p> |
---|
1074 | For the complete list of commands and options, see the |
---|
1075 | <a href="./AllResources/Control/UIcommands/_vis_.html" target="_top"> |
---|
1076 | Control...UICommands</a> section of this user guide. |
---|
1077 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.GAGTree"></a>8.3.11. |
---|
1078 | GAG Tree |
---|
1079 | </h3></div></div></div><p> |
---|
1080 | The GAGTree driver provides a listing of the detector geometry tree |
---|
1081 | within GAG, the Geant Adaptive GUI, ( |
---|
1082 | <a href="http://erpc1.naruto-u.ac.jp/~geant4" target="_top"> |
---|
1083 | http://erpc1.naruto-u.ac.jp/~geant4 |
---|
1084 | </a> |
---|
1085 | ). GAG allows "folding/un-folding" a part of the geometry tree, using |
---|
1086 | the <span class="emphasis"><em>Tree Widget</em></span> in Java: |
---|
1087 | |
---|
1088 | </p><div class="informalfigure"><a name="fig.VisDrv_1"></a><div class="mediaobject" align="center"><img src="./AllResources/Visualization/visualization.src/gagtree.jpg" align="middle"></div></div><p> |
---|
1089 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.XMLTree"></a>8.3.12. |
---|
1090 | XML Tree |
---|
1091 | </h3></div></div></div><p> |
---|
1092 | The XML description of the geometry tree can be created in Geant4 |
---|
1093 | by the XML Tree driver. The XML source can also be edited on the |
---|
1094 | fly. The created XML files are visualizable with any XML browser |
---|
1095 | (in Windows, a good XML viewer is <span class="emphasis"><em>XML Notepad</em></span>). |
---|
1096 | |
---|
1097 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
1098 | Folding and un-folding: |
---|
1099 | |
---|
1100 | </p><div class="informalfigure"><a name="fig.VisDrv_2"></a><div class="mediaobject" align="center"><img src="./AllResources/Visualization/visualization.src/xmlnp.gif" align="middle"></div></div><p> |
---|
1101 | </p></li></ul></div><p> |
---|
1102 | |
---|
1103 | |
---|
1104 | </p><div class="itemizedlist"><ul type="disc"><li><p> |
---|
1105 | Searching a string: |
---|
1106 | |
---|
1107 | </p><div class="informalfigure"><a name="fig.VisDrv_3"></a><div class="mediaobject" align="center"><img src="./AllResources/Visualization/visualization.src/xmlnpfind.gif" align="middle"></div></div><p> |
---|
1108 | </p></li></ul></div><p> |
---|
1109 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisDrv.Qt"></a>8.3.13. |
---|
1110 | Qt |
---|
1111 | </h3></div></div></div><p> |
---|
1112 | This driver have been developed by Laurent Garnier (IN2P3, LAL Orsay). |
---|
1113 | It is an interface to the powerful toolkit Qt, now free on lot of |
---|
1114 | platforms. This driver needs OpenGL library to be install. It is well suited for |
---|
1115 | real-time fast visualization and demonstration. Fast visualization |
---|
1116 | is realized with hardware acceleration, reuse of shapes stored in a |
---|
1117 | display list, etc. NURBS visualization is also supported. All OpenGL |
---|
1118 | features are implements in Qt driver . In addition, mouse events control |
---|
1119 | are used to rotation/move/zoom volume, you can save your scene in lots |
---|
1120 | of formats (vector or not), make movies... |
---|
1121 | </p><p> |
---|
1122 | There is only one session of Qt driver for all available platform. |
---|
1123 | Two display modes are available: immediate mode and stored mode. |
---|
1124 | The former has no limitation on data size, and the latter is fast |
---|
1125 | for visualizing large data repetitively, and so is suitable for |
---|
1126 | animation. |
---|
1127 | </p><p> |
---|
1128 | To see the visualization window : |
---|
1129 | </p><div class="informalexample"><pre class="programlisting"> |
---|
1130 | /vis/open OGLSQt |
---|
1131 | </pre></div><p> |
---|
1132 | </p><p> |
---|
1133 | <span class="bold"><strong>Further information (Qt):</strong></span> |
---|
1134 | |
---|
1135 | </p><div class="itemizedlist"><ul type="disc" compact><li><p> |
---|
1136 | Qt toolkit |
---|
1137 | <a href="http://trolltech.com/" target="_top"> |
---|
1138 | http://trolltech.com/ |
---|
1139 | </a> |
---|
1140 | </p></li><li><p> |
---|
1141 | <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4OpenGLTutorial/G4OpenGLTutorial.html" target="_top"> |
---|
1142 | Geant4 Visualization Tutorial |
---|
1143 | </a> |
---|
1144 | using the Qt Toolkit |
---|
1145 | </p></li></ul></div><p> |
---|
1146 | </p><p> |
---|
1147 | </div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch08s02.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch08.html"><img src="AllResources/IconsGIF/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch08s04.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">8.2. |
---|
1148 | Adding Visualization to Your Executable |
---|
1149 | </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="AllResources/IconsGIF/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> 8.4. |
---|
1150 | Controlling Visualization from Commands |
---|
1151 | </td></tr></table></div></body></html> |
---|