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

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

debut de modif de la doc

File size: 16.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><li><p>
194 Qt
195 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
196 View directly from Geant4
197 </p></li><li><p>
198 Uses GL libraries that are already included on most Linux
199 systems (plus some Windows availability)
200 </p></li><li><p>
201 Rendered, photorealistic image with some interactive features
202 </p></li><li><p>
203 zoom, rotate, translate
204 </p></li><li><p>
205 Fast response (can usually exploit full potential of graphics
206 hardware)
207 </p></li><li><p>
208 Expanded printing ability (vector and pixel graphics)
209 </p></li><li><p>
210 Could make movies
211 </p></li></ul></div><p>
212 </p></li></ul></div><p>
213</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.ChoDrv"></a>8.1.3. 
214Choose the Driver that Meets Your Needs
215</h3></div></div></div><p>
216</p><div class="itemizedlist"><ul type="disc" compact><li><p>
217 If you want very responsive photorealistic graphics (and have
218 the OpenGL libraries installed)
219 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
220 OpenGL is a good solution (if you have the Motif extensions,
221 this also gives GUI control)
222 </p></li></ul></div><p>
223 </p></li><li><p>
224 If you want very responsive photorealistic graphics plus more
225 interactivity (and have the Qt and OpenGL libraries installed)
226 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
227 Qt is a good solution and will also give you the GUI control
228 </p></li></ul></div><p>
229 </p></li><li><p>
230 If you want very responsive photorealistic graphics plus more
231 interactivity (and have the OpenInventor libraries installed)
232 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
233 OpenInventor is a good solution
234 </p></li></ul></div><p>
235 </p></li><li><p>
236 If you want GUI control, want to be able to pick on items to
237 inquire about them (identity, momentum, etc.), perhaps want to
238 render to vector formats, and a wireframe look will do
239 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
240 HepRep/WIRED will meet your needs
241 </p></li></ul></div><p>
242 </p></li><li><p>
243 If you want to render highest quality photorealistic images for
244 use in a poster or a technical design report, and you can live
245 without quick rotate and zoom
246 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
247 DAWN is the way to go
248 </p></li></ul></div><p>
249 </p></li><li><p>
250 If you want to render to a 3D format that others can view in a
251 variety of commodity browsers (including some web browser plug-ins)
252 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
253 VRML is the way to go
254 </p></li></ul></div><p>
255 </p></li></ul></div><p>
256
257
258</p><div class="itemizedlist"><ul type="disc" compact><li><p>
259 If you want to visualize a geometry that the other
260 visualization drivers can't handle, or you need
261 transparency or mirrors, and you don't need to
262 visualize trajectories
263 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
264 RayTracer will do it
265 </p></li></ul></div><p>
266 </p></li><li><p>
267 If you just want to quickly check the geometry hierarchy, or if
268 you want to calculate the volume or mass of any geometry hierarchy
269 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
270 ASCIITree will meet your needs
271 </p></li></ul></div><p>
272 </p></li><li><p>
273 You can also add your own visualization driver.
274 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
275 Geant4's visualization system is modular. By
276 creating just three new classes, you can direct Geant4 information
277 to your own visualization system.
278 </p></li></ul></div><p>
279 </p></li></ul></div><p>
280</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.CntVis"></a>8.1.4. 
281Controlling Visualization
282</h3></div></div></div><p>
283Your Geant4 code stays basically the same no matter which driver
284you use.
285</p><p>
286Visualization is performed either with commands or from C++ code.
287
288</p><div class="itemizedlist"><ul type="disc" compact><li><p>
289 Some visualization drivers work directly from Geant4
290 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
291 OpenGL
292 </p></li><li><p>
293 Qt
294 </p></li><li><p>
295 OpenInventor
296 </p></li><li><p>
297 RayTracer
298 </p></li><li><p>
299 ASCIITree
300 </p></li></ul></div><p>
301 </p></li><li><p>
302 For other visualization drivers, you first have Geant4 produce
303 a file, and then you have that file rendered by another application
304 (which may have GUI control)
305 </p><div class="itemizedlist"><ul type="circle" compact><li><p>
306 HepRep/WIRED
307 </p></li><li><p>
308 DAWN
309 </p></li><li><p>
310 VRML
311 </p></li></ul></div><p>
312 </p></li></ul></div><p>
313</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.VisIntro.Details"></a>8.1.5. 
314Visualization Details
315</h3></div></div></div><p>
316The following sections of this guide cover the details of Geant4
317visualization:
318
319</p><div class="itemizedlist"><ul type="disc" compact><li><p>
320 <a href="ch08s02.html" title="8.2. 
321Adding Visualization to Your Executable
322">Section 8.2</a>
323 Adding Visualization to Your Executable
324 </p></li><li><p>
325 <a href="ch08s03.html" title="8.3. 
326The Visualization Drivers
327">Section 8.3</a>
328 The Visualization Drivers
329 </p></li><li><p>
330 <a href="ch08s04.html" title="8.4. 
331Controlling Visualization from Commands
332">Section 8.4</a>
333 Controlling Visualization from Commands
334 </p></li><li><p>
335 <a href="ch08s05.html" title="8.5. 
336Controlling Visualization from Compiled Code
337">Section 8.5</a>
338 Controlling Visualization from Compiled Code
339 </p></li><li><p>
340 <a href="ch08s06.html" title="8.6. 
341Visualization Attributes
342">Section 8.6</a>
343 Visualization Attributes
344 </p></li><li><p>
345 <a href="ch08s07.html" title="8.7. 
346Enhanced Trajectory Drawing
347">Section 8.7</a>
348 Enhanced Trajectory Drawing
349 </p></li><li><p>
350 <a href="ch08s09.html" title="8.9. 
351Polylines, Markers and Text
352">Section 8.9</a>
353 Polylines, Markers and Text
354 </p></li></ul></div><p>
355</p><p>
356Other useful references for Geant4 visualization outside of this
357user guide:
358
359</p><div class="itemizedlist"><ul type="disc" compact><li><p>
360 Introduction to Geant4 Visualization (
361 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisTutorial.pdf" target="_top">
362 pdf</a>,
363 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisTutorial.ppt" target="_top">
364 ppt</a> )
365 </p></li><li><p>
366 Status of Geant4 Visualization (giving current status and a
367 summary of what has been improved over the last few releases) (
368 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisStatus.pdf" target="_top">
369 pdf</a>,
370 <a href="http://geant4.slac.stanford.edu/Presentations/vis/G4VisStatus.ppt" target="_top">
371 ppt</a> )
372 </p></li><li><p>
373 Macro files distributed in Geant4 source in
374 <code class="literal">examples/novice/N03/visTutor/</code>.
375 </p></li></ul></div><p>
376</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. 
377User Interface - Defining New Commands
378 </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. 
379Adding Visualization to Your Executable
380</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.