Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DAWNFILESceneHandler.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//
26//
27//
28// Satoshi TANAKA
29
30#ifndef G4DAWNFILE_SCENE_HANDLER_HH
31#define G4DAWNFILE_SCENE_HANDLER_HH
32
33#include "globals.hh"
34
35#include "G4VSceneHandler.hh"
36
37#include "G4FRofstream.hh"
38#include "G4FRConst.hh"
39
40
41class G4VisAttributes ;
42class G4DAWNFILE;
43
44
45 //-----
47
48 friend class G4DAWNFILEViewer;
49
50public:
51
52 //----- constructor and destructor
53 G4DAWNFILESceneHandler (G4DAWNFILE& system, const G4String& name = "");
54 virtual ~G4DAWNFILESceneHandler ();
55
56 //----- overriding base class methods
57 void AddPrimitive (const G4Polyline& line);
58 void AddPrimitive (const G4Polyhedron& p);
59 void AddPrimitive (const G4Text&);
60 void AddPrimitive (const G4Circle&);
61 void AddPrimitive (const G4Square&);
62
63 //----- explicitly invoke base class methods to avoid warnings about
64 //----- hiding of base class methods.
65 void AddPrimitive (const G4Polymarker& polymarker)
66 { G4VSceneHandler::AddPrimitive (polymarker); }
67 void AddPrimitive (const G4Scale& scale)
69
72
73 virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
74 virtual void EndPrimitives ();
75
76 void AddSolid ( const G4Box& box );
77 void AddSolid ( const G4Cons& cons );
78 void AddSolid ( const G4Tubs& tubs );
79 void AddSolid ( const G4Trd& trd );
80 void AddSolid ( const G4Trap& trap );
81 void AddSolid ( const G4Sphere& sphere );
82 void AddSolid ( const G4Para& para );
83 void AddSolid ( const G4Torus& torus );
84 void AddSolid ( const G4Polycone& polycone ) {
86 }
87 void AddSolid ( const G4Polyhedra& polyhedra ) {
88 G4VSceneHandler::AddSolid (polyhedra);
89 }
90 void AddSolid ( const G4Orb& orb ) {
92 }
93 void AddSolid ( const G4Ellipsoid& ellipsoid ) {
94 G4VSceneHandler::AddSolid (ellipsoid);
95 }
96 void AddSolid ( const G4TessellatedSolid& tess ) {
98 }
99 void AddSolid ( const G4VSolid& solid );
100 void AddCompound ( const G4VTrajectory& traj) {
102 }
103 void AddCompound ( const G4VHit& hit) {
105 }
106 void AddCompound ( const G4VDigi& digi) {
108 }
109 void AddCompound ( const G4THitsMap<G4double> & hits) {
111 }
114 }
115
116 void ClearTransientStore(); // Used for triggering detector re-drawing.
117
118 //----- public methods inherent to this class
119 void FRBeginModeling () ;
121 G4bool FRIsInModeling () { return FRflag_in_modeling ; }
122
123 G4bool IsSavingG4Prim ( void ) { return flag_saving_g4_prim ; }
124 void BeginSavingG4Prim( void );
125 void EndSavingG4Prim ( void ) ;
126 void SetG4PrimFileName() ;
127
128 G4DAWNFILE& GetSystem () { return fSystem ; }
129 void SendBoundingBox ( void );
130 const char* GetG4PrimFileName () { return fG4PrimFileName ; }
131
132
133private:
134
135 //----- Utilities etc (common to DAWN and DAWNFILE drivers )
136 G4bool SendVisAttributes ( const G4VisAttributes* pAV );
137 G4bool IsVisible ( void ) ;
138 void SendTransformedCoordinates( void ) ;
139 void SendPhysVolName ( void ) ;
140 void SendNdiv ( void ) ;
141
142 //----- public methods common to DAWN and DAWNFILE drivers
143public:
144 void SendStr ( const char* char_string ) ;
145 void SendStrInt( const char* char_string ,
146 G4int ival );
147 void SendStrInt3( const char* char_string ,
148 G4int ival1 ,
149 G4int ival2 ,
150 G4int ival3 );
151 void SendStrInt4( const char* char_string ,
152 G4int ival1 ,
153 G4int ival2 ,
154 G4int ival3 ,
155 G4int ival4 );
156 void SendStrDouble( const char* char_string ,
157 G4double dval );
158 void SendStrDouble2( const char* char_string ,
159 G4double dval1 ,
160 G4double dval2 );
161 void SendStrDouble3( const char* char_string ,
162 G4double dval1 ,
163 G4double dval2 ,
164 G4double dval3 );
165
166 void SendStrDouble4( const char* char_string ,
167 G4double dval1 ,
168 G4double dval2 ,
169 G4double dval3 ,
170 G4double dval4 );
171
172 void SendStrDouble5( const char* char_string ,
173 G4double dval1 ,
174 G4double dval2 ,
175 G4double dval3 ,
176 G4double dval4 ,
177 G4double dval5 );
178
179 void SendStrDouble6( const char* char_string ,
180 G4double dval1 ,
181 G4double dval2 ,
182 G4double dval3 ,
183 G4double dval4 ,
184 G4double dval5 ,
185 G4double dval6 );
186
187 void SendStrDouble7( const char* char_string ,
188 G4double dval1 ,
189 G4double dval2 ,
190 G4double dval3 ,
191 G4double dval4 ,
192 G4double dval5 ,
193 G4double dval6 ,
194 G4double dval7 );
195
196 void SendStrDouble11( const char* char_string ,
197 G4double dval1 ,
198 G4double dval2 ,
199 G4double dval3 ,
200 G4double dval4 ,
201 G4double dval5 ,
202 G4double dval6 ,
203 G4double dval7 ,
204 G4double dval8 ,
205 G4double dval9 ,
206 G4double dval10 ,
207 G4double dval11 ) ;
208
210 G4double dval1 ,
211 G4double dval2 ,
212 G4double dval3 );
213 void SendInt3Str( G4int ival1 ,
214 G4int ival2 ,
215 G4int ival3 ,
216 const char* char_string );
217 void SendInt4Str( G4int ival1 ,
218 G4int ival2 ,
219 G4int ival3 ,
220 G4int ival4 ,
221 const char* char_string );
222
223 void SendStrDouble3Str( const char* char_string1 ,
224 G4double dval1 ,
225 G4double dval2 ,
226 G4double dval3 ,
227 const char* char_string2 );
228
229 void SendStrDouble6Str( const char* char_string1 ,
230 G4double dval1 ,
231 G4double dval2 ,
232 G4double dval3 ,
233 G4double dval4 ,
234 G4double dval5 ,
235 G4double dval6 ,
236 const char* char_string2 );
237
238 void SendInt ( G4int val );
239 void SendDouble( G4double val );
240
241private:
242 G4DAWNFILE& fSystem; // Graphics system for this scene.
243 static G4int fSceneIdCount;
244
245 G4FRofstream fPrimDest ; // defined here
246 G4bool FRflag_in_modeling ;
247 // true: FR_BEGIN_MODELING has sent to DAWN, and
248 // FR_END_MODELING has not sent yet.
249 // false: otherwise
250 //
251 // FRflag_in_modeling is set to "true"
252 // in FRBeginModeling(), and to "false"
253 // in FREndModeling().
254
255 G4bool flag_saving_g4_prim ;
256
257 const int COMMAND_BUF_SIZE ;
258
259 char fG4PrimDestDir [256] ;
260 char fG4PrimFileName[256] ;
261 G4int fMaxFileNum ;
262
263 G4int fPrec, fPrec2 ;
264
265};
266
267#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Definition: G4Box.hh:56
Definition: G4Cons.hh:78
void AddCompound(const G4THitsMap< G4double > &hits)
void SendBoundingBox(void)
void SendStrDouble7(const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, G4double dval7)
void SendStrInt4(const char *char_string, G4int ival1, G4int ival2, G4int ival3, G4int ival4)
void AddPrimitive(const G4Square &)
void AddSolid(const G4Sphere &sphere)
void SendStrDouble3(const char *char_string, G4double dval1, G4double dval2, G4double dval3)
void AddSolid(const G4Cons &cons)
void AddSolid(const G4Polyhedra &polyhedra)
void SendStr(const char *char_string)
void AddPrimitive(const G4Text &)
void SendStrDouble5(const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5)
void SendInt3Str(G4int ival1, G4int ival2, G4int ival3, const char *char_string)
void AddCompound(const G4VTrajectory &traj)
void SendInt(G4int val)
void AddSolid(const G4TessellatedSolid &tess)
void SendDouble(G4double val)
void SendStrDouble6Str(const char *char_string1, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, const char *char_string2)
void AddSolid(const G4Trap &trap)
virtual void EndPrimitives()
void SendIntDouble3(G4int ival, G4double dval1, G4double dval2, G4double dval3)
void AddPrimitive(const G4Polymarker &polymarker)
void SendStrDouble11(const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, G4double dval7, G4double dval8, G4double dval9, G4double dval10, G4double dval11)
void AddPrimitive(const G4Polyline &line)
void SendStrDouble(const char *char_string, G4double dval)
void SendStrDouble2(const char *char_string, G4double dval1, G4double dval2)
void SendStrDouble3Str(const char *char_string1, G4double dval1, G4double dval2, G4double dval3, const char *char_string2)
void AddSolid(const G4Box &box)
void AddCompound(const G4VHit &hit)
void SendStrDouble6(const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6)
void AddPrimitive(const G4Circle &)
void AddPrimitive(const G4Scale &scale)
void AddSolid(const G4Trd &trd)
void AddSolid(const G4Tubs &tubs)
void SendStrInt3(const char *char_string, G4int ival1, G4int ival2, G4int ival3)
void AddSolid(const G4Ellipsoid &ellipsoid)
void AddCompound(const G4VDigi &digi)
void AddSolid(const G4Polycone &polycone)
void SendStrInt(const char *char_string, G4int ival)
void SendStrDouble4(const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4)
void AddPrimitive(const G4Polyhedron &p)
void AddCompound(const G4THitsMap< G4StatDouble > &hits)
void AddSolid(const G4Para &para)
void AddSolid(const G4Torus &torus)
void SendInt4Str(G4int ival1, G4int ival2, G4int ival3, G4int ival4, const char *char_string)
void AddSolid(const G4Orb &orb)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation)
void AddSolid(const G4VSolid &solid)
Definition: G4Orb.hh:56
Definition: G4Para.hh:79
Definition: G4Text.hh:72
Definition: G4Trd.hh:63
Definition: G4Tubs.hh:75
Definition: G4VHit.hh:48
virtual void BeginModeling()
virtual void EndModeling()
virtual void AddSolid(const G4Box &)
virtual void AddCompound(const G4VTrajectory &)
virtual void AddPrimitive(const G4Polyline &)=0