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 // ******************************************************************** >> 25 // * DISCLAIMER * >> 26 // * * >> 27 // * The following disclaimer summarizes all the specific disclaimers * >> 28 // * of contributors to this software. The specific disclaimers,which * >> 29 // * govern, are listed with their locations in: * >> 30 // * http://cern.ch/geant4/license * >> 31 // * * >> 32 // * Neither the authors of this software system, nor their employing * >> 33 // * institutes,nor the agencies providing financial support for this * >> 34 // * work make any representation or warranty, express or implied, * >> 35 // * regarding this software system or assume any liability for its * >> 36 // * use. * >> 37 // * * >> 38 // * This code implementation is the intellectual property of the * >> 39 // * GEANT4 collaboration. * >> 40 // * By copying, distributing or modifying the Program (or any work * >> 41 // * based on the Program) you indicate your acceptance of this * >> 42 // * statement, and all its terms. * >> 43 // ******************************************************************** >> 44 // >> 45 // >> 46 // $Id: G4HepRepFile.cc,v 1.6 2002/12/13 11:18:03 gunter Exp $ >> 47 // GEANT4 tag $Name: geant4-05-00 $ 27 // 48 // >> 49 // 28 // Joseph Perl 1 October 2001 50 // Joseph Perl 1 October 2001 29 // A graphics system to dump geometry hierarch 51 // A graphics system to dump geometry hierarchy to the 30 // HepRep graphics format (HepRep version 1). 52 // HepRep graphics format (HepRep version 1). 31 53 32 // HepRep << 54 //HepRep 33 #include "G4HepRepFileXMLWriter.hh" << 55 #include "HepRepXMLWriter.hh" 34 56 35 #include "G4HepRepFile.hh" 57 #include "G4HepRepFile.hh" 36 #include "G4HepRepFileSceneHandler.hh" 58 #include "G4HepRepFileSceneHandler.hh" 37 #include "G4HepRepFileViewer.hh" 59 #include "G4HepRepFileViewer.hh" 38 #include "G4HepRepMessenger.hh" << 39 60 40 static G4HepRepFileXMLWriter* hepRepXMLWriter; << 61 static HepRepXMLWriter* hepRepXMLWriter; 41 62 42 G4HepRepFile::G4HepRepFile() << 63 G4HepRepFile::G4HepRepFile(): 43 : G4VGraphicsSystem("G4HepRepFile", "HepRepF << 64 G4VGraphicsSystem("G4HepRepFile", 44 "A HepRep (format 1) asc << 65 "HepRepFile", 45 G4VGraphicsSystem::fileW << 66 "A HepRep (format 1) ascii file driver", 46 { << 67 G4VGraphicsSystem::threeD) { 47 G4HepRepMessenger::GetInstance(); << 68 hepRepXMLWriter = new HepRepXMLWriter(); 48 hepRepXMLWriter = new G4HepRepFileXMLWriter( << 49 } 69 } 50 70 51 G4HepRepFile::~G4HepRepFile() { delete hepRepX << 71 G4HepRepFile::~G4HepRepFile() {} 52 72 53 G4VSceneHandler* G4HepRepFile::CreateSceneHand << 73 G4VSceneHandler* G4HepRepFile::CreateSceneHandler(const G4String& name) { 54 { << 55 G4VSceneHandler* pScene = new G4HepRepFileSc 74 G4VSceneHandler* pScene = new G4HepRepFileSceneHandler(*this, name); >> 75 G4cout << G4HepRepFileSceneHandler::GetSceneCount() >> 76 << ' ' << fName << " scene handlers extanct." << G4endl; 56 return pScene; 77 return pScene; 57 } 78 } 58 79 59 G4VViewer* G4HepRepFile::CreateViewer(G4VScene 80 G4VViewer* G4HepRepFile::CreateViewer(G4VSceneHandler& scene, 60 const G4 << 81 const G4String& name) { 61 { << 62 G4VViewer* pView = 82 G4VViewer* pView = 63 new G4HepRepFileViewer((G4HepRepFileSceneH 83 new G4HepRepFileViewer((G4HepRepFileSceneHandler&) scene, name); 64 if(pView) << 84 if (pView) { 65 { << 85 if (pView->GetViewId() < 0) { 66 if(pView->GetViewId() < 0) << 86 G4cout << 67 { << 87 "G4HepRepFile::CreateViewer: ERROR flagged by negative" 68 G4cout << "G4HepRepFile::CreateViewer: E << 88 " view id in G4HepRepFileViewer creation." 69 " view id in G4HepRepFileViewe << 89 "\n Destroying view and returning null pointer." 70 "\n Destroying view and return << 90 << G4endl; 71 << G4endl; << 72 delete pView; 91 delete pView; 73 pView = 0; 92 pView = 0; 74 } 93 } 75 } 94 } 76 else << 95 else { 77 { << 96 G4cout << 78 G4cout << "G4HepRepFile::CreateViewer: ERR << 97 "G4HepRepFile::CreateViewer: ERROR: null pointer on new G4HepRepFileViewer." 79 "G4HepRepFileViewer." << 98 << G4endl; 80 << G4endl; << 81 } 99 } 82 return pView; 100 return pView; 83 } 101 } 84 102 85 G4HepRepFileXMLWriter* G4HepRepFile::GetHepRep << 103 HepRepXMLWriter* G4HepRepFile::GetHepRepXMLWriter () { 86 { << 104 return hepRepXMLWriter; 87 return hepRepXMLWriter; << 88 } 105 } 89 106