source: trunk/source/visualization/FukuiRenderer/include/G4DAWNFILESceneHandler.hh @ 834

Last change on this file since 834 was 834, checked in by garnier, 16 years ago

import all except CVS

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