source: trunk/source/visualization/management/src/G4VGraphicsSystem.cc@ 896

Last change on this file since 896 was 850, checked in by garnier, 17 years ago

geant4.8.2 beta

  • Property svn:mime-type set to text/cpp
File size: 3.7 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: G4VGraphicsSystem.cc,v 1.11 2006/06/29 21:29:22 gunter Exp $
28// GEANT4 tag $Name: HEAD $
29//
30//
31// John Allison 27th March 1996
32// Abstract interface class for graphics systems.
33
34#include "G4VGraphicsSystem.hh"
35
36#include "G4VisManager.hh"
37
38G4VGraphicsSystem::~G4VGraphicsSystem () {}
39
40G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
41 Functionality f):
42 fName (name),
43 fNickname (""),
44 fDescription (""),
45 fFunctionality (f) {}
46
47G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
48 const G4String& nickname,
49 Functionality f):
50 fName (name),
51 fNickname (nickname),
52 fDescription (""),
53 fFunctionality (f) {}
54
55G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
56 const G4String& nickname,
57 const G4String& description,
58 Functionality f):
59 fName (name),
60 fNickname (nickname),
61 fDescription (description),
62 fFunctionality (f) {}
63
64std::ostream& operator << (std::ostream& os, const G4VGraphicsSystem& gs) {
65 G4VisManager* pVMan = G4VisManager::GetInstance ();
66 const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
67 os << "Graphics System: " << gs.GetName ();
68 if (gs.GetNickname () != "") {
69 os << ", nickname: " << gs.GetNickname ();
70 }
71 if (gs.GetDescription () != "") {
72 os << "\n Description: " << gs.GetDescription ();
73 }
74 os << "\n Functionality: " << G4int(gs.GetFunctionality());
75 if (pVMan -> GetVerbosity() >= G4VisManager::parameters) {
76 size_t nScenes = scenes.size ();
77 if (nScenes) {
78 G4int nScenesOfThisSystem = 0;
79 for (size_t i = 0; i < nScenes; i++) {
80 if (scenes [i] -> GetGraphicsSystem () == &gs) {
81 nScenesOfThisSystem++;
82 }
83 }
84 if (nScenesOfThisSystem) {
85 os << "\n Its scenes are: ";
86 for (size_t i = 0; i < nScenes; i++) {
87 if (scenes [i] -> GetGraphicsSystem () == &gs) {
88 os << "\n " << *(scenes [i]);
89 }
90 }
91 }
92 else {
93 os << "\n It has no scenes at present.";
94 }
95 }
96 else {
97 os << "\n There are no scenes instantiated at present.";
98 }
99 }
100 return os;
101}
Note: See TracBrowser for help on using the repository browser.