Files
geant4/source/visualization/README.adding_graphics_system
T
2016-06-08 16:18:25 +02:00

46 lines
1.7 KiB
Plaintext

To add a graphics system:
1) implement 3 new classes:
class G4XXX: public G4VGraphicsSystem
class G4XXXSceneHandler: public G4VSceneHandler
class G4XXXViewer: virtual public G4VViewer
These should be placed in their own sub-directory under
visualization, together with a GNUmakefile and a History file.
Change the library name G4XXX in "name := G4XXX" in GNUmakefile.
2) Add to SUBDIRS and SUBLIBS in visualization/GNUmakefile.
3) Look at the XXX graphics system teamplate in visualization/XXX and
use it to build your graphics system.
You might also find it useful to look at ASCIITree (and VTree) as
an example of a minimal graphics system.
Look at FukuiRenderer as an example of a system which implements
AddThis methods for some solids.
Look at OpenGL as an example of a system which implements a graphical
database (display lists) and the machinery to decide when to rebuild.
(OpenGL is complicated by the proliferation of combinations of:
immediate (no display lists) ) ( X-windows
stored (uses display lists) ) x ( X with motif - interactive
( Win32
(6 combinations) and much use is made of inheritance to avoid code
duplication.)
4) If it requires external libraries, introduce two new environment
variables G4VIS_BUILD_XXX_DRIVER and G4VIS_USE_XXX and make the
modifications to:
source/visualization/management/include/MyVisManager.cc
(similarly all examples vis managers)
source/visualization/management/src/G4VisManager.cc
config/G4VIS_BUILD.gmk
config/G4VIS_USE.gmk
In any case, augment the informational printing in G4VisManager.cc.