Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: G4HepRepFile.cc,v 1.4 2002/02/02 04:00:22 perl Exp $ >> 25 // GEANT4 tag $Name: geant4-04-00-patch-02 $ 27 // 26 // >> 27 // 28 // Joseph Perl 1 October 2001 28 // Joseph Perl 1 October 2001 29 // A graphics system to dump geometry hierarch 29 // A graphics system to dump geometry hierarchy to the 30 // HepRep graphics format (HepRep version 1). 30 // HepRep graphics format (HepRep version 1). 31 31 32 // HepRep << 32 //HepRep 33 #include "G4HepRepFileXMLWriter.hh" << 33 #include "HepRepXMLWriter.hh" 34 34 35 #include "G4HepRepFile.hh" 35 #include "G4HepRepFile.hh" 36 #include "G4HepRepFileSceneHandler.hh" 36 #include "G4HepRepFileSceneHandler.hh" 37 #include "G4HepRepFileViewer.hh" 37 #include "G4HepRepFileViewer.hh" 38 #include "G4HepRepMessenger.hh" << 39 38 40 static G4HepRepFileXMLWriter* hepRepXMLWriter; << 39 static HepRepXMLWriter* hepRepXMLWriter; 41 40 42 G4HepRepFile::G4HepRepFile() << 41 G4HepRepFile::G4HepRepFile(): 43 : G4VGraphicsSystem("G4HepRepFile", "HepRepF << 42 G4VGraphicsSystem("G4HepRepFile", 44 "A HepRep (format 1) asc << 43 "HepRepFile", 45 G4VGraphicsSystem::fileW << 44 "A template graphics driver", 46 { << 45 G4VGraphicsSystem::noFunctionality) { 47 G4HepRepMessenger::GetInstance(); << 46 hepRepXMLWriter = new HepRepXMLWriter(); 48 hepRepXMLWriter = new G4HepRepFileXMLWriter( << 49 } 47 } 50 48 51 G4HepRepFile::~G4HepRepFile() { delete hepRepX << 49 G4HepRepFile::~G4HepRepFile() {} 52 50 53 G4VSceneHandler* G4HepRepFile::CreateSceneHand << 51 G4VSceneHandler* G4HepRepFile::CreateSceneHandler(const G4String& name) { 54 { << 55 G4VSceneHandler* pScene = new G4HepRepFileSc 52 G4VSceneHandler* pScene = new G4HepRepFileSceneHandler(*this, name); >> 53 G4cout << G4HepRepFileSceneHandler::GetSceneCount() >> 54 << ' ' << fName << " scene handlers extanct." << G4endl; 56 return pScene; 55 return pScene; 57 } 56 } 58 57 59 G4VViewer* G4HepRepFile::CreateViewer(G4VScene 58 G4VViewer* G4HepRepFile::CreateViewer(G4VSceneHandler& scene, 60 const G4 << 59 const G4String& name) { 61 { << 62 G4VViewer* pView = 60 G4VViewer* pView = 63 new G4HepRepFileViewer((G4HepRepFileSceneH 61 new G4HepRepFileViewer((G4HepRepFileSceneHandler&) scene, name); 64 if(pView) << 62 if (pView) { 65 { << 63 if (pView->GetViewId() < 0) { 66 if(pView->GetViewId() < 0) << 64 G4cout << 67 { << 65 "G4HepRepFile::CreateViewer: ERROR flagged by negative" 68 G4cout << "G4HepRepFile::CreateViewer: E << 66 " view id in G4HepRepFileViewer creation." 69 " view id in G4HepRepFileViewe << 67 "\n Destroying view and returning null pointer." 70 "\n Destroying view and return << 68 << G4endl; 71 << G4endl; << 72 delete pView; 69 delete pView; 73 pView = 0; 70 pView = 0; 74 } 71 } 75 } 72 } 76 else << 73 else { 77 { << 74 G4cout << 78 G4cout << "G4HepRepFile::CreateViewer: ERR << 75 "G4HepRepFile::CreateViewer: ERROR: null pointer on new G4HepRepFileViewer." 79 "G4HepRepFileViewer." << 76 << G4endl; 80 << G4endl; << 81 } 77 } 82 return pView; 78 return pView; 83 } 79 } 84 80 85 G4HepRepFileXMLWriter* G4HepRepFile::GetHepRep << 81 HepRepXMLWriter* G4HepRepFile::GetHepRepXMLWriter () { 86 { << 82 return hepRepXMLWriter; 87 return hepRepXMLWriter; << 88 } 83 } 89 84