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