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