Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4XXXStoredSceneHandler.hh
Go to the documentation of this file.
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: G4XXXStoredSceneHandler.hh 99152 2016-09-07 08:04:30Z gcosmo $
28 //
29 //
30 // John Allison 7th March 2006
31 // A template for a graphics driver with a store/database.
32 //?? Lines beginning like this require specialisation for your driver.
33 
34 #ifndef G4XXXStoredSCENEHANDLER_HH
35 #define G4XXXStoredSCENEHANDLER_HH
36 
37 #include "G4VSceneHandler.hh"
38 
39 #include <list>
40 
42 
43  friend class G4XXXStoredViewer;
44 
45 public:
47  const G4String& name);
48  virtual ~G4XXXStoredSceneHandler();
49 
51  // Optional virtual functions...
52  void AddSolid(const G4Box&);
53  // Further optional AddSolid functions. Explicitly invoke base
54  // class methods if not otherwise defined to avoid warnings about
55  // hiding of base class methods.
56  void AddSolid(const G4Cons& cons)
58  void AddSolid(const G4Tubs& tubs)
60  void AddSolid(const G4Trd& trd)
62  void AddSolid(const G4Trap& trap)
64  void AddSolid(const G4Sphere& sphere)
65  {G4VSceneHandler::AddSolid(sphere);}
66  void AddSolid(const G4Para& para)
68  void AddSolid(const G4Torus& torus)
70  void AddSolid(const G4Polycone& polycone)
71  {G4VSceneHandler::AddSolid(polycone);}
72  void AddSolid(const G4Polyhedra& polyhedra)
73  {G4VSceneHandler::AddSolid(polyhedra);}
74  void AddSolid(const G4Orb& orb)
76  void AddSolid(const G4Ellipsoid& ellipsoid)
77  {G4VSceneHandler::AddSolid(ellipsoid);}
78  void AddSolid(const G4VSolid& solid)
80  // More optional functions...
81  // void AddCompound(const G4VTrajectory&);
82  // void AddCompound(const G4VHit&);
83  // void AddCompound(const G4THitsMap<G4double>&);
84  // void AddCompound(const G4THitsMap<G4StatDouble>&);
85  void PreAddSolid(const G4Transform3D& objectTransformation,
86  const G4VisAttributes&);
87  void PostAddSolid();
88 
90  // Required implementation of pure virtual functions...
91 
92  void AddPrimitive(const G4Polyline&);
93  void AddPrimitive(const G4Text&);
94  void AddPrimitive(const G4Circle&);
95  void AddPrimitive(const G4Square&);
96  void AddPrimitive(const G4Polyhedron&);
97  // Further optional AddPrimitive methods. Explicitly invoke base
98  // class methods if not otherwise defined to avoid warnings about
99  // hiding of base class methods.
100  void AddPrimitive(const G4Polymarker& polymarker)
101  {G4VSceneHandler::AddPrimitive (polymarker);}
102  void AddPrimitive(const G4Scale& scale)
104  // Further related optional virtual functions...
105  void BeginPrimitives(const G4Transform3D& objectTransformation);
106  void EndPrimitives();
107 
109  // Further optional virtual functions...
110 
111  // void BeginModeling();
112  // void EndModeling();
113 
115  // Administration functions.
116 
117  void ClearStore ();
118  void ClearTransientStore ();
119 
120 protected:
121 
122  static G4int fSceneIdCount; // Counter for XXXStored scene handlers.
123 
124  //?? Define a store for your graphics system. (For emulation, list
125  //?? has good properties - removal of items is fast and does not
126  //?? invalidate iterators to other elements.)
127  typedef std::list<G4String> Store;
128  typedef std::list<G4String>::iterator StoreIterator;
131 
132  // Keep track of which items are permanent, which transient...
133  std::vector<StoreIterator> fPermanents;
134  std::vector<StoreIterator> fTransients;
135 
136 private:
137 
138 #ifdef G4XXXFileDEBUG
139  void PrintThings();
140 #endif
141 
142 };
143 
144 #endif
void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
const XML_Char * name
Definition: expat.h:151
Definition: G4Para.hh:77
virtual void AddSolid(const G4Box &)
Definition: G4Text.hh:73
std::list< G4String >::iterator StoreIterator
void AddSolid(const G4Polyhedra &polyhedra)
Definition: G4Box.hh:64
void AddSolid(const G4Polycone &polycone)
Definition: G4Tubs.hh:85
Definition: G4Trd.hh:72
void AddPrimitive(const G4Polyline &)
G4XXXStoredSceneHandler(G4VGraphicsSystem &system, const G4String &name)
int G4int
Definition: G4Types.hh:78
virtual void AddPrimitive(const G4Polyline &)=0
std::vector< StoreIterator > fPermanents
void AddSolid(const G4Orb &orb)
void AddSolid(const G4VSolid &solid)
Definition: G4Cons.hh:83
void AddSolid(const G4Sphere &sphere)
std::vector< StoreIterator > fTransients
void AddSolid(const G4Tubs &tubs)
void AddSolid(const G4Cons &cons)
Definition: G4Orb.hh:61
void AddSolid(const G4Torus &torus)
void BeginPrimitives(const G4Transform3D &objectTransformation)
void AddPrimitive(const G4Polymarker &polymarker)
void AddSolid(const G4Trd &trd)
void AddPrimitive(const G4Scale &scale)
void AddSolid(const G4Para &para)
void AddSolid(const G4Ellipsoid &ellipsoid)
void AddSolid(const G4Trap &trap)