source: trunk/source/visualization/management/include/G4VisExecutive.icc@ 1358

Last change on this file since 1358 was 1346, checked in by garnier, 15 years ago

before tag

  • Property svn:mime-type set to text/cpp
File size: 7.8 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4VisExecutive.icc,v 1.27 2010/11/07 11:14:33 allison Exp $
28// GEANT4 tag $Name: $
29//
30//
31// John Allison 24th January 1998.
32
33#ifndef G4VISEXECUTIVE_ICC
34#define G4VISEXECUTIVE_ICC
35
36// Supported drivers...
37
38// Not needing external packages or libraries...
39#include "G4ASCIITree.hh"
40#include "G4DAWNFILE.hh"
41#include "G4HepRep.hh"
42#include "G4HepRepFile.hh"
43#include "G4RayTracer.hh"
44#include "G4HitFilterFactories.hh"
45#include "G4DigiFilterFactories.hh"
46#include "G4TrajectoryFilterFactories.hh"
47#include "G4TrajectoryModelFactories.hh"
48#include "G4VRML1File.hh"
49#include "G4VRML2File.hh"
50#include "G4GMocrenFile.hh"
51
52// Needing external packages or libraries...
53
54#ifdef G4VIS_USE_DAWN
55#include "G4FukuiRenderer.hh"
56#endif
57
58#ifdef G4VIS_USE_OPENGLX
59#include "G4OpenGLImmediateX.hh"
60#include "G4OpenGLStoredX.hh"
61#endif
62
63#ifdef G4VIS_USE_OPENGLWIN32
64#include "G4OpenGLImmediateWin32.hh"
65#include "G4OpenGLStoredWin32.hh"
66#endif
67
68#ifdef G4VIS_USE_OPENGLXM
69#include "G4OpenGLImmediateXm.hh"
70#include "G4OpenGLStoredXm.hh"
71#endif
72
73#ifdef G4VIS_USE_OPENGLQT
74#include "G4OpenGLImmediateQt.hh"
75#include "G4OpenGLStoredQt.hh"
76#endif
77
78#ifdef G4VIS_USE_OIX
79#include "G4OpenInventorX.hh"
80#endif
81
82#ifdef G4VIS_USE_OIWIN32
83#include "G4OpenInventorWin32.hh"
84#endif
85
86#ifdef G4VIS_USE_RAYTRACERX
87#include "G4RayTracerX.hh"
88#endif
89
90#ifdef G4VIS_USE_VRML
91#include "G4VRML1.hh"
92#include "G4VRML2.hh"
93#endif
94
95inline
96G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
97 G4VisManager(verbosityString)
98{}
99
100// The inline keyword prevents the compiler making an external
101// reference even though they cannot actually be inlined since they
102// are virtual functions. This prevents a "multiple definition" error
103// if it is included in more than one file. However, as explained in
104// the class description in G4VisExecutive.hh, it should never be
105// necessary to #include "G4VisExecutive.hh" in more than one file
106// since after instantiation the object can be treated as a
107// G4VisManager.
108inline void
109G4VisExecutive::RegisterGraphicsSystems () {
110
111 // Graphics Systems not needing external packages or libraries...
112 RegisterGraphicsSystem (new G4ASCIITree);
113 RegisterGraphicsSystem (new G4DAWNFILE);
114 RegisterGraphicsSystem (new G4HepRep);
115 RegisterGraphicsSystem (new G4HepRepFile);
116 RegisterGraphicsSystem (new G4RayTracer);
117 RegisterGraphicsSystem (new G4VRML1File);
118 RegisterGraphicsSystem (new G4VRML2File);
119 RegisterGraphicsSystem (new G4GMocrenFile);
120 // Graphics systems needing external packages or libraries...
121
122#ifdef G4VIS_USE_DAWN
123 RegisterGraphicsSystem (new G4FukuiRenderer);
124#endif
125
126// Register OGL graphics system with generic nicknames
127#ifdef G4VIS_USE_OPENGL
128 G4VGraphicsSystem* ogl = 0;
129 G4VGraphicsSystem* ogli = 0;
130 G4VGraphicsSystem* ogls = 0;
131// Follow G4UIExecutive
132#if defined(G4UI_USE_QT)
133#ifdef G4VIS_USE_OPENGLQT
134 ogl = new G4OpenGLStoredQt;
135 ogli = new G4OpenGLImmediateQt;
136 ogls = new G4OpenGLStoredQt;
137#endif
138#elif defined(G4UI_USE_XM)
139#ifdef G4VIS_USE_OPENGLXM
140 ogl = new G4OpenGLStoredXm;
141 ogli = new G4OpenGLImmediateXm;
142 ogls = new G4OpenGLStoredXm;
143#endif
144#elif defined(G4UI_USE_WIN32)
145#ifdef G4VIS_USE_OPENGLWIN32
146 ogl = new G4OpenGLStoredWin32;
147 ogli = new G4OpenGLImmediateWin32;
148 ogls = new G4OpenGLStoredWin32;
149#endif
150#elif defined(G4UI_USE_TCSH)
151#if defined (G4VIS_USE_OPENGLX)
152 ogl = new G4OpenGLStoredX;
153 ogli = new G4OpenGLImmediateX;
154 ogls = new G4OpenGLStoredX;
155#elif defined (G4VIS_USE_OPENGLWIN32)
156 ogl = new G4OpenGLStoredWin32;
157 ogli = new G4OpenGLImmediateWin32;
158 ogls = new G4OpenGLStoredWin32;
159#endif
160#else
161#if defined (G4VIS_USE_OPENGLX)
162 ogl = new G4OpenGLStoredX;
163 ogli = new G4OpenGLImmediateX;
164 ogls = new G4OpenGLStoredX;
165#elif defined (G4VIS_USE_OPENGLWIN32)
166 ogl = new G4OpenGLStoredWin32;
167 ogli = new G4OpenGLImmediateWin32;
168 ogls = new G4OpenGLStoredWin32;
169#endif
170#endif
171 if (ogl) {
172 ogl->SetNickName("OGL");
173 RegisterGraphicsSystem (ogl);
174 }
175 if (ogli) {
176 ogli->SetNickName("OGLI");
177 RegisterGraphicsSystem (ogli);
178 }
179 if (ogls) {
180 ogls->SetNickName("OGLS");
181 RegisterGraphicsSystem (ogls);
182 }
183#endif
184
185#ifdef G4VIS_USE_OPENGLX
186 RegisterGraphicsSystem (new G4OpenGLImmediateX);
187 RegisterGraphicsSystem (new G4OpenGLStoredX);
188#endif
189
190#ifdef G4VIS_USE_OPENGLWIN32
191 RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
192 RegisterGraphicsSystem (new G4OpenGLStoredWin32);
193#endif
194
195#ifdef G4VIS_USE_OPENGLXM
196 RegisterGraphicsSystem (new G4OpenGLImmediateXm);
197 RegisterGraphicsSystem (new G4OpenGLStoredXm);
198#endif
199
200#ifdef G4VIS_USE_OPENGLQT
201 RegisterGraphicsSystem (new G4OpenGLImmediateQt);
202 RegisterGraphicsSystem (new G4OpenGLStoredQt);
203#endif
204
205// Register OI graphics system with generic nickname
206#ifdef G4VIS_USE_OI
207 G4VGraphicsSystem* oi = 0;
208#ifdef G4VIS_USE_OIX
209 oi = new G4OpenInventorX;
210#endif
211#ifdef G4VIS_USE_OIWIN32
212 oi = new G4OpenInventorWin32;
213#endif
214 if (oi) {
215 oi->SetNickName("OI");
216 RegisterGraphicsSystem (oi);
217 }
218#endif
219
220#ifdef G4VIS_USE_OIX
221 RegisterGraphicsSystem (new G4OpenInventorX);
222#endif
223
224#ifdef G4VIS_USE_OIWIN32
225 RegisterGraphicsSystem (new G4OpenInventorWin32);
226#endif
227
228#ifdef G4VIS_USE_RAYTRACERX
229 RegisterGraphicsSystem (new G4RayTracerX);
230#endif
231
232#ifdef G4VIS_USE_VRML
233 RegisterGraphicsSystem (new G4VRML1);
234 RegisterGraphicsSystem (new G4VRML2);
235#endif
236
237}
238
239// See comments about inlining above.
240inline void
241G4VisExecutive::RegisterModelFactories()
242{
243 // Trajectory draw models
244 RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());
245 RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
246 RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
247 RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());
248 RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());
249
250 // Trajectory filter models
251 RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
252 RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
253 RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
254 RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
255
256 // Hit filter models
257 RegisterModelFactory(new G4HitAttributeFilterFactory());
258
259 // Digi filter models
260 RegisterModelFactory(new G4DigiAttributeFilterFactory());
261}
262
263#endif
Note: See TracBrowser for help on using the repository browser.