| 1 | <!-- ******************************************************** -->
|
|---|
| 2 | <!-- -->
|
|---|
| 3 | <!-- [History] -->
|
|---|
| 4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 -->
|
|---|
| 5 | <!-- Updates for Qt: Laurent Garnier, Dec-2008 -->
|
|---|
| 6 | <!-- -->
|
|---|
| 7 | <!-- ******************************************************** -->
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | <!-- ******************* Section (Level#1) ****************** -->
|
|---|
| 11 | <sect1 id="sect.VisAddExe">
|
|---|
| 12 | <title>
|
|---|
| 13 | Adding Visualization to Your Executable
|
|---|
| 14 | </title>
|
|---|
| 15 |
|
|---|
| 16 | <para>
|
|---|
| 17 | This section explains how to incorporate your selected
|
|---|
| 18 | visualization drivers into the <literal>main()</literal> function and create
|
|---|
| 19 | an executable for it. In order to perform visualization with your
|
|---|
| 20 | Geant4 executable, you must compile it with realized visualization
|
|---|
| 21 | driver(s). You may be dazzled by the number of choices of
|
|---|
| 22 | visualization driver, but you need not use all of them at one time.
|
|---|
| 23 | </para>
|
|---|
| 24 |
|
|---|
| 25 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 26 | <sect2 id="sect.VisAddExe.InstDrv">
|
|---|
| 27 | <title>
|
|---|
| 28 | Installing Visualization Drivers
|
|---|
| 29 | </title>
|
|---|
| 30 |
|
|---|
| 31 | <para>
|
|---|
| 32 | Depending on what has been installed on your system, several kinds
|
|---|
| 33 | of visualization driver are available. One or many drivers may be
|
|---|
| 34 | chosen for realization in compilation, depending on your
|
|---|
| 35 | visualization requirements. Features and notes on each driver are
|
|---|
| 36 | briefly described in <xref linkend="sect.VisDrv" />
|
|---|
| 37 | "<emphasis role="bold">Visualization Drivers</emphasis>",
|
|---|
| 38 | along with links to detailed web pages for the various drivers.
|
|---|
| 39 | </para>
|
|---|
| 40 |
|
|---|
| 41 | <para>
|
|---|
| 42 | Note that not all drivers can be installed on all systems;
|
|---|
| 43 | <xref linkend="table.VisDrv_1" /> in
|
|---|
| 44 | <xref linkend="sect.VisDrv" /> lists all the available drivers
|
|---|
| 45 | and the platforms on which they can be installed.
|
|---|
| 46 | For any of the visualization drivers to work, the corresponding
|
|---|
| 47 | graphics system must be installed beforehand.
|
|---|
| 48 | </para>
|
|---|
| 49 |
|
|---|
| 50 | <para>
|
|---|
| 51 | Unless the environment variable <literal>G4VIS_NONE</literal> is set to
|
|---|
| 52 | "1", visualization drivers that do not depend on external libraries
|
|---|
| 53 | are automatically incorporated into Geant4 libraries during their
|
|---|
| 54 | installation. (Here "installation of Geant4 libraries" means the
|
|---|
| 55 | generation of Geant4 libraries by compilation.) The automatically
|
|---|
| 56 | incorporated visualization drivers are: DAWNFILE, HepRepFile,
|
|---|
| 57 | HepRepXML, RayTracer, VRML1FILE, VRML2FILE and ATree and
|
|---|
| 58 | GAGTree.
|
|---|
| 59 | </para>
|
|---|
| 60 |
|
|---|
| 61 | <para>
|
|---|
| 62 | The OpenGL, Qt, OpenInventor and RayTracerX drivers are not
|
|---|
| 63 | incorporated by default. Nor are the DAWN-Network and VRML-Network
|
|---|
| 64 | drivers, because they require the network setting of the installed
|
|---|
| 65 | machine. In order to incorporate them, the environment variables
|
|---|
| 66 | "<literal>G4VIS_BUILD_DRIVERNAME_DRIVER</literal>" should be set to
|
|---|
| 67 | "<literal>1</literal>" before installing the Geant4 libraries:
|
|---|
| 68 |
|
|---|
| 69 | <informalexample>
|
|---|
| 70 | <programlisting>
|
|---|
| 71 | setenv G4VIS_BUILD_OPENGLX_DRIVER 1 # OpenGL-Xlib driver
|
|---|
| 72 | setenv G4VIS_BUILD_OPENGLXM_DRIVER 1 # OpenGL-Motif driver
|
|---|
| 73 | setenv G4VIS_BUILD_OPENGLQT_DRIVER 1 # Qt driver
|
|---|
| 74 | setenv G4VIS_BUILD_OIX_DRIVER 1 # OpenInventor-Xlib driver
|
|---|
| 75 | setenv G4VIS_BUILD_RAYTRACERX_DRIVER 1 # RayTracer-XLib driver
|
|---|
| 76 | setenv G4VIS_BUILD_DAWN_DRIVER 1 # DAWN-Network driver
|
|---|
| 77 | setenv G4VIS_BUILD_VRML_DRIVER 1 # VRML-Network
|
|---|
| 78 | </programlisting>
|
|---|
| 79 | </informalexample>
|
|---|
| 80 | </para>
|
|---|
| 81 |
|
|---|
| 82 | <para>
|
|---|
| 83 | Unless the environment variable <literal>G4VIS_NONE</literal> is set to "1",
|
|---|
| 84 | setting any of the above variables sets a C-pre-processor flag of
|
|---|
| 85 | the same name. Also the C-pre-processor flag <literal>G4VIS_BUILD</literal>
|
|---|
| 86 | is set (see config/G4VIS_BUILD.gmk), which incorparates the
|
|---|
| 87 | selected driver into the Geant4 libraries.
|
|---|
| 88 | </para>
|
|---|
| 89 |
|
|---|
| 90 | </sect2>
|
|---|
| 91 |
|
|---|
| 92 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 93 | <sect2 id="sect.VisAddExe.RealVisDrv">
|
|---|
| 94 | <title>
|
|---|
| 95 | How to Realize Visualization Drivers in an Executable
|
|---|
| 96 | </title>
|
|---|
| 97 |
|
|---|
| 98 | <para>
|
|---|
| 99 | You can realize and use any of the visualization driver(s) you want
|
|---|
| 100 | in your Geant4 executable, provided they are among the set
|
|---|
| 101 | installed beforehand into the Geant4 libraries. A warning will
|
|---|
| 102 | appear if this is not the case.
|
|---|
| 103 | </para>
|
|---|
| 104 |
|
|---|
| 105 | <para>
|
|---|
| 106 | In order to realize visualization drivers, you must instantiate
|
|---|
| 107 | and initialize a subclass of <literal>G4VisManager</literal> that implements
|
|---|
| 108 | the pure virtual function <literal>RegisterGraphicsSystems()</literal>. This
|
|---|
| 109 | subclass must be compiled in the user's domain to force the loading
|
|---|
| 110 | of appropriate libraries in the right order. The easiest way to do
|
|---|
| 111 | this is to use <literal>G4VisExecutive</literal>, a provided class with
|
|---|
| 112 | included implementation. <literal>G4VisExecutive</literal> is sensitive to
|
|---|
| 113 | the <literal>G4VIS_USE...</literal> variables mentioned below.
|
|---|
| 114 | </para>
|
|---|
| 115 |
|
|---|
| 116 | <para>
|
|---|
| 117 | If you do wish to write your own subclass, you may do so. You
|
|---|
| 118 | will see how to do this by looking at <literal>G4VisExecutive.icc</literal>.
|
|---|
| 119 | A typical extract is:
|
|---|
| 120 |
|
|---|
| 121 | <informalexample>
|
|---|
| 122 | <programlisting>
|
|---|
| 123 | ...
|
|---|
| 124 | RegisterGraphicsSystem (new G4DAWNFILE);
|
|---|
| 125 | ...
|
|---|
| 126 | #ifdef G4VIS_USE_OPENGLX
|
|---|
| 127 | RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
|---|
| 128 | RegisterGraphicsSystem (new G4OpenGLStoredX);
|
|---|
| 129 | #endif
|
|---|
| 130 | ...
|
|---|
| 131 | </programlisting>
|
|---|
| 132 | </informalexample>
|
|---|
| 133 | </para>
|
|---|
| 134 |
|
|---|
| 135 | <para>
|
|---|
| 136 | If you wish to use <literal>G4VisExecutive</literal> but register an
|
|---|
| 137 | additional graphics system, <literal>XXX</literal> say, you may do so either
|
|---|
| 138 | before or after initializing:
|
|---|
| 139 |
|
|---|
| 140 | <informalexample>
|
|---|
| 141 | <programlisting>
|
|---|
| 142 | visManager->RegisterGraphicsSytem(new XXX);
|
|---|
| 143 | visManager->Initialize();
|
|---|
| 144 | </programlisting>
|
|---|
| 145 | </informalexample>
|
|---|
| 146 | </para>
|
|---|
| 147 |
|
|---|
| 148 | <para>
|
|---|
| 149 | By default, you get the DAWNFILE, HepRepFile, RayTracer,
|
|---|
| 150 | VRML1FILE, VRML2FILE, ATree and GAGTree drivers. Additionally, you
|
|---|
| 151 | may choose from the OpenGL-Xlib, OpenGL-Motif, Qt, OpenInventor,
|
|---|
| 152 | RayTracerX, DAWN-Network and VRML-Network drivers, each of which
|
|---|
| 153 | can be selected by setting the proper environment variable:
|
|---|
| 154 |
|
|---|
| 155 | <informalexample>
|
|---|
| 156 | <programlisting>
|
|---|
| 157 | setenv G4VIS_USE_OPENGLX 1
|
|---|
| 158 | setenv G4VIS_USE_OPENGLXM 1
|
|---|
| 159 | setenv G4VIS_USE_OPENGLQT 1
|
|---|
| 160 | setenv G4VIS_USE_OIX 1
|
|---|
| 161 | setenv G4VIS_USE_RAYTRACERX 1
|
|---|
| 162 | setenv G4VIS_USE_DAWN 1
|
|---|
| 163 | setenv G4VIS_USE_VRML 1
|
|---|
| 164 | </programlisting>
|
|---|
| 165 | </informalexample>
|
|---|
| 166 | </para>
|
|---|
| 167 |
|
|---|
| 168 | <para>
|
|---|
| 169 | (Of course, this has to be chosen from the set incorporated into
|
|---|
| 170 | the Geant4 libraries during their compilation.) Unless the
|
|---|
| 171 | environment variable <literal>G4VIS_NONE</literal> is set, these set
|
|---|
| 172 | C-pre-processor flags of the same name.
|
|---|
| 173 | </para>
|
|---|
| 174 |
|
|---|
| 175 | <para>
|
|---|
| 176 | Also, unless the environment variable <literal>G4VIS_NONE</literal> is
|
|---|
| 177 | set, the C-pre-processor flag <literal>G4VIS_USE</literal> is always set by
|
|---|
| 178 | default. This flag is available in describing the <literal>main()</literal>
|
|---|
| 179 | function.
|
|---|
| 180 | </para>
|
|---|
| 181 |
|
|---|
| 182 | <para>
|
|---|
| 183 | You may have to set additional environment variables for your
|
|---|
| 184 | selected visualization drivers and graphics systems. For example,
|
|---|
| 185 | the OpenGL driver may require the setting of <literal>OGLHOME</literal> which
|
|---|
| 186 | points to the location of the OpenGL libraries. For more details,
|
|---|
| 187 | see <xref linkend="sect.VisDrv" />
|
|---|
| 188 | "<emphasis role="bold">Visualization Drivers</emphasis>" and
|
|---|
| 189 | pages linked from there.
|
|---|
| 190 | </para>
|
|---|
| 191 |
|
|---|
| 192 | </sect2>
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 196 | <sect2 id="sect.VisAddExe.SampSetup">
|
|---|
| 197 | <title>
|
|---|
| 198 | A Sample Set-up File
|
|---|
| 199 | </title>
|
|---|
| 200 |
|
|---|
| 201 | <para>
|
|---|
| 202 | The following can be part of the user's <literal>.cshrc</literal> or
|
|---|
| 203 | <literal>.tcshrc</literal> file on a Linux platform to configure the
|
|---|
| 204 | environment for creating Geant4 executables available for Geant4
|
|---|
| 205 | visualization. This sample is shown only as an example; it may NOT
|
|---|
| 206 | correspond to a specific platform configuration and does NOT apply
|
|---|
| 207 | in general for any specific setup !
|
|---|
| 208 |
|
|---|
| 209 | <example id="programlist_VisAddExe_1">
|
|---|
| 210 | <title>
|
|---|
| 211 | Part of a sample <literal>.cshrc</literal> setup file for the Linux platform.
|
|---|
| 212 | </title>
|
|---|
| 213 |
|
|---|
| 214 | <programlisting>
|
|---|
| 215 | ############################################################
|
|---|
| 216 | # Main Environment Variables for GEANT4 with Visualization #
|
|---|
| 217 | ############################################################
|
|---|
| 218 |
|
|---|
| 219 | ### Platform
|
|---|
| 220 | setenv G4SYSTEM Linux-g++
|
|---|
| 221 |
|
|---|
| 222 | ### CLHEP base directory
|
|---|
| 223 | setenv CLHEP_BASE_DIR /opt/local
|
|---|
| 224 |
|
|---|
| 225 | ### OpenGL base directory
|
|---|
| 226 | setenv OGLHOME /usr/X11R6
|
|---|
| 227 |
|
|---|
| 228 | ### G4VIS_BUILD
|
|---|
| 229 | ### Incorporation of OpenGL-Xlib and OpenGL-Motif drivers
|
|---|
| 230 | ### into Geant4 libraries.
|
|---|
| 231 | setenv G4VIS_BUILD_OPENGLX_DRIVER 1
|
|---|
| 232 | setenv G4VIS_BUILD_OPENGLXM_DRIVER 1
|
|---|
| 233 |
|
|---|
| 234 | ### G4VIS_USE
|
|---|
| 235 | ### Incorporation of OpenGL-Xlib and OpenGL-Motif drivers
|
|---|
| 236 | ### into Geant4 executables.
|
|---|
| 237 | setenv G4VIS_USE_OPENGLX 1
|
|---|
| 238 | setenv G4VIS_USE_OPENGLXM 1
|
|---|
| 239 |
|
|---|
| 240 | ### Viewer for DAWNFILE driver
|
|---|
| 241 | ### Default value is "dawn". You can change it to, say,
|
|---|
| 242 | ### "david" for volume overlapping tests
|
|---|
| 243 | # setenv G4DAWNFILE_VIEWER david
|
|---|
| 244 |
|
|---|
| 245 | ### Viewer for VRMLFILE drivers
|
|---|
| 246 | setenv G4VRMLFILE_VIEWER vrmlview
|
|---|
| 247 |
|
|---|
| 248 | ########## end
|
|---|
| 249 | </programlisting>
|
|---|
| 250 | </example>
|
|---|
| 251 | </para>
|
|---|
| 252 |
|
|---|
| 253 | </sect2>
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 257 | <sect2 id="sect.VisAddExe.VisMan">
|
|---|
| 258 | <title>
|
|---|
| 259 | Visualization Manager
|
|---|
| 260 | </title>
|
|---|
| 261 |
|
|---|
| 262 | <para>
|
|---|
| 263 | Visualization procedures are controlled by the "Visualization
|
|---|
| 264 | Manager", a class which must inherit from <emphasis>G4VisManager</emphasis>
|
|---|
| 265 | defined in the visualization category. Most users will find that
|
|---|
| 266 | they can just use the default visualization manager,
|
|---|
| 267 | <emphasis>G4VisExecutive</emphasis>. The Visualization Manager accepts users'
|
|---|
| 268 | requests for visualization, processes them, and passes the
|
|---|
| 269 | processed requirements to the abstract interface, i.e., to the
|
|---|
| 270 | currently selected visualization driver.
|
|---|
| 271 | </para>
|
|---|
| 272 |
|
|---|
| 273 | </sect2>
|
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 277 | <sect2 id="sect.VisAddExe.WrtMain">
|
|---|
| 278 | <title>
|
|---|
| 279 | How to Write the <literal>main()</literal> Function
|
|---|
| 280 | </title>
|
|---|
| 281 |
|
|---|
| 282 | <para>
|
|---|
| 283 | In order for your Geant4 executable to perform visualization, you
|
|---|
| 284 | must instantiate and initialize "your" Visualization Manager in the
|
|---|
| 285 | <literal>main()</literal> function. The core of the Visualization Manager is
|
|---|
| 286 | the class <literal>G4VisManager</literal>, defined in the visualization
|
|---|
| 287 | category. This class requires that one pure virtual function be
|
|---|
| 288 | implemented, namely, <literal>void RegisterGraphicsSystems()</literal>. The
|
|---|
| 289 | easiest way to do this is to use <literal>G4VisExecutive</literal>, as
|
|---|
| 290 | described above (but you may write your own class - see above).
|
|---|
| 291 | </para>
|
|---|
| 292 |
|
|---|
| 293 | <para>
|
|---|
| 294 | <xref linkend="programlist_VisAddExe_2" /> shows the form of the
|
|---|
| 295 | <literal>main()</literal> function.
|
|---|
| 296 |
|
|---|
| 297 | <example id="programlist_VisAddExe_2">
|
|---|
| 298 | <title>
|
|---|
| 299 | The form of the <literal>main()</literal> function.
|
|---|
| 300 | </title>
|
|---|
| 301 |
|
|---|
| 302 | <programlisting>
|
|---|
| 303 | //----- C++ source codes: Instantiation and initialization of G4VisManager
|
|---|
| 304 |
|
|---|
| 305 | .....
|
|---|
| 306 | // Your Visualization Manager
|
|---|
| 307 | #include "G4VisExecutive.hh"
|
|---|
| 308 | .....
|
|---|
| 309 |
|
|---|
| 310 | // Instantiation and initialization of the Visualization Manager
|
|---|
| 311 | #ifdef G4VIS_USE
|
|---|
| 312 | G4VisManager* visManager = new G4VisExecutive;
|
|---|
| 313 | visManager -> initialize ();
|
|---|
| 314 | #endif
|
|---|
| 315 |
|
|---|
| 316 | .....
|
|---|
| 317 | #ifdef G4VIS_USE
|
|---|
| 318 | delete visManager;
|
|---|
| 319 | #endif
|
|---|
| 320 |
|
|---|
| 321 | //----- end of C++
|
|---|
| 322 | </programlisting>
|
|---|
| 323 | </example>
|
|---|
| 324 | </para>
|
|---|
| 325 |
|
|---|
| 326 | <para>
|
|---|
| 327 | Alternatively, you can implement an empty
|
|---|
| 328 | <literal>RegisterGraphicsSystems()</literal> function, and register
|
|---|
| 329 | visualization drivers you want directly in your <literal>main()</literal>
|
|---|
| 330 | function. See <xref linkend="programlist_VisAddExe_3" />.
|
|---|
| 331 |
|
|---|
| 332 | <example id="programlist_VisAddExe_3">
|
|---|
| 333 | <title>
|
|---|
| 334 | An alternative style for the <literal>main()</literal> function.
|
|---|
| 335 | </title>
|
|---|
| 336 |
|
|---|
| 337 | <programlisting>
|
|---|
| 338 | //----- C++ source codes: How to register a visualization driver directly
|
|---|
| 339 | // in main() function
|
|---|
| 340 |
|
|---|
| 341 | .....
|
|---|
| 342 | G4VisManager* visManager = new G4VisExecutive;
|
|---|
| 343 | visManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
|---|
| 344 | .....
|
|---|
| 345 | delete visManager
|
|---|
| 346 |
|
|---|
| 347 | //----- end of C++
|
|---|
| 348 | </programlisting>
|
|---|
| 349 | </example>
|
|---|
| 350 | </para>
|
|---|
| 351 |
|
|---|
| 352 | <para>
|
|---|
| 353 | <emphasis>Do not forget</emphasis> to delete the instantiated Visualization
|
|---|
| 354 | Manager by yourself. Note that a graphics system for Geant4 Visualization
|
|---|
| 355 | may run as a different process. In that case, the destructor of
|
|---|
| 356 | <literal>G4VisManager</literal> might have to terminate the graphics system
|
|---|
| 357 | and/or close the connection.
|
|---|
| 358 | </para>
|
|---|
| 359 |
|
|---|
| 360 | <para>
|
|---|
| 361 | We recommend that the instantiation, initialization, and
|
|---|
| 362 | deletion of the Visualization Manager be protected by
|
|---|
| 363 | C-pre-processor commands, as in the novice examples. The
|
|---|
| 364 | C-pre-processor macro <literal>G4VIS_USE</literal> is automatically defined
|
|---|
| 365 | unless the environment variable <literal>G4VIS_NONE</literal> is set. This
|
|---|
| 366 | assumes that you are compiling your Geant4 executable with the
|
|---|
| 367 | standard version of GNUmakefile found in the <literal>config</literal>
|
|---|
| 368 | directory.
|
|---|
| 369 | </para>
|
|---|
| 370 |
|
|---|
| 371 | <para>
|
|---|
| 372 | <xref linkend="programlist_VisAddExe_4" /> shows an example of the
|
|---|
| 373 | <literal>main()</literal> function available for Geant4 Visualization.
|
|---|
| 374 |
|
|---|
| 375 | <example id="programlist_VisAddExe_4">
|
|---|
| 376 | <title>
|
|---|
| 377 | An example of the <literal>main()</literal> function available for
|
|---|
| 378 | Geant4 Visualization.
|
|---|
| 379 | </title>
|
|---|
| 380 |
|
|---|
| 381 | <programlisting>
|
|---|
| 382 | //----- C++ source codes: An example of main() for visualization
|
|---|
| 383 | .....
|
|---|
| 384 | #include "G4VisExecutive.hh"
|
|---|
| 385 | .....
|
|---|
| 386 |
|
|---|
| 387 | int main()
|
|---|
| 388 | {
|
|---|
| 389 | // Run Manager
|
|---|
| 390 | G4RunManager * runManager = new G4RunManager;
|
|---|
| 391 |
|
|---|
| 392 | // Detector components
|
|---|
| 393 | runManager->set_userInitialization(new MyDetectorConstruction);
|
|---|
| 394 | runManager->set_userInitialization(new MyPhysicsList);
|
|---|
| 395 |
|
|---|
| 396 | // UserAction classes.
|
|---|
| 397 | runManager->set_userAction(new MyRunAction);
|
|---|
| 398 | runManager->set_userAction(new MyPrimaryGeneratorAction);
|
|---|
| 399 | runManager->set_userAction(new MyEventAction);
|
|---|
| 400 | runManager->set_userAction(new MySteppingAction);
|
|---|
| 401 |
|
|---|
| 402 | #ifdef G4VIS_USE
|
|---|
| 403 | G4VisManager* visManager = new G4VisExecutive;
|
|---|
| 404 | visManager -> initialize ();
|
|---|
| 405 | #endif
|
|---|
| 406 |
|
|---|
| 407 | // Event loop
|
|---|
| 408 | // Define (G)UI terminal
|
|---|
| 409 | G4UIsession * session = new G4UIterminal
|
|---|
| 410 | session->sessionStart();
|
|---|
| 411 |
|
|---|
| 412 | delete session;
|
|---|
| 413 | delete runManager;
|
|---|
| 414 |
|
|---|
| 415 | #ifdef G4VIS_USE
|
|---|
| 416 | delete visManager;
|
|---|
| 417 | #endif
|
|---|
| 418 |
|
|---|
| 419 | return 0;
|
|---|
| 420 | }
|
|---|
| 421 |
|
|---|
| 422 | //----- end of C++
|
|---|
| 423 | </programlisting>
|
|---|
| 424 | </example>
|
|---|
| 425 | </para>
|
|---|
| 426 |
|
|---|
| 427 | <para>
|
|---|
| 428 | Useful information on incorporated visualization drivers can be
|
|---|
| 429 | displayed in initializing the Visualization Manager. This is done
|
|---|
| 430 | by setting the verbosity flag to an appropriate string:
|
|---|
| 431 |
|
|---|
| 432 | <informalexample>
|
|---|
| 433 | <programlisting>
|
|---|
| 434 | Simple graded message scheme - give first letter or a digit:
|
|---|
| 435 | 0) quiet, // Nothing is printed.
|
|---|
| 436 | 1) startup, // Startup and endup messages are printed...
|
|---|
| 437 | 2) errors, // ...and errors...
|
|---|
| 438 | 3) warnings, // ...and warnings...
|
|---|
| 439 | 4) confirmations, // ...and confirming messages...
|
|---|
| 440 | 5) parameters, // ...and parameters of scenes and views...
|
|---|
| 441 | 6) all // ...and everything available.
|
|---|
| 442 | </programlisting>
|
|---|
| 443 | </informalexample>
|
|---|
| 444 | </para>
|
|---|
| 445 |
|
|---|
| 446 | <para>
|
|---|
| 447 | For example, in your <literal>main()</literal> function, write the following
|
|---|
| 448 | code:
|
|---|
| 449 |
|
|---|
| 450 | <informalexample>
|
|---|
| 451 | <programlisting>
|
|---|
| 452 | ...
|
|---|
| 453 | G4VisManager* visManager = new G4VisExecutive ();
|
|---|
| 454 | visManager -> SetVerboseLevel (1);
|
|---|
| 455 | visManager -> Initialize ();
|
|---|
| 456 | ...
|
|---|
| 457 | </programlisting>
|
|---|
| 458 | </informalexample>
|
|---|
| 459 | </para>
|
|---|
| 460 |
|
|---|
| 461 | <para>
|
|---|
| 462 | (This can also be set with the <literal>/vis/verbose</literal> command.)
|
|---|
| 463 | </para>
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 | </sect2>
|
|---|
| 467 | </sect1> |
|---|