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