Geant4  10.00.p03
G4VGraphicsSystem.cc
Go to the documentation of this file.
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: G4VGraphicsSystem.cc 66373 2012-12-18 09:41:34Z gcosmo $
28 //
29 //
30 // John Allison 27th March 1996
31 // Abstract interface class for graphics systems.
32 
33 #include "G4VGraphicsSystem.hh"
34 
35 #include "G4VisManager.hh"
36 
38 
40  Functionality f):
41  fName (name),
42  fNickname (""),
43  fDescription (""),
44  fFunctionality (f) {}
45 
47  const G4String& nickname,
48  Functionality f):
49  fName (name),
50  fNickname (nickname),
51  fDescription (""),
52  fFunctionality (f) {}
53 
55  const G4String& nickname,
56  const G4String& description,
57  Functionality f):
58  fName (name),
59  fNickname (nickname),
60  fDescription (description),
61  fFunctionality (f) {}
62 
64 {
65  return true;
66 }
67 
68 std::ostream& operator << (std::ostream& os, const G4VGraphicsSystem& gs) {
70  const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
71  os << "Graphics System: " << gs.GetName ();
72  if (gs.GetNickname () != "") {
73  os << ", nickname: " << gs.GetNickname ();
74  }
75  if (gs.GetDescription () != "") {
76  os << "\n Description: " << gs.GetDescription ();
77  }
78  os << "\n Functionality: " << G4int(gs.GetFunctionality());
79  if (pVMan -> GetVerbosity() >= G4VisManager::parameters) {
80  size_t nScenes = scenes.size ();
81  if (nScenes) {
82  G4int nScenesOfThisSystem = 0;
83  for (size_t i = 0; i < nScenes; i++) {
84  if (scenes [i] -> GetGraphicsSystem () == &gs) {
85  nScenesOfThisSystem++;
86  }
87  }
88  if (nScenesOfThisSystem) {
89  os << "\n Its scenes are: ";
90  for (size_t i = 0; i < nScenes; i++) {
91  if (scenes [i] -> GetGraphicsSystem () == &gs) {
92  os << "\n " << *(scenes [i]);
93  }
94  }
95  }
96  else {
97  os << "\n It has no scenes at present.";
98  }
99  }
100  else {
101  os << "\n There are no scenes instantiated at present.";
102  }
103  }
104  return os;
105 }
G4String fName
Definition: G4AttUtils.hh:55
G4String name
Definition: TRTMaterials.hh:40
int G4int
Definition: G4Types.hh:78
virtual G4bool IsUISessionCompatible() const
bool G4bool
Definition: G4Types.hh:79
static G4VisManager * GetInstance()
const G4String & GetNickname() const
G4VGraphicsSystem(const G4String &name, Functionality f)
virtual ~G4VGraphicsSystem()
const G4String & GetName() const
const G4String & GetDescription() const
Functionality GetFunctionality() const
std::ostream & operator<<(std::ostream &os, const G4VGraphicsSystem &gs)