ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FukuiRendererSceneHandler.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4FukuiRendererSceneHandler.hh
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 //
29 // Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
30 
31 
32 //=================//
33 #ifdef G4VIS_BUILD_DAWN_DRIVER
34 //=================//
35 
36 
37 #ifndef G4FUKUI_RENDERER_SCENE_HANDLER_HH
38 #define G4FUKUI_RENDERER_SCENE_HANDLER_HH
39 
40 #include "globals.hh"
41 
42 #include "G4VSceneHandler.hh"
43 
44 #include "G4FRClientServer.hh"
45 #include "G4FRConst.hh"
46 
47 class G4VisAttributes ;
48 class G4FukuiRenderer;
49 
50  //-----
51 class G4FukuiRendererSceneHandler: public G4VSceneHandler {
52 
53 public:
54 
55  //----- constructor and destructor
56  G4FukuiRendererSceneHandler (G4FukuiRenderer& system, const G4String& name = "");
57  virtual ~G4FukuiRendererSceneHandler ();
58 
59  //----- overriding base class methods
60  void AddPrimitive (const G4Polyline& line);
61  void AddPrimitive (const G4Polyhedron& p);
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)
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 G4Orb& orb ) {
95  }
96  void AddSolid ( const G4Ellipsoid& ellipsoid ) {
97  G4VSceneHandler::AddSolid (ellipsoid);
98  }
99  void AddSolid ( const G4TessellatedSolid& tess ) {
101  }
102  void AddSolid ( const G4VSolid& solid );
103  void AddCompound ( const G4VTrajectory& traj) {
105  }
106  void AddCompound ( const G4VHit& hit) {
108  }
109  void AddCompound ( const G4VDigi& digi) {
111  }
112  void AddCompound ( const G4THitsMap<G4double> & hits) {
114  }
115  void AddCompound ( const G4THitsMap<G4StatDouble> & hits) {
117  }
118 
119  void ClearTransientStore(); // Used for triggering detector re-drawing.
120 
121  //----- methods inherent to this class
122  void FRBeginModeling () ;
123  void FREndModeling () ;
124  G4bool FRIsInModeling () { return FRflag_in_modeling ; }
125 
126  G4bool IsSavingG4Prim ( void ) { return flag_saving_g4_prim ; }
127  void BeginSavingG4Prim( void )
128  {
129  if( !IsSavingG4Prim() )
130  {
131  SendStr( FR_SAVE ) ;
132  SendStr( FR_G4_PRIM_HEADER ) ;
133  flag_saving_g4_prim = true ;
134  }
135  }
136  void EndSavingG4Prim ( void )
137  { if( IsSavingG4Prim() ) { SendStr( FR_END_SAVE ); flag_saving_g4_prim = false ; } }
138 
139  G4FRClientServer& GetPrimDest () { return fPrimDest ; }
140  G4FukuiRenderer& GetSystem () { return fSystem ; }
141  void SendBoundingBox ( void );
142 
143 private:
144 
145  //----- Utilities etc
146  G4bool SendVisAttributes ( const G4VisAttributes* pAV );
147  G4bool IsVisible ( void ) ;
148  void SendTransformedCoordinates( void ) ;
149  void SendPhysVolName ( void ) ;
150  void SendNdiv ( void ) ;
151 
152 public:
153 
154  void SendStr ( const char* char_string ) ;
155  void SendStrInt( const char* char_string ,
156  G4int ival );
157  void SendStrInt3( const char* char_string ,
158  G4int ival1 ,
159  G4int ival2 ,
160  G4int ival3 );
161  void SendStrInt4( const char* char_string ,
162  G4int ival1 ,
163  G4int ival2 ,
164  G4int ival3 ,
165  G4int ival4 );
166  void SendStrDouble( const char* char_string ,
167  G4double dval );
168  void SendStrDouble2( const char* char_string ,
169  G4double dval1 ,
170  G4double dval2 );
171  void SendStrDouble3( const char* char_string ,
172  G4double dval1 ,
173  G4double dval2 ,
174  G4double dval3 );
175 
176  void SendStrDouble4( const char* char_string ,
177  G4double dval1 ,
178  G4double dval2 ,
179  G4double dval3 ,
180  G4double dval4 );
181 
182  void SendStrDouble5( const char* char_string ,
183  G4double dval1 ,
184  G4double dval2 ,
185  G4double dval3 ,
186  G4double dval4 ,
187  G4double dval5 );
188 
189  void SendStrDouble6( const char* char_string ,
190  G4double dval1 ,
191  G4double dval2 ,
192  G4double dval3 ,
193  G4double dval4 ,
194  G4double dval5 ,
195  G4double dval6 );
196 
197  void SendStrDouble7( const char* char_string ,
198  G4double dval1 ,
199  G4double dval2 ,
200  G4double dval3 ,
201  G4double dval4 ,
202  G4double dval5 ,
203  G4double dval6 ,
204  G4double dval7 );
205 
206  void SendStrDouble11( const char* char_string ,
207  G4double dval1 ,
208  G4double dval2 ,
209  G4double dval3 ,
210  G4double dval4 ,
211  G4double dval5 ,
212  G4double dval6 ,
213  G4double dval7 ,
214  G4double dval8 ,
215  G4double dval9 ,
216  G4double dval10 ,
217  G4double dval11 ) ;
218 
219  void SendIntDouble3( G4int ival ,
220  G4double dval1 ,
221  G4double dval2 ,
222  G4double dval3 );
223  void SendInt3Str( G4int ival1 ,
224  G4int ival2 ,
225  G4int ival3 ,
226  const char* char_string );
227  void SendInt4Str( G4int ival1 ,
228  G4int ival2 ,
229  G4int ival3 ,
230  G4int ival4 ,
231  const char* char_string );
232 
233  void SendStrDouble3Str( const char* char_string1 ,
234  G4double dval1 ,
235  G4double dval2 ,
236  G4double dval3 ,
237  const char* char_string2 );
238 
239  void SendStrDouble6Str( const char* char_string1 ,
240  G4double dval1 ,
241  G4double dval2 ,
242  G4double dval3 ,
243  G4double dval4 ,
244  G4double dval5 ,
245  G4double dval6 ,
246  const char* char_string2 );
247 
248  void SendInt ( G4int val );
249  void SendDouble( G4double val );
250 
251 
252 
253 private:
254  G4FukuiRenderer& fSystem; // Graphics system for this scene.
255  static G4int fSceneIdCount;
256 
257  G4FRClientServer& fPrimDest ; // defined in G4FukuiRenderer
258  G4bool FRflag_in_modeling ;
259  // true: FR_BEGIN_MODELING has sent to DAWN, and
260  // FR_END_MODELING has not sent yet.
261  // false: otherwise
262  //
263  // FRflag_in_modeling is set to "true"
264  // in FRBeginModeling(), and to "false"
265  // in FREndModeling().
266 
267  G4bool flag_saving_g4_prim ;
268 
269  const int COMMAND_BUF_SIZE ;
270 
271  G4int fPrec, fPrec2 ;
272 
273 };
274 
275 #endif
276 #endif //G4VIS_BUILD_DAWN_DRIVER