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 | // SBTMessenger.hh |
---|
28 | // |
---|
29 | // Definition of the messenger for controlling test 3 |
---|
30 | // |
---|
31 | #ifndef SBTMessenger_hh |
---|
32 | #define SBTMessenger_hh |
---|
33 | |
---|
34 | #include "G4UImessenger.hh" |
---|
35 | #include "globals.hh" |
---|
36 | #include <fstream> |
---|
37 | |
---|
38 | class SBTrun; |
---|
39 | class SBTVisManager; |
---|
40 | |
---|
41 | class G4VSolid; |
---|
42 | class G4SolidQuery; |
---|
43 | |
---|
44 | class G4UIdirectory; |
---|
45 | class G4UIcommand; |
---|
46 | class G4UIcmdWith3VectorAndUnit; |
---|
47 | class G4UIcmdWithAnInteger; |
---|
48 | class G4UIcmdWithAString; |
---|
49 | class G4UIcmdWithoutParameter; |
---|
50 | |
---|
51 | class SBTMessenger : public G4UImessenger |
---|
52 | { |
---|
53 | public: |
---|
54 | SBTMessenger( const G4String prefix, const G4SolidQuery *solidQuery, SBTVisManager *visManager ); |
---|
55 | ~SBTMessenger(); |
---|
56 | |
---|
57 | void SetNewValue( G4UIcommand *command, G4String newValues ); |
---|
58 | G4String GetCurrentValue( G4UIcommand *command ); |
---|
59 | |
---|
60 | inline const G4SolidQuery *GetSolidQuery() const { return solidQuery; } |
---|
61 | |
---|
62 | inline SBTVisManager *GetVisManager() const { return visManager; } |
---|
63 | inline void SetVisManager( SBTVisManager *theVisManager ) { visManager = theVisManager; } |
---|
64 | |
---|
65 | public: |
---|
66 | class Debugger { |
---|
67 | public: |
---|
68 | Debugger( const G4VSolid *aSolid, const SBTrun *aTester ) |
---|
69 | { testSolid = aSolid; tester = aTester; } |
---|
70 | virtual ~Debugger() {;} |
---|
71 | |
---|
72 | virtual G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ) = 0; |
---|
73 | |
---|
74 | protected: |
---|
75 | const G4VSolid *testSolid; |
---|
76 | const SBTrun *tester; |
---|
77 | }; |
---|
78 | |
---|
79 | protected: |
---|
80 | class DrawError : public SBTMessenger::Debugger { |
---|
81 | public: |
---|
82 | DrawError( const G4VSolid *aSolid, const SBTrun *aTester, SBTVisManager *theVisManager ) |
---|
83 | : Debugger(aSolid,aTester) { visManager = theVisManager;} |
---|
84 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
85 | |
---|
86 | protected: |
---|
87 | SBTVisManager *visManager; |
---|
88 | }; |
---|
89 | class DebugInside : public SBTMessenger::Debugger { |
---|
90 | public: |
---|
91 | DebugInside( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
92 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
93 | }; |
---|
94 | class DebugToInP : public SBTMessenger::Debugger { |
---|
95 | public: |
---|
96 | DebugToInP( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
97 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
98 | }; |
---|
99 | class DebugToInPV : public SBTMessenger::Debugger { |
---|
100 | public: |
---|
101 | DebugToInPV( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
102 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
103 | }; |
---|
104 | class DebugToOutP : public SBTMessenger::Debugger { |
---|
105 | public: |
---|
106 | DebugToOutP( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
107 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
108 | }; |
---|
109 | class DebugToOutPV : public SBTMessenger::Debugger { |
---|
110 | public: |
---|
111 | DebugToOutPV( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
112 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
113 | }; |
---|
114 | |
---|
115 | class DebugSurfNorm : public SBTMessenger::Debugger { |
---|
116 | public: |
---|
117 | DebugSurfNorm( const G4VSolid *aSolid, const SBTrun *aTester ) : Debugger(aSolid,aTester) {;} |
---|
118 | G4int DebugMe( std::ifstream &logFile, const G4int errorIndex ); |
---|
119 | }; |
---|
120 | void InvokeTest3(); |
---|
121 | void Debug( const G4int errorIndex, SBTMessenger::Debugger *debugger ); |
---|
122 | |
---|
123 | private: |
---|
124 | SBTrun *tester; |
---|
125 | const G4SolidQuery *solidQuery; |
---|
126 | SBTVisManager *visManager; |
---|
127 | |
---|
128 | G4String errorFile; |
---|
129 | |
---|
130 | G4UIdirectory *test3Directory; |
---|
131 | G4UIcmdWith3VectorAndUnit *targetCmd; |
---|
132 | G4UIcmdWith3VectorAndUnit *widthsCmd; |
---|
133 | G4UIcmdWith3VectorAndUnit *gridSizesCmd; |
---|
134 | G4UIcmdWithAnInteger *maxPointsCmd; |
---|
135 | G4UIcmdWithAnInteger *maxErrorsCmd; |
---|
136 | G4UIcmdWithAString *errorFileCmd; |
---|
137 | G4UIcmdWithoutParameter *runCmd; |
---|
138 | G4UIcmdWithAnInteger *drawCmd; |
---|
139 | G4UIcmdWithAnInteger *debugInsideCmd; |
---|
140 | G4UIcmdWithAnInteger *debugToInPCmd; |
---|
141 | G4UIcmdWithAnInteger *debugToInPVCmd; |
---|
142 | G4UIcmdWithAnInteger *debugToOutPCmd; |
---|
143 | G4UIcmdWithAnInteger *debugToOutPVCmd; |
---|
144 | G4UIcmdWithAnInteger *debugSurfNormCmd; |
---|
145 | G4UIcmdWithoutParameter *pauseCmd; |
---|
146 | }; |
---|
147 | |
---|
148 | #endif |
---|