[831] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4GeomTestStreamLogger.hh,v 1.3 2006/06/29 18:35:52 gunter Exp $ |
---|
[921] | 28 | // GEANT4 tag $Name: geant4-09-02-cand-01 $ |
---|
[831] | 29 | // |
---|
| 30 | // -------------------------------------------------------------------- |
---|
| 31 | // GEANT 4 class header file |
---|
| 32 | // |
---|
| 33 | // G4GeomTestStreamLogger |
---|
| 34 | // |
---|
| 35 | // Class description: |
---|
| 36 | // |
---|
| 37 | // A G4GeomTestLogger that outputs to a stream. |
---|
| 38 | |
---|
| 39 | // Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu) |
---|
| 40 | // -------------------------------------------------------------------- |
---|
| 41 | #ifndef G4GeomTestStreamLogger_hh |
---|
| 42 | #define G4GeomTestStreamLogger_hh |
---|
| 43 | |
---|
| 44 | #include "G4Types.hh" |
---|
| 45 | #include "G4GeomTestLogger.hh" |
---|
| 46 | |
---|
| 47 | class G4VPhysicalVolume; |
---|
| 48 | |
---|
| 49 | class G4GeomTestStreamLogger : public G4GeomTestLogger |
---|
| 50 | { |
---|
| 51 | public: // with description |
---|
| 52 | |
---|
| 53 | G4GeomTestStreamLogger( std::ostream &o, |
---|
| 54 | G4int theMaxPointsPerError=20 ); |
---|
| 55 | virtual ~G4GeomTestStreamLogger(); |
---|
| 56 | // Constructors and virtual destructor |
---|
| 57 | |
---|
| 58 | virtual void SolidProblem( const G4VSolid *solid, |
---|
| 59 | const G4String &message, |
---|
| 60 | const G4ThreeVector &point ); |
---|
| 61 | virtual void OverlappingDaughters( const G4GeomTestOverlapList *list ); |
---|
| 62 | virtual void OvershootingDaughter( const G4GeomTestOvershootList *list ); |
---|
| 63 | virtual void NoProblem ( const G4String &message ); |
---|
| 64 | |
---|
| 65 | protected: |
---|
| 66 | |
---|
| 67 | void PrintSegmentListHeader(); |
---|
| 68 | void PrintSegmentListElement( const G4ThreeVector &s1, |
---|
| 69 | const G4ThreeVector &s2 ); |
---|
| 70 | // Format aides |
---|
| 71 | |
---|
| 72 | const char *IsAre(G4int n); |
---|
| 73 | |
---|
| 74 | public: // Solaris 7 insists on these guys being public |
---|
| 75 | |
---|
| 76 | class PrintPos |
---|
| 77 | { |
---|
| 78 | public: |
---|
| 79 | PrintPos(const G4ThreeVector pos, G4bool useUnit=true ) |
---|
| 80 | : p(pos), unit(useUnit) {;} |
---|
| 81 | |
---|
| 82 | void Print( std::ostream & ) const; |
---|
| 83 | |
---|
| 84 | private: |
---|
| 85 | G4ThreeVector p; |
---|
| 86 | G4bool unit; |
---|
| 87 | }; |
---|
| 88 | |
---|
| 89 | class VolumeNameAndCopy |
---|
| 90 | { |
---|
| 91 | public: |
---|
| 92 | VolumeNameAndCopy( const G4VPhysicalVolume *theVolume ) |
---|
| 93 | : volume(theVolume) {;} |
---|
| 94 | |
---|
| 95 | void Print( std::ostream & ) const; |
---|
| 96 | |
---|
| 97 | private: |
---|
| 98 | const G4VPhysicalVolume *volume; |
---|
| 99 | }; |
---|
| 100 | |
---|
| 101 | friend std::ostream &operator<<( std::ostream &, |
---|
| 102 | const G4GeomTestStreamLogger::PrintPos & ); |
---|
| 103 | friend std::ostream &operator<<( std::ostream &, |
---|
| 104 | const G4GeomTestStreamLogger::VolumeNameAndCopy & ); |
---|
| 105 | |
---|
| 106 | protected: |
---|
| 107 | |
---|
| 108 | std::ostream &out; |
---|
| 109 | G4int maxPointsPerError; |
---|
| 110 | }; |
---|
| 111 | |
---|
| 112 | #endif |
---|