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 // >> 23 // $Id: G4HepRepFile.cc,v 1.7 2003/06/25 10:19:59 gunter Exp $ >> 24 // GEANT4 tag $Name: geant4-05-02-patch-01 $ 26 // 25 // 27 // << 26 // 28 // Joseph Perl 1 October 2001 27 // Joseph Perl 1 October 2001 29 // A graphics system to dump geometry hierarch 28 // A graphics system to dump geometry hierarchy to the 30 // HepRep graphics format (HepRep version 1). 29 // HepRep graphics format (HepRep version 1). 31 30 32 // HepRep << 31 //HepRep 33 #include "G4HepRepFileXMLWriter.hh" << 32 #include "HepRepXMLWriter.hh" 34 33 35 #include "G4HepRepFile.hh" 34 #include "G4HepRepFile.hh" 36 #include "G4HepRepFileSceneHandler.hh" 35 #include "G4HepRepFileSceneHandler.hh" 37 #include "G4HepRepFileViewer.hh" 36 #include "G4HepRepFileViewer.hh" 38 #include "G4HepRepMessenger.hh" << 39 37 40 static G4HepRepFileXMLWriter* hepRepXMLWriter; << 38 static HepRepXMLWriter* hepRepXMLWriter; 41 39 42 G4HepRepFile::G4HepRepFile() << 40 G4HepRepFile::G4HepRepFile(): 43 : G4VGraphicsSystem("G4HepRepFile", "HepRepF << 41 G4VGraphicsSystem("G4HepRepFile", 44 "A HepRep (format 1) asc << 42 "HepRepFile", 45 G4VGraphicsSystem::fileW << 43 "A HepRep (format 1) ascii file driver", 46 { << 44 G4VGraphicsSystem::threeD) { 47 G4HepRepMessenger::GetInstance(); << 45 hepRepXMLWriter = new HepRepXMLWriter(); 48 hepRepXMLWriter = new G4HepRepFileXMLWriter( << 49 } 46 } 50 47 51 G4HepRepFile::~G4HepRepFile() { delete hepRepX << 48 G4HepRepFile::~G4HepRepFile() {} 52 49 53 G4VSceneHandler* G4HepRepFile::CreateSceneHand << 50 G4VSceneHandler* G4HepRepFile::CreateSceneHandler(const G4String& name) { 54 { << 55 G4VSceneHandler* pScene = new G4HepRepFileSc 51 G4VSceneHandler* pScene = new G4HepRepFileSceneHandler(*this, name); >> 52 G4cout << G4HepRepFileSceneHandler::GetSceneCount() >> 53 << ' ' << fName << " scene handlers extanct." << G4endl; 56 return pScene; 54 return pScene; 57 } 55 } 58 56 59 G4VViewer* G4HepRepFile::CreateViewer(G4VScene 57 G4VViewer* G4HepRepFile::CreateViewer(G4VSceneHandler& scene, 60 const G4 << 58 const G4String& name) { 61 { << 62 G4VViewer* pView = 59 G4VViewer* pView = 63 new G4HepRepFileViewer((G4HepRepFileSceneH 60 new G4HepRepFileViewer((G4HepRepFileSceneHandler&) scene, name); 64 if(pView) << 61 if (pView) { 65 { << 62 if (pView->GetViewId() < 0) { 66 if(pView->GetViewId() < 0) << 63 G4cout << 67 { << 64 "G4HepRepFile::CreateViewer: ERROR flagged by negative" 68 G4cout << "G4HepRepFile::CreateViewer: E << 65 " view id in G4HepRepFileViewer creation." 69 " view id in G4HepRepFileViewe << 66 "\n Destroying view and returning null pointer." 70 "\n Destroying view and return << 67 << G4endl; 71 << G4endl; << 72 delete pView; 68 delete pView; 73 pView = 0; 69 pView = 0; 74 } 70 } 75 } 71 } 76 else << 72 else { 77 { << 73 G4cout << 78 G4cout << "G4HepRepFile::CreateViewer: ERR << 74 "G4HepRepFile::CreateViewer: ERROR: null pointer on new G4HepRepFileViewer." 79 "G4HepRepFileViewer." << 75 << G4endl; 80 << G4endl; << 81 } 76 } 82 return pView; 77 return pView; 83 } 78 } 84 79 85 G4HepRepFileXMLWriter* G4HepRepFile::GetHepRep << 80 HepRepXMLWriter* G4HepRepFile::GetHepRepXMLWriter () { 86 { << 81 return hepRepXMLWriter; 87 return hepRepXMLWriter; << 88 } 82 } 89 83