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

Last change on this file since 1305 was 1288, checked in by garnier, 16 years ago

update from CVS

  • 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.26 2010/05/30 11:30:49 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
95 G4VisExecutive::G4VisExecutive (const G4String& verbosityString):
96 G4VisManager(verbosityString)
97 {}
98
99// The inline keyword prevents the compiler making an external
100// reference even though they cannot actually be inlined since they
101// are virtual functions. This prevents a "multiple definition" error
102// if it is included in more than one file. However, as explained in
103// the class description in G4VisExecutive.hh, it should never be
104// necessary to #include "G4VisExecutive.hh" in more than one file
105// since after instantiation the object can be treated as a
106// G4VisManager.
107inline void
108G4VisExecutive::RegisterGraphicsSystems () {
109
110 // Graphics Systems not needing external packages or libraries...
111 RegisterGraphicsSystem (new G4ASCIITree);
112 RegisterGraphicsSystem (new G4DAWNFILE);
113 RegisterGraphicsSystem (new G4HepRep);
114 RegisterGraphicsSystem (new G4HepRepFile);
115 RegisterGraphicsSystem (new G4RayTracer);
116 RegisterGraphicsSystem (new G4VRML1File);
117 RegisterGraphicsSystem (new G4VRML2File);
118 RegisterGraphicsSystem (new G4GMocrenFile);
119 // Graphics systems needing external packages or libraries...
120
121#ifdef G4VIS_USE_DAWN
122 RegisterGraphicsSystem (new G4FukuiRenderer);
123#endif
124
125// Register OGL graphics system with generic nicknames
126#ifdef G4VIS_USE_OPENGL
127 G4VGraphicsSystem* ogl = 0;
128 G4VGraphicsSystem* ogli = 0;
129 G4VGraphicsSystem* ogls = 0;
130// Follow G4UIExecutive
131#if defined(G4UI_USE_QT)
132#ifdef G4VIS_USE_OPENGLQT
133 ogl = new G4OpenGLStoredQt;
134 ogli = new G4OpenGLImmediateQt;
135 ogls = new G4OpenGLStoredQt;
136#endif
137#elif defined(G4UI_USE_XM)
138#ifdef G4VIS_USE_OPENGLXM
139 ogl = new G4OpenGLStoredXm;
140 ogli = new G4OpenGLImmediateXm;
141 ogls = new G4OpenGLStoredXm;
142#endif
143#elif defined(G4UI_USE_WIN32)
144#ifdef G4VIS_USE_OPENGLWIN32
145 ogl = new G4OpenGLStoredWin32;
146 ogli = new G4OpenGLImmediateWin32;
147 ogls = new G4OpenGLStoredWin32;
148#endif
149#elif defined(G4UI_USE_TCSH)
150#if defined (G4VIS_USE_OPENGLX)
151 ogl = new G4OpenGLStoredX;
152 ogli = new G4OpenGLImmediateX;
153 ogls = new G4OpenGLStoredX;
154#elif defined (G4VIS_USE_OPENGLWIN32)
155 ogl = new G4OpenGLStoredWin32;
156 ogli = new G4OpenGLImmediateWin32;
157 ogls = new G4OpenGLStoredWin32;
158#endif
159#else
160#if defined (G4VIS_USE_OPENGLX)
161 ogl = new G4OpenGLStoredX;
162 ogli = new G4OpenGLImmediateX;
163 ogls = new G4OpenGLStoredX;
164#elif defined (G4VIS_USE_OPENGLWIN32)
165 ogl = new G4OpenGLStoredWin32;
166 ogli = new G4OpenGLImmediateWin32;
167 ogls = new G4OpenGLStoredWin32;
168#endif
169#endif
170 if (ogl) {
171 ogl->SetNickName("OGL");
172 RegisterGraphicsSystem (ogl);
173 }
174 if (ogli) {
175 ogli->SetNickName("OGLI");
176 RegisterGraphicsSystem (ogli);
177 }
178 if (ogls) {
179 ogls->SetNickName("OGLS");
180 RegisterGraphicsSystem (ogls);
181 }
182#endif
183
184#ifdef G4VIS_USE_OPENGLX
185 RegisterGraphicsSystem (new G4OpenGLImmediateX);
186 RegisterGraphicsSystem (new G4OpenGLStoredX);
187#endif
188
189#ifdef G4VIS_USE_OPENGLWIN32
190 RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
191 RegisterGraphicsSystem (new G4OpenGLStoredWin32);
192#endif
193
194#ifdef G4VIS_USE_OPENGLXM
195 RegisterGraphicsSystem (new G4OpenGLImmediateXm);
196 RegisterGraphicsSystem (new G4OpenGLStoredXm);
197#endif
198
199#ifdef G4VIS_USE_OPENGLQT
200 RegisterGraphicsSystem (new G4OpenGLImmediateQt);
201 RegisterGraphicsSystem (new G4OpenGLStoredQt);
202#endif
203
204// Register OI graphics system with generic nickname
205#ifdef G4VIS_USE_OI
206 G4VGraphicsSystem* oi = 0;
207#ifdef G4VIS_USE_OIX
208 oi = new G4OpenInventorX;
209#endif
210#ifdef G4VIS_USE_OIWIN32
211 oi = new G4OpenInventorWin32;
212#endif
213 if (oi) {
214 oi->SetNickName("OI");
215 RegisterGraphicsSystem (oi);
216 }
217#endif
218
219#ifdef G4VIS_USE_OIX
220 RegisterGraphicsSystem (new G4OpenInventorX);
221#endif
222
223#ifdef G4VIS_USE_OIWIN32
224 RegisterGraphicsSystem (new G4OpenInventorWin32);
225#endif
226
227#ifdef G4VIS_USE_RAYTRACERX
228 RegisterGraphicsSystem (new G4RayTracerX);
229#endif
230
231#ifdef G4VIS_USE_VRML
232 RegisterGraphicsSystem (new G4VRML1);
233 RegisterGraphicsSystem (new G4VRML2);
234#endif
235
236}
237
238// See comments about inlining above.
239inline void
240G4VisExecutive::RegisterModelFactories()
241{
242 // Trajectory draw models
243 RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());
244 RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
245 RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
246 RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory());
247 RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory());
248
249 // Trajectory filter models
250 RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
251 RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
252 RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
253 RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
254
255 // Hit filter models
256 RegisterModelFactory(new G4HitAttributeFilterFactory());
257
258 // Digi filter models
259 RegisterModelFactory(new G4DigiAttributeFilterFactory());
260}
261
262#endif
Note: See TracBrowser for help on using the repository browser.