00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // -------------------------------------------------------------------- 00030 // GEANT 4 class header file 00031 // 00032 // G4GeomTestStreamLogger 00033 // 00034 // Class description: 00035 // 00036 // A G4GeomTestLogger that outputs to a stream. 00037 00038 // Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu) 00039 // -------------------------------------------------------------------- 00040 #ifndef G4GeomTestStreamLogger_hh 00041 #define G4GeomTestStreamLogger_hh 00042 00043 #include "G4Types.hh" 00044 #include "G4GeomTestLogger.hh" 00045 00046 class G4VPhysicalVolume; 00047 00048 class G4GeomTestStreamLogger : public G4GeomTestLogger 00049 { 00050 public: // with description 00051 00052 G4GeomTestStreamLogger( std::ostream &o, 00053 G4int theMaxPointsPerError=20 ); 00054 virtual ~G4GeomTestStreamLogger(); 00055 // Constructors and virtual destructor 00056 00057 virtual void SolidProblem( const G4VSolid *solid, 00058 const G4String &message, 00059 const G4ThreeVector &point ); 00060 virtual void OverlappingDaughters( const G4GeomTestOverlapList *list ); 00061 virtual void OvershootingDaughter( const G4GeomTestOvershootList *list ); 00062 virtual void NoProblem ( const G4String &message ); 00063 00064 protected: 00065 00066 void PrintSegmentListHeader(); 00067 void PrintSegmentListElement( const G4ThreeVector &s1, 00068 const G4ThreeVector &s2 ); 00069 // Format aides 00070 00071 const char *IsAre(G4int n); 00072 00073 public: // Solaris 7 insists on these guys being public 00074 00075 class PrintPos 00076 { 00077 public: 00078 PrintPos(const G4ThreeVector pos, G4bool useUnit=true ) 00079 : p(pos), unit(useUnit) {;} 00080 00081 void Print( std::ostream & ) const; 00082 00083 private: 00084 G4ThreeVector p; 00085 G4bool unit; 00086 }; 00087 00088 class VolumeNameAndCopy 00089 { 00090 public: 00091 VolumeNameAndCopy( const G4VPhysicalVolume *theVolume ) 00092 : volume(theVolume) {;} 00093 00094 void Print( std::ostream & ) const; 00095 00096 private: 00097 const G4VPhysicalVolume *volume; 00098 }; 00099 00100 friend std::ostream &operator<<( std::ostream &, 00101 const G4GeomTestStreamLogger::PrintPos & ); 00102 friend std::ostream &operator<<( std::ostream &, 00103 const G4GeomTestStreamLogger::VolumeNameAndCopy & ); 00104 00105 protected: 00106 00107 std::ostream &out; 00108 G4int maxPointsPerError; 00109 }; 00110 00111 #endif