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

Last change on this file since 1314 was 1314, checked in by garnier, 14 years ago

en test pas dans CVS

  • Property svn:mime-type set to text/cpp
File size: 8.5 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#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
134  ogl  = new G4OpenGLStoredQt;
135  ogli = new G4OpenGLImmediateQt;
136  ogls = new G4OpenGLStoredQt;
137#endif
138#endif
139#elif defined(G4UI_USE_XM)
140#ifdef G4VIS_USE_OPENGLXM
141#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
142  ogl  = new G4OpenGLStoredXm;
143  ogli = new G4OpenGLImmediateXm;
144  ogls = new G4OpenGLStoredXm;
145#endif
146#endif
147#elif defined(G4UI_USE_WIN32)
148#ifdef G4VIS_USE_OPENGLWIN32
149#ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER
150  ogl  = new G4OpenGLStoredWin32;
151  ogli = new G4OpenGLImmediateWin32;
152  ogls = new G4OpenGLStoredWin32;
153#endif
154#endif
155#elif defined(G4UI_USE_TCSH)
156#if defined (G4VIS_USE_OPENGLX)
157#ifdef G4VIS_BUILD_OPENGLX_DRIVER
158  ogl  = new G4OpenGLStoredX;
159  ogli = new G4OpenGLImmediateX;
160  ogls = new G4OpenGLStoredX;
161#endif
162#elif defined (G4VIS_USE_OPENGLWIN32)
163#ifdef G4VIS_BUILD_OPENGWIN32_DRIVER
164  ogl  = new G4OpenGLStoredWin32;
165  ogli = new G4OpenGLImmediateWin32;
166  ogls = new G4OpenGLStoredWin32;
167#endif
168#endif
169#else
170#if defined (G4VIS_USE_OPENGLX)
171#ifdef G4VIS_BUILD_OPENGLX_DRIVER
172  ogl  = new G4OpenGLStoredX;
173  ogli = new G4OpenGLImmediateX;
174  ogls = new G4OpenGLStoredX;
175#endif
176#elif defined (G4VIS_USE_OPENGLWIN32)
177#ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER
178  ogl  = new G4OpenGLStoredWin32;
179  ogli = new G4OpenGLImmediateWin32;
180  ogls = new G4OpenGLStoredWin32;
181#endif
182#endif
183#endif
184  if (ogl) {
185    ogl->SetNickName("OGL");
186    RegisterGraphicsSystem (ogl);
187  }
188  if (ogli) {
189    ogli->SetNickName("OGLI");
190    RegisterGraphicsSystem (ogli);
191  }
192  if (ogls) {
193    ogls->SetNickName("OGLS");
194    RegisterGraphicsSystem (ogls);
195  }
196#endif
197
198#ifdef G4VIS_USE_OPENGLX
199#ifdef G4VIS_BUILD_OPENGLX_DRIVER
200  RegisterGraphicsSystem (new G4OpenGLImmediateX);
201  RegisterGraphicsSystem (new G4OpenGLStoredX);
202#endif
203#endif
204
205#ifdef G4VIS_USE_OPENGLWIN32
206#ifdef G4VIS_BUILD_OPENGLWIN32_DRIVER
207  RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
208  RegisterGraphicsSystem (new G4OpenGLStoredWin32);
209#endif
210#endif
211
212#ifdef G4VIS_USE_OPENGLXM
213#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
214  RegisterGraphicsSystem (new G4OpenGLImmediateXm);
215  RegisterGraphicsSystem (new G4OpenGLStoredXm);
216#endif
217#endif
218
219#ifdef G4VIS_USE_OPENGLQT
220#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
221  RegisterGraphicsSystem (new G4OpenGLImmediateQt);
222  RegisterGraphicsSystem (new G4OpenGLStoredQt);
223#endif
224#endif
225
226// Register OI graphics system with generic nickname
227#ifdef G4VIS_USE_OI
228  G4VGraphicsSystem* oi  = 0;
229#ifdef G4VIS_USE_OIX
230#ifdef G4VIS_BUILD_OI_DRIVER
231  oi = new G4OpenInventorX;
232#endif
233#endif
234#ifdef G4VIS_USE_OIWIN32
235#ifdef G4VIS_BUILD_OIWIN32_DRIVER
236  oi = new G4OpenInventorWin32;
237#endif
238#endif
239  if (oi) {
240    oi->SetNickName("OI");
241    RegisterGraphicsSystem (oi);
242  }
243#endif
244
245#ifdef G4VIS_USE_OIX
246#ifdef G4VIS_BUILD_OIX_DRIVER
247  RegisterGraphicsSystem (new G4OpenInventorX);
248#endif
249#endif
250
251#ifdef G4VIS_USE_OIWIN32
252#ifdef G4VIS_BUILD_OIWIN32_DRIVER
253  RegisterGraphicsSystem (new G4OpenInventorWin32);
254#endif
255#endif
256
257#ifdef G4VIS_USE_RAYTRACERX
258#ifdef G4VIS_BUILD_RAYTRACERX_DRIVER
259  RegisterGraphicsSystem (new G4RayTracerX);
260#endif
261#endif
262
263#ifdef G4VIS_USE_VRML
264#ifdef G4VIS_BUILD_VRML_DRIVER
265  RegisterGraphicsSystem (new G4VRML1);
266  RegisterGraphicsSystem (new G4VRML2);
267#endif
268#endif
269
270}
271
272// See comments about inlining above.
273inline void
274G4VisExecutive::RegisterModelFactories()
275{
276   // Trajectory draw models
277   RegisterModelFactory(new G4TrajectoryGenericDrawerFactory());       
278   RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
279   RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
280   RegisterModelFactory(new G4TrajectoryDrawByOriginVolumeFactory()); 
281   RegisterModelFactory(new G4TrajectoryDrawByAttributeFactory()); 
282
283   // Trajectory filter models
284   RegisterModelFactory(new G4TrajectoryChargeFilterFactory());
285   RegisterModelFactory(new G4TrajectoryParticleFilterFactory());
286   RegisterModelFactory(new G4TrajectoryOriginVolumeFilterFactory());
287   RegisterModelFactory(new G4TrajectoryAttributeFilterFactory());
288
289   // Hit filter models
290   RegisterModelFactory(new G4HitAttributeFilterFactory());
291
292   // Digi filter models
293   RegisterModelFactory(new G4DigiAttributeFilterFactory());
294}
295
296#endif
Note: See TracBrowser for help on using the repository browser.