ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VRML1SceneHandler.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VRML1SceneHandler.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 // G4VRML1SceneHandler.hh
29 // Yasuhide Sawada & Satoshi Tanaka
30 
31 #ifndef WIN32
32 
33 
34 #ifdef G4VIS_BUILD_VRML_DRIVER
35 
36 #ifndef G4VRML1_SCENE_HANDLER_HH
37 #define G4VRML1_SCENE_HANDLER_HH
38 
39 
40 #include "globals.hh"
41 #include "G4LogicalVolume.hh"
42 #include "G4VSceneHandler.hh"
43 
44 #include "G4FRClient.hh"
45 
46 class G4VRML1;
47 class G4VisAttributes;
48 
49 class G4VRML1SceneHandler: public G4VSceneHandler {
50 
51  enum { MAX_CONNECTION_TRIAL = 10 } ;
52 
53 // methods (public)
54 public:
55  G4VRML1SceneHandler(G4VRML1& system, const G4String& name = "");
56  virtual ~G4VRML1SceneHandler();
57  void AddSolid(const G4Box&);
58  void AddSolid(const G4Cons&);
59  void AddSolid(const G4Tubs&);
60  void AddSolid(const G4Trd&);
61  void AddSolid(const G4Trap&);
62  void AddSolid(const G4Sphere&);
63  void AddSolid(const G4Para&);
64  void AddSolid(const G4Torus&);
65  void AddSolid ( const G4Polycone& polycone ) {
66  G4VSceneHandler::AddSolid (polycone);
67  }
68  void AddSolid ( const G4Polyhedra& polyhedra) {
69  G4VSceneHandler::AddSolid (polyhedra);
70  }
71  void AddSolid ( const G4Orb& orb ) {
73  }
74  void AddSolid ( const G4Ellipsoid& ellipsoid) {
75  G4VSceneHandler::AddSolid (ellipsoid);
76  }
77  void AddSolid ( const G4TessellatedSolid& tess) {
79  }
80  void AddSolid(const G4VSolid&);
81  void AddCompound ( const G4VTrajectory& traj) {
83  }
84  void AddCompound ( const G4VHit& hit) {
86  }
87  void AddCompound ( const G4VDigi& digi) {
89  }
90  void AddCompound ( const G4THitsMap<G4double> & hits) {
92  }
93  void AddCompound ( const G4THitsMap<G4StatDouble> & hits) {
95  }
96 
97  void BeginPrimitives(const G4Transform3D& objectTransformation);
98  void EndPrimitives();
99 
100  void AddPrimitive(const G4Polyline&);
101  void AddPrimitive(const G4Polyhedron&);
102  void AddPrimitive(const G4Text&);
103  void AddPrimitive(const G4Circle&);
104  void AddPrimitive(const G4Square&);
105  void AddPrimitive (const G4Polymarker& polymarker)
106  { G4VSceneHandler::AddPrimitive (polymarker); }
107  void AddPrimitive (const G4Scale& scale)
108  { G4VSceneHandler::AddPrimitive (scale); }
109 
110  void ClearTransientStore(); // Used for triggering detector re-drawing.
111 
112  void BeginModeling();
113  void EndModeling();
114 
115  void VRMLBeginModeling();
116  void VRMLEndModeling();
117 
118  void connectPort(int max_trial = MAX_CONNECTION_TRIAL );
119  void closePort();
120 
121 // methods (private)
122 private:
123  void SendMaterialNode( const G4VisAttributes* pAV );
124  void SendMaterialNode();
125  void SendMatrixTransformNode(const G4Transform3D &);
126  void SendCubeNode(G4double, G4double, G4double);
127  void SendCylinderNode(G4double, G4double);
128  void SendSphereNode(G4double);
129 
130  void SendMarkerColor ( const G4VMarker& mark ) ;
131  void SendMarkerWorldPosition ( const G4VMarker& mark ) ;
132  G4double GetMarkerHalfSize ( const G4VMarker& mark ) ;
133 
134 // data
135 private:
136  G4String fCurrentDEF;
137 
138  G4VRML1& fSystem; // Graphics system for this scene.
139  G4FRClient fDest ;
140 
141  static G4int fSceneIdCount;
142 
143 };
144 
145 #endif //G4VRML1_SCENE_HH
146 #endif //G4VIS_BUILD_VRML_DRIVER
147 #endif //WIN32