Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/visualization/management/include/G4VSceneHandler.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.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 ]

Diff markup

Differences between /visualization/management/include/G4VSceneHandler.hh (Version 11.3.0) and /visualization/management/include/G4VSceneHandler.hh (Version 9.3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
                                                   >>  27 // $Id: G4VSceneHandler.hh,v 1.42 2009/11/04 12:55:33 allison Exp $
                                                   >>  28 // GEANT4 tag $Name: geant4-09-03 $
 27 //                                                 29 //
 28 //                                             <<  30 // 
 29 // John Allison  19th July 1996.                   31 // John Allison  19th July 1996.
 30 //                                                 32 //
 31 // Class description                               33 // Class description
 32 //                                                 34 //
 33 // Abstract interface class for graphics scene     35 // Abstract interface class for graphics scene handlers.
 34 // Inherits from G4VGraphicsScene, in the inte     36 // Inherits from G4VGraphicsScene, in the intercoms category, which is
 35 // a minimal abstract interface for the GEANT4     37 // a minimal abstract interface for the GEANT4 kernel.
 36                                                    38 
 37 #ifndef G4VSCENEHANDLER_HH                         39 #ifndef G4VSCENEHANDLER_HH
 38 #define G4VSCENEHANDLER_HH                         40 #define G4VSCENEHANDLER_HH
 39                                                    41 
 40 #include "globals.hh"                              42 #include "globals.hh"
 41                                                    43 
 42 #include "G4VGraphicsScene.hh"                     44 #include "G4VGraphicsScene.hh"
 43 #include "G4ViewerList.hh"                         45 #include "G4ViewerList.hh"
 44 #include "G4ViewParameters.hh"                     46 #include "G4ViewParameters.hh"
 45 #include "G4THitsMap.hh"                           47 #include "G4THitsMap.hh"
 46 #include "G4PseudoScene.hh"                    << 
 47                                                << 
 48 #include <map>                                 << 
 49                                                    48 
 50 class G4Scene;                                     49 class G4Scene;
                                                   >>  50 class G4VViewer;
                                                   >>  51 class G4Colour;
                                                   >>  52 class G4Visible;
                                                   >>  53 class G4ModelingParameters;
                                                   >>  54 class G4VModel;
 51 class G4VGraphicsSystem;                           55 class G4VGraphicsSystem;
                                                   >>  56 class G4LogicalVolume;
                                                   >>  57 class G4VPhysicalVolume;
                                                   >>  58 class G4Material;
                                                   >>  59 class G4Event;
 52 class G4AttHolder;                                 60 class G4AttHolder;
 53                                                    61 
 54 class G4VSceneHandler: public G4VGraphicsScene     62 class G4VSceneHandler: public G4VGraphicsScene {
 55                                                    63 
 56   friend class G4VViewer;                      << 
 57   friend std::ostream& operator << (std::ostre << 
 58                                                << 
 59 public: // With description                        64 public: // With description
 60                                                    65 
                                                   >>  66   friend std::ostream& operator << (std::ostream& os, const G4VSceneHandler& s);
                                                   >>  67 
 61   enum MarkerSizeType {world, screen};             68   enum MarkerSizeType {world, screen};
 62                                                    69 
 63   G4VSceneHandler (G4VGraphicsSystem& system,      70   G4VSceneHandler (G4VGraphicsSystem& system,
 64        G4int id,                                   71        G4int id,
 65        const G4String& name = "");                 72        const G4String& name = "");
 66                                                    73 
 67   virtual ~G4VSceneHandler ();                     74   virtual ~G4VSceneHandler ();
 68                                                    75 
 69   ////////////////////////////////////////////     76   ///////////////////////////////////////////////////////////////////
 70   // Methods for adding raw GEANT4 objects to      77   // Methods for adding raw GEANT4 objects to the scene handler.  They
 71   // must always be called in the triplet PreA     78   // must always be called in the triplet PreAddSolid, AddSolid and
 72   // PostAddSolid.  The transformation and vis     79   // PostAddSolid.  The transformation and visualization attributes
 73   // must be set by the call to PreAddSolid.       80   // must be set by the call to PreAddSolid.  If your graphics system
 74   // is sophisticated enough to handle a parti     81   // is sophisticated enough to handle a particular solid shape as a
 75   // primitive, in your derived class write a      82   // primitive, in your derived class write a function to override one
 76   // or more of the following.  See the implem     83   // or more of the following.  See the implementation of
 77   // G4VSceneHandler::AddSolid (const G4Box& b     84   // G4VSceneHandler::AddSolid (const G4Box& box) for more
 78   // suggestions.  If not, please implement th     85   // suggestions.  If not, please implement the base class invocation.
 79                                                    86 
 80   virtual void PreAddSolid (const G4Transform3     87   virtual void PreAddSolid (const G4Transform3D& objectTransformation,
 81           const G4VisAttributes&);             <<  88          const G4VisAttributes& visAttribs);
 82   // objectTransformation is the transformatio     89   // objectTransformation is the transformation in the world
 83   // coordinate system of the object about to      90   // coordinate system of the object about to be added, and visAttribs
 84   // is its visualization attributes.              91   // is its visualization attributes.
 85   // IMPORTANT: invoke this from your polymorp     92   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
 86   // void MyXXXSceneHandler::PreAddSolid           93   // void MyXXXSceneHandler::PreAddSolid
 87   //  (const G4Transform3D& objectTransformati     94   //  (const G4Transform3D& objectTransformation,
 88   //   const G4VisAttributes& visAttribs) {        95   //   const G4VisAttributes& visAttribs) {
 89   //   G4VSceneHandler::PreAddSolid (objectTra     96   //   G4VSceneHandler::PreAddSolid (objectTransformation, visAttribs);
 90   //   ...                                         97   //   ...
 91   // }                                             98   // }
 92                                                    99 
 93   virtual void PostAddSolid ();                   100   virtual void PostAddSolid ();
 94   // IMPORTANT: invoke this from your polymorp    101   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
 95   // void MyXXXSceneHandler::PostAddSolid () {    102   // void MyXXXSceneHandler::PostAddSolid () {
 96   //   ...                                        103   //   ...
 97   //   G4VSceneHandler::PostAddSolid ();          104   //   G4VSceneHandler::PostAddSolid ();
 98   // }                                            105   // }
 99                                                   106 
100   // From geometry/solids/CSG                  << 
101   virtual void AddSolid (const G4Box&);           107   virtual void AddSolid (const G4Box&);
102   virtual void AddSolid (const G4Cons&);          108   virtual void AddSolid (const G4Cons&);
103   virtual void AddSolid (const G4Orb&);        << 109   virtual void AddSolid (const G4Tubs&);
104   virtual void AddSolid (const G4Para&);       << 110   virtual void AddSolid (const G4Trd&);
                                                   >> 111   virtual void AddSolid (const G4Trap&);
105   virtual void AddSolid (const G4Sphere&);        112   virtual void AddSolid (const G4Sphere&);
                                                   >> 113   virtual void AddSolid (const G4Para&);
106   virtual void AddSolid (const G4Torus&);         114   virtual void AddSolid (const G4Torus&);
107   virtual void AddSolid (const G4Trap&);       << 
108   virtual void AddSolid (const G4Trd&);        << 
109   virtual void AddSolid (const G4Tubs&);       << 
110                                                << 
111   // From geometry/solids/specific             << 
112   virtual void AddSolid (const G4Ellipsoid&);  << 
113   virtual void AddSolid (const G4Polycone&);      115   virtual void AddSolid (const G4Polycone&);
114   virtual void AddSolid (const G4Polyhedra&);     116   virtual void AddSolid (const G4Polyhedra&);
115   virtual void AddSolid (const G4TessellatedSo << 117   virtual void AddSolid (const G4VSolid&);  // For solids not above.
116                                                << 
117   // For solids not above.                     << 
118   virtual void AddSolid (const G4VSolid&);     << 
119                                                   118 
120   ////////////////////////////////////////////    119   ///////////////////////////////////////////////////////////////////
121   // Methods for adding "compound" GEANT4 obje    120   // Methods for adding "compound" GEANT4 objects to the scene
122   // handler.  These methods may either (a) in    121   // handler.  These methods may either (a) invoke "user code" that
123   // uses the "user interface", G4VVisManager     122   // uses the "user interface", G4VVisManager (see, for example,
124   // G4VSceneHandler, which for trajectories u    123   // G4VSceneHandler, which for trajectories uses
125   // G4VTrajectory::DrawTrajectory, via G4Traj    124   // G4VTrajectory::DrawTrajectory, via G4TrajectoriesModel in the
126   // Modeling Category) or (b) invoke AddPrimi    125   // Modeling Category) or (b) invoke AddPrimitives below (between
127   // calls to Begin/EndPrimitives) or (c) use     126   // calls to Begin/EndPrimitives) or (c) use graphics-system-specific
128   // code or (d) any combination of the above.    127   // code or (d) any combination of the above.
129                                                   128 
130   virtual void AddCompound (const G4VTrajector    129   virtual void AddCompound (const G4VTrajectory&);
131   virtual void AddCompound (const G4VHit&);       130   virtual void AddCompound (const G4VHit&);
132   virtual void AddCompound (const G4VDigi&);   << 
133   virtual void AddCompound (const G4THitsMap<G    131   virtual void AddCompound (const G4THitsMap<G4double>&);
134   virtual void AddCompound (const G4THitsMap<G << 
135   virtual void AddCompound (const G4Mesh&);    << 
136                                                   132 
137   ////////////////////////////////////////////    133   //////////////////////////////////////////////////////////////
138   // Functions for adding primitives.             134   // Functions for adding primitives.
139                                                   135 
140   virtual void BeginModeling ();                  136   virtual void BeginModeling ();
141   // IMPORTANT: invoke this from your polymorp    137   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
142   // void MyXXXSceneHandler::BeginModeling ()     138   // void MyXXXSceneHandler::BeginModeling () {
143   //   G4VSceneHandler::BeginModeling ();         139   //   G4VSceneHandler::BeginModeling ();
144   //   ...                                        140   //   ...
145   // }                                            141   // }
146                                                   142 
147   virtual void EndModeling ();                    143   virtual void EndModeling ();
148   // IMPORTANT: invoke this from your polymorp    144   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
149   // void MyXXXSceneHandler::EndModeling () {     145   // void MyXXXSceneHandler::EndModeling () {
150   //   ...                                        146   //   ...
151   //   G4VSceneHandler::EndModeling ();           147   //   G4VSceneHandler::EndModeling ();
152   // }                                            148   // }
153                                                   149 
154   virtual void BeginPrimitives                    150   virtual void BeginPrimitives
155   (const G4Transform3D& objectTransformation = << 151   (const G4Transform3D& objectTransformation);
156   // IMPORTANT: invoke this from your polymorp    152   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
157   // void MyXXXSceneHandler::BeginPrimitives      153   // void MyXXXSceneHandler::BeginPrimitives
158   // (const G4Transform3D& objectTransformatio    154   // (const G4Transform3D& objectTransformation) {
159   //   G4VSceneHandler::BeginPrimitives (objec    155   //   G4VSceneHandler::BeginPrimitives (objectTransformation);
160   //   ...                                        156   //   ...
161   // }                                            157   // }
162                                                   158 
163   virtual void EndPrimitives ();                  159   virtual void EndPrimitives ();
164   // IMPORTANT: invoke this from your polymorp    160   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
165   // void MyXXXSceneHandler::EndPrimitives ()     161   // void MyXXXSceneHandler::EndPrimitives () {
166   //   ...                                        162   //   ...
167   //   G4VSceneHandler::EndPrimitives ();         163   //   G4VSceneHandler::EndPrimitives ();
168   // }                                            164   // }
169                                                   165 
170   virtual void BeginPrimitives2D                  166   virtual void BeginPrimitives2D
171   (const G4Transform3D& objectTransformation = << 167   (const G4Transform3D& objectTransformation);
172   // The x,y coordinates of the primitives pas    168   // The x,y coordinates of the primitives passed to AddPrimitive are
173   // intrepreted as screen coordinates, -1 < x    169   // intrepreted as screen coordinates, -1 < x,y < 1.  The
174   // z-coordinate is ignored.                     170   // z-coordinate is ignored.
175   // IMPORTANT: invoke this from your polymorp    171   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
176   // void MyXXXSceneHandler::BeginPrimitives2D    172   // void MyXXXSceneHandler::BeginPrimitives2D
177   // (const G4Transform3D& objectTransformatio    173   // (const G4Transform3D& objectTransformation) {
178   //   G4VSceneHandler::BeginPrimitives2D (obj << 174   //   G4VSceneHandler::BeginPrimitives2D ();
179   //   ...                                        175   //   ...
180   // }                                            176   // }
181                                                   177 
182   virtual void EndPrimitives2D ();                178   virtual void EndPrimitives2D ();
183   // IMPORTANT: invoke this from your polymorp    179   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
184   // void MyXXXSceneHandler::EndPrimitives2D (    180   // void MyXXXSceneHandler::EndPrimitives2D () {
185   //   ...                                        181   //   ...
186   //   G4VSceneHandler::EndPrimitives2D ();       182   //   G4VSceneHandler::EndPrimitives2D ();
187   // }                                            183   // }
188                                                   184 
189   virtual void AddPrimitive (const G4Polyline&    185   virtual void AddPrimitive (const G4Polyline&)   = 0;
                                                   >> 186   virtual void AddPrimitive (const G4Scale&);
                                                   >> 187   // Default implementation in this class but can be over-ridden.
190   virtual void AddPrimitive (const G4Text&)       188   virtual void AddPrimitive (const G4Text&)       = 0;
191   virtual void AddPrimitive (const G4Circle&)     189   virtual void AddPrimitive (const G4Circle&)     = 0;      
192   virtual void AddPrimitive (const G4Square&)     190   virtual void AddPrimitive (const G4Square&)     = 0;      
193   virtual void AddPrimitive (const G4Polymarke    191   virtual void AddPrimitive (const G4Polymarker&);
194   virtual void AddPrimitive (const G4Polyhedro << 192   // Default implementation in this class but can be over-ridden.
195   virtual void AddPrimitive (const G4Plotter&) << 193   virtual void AddPrimitive (const G4Polyhedron&) = 0;  
196                                                << 194   virtual void AddPrimitive (const G4NURBS&)      = 0;       
197   // Other virtual functions                   << 
198   virtual const G4VisExtent& GetExtent() const << 
199                                                   195 
200   ////////////////////////////////////////////    196   //////////////////////////////////////////////////////////////
201   // Access functions.                            197   // Access functions.
202   const G4String&     GetName           () con    198   const G4String&     GetName           () const;
203   G4int               GetSceneHandlerId () con    199   G4int               GetSceneHandlerId () const;
204   G4int               GetViewCount      () con    200   G4int               GetViewCount      () const;
205   G4VGraphicsSystem*  GetGraphicsSystem () con    201   G4VGraphicsSystem*  GetGraphicsSystem () const;
206   G4Scene*            GetScene          () con    202   G4Scene*            GetScene          () const;
207   const G4ViewerList& GetViewerList     () con    203   const G4ViewerList& GetViewerList     () const;
208   G4VModel*           GetModel          () con    204   G4VModel*           GetModel          () const;
209   G4VViewer*          GetCurrentViewer  () con    205   G4VViewer*          GetCurrentViewer  () const;
210   G4bool              GetMarkForClearingTransi    206   G4bool              GetMarkForClearingTransientStore () const;
211   G4bool              IsReadyForTransients ()     207   G4bool              IsReadyForTransients () const;
212   G4bool              GetTransientsDrawnThisEv    208   G4bool              GetTransientsDrawnThisEvent () const;
213   G4bool              GetTransientsDrawnThisRu    209   G4bool              GetTransientsDrawnThisRun   () const;
214   const G4Transform3D& GetObjectTransformation << 210   void          SetName          (const G4String&);
215   void                SetName          (const  << 
216   void          SetCurrentViewer (G4VViewer*);    211   void          SetCurrentViewer (G4VViewer*);
217   virtual void        SetScene         (G4Scen << 212   void          SetScene         (G4Scene*);
218   G4ViewerList& SetViewerList    ();  // Non-c    213   G4ViewerList& SetViewerList    ();  // Non-const so you can change.
219   void          SetModel         (G4VModel*);     214   void          SetModel         (G4VModel*);
220   void          SetMarkForClearingTransientSto    215   void          SetMarkForClearingTransientStore (G4bool);
221   // Sets flag which will cause transient stor    216   // Sets flag which will cause transient store to be cleared at the
222   // next call to BeginPrimitives().  Maintain    217   // next call to BeginPrimitives().  Maintained by vis manager.
223   void          SetTransientsDrawnThisEvent       218   void          SetTransientsDrawnThisEvent      (G4bool);
224   void          SetTransientsDrawnThisRun         219   void          SetTransientsDrawnThisRun        (G4bool);
225   void          SetObjectTransformation        << 
226   // Maintained by vis manager.                   220   // Maintained by vis manager.
227                                                   221 
228   ////////////////////////////////////////////    222   //////////////////////////////////////////////////////////////
229   // Public utility functions.                    223   // Public utility functions.
230                                                   224 
231   const G4Colour& GetColour ();  // To be depr << 
232   const G4Colour& GetColor  ();                << 
233   // Returns colour - checks fpVisAttribs and  << 
234   // Assumes fpVisAttribs point to the G4VisAt << 
235   // If the pointer is null, the colour is obt << 
236   // parameters of the current viewer.         << 
237                                                << 
238   const G4Colour& GetColour (const G4Visible&)    225   const G4Colour& GetColour (const G4Visible&);
239   const G4Colour& GetColor  (const G4Visible&)    226   const G4Colour& GetColor  (const G4Visible&);
240   // Returns colour, or viewer default colour. << 227   // Returns colour of G4Visible object, or default global colour.
241   // Makes no assumptions about the validity o << 
242   // If the G4Visible has no vis attributes, i << 
243   // the colour is obtained from the default v << 
244   // current viewer.                           << 
245                                                   228 
246   const G4Colour& GetTextColour (const G4Text&    229   const G4Colour& GetTextColour (const G4Text&);
247   const G4Colour& GetTextColor  (const G4Text&    230   const G4Colour& GetTextColor  (const G4Text&);
248   // Returns colour of G4Text object, or defau    231   // Returns colour of G4Text object, or default text colour.
249                                                   232 
250   G4double GetLineWidth(const G4VisAttributes*    233   G4double GetLineWidth(const G4VisAttributes*);
251   // Returns line width of G4VisAttributes mul    234   // Returns line width of G4VisAttributes multiplied by GlobalLineWidthScale.
252                                                   235 
253   G4ViewParameters::DrawingStyle GetDrawingSty    236   G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes*);
254   // Returns drawing style from current view p    237   // Returns drawing style from current view parameters, unless the user
255   // has forced through the vis attributes, th    238   // has forced through the vis attributes, thereby over-riding the
256   // current view parameter.                      239   // current view parameter.
257                                                   240 
258   G4int GetNumberOfCloudPoints (const G4VisAtt << 
259   // Returns no of cloud points from current v << 
260   // has forced through the vis attributes, th << 
261   // current view parameter.                   << 
262                                                << 
263   G4bool GetAuxEdgeVisible (const G4VisAttribu    241   G4bool GetAuxEdgeVisible (const G4VisAttributes*);
264   // Returns auxiliary edge visibility from cu    242   // Returns auxiliary edge visibility from current view parameters,
265   // unless the user has forced through the vi    243   // unless the user has forced through the vis attributes, thereby
266   // over-riding the current view parameter.      244   // over-riding the current view parameter.
267                                                   245 
268   G4int GetNoOfSides(const G4VisAttributes*);     246   G4int GetNoOfSides(const G4VisAttributes*);
269   // Returns no. of sides (lines segments per     247   // Returns no. of sides (lines segments per circle) from current
270   // view parameters, unless the user has forc    248   // view parameters, unless the user has forced through the vis
271   // attributes, thereby over-riding the curre    249   // attributes, thereby over-riding the current view parameter.
272                                                   250 
273   G4double GetMarkerSize (const G4VMarker&, Ma    251   G4double GetMarkerSize (const G4VMarker&, MarkerSizeType&);
274   // Returns applicable marker size (diameter)    252   // Returns applicable marker size (diameter) and type (in second
275   // argument).  Uses global default marker if    253   // argument).  Uses global default marker if marker sizes are not
276   // set.  Multiplies by GlobalMarkerScale.       254   // set.  Multiplies by GlobalMarkerScale.
277                                                   255 
278   G4double GetMarkerDiameter (const G4VMarker&    256   G4double GetMarkerDiameter (const G4VMarker&, MarkerSizeType&);
279   // Alias for GetMarkerSize.                     257   // Alias for GetMarkerSize.
280                                                   258 
281   G4double GetMarkerRadius (const G4VMarker&,     259   G4double GetMarkerRadius (const G4VMarker&, MarkerSizeType&);
282   // GetMarkerSize / 2.                           260   // GetMarkerSize / 2.
283                                                   261 
284   G4ModelingParameters* CreateModelingParamete    262   G4ModelingParameters* CreateModelingParameters ();
285   // Only the scene handler and view know what    263   // Only the scene handler and view know what the Modeling Parameters should
286   // be.  For historical reasons, the GEANT4 V    264   // be.  For historical reasons, the GEANT4 Visualization Environment
287   // maintains its own Scene Data and View Par    265   // maintains its own Scene Data and View Parameters, which must be
288   // converted, when needed, to Modeling Param    266   // converted, when needed, to Modeling Parameters.
289                                                   267 
290   void DrawEvent(const G4Event*);                 268   void DrawEvent(const G4Event*);
291   // Checks scene's end-of-event model list an    269   // Checks scene's end-of-event model list and draws trajectories,
292   // hits, etc.                                   270   // hits, etc.
293                                                   271 
294   void DrawEndOfRunModels();                      272   void DrawEndOfRunModels();
295   // Draws end-of-run models.                     273   // Draws end-of-run models.
296                                                   274 
297   ////////////////////////////////////////////    275   //////////////////////////////////////////////////////////////
298   // Administration functions.                    276   // Administration functions.
299                                                   277 
300   template <class T> void AddSolidT (const T&  << 
301   template <class T> void AddSolidWithAuxiliar << 
302                                                << 
303   G4int IncrementViewCount ();                    278   G4int IncrementViewCount ();
304                                                   279 
305   virtual void ClearStore ();                     280   virtual void ClearStore ();
306   // Clears graphics database (display lists)  << 281   // Clears graphics database (display lists) if any.  This base class
                                                   >> 282   // implements some common functionality so...
                                                   >> 283   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
                                                   >> 284   // void MyXXXSceneHandler::ClearStore () {
                                                   >> 285   //   G4VSceneHandler::ClearStore ();
                                                   >> 286   //   ...
                                                   >> 287   // }
307                                                   288 
308   virtual void ClearTransientStore ();            289   virtual void ClearTransientStore ();
309   // Clears transient part of graphics databas    290   // Clears transient part of graphics database (display lists) if any.
                                                   >> 291   // This base class implements some common functionality so...
                                                   >> 292   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
                                                   >> 293   // void MyXXXSceneHandler::ClearTransientStore () {
                                                   >> 294   //   G4VSceneHandler::ClearTransientStore ();
                                                   >> 295   //   ...
                                                   >> 296   // }
310                                                   297 
311   void AddViewerToList      (G4VViewer* pView)    298   void AddViewerToList      (G4VViewer* pView);  // Add view to view List.
312   void RemoveViewerFromList (G4VViewer* pView)    299   void RemoveViewerFromList (G4VViewer* pView);  // Remove view from view List.
313                                                   300 
314 protected:                                        301 protected:
315                                                   302 
316   ////////////////////////////////////////////    303   //////////////////////////////////////////////////////////////
317   // Core routine for looping over models, red << 
318   // Overload with care (see, for example,     << 
319   // G4OpenGLScenehandler::ProcessScene).      << 
320   virtual void ProcessScene ();                << 
321                                                << 
322   //////////////////////////////////////////// << 
323   // Default routine used by default AddSolid     304   // Default routine used by default AddSolid ().
                                                   >> 305 
324   virtual void RequestPrimitives (const G4VSol    306   virtual void RequestPrimitives (const G4VSolid& solid);
325                                                   307 
326   ////////////////////////////////////////////    308   //////////////////////////////////////////////////////////////
327   // Other internal routines...                   309   // Other internal routines...
328                                                   310 
329   virtual G4DisplacedSolid* CreateSectionSolid << 311   virtual const G4Polyhedron* CreateSectionPolyhedron ();
330   virtual G4DisplacedSolid* CreateCutawaySolid << 312   virtual const G4Polyhedron* CreateCutawayPolyhedron ();
331   // Generic clipping using the BooleanProcess    313   // Generic clipping using the BooleanProcessor in graphics_reps is
332   // implemented in this class.  Subclasses th    314   // implemented in this class.  Subclasses that implement their own
333   // clipping should provide an override that     315   // clipping should provide an override that returns zero.
334                                                << 
335   void LoadAtts(const G4Visible&, G4AttHolder*    316   void LoadAtts(const G4Visible&, G4AttHolder*);
336   // Load G4AttValues and G4AttDefs associated    317   // Load G4AttValues and G4AttDefs associated with the G4Visible
337   // object onto the G4AttHolder object.  It c    318   // object onto the G4AttHolder object.  It checks fpModel, and also
338   // loads the G4AttValues and G4AttDefs from     319   // loads the G4AttValues and G4AttDefs from G4PhysicalVolumeModel,
339   // G4VTrajectory, G4VTrajectoryPoint, G4VHit << 320   // G4VTrajectory, G4VTrajectoryPoint, or G4VHits, as appropriate.
340   // appropriate.  The G4AttHolder object is a << 321   // The G4AttHolder object is an object of a class that publicly
341   // publicly inherits G4AttHolder - see, e.g. << 322   // inherits G4AttHolder - see, e.g., SoG4Polyhedron in the Open
342   // Open Inventor driver.  G4AttHolder delete << 323   // Inventor driver.  G4AttHolder deletes G4AttValues in its
343   // destructor to ensure proper clean-up of G    324   // destructor to ensure proper clean-up of G4AttValues.
344                                                   325 
345   ////////////////////////////////////////////    326   //////////////////////////////////////////////////////////////
346   // Special mesh rendering utilities...       << 
347                                                << 
348   struct NameAndVisAtts {                      << 
349     NameAndVisAtts(const G4String& name = "",c << 
350     : fName(name),fVisAtts(visAtts) {}         << 
351     G4String fName;                            << 
352     G4VisAttributes fVisAtts;                  << 
353   };                                           << 
354                                                << 
355   class PseudoSceneFor3DRectMeshPositions: pub << 
356   public:                                      << 
357     PseudoSceneFor3DRectMeshPositions          << 
358     (G4PhysicalVolumeModel* pvModel  // input  << 
359      , const G4Mesh* pMesh  // input...the fol << 
360      , std::multimap<const G4Material*,const G << 
361      , std::map<const G4Material*,NameAndVisAt << 
362     : fpPVModel(pvModel)                       << 
363     , fpMesh(pMesh)                            << 
364     , fPositionByMaterial(positionByMaterial)  << 
365     , fNameAndVisAttsByMaterial(nameAndVisAtts << 
366     {}                                         << 
367   private:                                     << 
368     using G4PseudoScene::AddSolid;  // except  << 
369     void AddSolid(const G4Box&) override;      << 
370     void ProcessVolume(const G4VSolid&) overri << 
371       // Do nothing if uninteresting solids fo << 
372     }                                          << 
373     G4PhysicalVolumeModel* fpPVModel;          << 
374     const G4Mesh* fpMesh;                      << 
375     std::multimap<const G4Material*,const G4Th << 
376     std::map<const G4Material*,NameAndVisAtts> << 
377   };                                           << 
378                                                << 
379   class PseudoSceneForTetVertices: public G4Ps << 
380   public:                                      << 
381     PseudoSceneForTetVertices                  << 
382     (G4PhysicalVolumeModel* pvModel  // input  << 
383      , const G4Mesh* pMesh  // input...the fol << 
384      , std::multimap<const G4Material*,std::ve << 
385      , std::map<const G4Material*,NameAndVisAt << 
386     : fpPVModel(pvModel)                       << 
387     , fpMesh(pMesh)                            << 
388     , fVerticesByMaterial(verticesByMaterial)  << 
389     , fNameAndVisAttsByMaterial(nameAndVisAtts << 
390     {}                                         << 
391   private:                                     << 
392     using G4PseudoScene::AddSolid;  // except  << 
393     void AddSolid(const G4VSolid& solid) overr << 
394     void ProcessVolume(const G4VSolid&) overri << 
395       // Do nothing if uninteresting solids fo << 
396     }                                          << 
397     G4PhysicalVolumeModel* fpPVModel;          << 
398     const G4Mesh* fpMesh;                      << 
399     std::multimap<const G4Material*,std::vecto << 
400     std::map<const G4Material*,NameAndVisAtts> << 
401   };                                           << 
402                                                << 
403   void StandardSpecialMeshRendering(const G4Me << 
404   // Standard way of special mesh rendering.   << 
405   // MySceneHandler::AddCompound(const G4Mesh& << 
406   // appropriate or implement its own special  << 
407                                                << 
408   void Draw3DRectMeshAsDots(const G4Mesh&);    << 
409   // For a rectangular 3-D mesh, draw as colou << 
410   // one dot randomly placed in each visible m << 
411                                                << 
412   void Draw3DRectMeshAsSurfaces(const G4Mesh&) << 
413   // For a rectangular 3-D mesh, draw as surfa << 
414   // with inner shared faces removed.          << 
415                                                << 
416   void DrawTetMeshAsDots(const G4Mesh&);       << 
417   // For a tetrahedron mesh, draw as coloured  << 
418   // one dot randomly placed in each visible m << 
419                                                << 
420   void DrawTetMeshAsSurfaces(const G4Mesh&);   << 
421   // For a tetrahedron mesh, draw as surfaces  << 
422   // with inner shared faces removed.          << 
423                                                << 
424   G4ThreeVector GetPointInBox(const G4ThreeVec << 
425                               G4double halfX,  << 
426                               G4double halfY,  << 
427                               G4double halfZ)  << 
428   // Sample a random point inside the box      << 
429                                                << 
430   G4ThreeVector GetPointInTet(const std::vecto << 
431   // Sample a random point inside the tetrahed << 
432                                                << 
433   //////////////////////////////////////////// << 
434   // Data members                                 327   // Data members
435                                                   328 
436   G4VGraphicsSystem& fSystem;          // Grap    329   G4VGraphicsSystem& fSystem;          // Graphics system.
437   const G4int        fSceneHandlerId;  // Id o    330   const G4int        fSceneHandlerId;  // Id of this instance.
438   G4String           fName;                       331   G4String           fName;
439   G4int              fViewCount;       // To d    332   G4int              fViewCount;       // To determine view ids.
440   G4ViewerList       fViewerList;      // View    333   G4ViewerList       fViewerList;      // Viewers.
441   G4VViewer*         fpViewer;         // Curr    334   G4VViewer*         fpViewer;         // Current viewer.
442   G4Scene*           fpScene;          // Scen    335   G4Scene*           fpScene;          // Scene for this scene handler.
443   G4bool             fMarkForClearingTransient    336   G4bool             fMarkForClearingTransientStore;
444   G4bool             fReadyForTransients;  //     337   G4bool             fReadyForTransients;  // I.e., not processing the
445                          // run-duration part     338                          // run-duration part of scene.
446   G4bool             fTransientsDrawnThisEvent    339   G4bool             fTransientsDrawnThisEvent;  // Maintained by vis
447   G4bool             fTransientsDrawnThisRun;     340   G4bool             fTransientsDrawnThisRun;    // manager.
448   G4bool             fProcessingSolid; // True    341   G4bool             fProcessingSolid; // True if within Pre/PostAddSolid.
449   G4bool             fProcessing2D;    // True << 342   G4bool             fSecondPassRequested;
450   G4VModel*          fpModel;          // Curr << 343   G4bool             fSecondPass;    // ...in process.
451   G4Transform3D fObjectTransformation; // Curr << 344   G4VModel*          fpModel;        // Current model.
452                // object transformation.       << 345   const G4Transform3D* fpObjectTransformation; // Current accumulated
453   G4int              fNestingDepth;    // For  << 346                  // object transformation.
454   const G4VisAttributes* fpVisAttribs; // Work << 347   G4int              fNestingDepth; // For Begin/EndPrimitives.
                                                   >> 348   const G4VisAttributes* fpVisAttribs;  // Working vis attributes.
455   const G4Transform3D fIdentityTransformation;    349   const G4Transform3D fIdentityTransformation;
456   std::map<G4VPhysicalVolume*,G4String> fProbl << 
457                                                   350 
458 private:                                          351 private:
459                                                   352 
460   G4VSceneHandler (const G4VSceneHandler&);       353   G4VSceneHandler (const G4VSceneHandler&);
461   G4VSceneHandler& operator = (const G4VSceneH    354   G4VSceneHandler& operator = (const G4VSceneHandler&);
                                                   >> 355 
                                                   >> 356   //////////////////////////////////////////////////////////////
                                                   >> 357   // Friend function accessed only by views of this scene.
                                                   >> 358 
                                                   >> 359   friend void G4VViewer::ProcessView ();
                                                   >> 360 
                                                   >> 361   //////////////////////////////////////////////////////////////
                                                   >> 362   // Private functions, etc..
                                                   >> 363 
                                                   >> 364   void   ProcessScene     (G4VViewer& view);
                                                   >> 365   // Accessed by G4VViewer::ProcessView ().
                                                   >> 366 
462 };                                                367 };
463                                                   368 
464 #include "G4VSceneHandler.icc"                    369 #include "G4VSceneHandler.icc"
465                                                   370 
466 #endif                                            371 #endif
467                                                   372