00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "G4VGraphicsSystem.hh"
00034
00035 #include "G4VisManager.hh"
00036
00037 G4VGraphicsSystem::~G4VGraphicsSystem () {}
00038
00039 G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
00040 Functionality f):
00041 fName (name),
00042 fNickname (""),
00043 fDescription (""),
00044 fFunctionality (f) {}
00045
00046 G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
00047 const G4String& nickname,
00048 Functionality f):
00049 fName (name),
00050 fNickname (nickname),
00051 fDescription (""),
00052 fFunctionality (f) {}
00053
00054 G4VGraphicsSystem::G4VGraphicsSystem (const G4String& name,
00055 const G4String& nickname,
00056 const G4String& description,
00057 Functionality f):
00058 fName (name),
00059 fNickname (nickname),
00060 fDescription (description),
00061 fFunctionality (f) {}
00062
00063 G4bool G4VGraphicsSystem::IsUISessionCompatible () const
00064 {
00065 return true;
00066 }
00067
00068 std::ostream& operator << (std::ostream& os, const G4VGraphicsSystem& gs) {
00069 G4VisManager* pVMan = G4VisManager::GetInstance ();
00070 const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
00071 os << "Graphics System: " << gs.GetName ();
00072 if (gs.GetNickname () != "") {
00073 os << ", nickname: " << gs.GetNickname ();
00074 }
00075 if (gs.GetDescription () != "") {
00076 os << "\n Description: " << gs.GetDescription ();
00077 }
00078 os << "\n Functionality: " << G4int(gs.GetFunctionality());
00079 if (pVMan -> GetVerbosity() >= G4VisManager::parameters) {
00080 size_t nScenes = scenes.size ();
00081 if (nScenes) {
00082 G4int nScenesOfThisSystem = 0;
00083 for (size_t i = 0; i < nScenes; i++) {
00084 if (scenes [i] -> GetGraphicsSystem () == &gs) {
00085 nScenesOfThisSystem++;
00086 }
00087 }
00088 if (nScenesOfThisSystem) {
00089 os << "\n Its scenes are: ";
00090 for (size_t i = 0; i < nScenes; i++) {
00091 if (scenes [i] -> GetGraphicsSystem () == &gs) {
00092 os << "\n " << *(scenes [i]);
00093 }
00094 }
00095 }
00096 else {
00097 os << "\n It has no scenes at present.";
00098 }
00099 }
00100 else {
00101 os << "\n There are no scenes instantiated at present.";
00102 }
00103 }
00104 return os;
00105 }