ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4XXXStoredSceneHandler.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4XXXStoredSceneHandler.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 // John Allison 7th March 2006
30 // A template for a graphics driver with a store/database.
31 //?? Lines beginning like this require specialisation for your driver.
32 
33 #ifndef G4XXXStoredSCENEHANDLER_HH
34 #define G4XXXStoredSCENEHANDLER_HH
35 
36 #include "G4VSceneHandler.hh"
37 
38 #include <list>
39 
41 
42  friend class G4XXXStoredViewer;
43 
44 public:
46  const G4String& name);
47  virtual ~G4XXXStoredSceneHandler();
48 
50  // Optional virtual functions...
51  void AddSolid(const G4Box&);
52  // Further optional AddSolid functions. Explicitly invoke base
53  // class methods if not otherwise defined to avoid warnings about
54  // hiding of base class methods.
55  void AddSolid(const G4Cons& cons)
57  void AddSolid(const G4Tubs& tubs)
59  void AddSolid(const G4Trd& trd)
61  void AddSolid(const G4Trap& trap)
63  void AddSolid(const G4Sphere& sphere)
64  {G4VSceneHandler::AddSolid(sphere);}
65  void AddSolid(const G4Para& para)
67  void AddSolid(const G4Torus& torus)
69  void AddSolid(const G4Polycone& polycone)
70  {G4VSceneHandler::AddSolid(polycone);}
71  void AddSolid(const G4Polyhedra& polyhedra)
72  {G4VSceneHandler::AddSolid(polyhedra);}
73  void AddSolid(const G4Orb& orb)
75  void AddSolid(const G4Ellipsoid& ellipsoid)
76  {G4VSceneHandler::AddSolid(ellipsoid);}
77  void AddSolid(const G4TessellatedSolid& tess)
79  void AddSolid(const G4VSolid& solid)
81  // More optional functions...
82  // void AddCompound(const G4VTrajectory&);
83  // void AddCompound(const G4VHit&);
84  // void AddCompound(const G4THitsMap<G4double>&);
85  // void AddCompound(const G4THitsMap<G4StatDouble>&);
86  void PreAddSolid(const G4Transform3D& objectTransformation,
87  const G4VisAttributes&);
88  void PostAddSolid();
89 
91  // Required implementation of pure virtual functions...
92 
93  void AddPrimitive(const G4Polyline&);
94  void AddPrimitive(const G4Text&);
95  void AddPrimitive(const G4Circle&);
96  void AddPrimitive(const G4Square&);
97  void AddPrimitive(const G4Polyhedron&);
98  // Further optional AddPrimitive methods. Explicitly invoke base
99  // class methods if not otherwise defined to avoid warnings about
100  // hiding of base class methods.
101  void AddPrimitive(const G4Polymarker& polymarker)
102  {G4VSceneHandler::AddPrimitive (polymarker);}
105  // Further related optional virtual functions...
106  void BeginPrimitives(const G4Transform3D& objectTransformation);
107  void EndPrimitives();
108 
110  // Further optional virtual functions...
111 
112  // void BeginModeling();
113  // void EndModeling();
114 
116  // Administration functions.
117 
118  void ClearStore ();
119  void ClearTransientStore ();
120 
121 protected:
122 
123  static G4int fSceneIdCount; // Counter for XXXStored scene handlers.
124 
125  //?? Define a store for your graphics system. (For emulation, list
126  //?? has good properties - removal of items is fast and does not
127  //?? invalidate iterators to other elements.)
128  typedef std::list<G4String> Store;
129  typedef std::list<G4String>::iterator StoreIterator;
132 
133  // Keep track of which items are permanent, which transient...
134  std::vector<StoreIterator> fPermanents;
135  std::vector<StoreIterator> fTransients;
136 
137 private:
138 
139 #ifdef G4XXXFileDEBUG
140  void PrintThings();
141 #endif
142 
143 };
144 
145 #endif