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: G4ASCIITree.cc,v 1.8 2004/09/13 20:52:54 johna Exp $ >> 25 // GEANT4 tag $Name: geant4-07-00-cand-01 $ 27 // 26 // 28 // 27 // 29 // John Allison 5th April 2001 28 // John Allison 5th April 2001 30 // A graphics system to dump geometry hierarch 29 // A graphics system to dump geometry hierarchy. 31 30 32 #include "G4ASCIITree.hh" 31 #include "G4ASCIITree.hh" 33 #include "G4ASCIITreeSceneHandler.hh" 32 #include "G4ASCIITreeSceneHandler.hh" 34 #include "G4ASCIITreeViewer.hh" 33 #include "G4ASCIITreeViewer.hh" 35 #include "G4ASCIITreeMessenger.hh" 34 #include "G4ASCIITreeMessenger.hh" 36 35 37 #define G4warn G4cout << 38 << 39 G4ASCIITree::G4ASCIITree (): 36 G4ASCIITree::G4ASCIITree (): 40 G4VTree ("ASCIITree", 37 G4VTree ("ASCIITree", 41 "ATree", 38 "ATree", 42 "A graphics system to dump geometry hiera 39 "A graphics system to dump geometry hierarchy" 43 "\n to standard output as an ASCII strea 40 "\n to standard output as an ASCII stream.", 44 G4VGraphicsSystem::nonEuclidian), 41 G4VGraphicsSystem::nonEuclidian), 45 fVerbosity(1), << 42 fVerbosity(0), 46 fOutFileName ("G4cout") 43 fOutFileName ("G4cout") 47 { 44 { 48 fpMessenger = new G4ASCIITreeMessenger(this) 45 fpMessenger = new G4ASCIITreeMessenger(this); 49 } 46 } 50 47 51 G4ASCIITree::~G4ASCIITree () { 48 G4ASCIITree::~G4ASCIITree () { 52 delete fpMessenger; 49 delete fpMessenger; 53 } 50 } 54 51 55 G4VSceneHandler* G4ASCIITree::CreateSceneHandl 52 G4VSceneHandler* G4ASCIITree::CreateSceneHandler (const G4String& name) { 56 G4VSceneHandler* pScene = new G4ASCIITreeSce 53 G4VSceneHandler* pScene = new G4ASCIITreeSceneHandler (*this, name); >> 54 G4cout << G4ASCIITreeSceneHandler::GetSceneCount () >> 55 << ' ' << fName << " scene handlers extanct." << G4endl; 57 return pScene; 56 return pScene; 58 } 57 } 59 58 60 G4VViewer* G4ASCIITree::CreateViewer (G4VScene 59 G4VViewer* G4ASCIITree::CreateViewer (G4VSceneHandler& scene, 61 const G4String& name) { 60 const G4String& name) { 62 G4VViewer* pView = 61 G4VViewer* pView = 63 new G4ASCIITreeViewer ((G4ASCIITreeSceneHa 62 new G4ASCIITreeViewer ((G4ASCIITreeSceneHandler&) scene, name); 64 if (pView) { 63 if (pView) { 65 if (pView -> GetViewId () < 0) { 64 if (pView -> GetViewId () < 0) { 66 G4warn << "G4ASCIITree::CreateViewer: ER << 65 G4cout << "G4ASCIITree::CreateViewer: ERROR flagged by negative" 67 " view id in G4ASCIITreeViewer creatio 66 " view id in G4ASCIITreeViewer creation." 68 "\n Destroying view and returning null 67 "\n Destroying view and returning null pointer." 69 << G4endl; 68 << G4endl; 70 delete pView; 69 delete pView; 71 pView = 0; 70 pView = 0; 72 } 71 } 73 } 72 } 74 else { 73 else { 75 G4warn << "G4ASCIITree::CreateViewer: ERRO << 74 G4cout << "G4ASCIITree::CreateViewer: ERROR: null pointer on" 76 " new G4ASCIITreeViewer." << G4endl; 75 " new G4ASCIITreeViewer." << G4endl; 77 } 76 } 78 return pView; 77 return pView; 79 } 78 } 80 79