source: trunk/Documentation/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch08.html@ 901

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

Add Geant4 Documentation at 8.12.2008

File size: 15.3 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 8.  Visualization</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="index.html" title="Geant4 User's Guide for Application Developers"><link rel="prev" href="ch07s02.html" title="7.2.  User Interface - Defining New Commands"><link rel="next" href="ch08s02.html" title="8.2.  Adding Visualization to Your Executable"><script language="JavaScript">
2function 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">Chapter 8. 
9Visualization
10</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s02.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch08s02.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chap.Visualization"></a>Chapter 8. 
11Visualization
12</h2></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.VisIntro"></a>8.1. 
13Introduction to Visualization
14</h2></div></div></div><p>
15The Geant4 visualization system was developed in response to a
16diverse set of requirements:
17
18</p><div class="orderedlist"><ol type="1" compact><li><p>
19 Quick response to study geometries, trajectories and hits
20 </p></li><li><p>
21 High-quality output for publications
22 </p></li><li><p>
23 Flexible camera control to debug complex geometries
24 </p></li><li><p>
25 Tools to show volume overlap errors in detector geometries
26 </p></li><li><p>
27 Interactive picking to get more information on visualized objects
28 </p></li></ol></div><p>
29</p><p>
30No one graphics system is ideal for all of these requirements,
31and many of the large software frameworks into which Geant4 has
32been incorporated already have their own visualization systems, so
33Geant4 visualization was designed around an abstract interface that
34supports a diverse family of graphics systems. Some of these
35graphics systems use a graphics library compiled with Geant4, such
36as OpenGL, while others involve a separate application, such as
37WIRED or DAWN.
38</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.What"></a>8.1.1. 
39What Can be Visualized
40</h3></div></div></div><p>
41Simulation data can be visualized:
42
43</p><div class="itemizedlist"><ul type="disc" compact><li><p>
44 Detector components
45 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
46 A hierarchical structure of physical volumes
47 </p></li><li><p>
48 A piece of physical volume, logical volume, and solid
49 </p></li></ul></div><p>
50 </p></li><li><p>
51 Particle trajectories and tracking steps
52 </p></li><li><p>
53 Hits of particles in detector components
54 </p></li></ul></div><p>
55</p><p>
56Other user defined objects can be visualized:
57
58</p><div class="itemizedlist"><ul type="disc" compact><li><p>
59 Polylines, such as coordinate axes
60 </p></li><li><p>
61 3D Markers, such as eye guides
62 </p></li><li><p>
63 Text, descriptive character strings, comments or titles
64 </p></li><li><p>
65 Scales
66 </p></li><li><p>
67 Logos
68 </p></li></ul></div><p>
69</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.Choice"></a>8.1.2. 
70You have a Choice of Visualization Drivers
71</h3></div></div></div><p>
72The many graphics systems that Geant4 supports are complementary to
73each other.
74
75</p><div class="itemizedlist"><ul type="disc" compact><li><p>
76 OpenGL
77 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
78 View directly from Geant4
79 </p></li><li><p>
80 Uses GL libraries that are already included on most Linux
81 systems (plus some Windows availability)
82 </p></li><li><p>
83 Rendered, photorealistic image with some interactive features
84 </p></li><li><p>
85 zoom, rotate, translate
86 </p></li><li><p>
87 Fast response (can usually exploit full potential of graphics
88 hardware)
89 </p></li><li><p>
90 Limited printing ability (pixel graphics, not vector graphics)
91 </p></li></ul></div><p>
92 </p></li><li><p>
93 OpenInventor
94 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
95 View directly from Geant4
96 </p></li><li><p>
97 Requires addition of OpenInventor libraries (freely available
98 for most Linux systems).
99 </p></li><li><p>
100 Rendered, photorealistic image
101 </p></li><li><p>
102 Many interactive features
103 </p></li><li><p>
104 zoom, rotate, translate
105 </p></li><li><p>
106 click to "see inside" opaque
107 volumes
108 </p></li><li><p>
109 Fast response (can usually exploit full potential of graphics
110 hardware)
111 </p></li><li><p>
112 Expanded printing ability (vector and pixel graphics)
113 </p></li></ul></div><p>
114 </p></li><li><p>
115 HepRep/WIRED
116 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
117 Create a file to view in the WIRED3 HepRep Browser or the
118 WIRED4 JAS Plugin
119 </p></li><li><p>
120 Requires WIRED browser (a Java application easily to install on
121 all operating systems)
122 </p></li><li><p>
123 Wireframe or simple area fills (not photorealistic)
124 </p></li><li><p>
125 Many interactive features
126 </p></li><li><p>
127 zoom, rotate, translate
128 </p></li><li><p>
129 click to show attributes (momentum, etc.)
130 </p></li><li><p>
131 special projections (FishEye, etc.)
132 </p></li><li><p>
133 control visibility from hierarchical (tree) view of data
134 </p></li><li><p>
135 Hierarchical view of the geometry
136 </p></li><li><p>
137 Export to many vector graphic formats (PostScript, PDF, etc.)
138 </p></li></ul></div><p>
139 </p></li><li><p>
140 DAWN
141 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
142 Create a file to view in the DAWN Renderer
143 </p></li><li><p>
144 Requires DAWN, available for all Linux and Windows systems.
145 </p></li><li><p>
146 Rendered, photorealistic image
147 </p></li><li><p>
148 No interactive features
149 </p></li><li><p>
150 Highest quality technical rendering - output to vector PostScript
151 </p></li></ul></div><p>
152 </p></li><li><p>
153 VRML
154 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
155 Create a file to view in any VRML browser (some as web browser
156 plug-ins).
157 </p></li><li><p>
158 Requires VRML browser (many different choices for different
159 operating systems).
160 </p></li><li><p>
161 Rendered, photorealistic image with some interactive features
162 </p></li><li><p>
163 zoom, rotate, translate
164 </p></li><li><p>
165 Limited printing ability (pixel graphics, not vector graphics)
166 </p></li></ul></div><p>
167 </p></li><li><p>
168 RayTracer
169 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
170 Create a jpeg file
171 </p></li><li><p>
172 Forms image by using Geant4's own tracking
173 to follow photons through the detector
174 </p></li><li><p>
175 Can show geometry but not trajectories
176 </p></li><li><p>
177 Can render any geometry that Geant4 can handle (such as Boolean
178 solids)
179 </p></li><li><p>
180 Supports shadows, transparency and mirrored surfaces
181 </p></li></ul></div><p>
182 </p></li><li><p>
183 ASCIITree
184 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
185 Text dump of the geometry hierarchy
186 </p></li><li><p>
187 Not graphical
188 </p></li><li><p>
189 Control over level of detail to be dumped
190 </p></li><li><p>
191 Can calculate mass and volume of any hierarchy of volumes
192 </p></li></ul></div><p>
193 </p></li></ul></div><p>
194</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.ChoDrv"></a>8.1.3. 
195Choose the Driver that Meets Your Needs
196</h3></div></div></div><p>
197</p><div class="itemizedlist"><ul type="disc" compact><li><p>
198 If you want very responsive photorealistic graphics (and have
199 the OpenGL libraries installed)
200 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
201 OpenGL is a good solution (if you have the Motif extensions,
202 this also gives GUI control)
203 </p></li></ul></div><p>
204 </p></li><li><p>
205 If you want very responsive photorealistic graphics plus more
206 interactivity (and have the OpenInventor libraries installed)
207 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
208 OpenInventor is a good solution
209 </p></li></ul></div><p>
210 </p></li><li><p>
211 If you want GUI control, want to be able to pick on items to
212 inquire about them (identity, momentum, etc.), perhaps want to
213 render to vector formats, and a wireframe look will do
214 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
215 HepRep/WIRED will meet your needs
216 </p></li></ul></div><p>
217 </p></li><li><p>
218 If you want to render highest quality photorealistic images for
219 use in a poster or a technical design report, and you can live
220 without quick rotate and zoom
221 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
222 DAWN is the way to go
223 </p></li></ul></div><p>
224 </p></li><li><p>
225 If you want to render to a 3D format that others can view in a
226 variety of commodity browsers (including some web browser plug-ins)
227 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
228 VRML is the way to go
229 </p></li></ul></div><p>
230 </p></li></ul></div><p>
231
232
233</p><div class="itemizedlist"><ul type="disc" compact><li><p>
234 If you want to visualize a geometry that the other
235 visualization drivers can't handle, or you need
236 transparency or mirrors, and you don't need to
237 visualize trajectories
238 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
239 RayTracer will do it
240 </p></li></ul></div><p>
241 </p></li><li><p>
242 If you just want to quickly check the geometry hierarchy, or if
243 you want to calculate the volume or mass of any geometry hierarchy
244 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
245 ASCIITree will meet your needs
246 </p></li></ul></div><p>
247 </p></li><li><p>
248 You can also add your own visualization driver.
249 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
250 Geant4's visualization system is modular. By
251 creating just three new classes, you can direct Geant4 information
252 to your own visualization system.
253 </p></li></ul></div><p>
254 </p></li></ul></div><p>
255</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.CntVis"></a>8.1.4. 
256Controlling Visualization
257</h3></div></div></div><p>
258Your Geant4 code stays basically the same no matter which driver
259you use.
260</p><p>
261Visualization is performed either with commands or from C++ code.
262
263</p><div class="itemizedlist"><ul type="disc" compact><li><p>
264 Some visualization drivers work directly from Geant4
265 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
266 OpenGL
267 </p></li><li><p>
268 OpenInventor
269 </p></li><li><p>
270 RayTracer
271 </p></li><li><p>
272 ASCIITree
273 </p></li></ul></div><p>
274 </p></li><li><p>
275 For other visualization drivers, you first have Geant4 produce
276 a file, and then you have that file rendered by another application
277 (which may have GUI control)
278 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
279 HepRep/WIRED
280 </p></li><li><p>
281 DAWN
282 </p></li><li><p>
283 VRML
284 </p></li></ul></div><p>
285 </p></li></ul></div><p>
286</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.Details"></a>8.1.5. 
287Visualization Details
288</h3></div></div></div><p>
289The following sections of this guide cover the details of Geant4
290visualization:
291
292</p><div class="itemizedlist"><ul type="disc" compact><li><p>
293 <a href="ch08s02.html" title="8.2. 
294Adding Visualization to Your Executable
295">Section 8.2</a>
296 Adding Visualization to Your Executable
297 </p></li><li><p>
298 <a href="ch08s03.html" title="8.3. 
299The Visualization Drivers
300">Section 8.3</a>
301 The Visualization Drivers
302 </p></li><li><p>
303 <a href="ch08s04.html" title="8.4. 
304Controlling Visualization from Commands
305">Section 8.4</a>
306 Controlling Visualization from Commands
307 </p></li><li><p>
308 <a href="ch08s05.html" title="8.5. 
309Controlling Visualization from Compiled Code
310">Section 8.5</a>
311 Controlling Visualization from Compiled Code
312 </p></li><li><p>
313 <a href="ch08s06.html" title="8.6. 
314Visualization Attributes
315">Section 8.6</a>
316 Visualization Attributes
317 </p></li><li><p>
318 <a href="ch08s07.html" title="8.7. 
319Enhanced Trajectory Drawing
320">Section 8.7</a>
321 Enhanced Trajectory Drawing
322 </p></li><li><p>
323 <a href="ch08s09.html" title="8.9. 
324Polylines, Markers and Text
325">Section 8.9</a>
326 Polylines, Markers and Text
327 </p></li></ul></div><p>
328</p><p>
329Other useful references for Geant4 visualization outside of this
330user guide:
331
332</p><div class="itemizedlist"><ul type="disc" compact><li><p>
333 Introduction to Geant4 Visualization (
334 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisTutorial.pdf" target="_top">
335 pdf</a>,
336 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisTutorial.ppt" target="_top">
337 ppt</a> )
338 </p></li><li><p>
339 Status of Geant4 Visualization (giving current status and a
340 summary of what has been improved over the last few releases) (
341 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisStatus.pdf" target="_top">
342 pdf</a>,
343 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisStatus.ppt" target="_top">
344 ppt</a> )
345 </p></li><li><p>
346 Macro files distributed in Geant4 source in
347 <code class="literal">examples/novice/N03/visTutor/</code>.
348 </p></li></ul></div><p>
349</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s02.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch08s02.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">7.2. 
350User Interface - Defining New Commands
351 </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.2. 
352Adding Visualization to Your Executable
353</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.