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p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 class G4VisAttributes;
 41 class G4DAWNFILE;
 42 
 43 //-----
 44 class G4DAWNFILESceneHandler : public G4VSceneHandler
 45 {
 46   friend class G4DAWNFILEViewer;
 47 
 48  public:
 49   //----- constructor and destructor
 50   G4DAWNFILESceneHandler(G4DAWNFILE& system, const G4String& name = "");
 51   virtual ~G4DAWNFILESceneHandler();
 52 
 53   //----- overriding base class methods
 54   using G4VSceneHandler::AddPrimitive;
 55   void AddPrimitive(const G4Polyline& line);
 56   void AddPrimitive(const G4Polyhedron& p);
 57   void AddPrimitive(const G4Text&);
 58   void AddPrimitive(const G4Circle&);
 59   void AddPrimitive(const G4Square&);
 60 
 61   void BeginPrimitives(const G4Transform3D& objectTransformation);
 62   void EndPrimitives();
 63 
 64   using G4VSceneHandler::AddSolid;
 65   void AddSolid(const G4Box& box);
 66   void AddSolid(const G4Cons& cons);
 67   void AddSolid(const G4Tubs& tubs);
 68   void AddSolid(const G4Trd& trd);
 69   void AddSolid(const G4Trap& trap);
 70   void AddSolid(const G4Sphere& sphere);
 71   void AddSolid(const G4Para& para);
 72   void AddSolid(const G4Torus& torus);
 73   void AddSolid(const G4VSolid& solid);
 74 
 75   void ClearTransientStore();  // Used for triggering detector re-drawing.
 76 
 77   //----- public methods inherent to this class
 78   void FRBeginModeling();
 79   void FREndModeling();
 80   G4bool FRIsInModeling() { return FRflag_in_modeling; }
 81 
 82   G4bool IsSavingG4Prim(void) { return flag_saving_g4_prim; }
 83   void BeginSavingG4Prim(void);
 84   void EndSavingG4Prim(void);
 85   void SetG4PrimFileName();
 86 
 87   G4DAWNFILE& GetSystem() { return fSystem; }
 88   void SendBoundingBox(void);
 89   const char* GetG4PrimFileName() { return fG4PrimFileName; }
 90 
 91  private:
 92   //----- Utilities etc (common to DAWN and DAWNFILE drivers )
 93   G4bool SendVisAttributes(const G4VisAttributes* pAV);
 94   G4bool IsVisible(void);
 95   void SendTransformedCoordinates(void);
 96   void SendPhysVolName(void);
 97   void SendNdiv(void);
 98 
 99   //----- public methods common to DAWN and DAWNFILE drivers
100  public:
101   void SendStr(const char* char_string);
102   void SendStrInt(const char* char_string, G4int ival);
103   void SendStrInt3(const char* char_string, G4int ival1, G4int ival2,
104                    G4int ival3);
105   void SendStrInt4(const char* char_string, G4int ival1, G4int ival2,
106                    G4int ival3, G4int ival4);
107   void SendStrDouble(const char* char_string, G4double dval);
108   void SendStrDouble2(const char* char_string, G4double dval1, G4double dval2);
109   void SendStrDouble3(const char* char_string, G4double dval1, G4double dval2,
110                       G4double dval3);
111 
112   void SendStrDouble4(const char* char_string, G4double dval1, G4double dval2,
113                       G4double dval3, G4double dval4);
114 
115   void SendStrDouble5(const char* char_string, G4double dval1, G4double dval2,
116                       G4double dval3, G4double dval4, G4double dval5);
117 
118   void SendStrDouble6(const char* char_string, G4double dval1, G4double dval2,
119                       G4double dval3, G4double dval4, G4double dval5,
120                       G4double dval6);
121 
122   void SendStrDouble7(const char* char_string, G4double dval1, G4double dval2,
123                       G4double dval3, G4double dval4, G4double dval5,
124                       G4double dval6, G4double dval7);
125 
126   void SendStrDouble11(const char* char_string, G4double dval1, G4double dval2,
127                        G4double dval3, G4double dval4, G4double dval5,
128                        G4double dval6, G4double dval7, G4double dval8,
129                        G4double dval9, G4double dval10, G4double dval11);
130 
131   void SendIntDouble3(G4int ival, G4double dval1, G4double dval2,
132                       G4double dval3);
133   void SendInt3Str(G4int ival1, G4int ival2, G4int ival3,
134                    const char* char_string);
135   void SendInt4Str(G4int ival1, G4int ival2, G4int ival3, G4int ival4,
136                    const char* char_string);
137 
138   void SendStrDouble3Str(const char* char_string1, G4double dval1,
139                          G4double dval2, G4double dval3,
140                          const char* char_string2);
141 
142   void SendStrDouble6Str(const char* char_string1, G4double dval1,
143                          G4double dval2, G4double dval3, G4double dval4,
144                          G4double dval5, G4double dval6,
145                          const char* char_string2);
146 
147   void SendInt(G4int val);
148   void SendDouble(G4double val);
149 
150  private:
151   G4DAWNFILE& fSystem;  // Graphics system for this scene.
152   static G4int fSceneIdCount;
153 
154   G4FRofstream fPrimDest;  // defined here
155   G4bool FRflag_in_modeling;
156   // true:  FR_BEGIN_MODELING has sent to DAWN, and
157   //        FR_END_MODELING   has not sent yet.
158   // false:  otherwise
159   //
160   // FRflag_in_modeling is set to "true"
161   // in FRBeginModeling(), and to "false"
162   // in FREndModeling().
163 
164   G4bool flag_saving_g4_prim;
165 
166   const int COMMAND_BUF_SIZE;
167 
168   char fG4PrimDestDir[256];
169   char fG4PrimFileName[256];
170   G4int fMaxFileNum;
171 
172   G4int fPrec, fPrec2;
173 };
174 
175 #endif
176