Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SolidAnalyser.hh
Go to the documentation of this file.
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 //
28 //
29 //
30 // $Id$
31 //
32 //
33 // --------------------------------------------------------------
34 // SolidAnalyser
35 //
36 // Sigleton providing Geant4 solids specifications in a generic way.
37 //
38 // Author: Martin Liendl - Martin.Liendl@cern.ch
39 //
40 // --------------------------------------------------------------
41 //
42 #ifndef SolidAnalyser_h
43 #define SolidAnalyser_h
44 
45 #include <vector>
46 #include <algorithm>
47 
48 #include "globals.hh"
49 
50 // supported Geant4 solids:
51 class G4VSolid;
52 class G4Box;
53 class G4Cons;
54 class G4Polycone;
55 class G4Polyhedra;
56 class G4Trap;
57 class G4Trd;
58 class G4Tubs;
59 
61 {
62 
63 public:
64 
66 
67  //void Reset();
68 
69  // user method to retrieve information
70  G4int GetParam(const G4VSolid *,
71  std::vector<std::pair<G4String,G4double> > & ) const;
72 
74 
75 protected:
76  G4int GetParam(const G4Box *,
77  std::vector<std::pair<G4String,G4double> > & ) const;
78  G4int GetParam(const G4Cons *,
79  std::vector<std::pair<G4String,G4double> > & ) const;
80  G4int GetParam(const G4Polycone *,
81  std::vector<std::pair<G4String,G4double> > & ) const;
82  G4int GetParam(const G4Polyhedra *,
83  std::vector<std::pair<G4String,G4double> > & ) const;
84  G4int GetParam(const G4Trap *,
85  std::vector<std::pair<G4String,G4double> > & ) const;
86  G4int GetParam(const G4Trd *,
87  std::vector<std::pair<G4String,G4double> > & ) const;
88  G4int GetParam(const G4Tubs *,
89  std::vector<std::pair<G4String,G4double> > & ) const;
90 
91 private:
92 
93  SolidAnalyser();
94 
95  G4int NotImplemented(const G4VSolid *,
96  std::vector<std::pair<G4String,G4double> > & ) const;
97 
98  static SolidAnalyser * theInstance;
99 };
100 
101 std::ostream & operator<<(std::ostream& flux,
102  std::vector<std::pair<G4String,G4double> >& v);
103 
104 #endif