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 5.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 //                                                 23 //
                                                   >>  24 // $Id: G4VSceneHandler.hh,v 1.19 2002/10/24 15:10:43 johna Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-05-00 $
 27 //                                                 26 //
 28 //                                             <<  27 // 
 29 // John Allison  19th July 1996.                   28 // John Allison  19th July 1996.
 30 //                                                 29 //
 31 // Class description                               30 // Class description
 32 //                                                 31 //
 33 // Abstract interface class for graphics scene     32 // Abstract interface class for graphics scene handlers.
 34 // Inherits from G4VGraphicsScene, in the inte     33 // Inherits from G4VGraphicsScene, in the intercoms category, which is
 35 // a minimal abstract interface for the GEANT4     34 // a minimal abstract interface for the GEANT4 kernel.
 36                                                    35 
 37 #ifndef G4VSCENEHANDLER_HH                         36 #ifndef G4VSCENEHANDLER_HH
 38 #define G4VSCENEHANDLER_HH                         37 #define G4VSCENEHANDLER_HH
 39                                                    38 
 40 #include "globals.hh"                              39 #include "globals.hh"
 41                                                    40 
 42 #include "G4VGraphicsScene.hh"                     41 #include "G4VGraphicsScene.hh"
 43 #include "G4ViewerList.hh"                         42 #include "G4ViewerList.hh"
 44 #include "G4ViewParameters.hh"                     43 #include "G4ViewParameters.hh"
 45 #include "G4THitsMap.hh"                       << 
 46 #include "G4PseudoScene.hh"                    << 
 47                                                << 
 48 #include <map>                                 << 
 49                                                    44 
 50 class G4Scene;                                     45 class G4Scene;
                                                   >>  46 class G4VViewer;
                                                   >>  47 class G4Colour;
                                                   >>  48 class G4Visible;
                                                   >>  49 class G4ModelingParameters;
                                                   >>  50 class G4VModel;
 51 class G4VGraphicsSystem;                           51 class G4VGraphicsSystem;
 52 class G4AttHolder;                             <<  52 class G4LogicalVolume;
                                                   >>  53 class G4VPhysicalVolume;
 53                                                    54 
 54 class G4VSceneHandler: public G4VGraphicsScene     55 class G4VSceneHandler: public G4VGraphicsScene {
 55                                                    56 
 56   friend class G4VViewer;                      << 
 57   friend std::ostream& operator << (std::ostre << 
 58                                                << 
 59 public: // With description                        57 public: // With description
 60                                                    58 
                                                   >>  59   friend G4std::ostream& operator << (G4std::ostream& os, const G4VSceneHandler& s);
                                                   >>  60 
 61   enum MarkerSizeType {world, screen};             61   enum MarkerSizeType {world, screen};
 62                                                    62 
 63   G4VSceneHandler (G4VGraphicsSystem& system,      63   G4VSceneHandler (G4VGraphicsSystem& system,
 64        G4int id,                                   64        G4int id,
 65        const G4String& name = "");                 65        const G4String& name = "");
 66                                                    66 
 67   virtual ~G4VSceneHandler ();                     67   virtual ~G4VSceneHandler ();
 68                                                    68 
 69   //////////////////////////////////////////// <<  69   //////////////////////////////////////////////////////////////
 70   // Methods for adding raw GEANT4 objects to  <<  70   // Functions for adding raw GEANT4 objects, if the graphics system
 71   // must always be called in the triplet PreA <<  71   // can can understand them (optional on the part of the graphics
 72   // PostAddSolid.  The transformation and vis <<  72   // system).  If your graphics system is sophisticated enough to
 73   // must be set by the call to PreAddSolid.   <<  73   // handle a particular solid shape as a primitive, in your derived
 74   // is sophisticated enough to handle a parti <<  74   // class write a function to override one or more of the following.
 75   // primitive, in your derived class write a  <<  75   // See the implementation of G4VSceneHandler::AddThis (const G4Box& box) for
 76   // or more of the following.  See the implem <<  76   // more suggestions.  If not, please implement the base class
 77   // G4VSceneHandler::AddSolid (const G4Box& b <<  77   // invocation.
 78   // suggestions.  If not, please implement th <<  78   virtual void AddThis (const G4Box&);
                                                   >>  79   virtual void AddThis (const G4Cons&);
                                                   >>  80   virtual void AddThis (const G4Tubs&);
                                                   >>  81   virtual void AddThis (const G4Trd&);
                                                   >>  82   virtual void AddThis (const G4Trap&);
                                                   >>  83   virtual void AddThis (const G4Sphere&);
                                                   >>  84   virtual void AddThis (const G4Para&);
                                                   >>  85   virtual void AddThis (const G4Torus&);
                                                   >>  86   virtual void AddThis (const G4Polycone&);
                                                   >>  87   virtual void AddThis (const G4Polyhedra&);
                                                   >>  88   virtual void AddThis (const G4VSolid&);  // For solids not above.
                                                   >>  89   virtual void AddThis (const G4VTrajectory&);
                                                   >>  90   virtual void AddThis (const G4VHit&);
                                                   >>  91 
                                                   >>  92   ///////////////////////////////////////////////////////////////
                                                   >>  93   // Other inherited functions.
                                                   >>  94 
                                                   >>  95   virtual void EstablishSpecials (G4PhysicalVolumeModel&);
                                                   >>  96   // Used to establish any special relationships between scene and this
                                                   >>  97   // particular type of model - non-pure, i.e., no requirement to
                                                   >>  98   // implement.  See G4PhysicalVolumeModel.hh for details.
 79                                                    99 
 80   virtual void PreAddSolid (const G4Transform3 << 100   virtual void PreAddThis (const G4Transform3D& objectTransformation,
 81           const G4VisAttributes&);             << 101          const G4VisAttributes& visAttribs);
 82   // objectTransformation is the transformatio    102   // objectTransformation is the transformation in the world
 83   // coordinate system of the object about to     103   // coordinate system of the object about to be added, and visAttribs
 84   // is its visualization attributes.             104   // is its visualization attributes.
 85   // IMPORTANT: invoke this from your polymorp    105   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
 86   // void MyXXXSceneHandler::PreAddSolid       << 106   // void MyXXXSceneHandler::PreAddThis
 87   //  (const G4Transform3D& objectTransformati    107   //  (const G4Transform3D& objectTransformation,
 88   //   const G4VisAttributes& visAttribs) {       108   //   const G4VisAttributes& visAttribs) {
 89   //   G4VSceneHandler::PreAddSolid (objectTra << 109   //   G4VSceneHandler::PreAddThis (objectTransformation, visAttribs);
 90   //   ...                                        110   //   ...
 91   // }                                            111   // }
 92                                                   112 
 93   virtual void PostAddSolid ();                << 113   virtual void PostAddThis ();
 94   // IMPORTANT: invoke this from your polymorp    114   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
 95   // void MyXXXSceneHandler::PostAddSolid () { << 115   // void MyXXXSceneHandler::PostAddThis () {
 96   //   ...                                        116   //   ...
 97   //   G4VSceneHandler::PostAddSolid ();       << 117   //   G4VSceneHandler::PostAddThis (objectTransformation, visAttribs);
 98   // }                                            118   // }
 99                                                   119 
100   // From geometry/solids/CSG                  << 
101   virtual void AddSolid (const G4Box&);        << 
102   virtual void AddSolid (const G4Cons&);       << 
103   virtual void AddSolid (const G4Orb&);        << 
104   virtual void AddSolid (const G4Para&);       << 
105   virtual void AddSolid (const G4Sphere&);     << 
106   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&);   << 
114   virtual void AddSolid (const G4Polyhedra&);  << 
115   virtual void AddSolid (const G4TessellatedSo << 
116                                                << 
117   // For solids not above.                     << 
118   virtual void AddSolid (const G4VSolid&);     << 
119                                                << 
120   //////////////////////////////////////////// << 
121   // Methods for adding "compound" GEANT4 obje << 
122   // handler.  These methods may either (a) in << 
123   // uses the "user interface", G4VVisManager  << 
124   // G4VSceneHandler, which for trajectories u << 
125   // G4VTrajectory::DrawTrajectory, via G4Traj << 
126   // Modeling Category) or (b) invoke AddPrimi << 
127   // calls to Begin/EndPrimitives) or (c) use  << 
128   // code or (d) any combination of the above. << 
129                                                << 
130   virtual void AddCompound (const G4VTrajector << 
131   virtual void AddCompound (const G4VHit&);    << 
132   virtual void AddCompound (const G4VDigi&);   << 
133   virtual void AddCompound (const G4THitsMap<G << 
134   virtual void AddCompound (const G4THitsMap<G << 
135   virtual void AddCompound (const G4Mesh&);    << 
136                                                << 
137   ////////////////////////////////////////////    120   //////////////////////////////////////////////////////////////
138   // Functions for adding primitives.             121   // Functions for adding primitives.
139                                                   122 
140   virtual void BeginModeling ();                  123   virtual void BeginModeling ();
141   // IMPORTANT: invoke this from your polymorp    124   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
142   // void MyXXXSceneHandler::BeginModeling ()  << 125   // void MyXXXScene::BeginModeling () {
143   //   G4VSceneHandler::BeginModeling ();         126   //   G4VSceneHandler::BeginModeling ();
144   //   ...                                        127   //   ...
145   // }                                            128   // }
146                                                   129 
147   virtual void EndModeling ();                    130   virtual void EndModeling ();
148   // IMPORTANT: invoke this from your polymorp    131   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
149   // void MyXXXSceneHandler::EndModeling () {  << 132   // void MyXXXScene::EndModeling () {
150   //   ...                                        133   //   ...
151   //   G4VSceneHandler::EndModeling ();           134   //   G4VSceneHandler::EndModeling ();
152   // }                                            135   // }
153                                                   136 
154   virtual void BeginPrimitives                    137   virtual void BeginPrimitives
155   (const G4Transform3D& objectTransformation = << 138   (const G4Transform3D& objectTransformation);
156   // IMPORTANT: invoke this from your polymorp    139   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
157   // void MyXXXSceneHandler::BeginPrimitives      140   // void MyXXXSceneHandler::BeginPrimitives
158   // (const G4Transform3D& objectTransformatio    141   // (const G4Transform3D& objectTransformation) {
159   //   G4VSceneHandler::BeginPrimitives (objec    142   //   G4VSceneHandler::BeginPrimitives (objectTransformation);
160   //   ...                                        143   //   ...
161   // }                                            144   // }
162                                                   145 
163   virtual void EndPrimitives ();                  146   virtual void EndPrimitives ();
164   // IMPORTANT: invoke this from your polymorp    147   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
165   // void MyXXXSceneHandler::EndPrimitives ()     148   // void MyXXXSceneHandler::EndPrimitives () {
166   //   ...                                        149   //   ...
167   //   G4VSceneHandler::EndPrimitives ();         150   //   G4VSceneHandler::EndPrimitives ();
168   // }                                            151   // }
169                                                   152 
170   virtual void BeginPrimitives2D               << 
171   (const G4Transform3D& objectTransformation = << 
172   // The x,y coordinates of the primitives pas << 
173   // intrepreted as screen coordinates, -1 < x << 
174   // z-coordinate is ignored.                  << 
175   // IMPORTANT: invoke this from your polymorp << 
176   // void MyXXXSceneHandler::BeginPrimitives2D << 
177   // (const G4Transform3D& objectTransformatio << 
178   //   G4VSceneHandler::BeginPrimitives2D (obj << 
179   //   ...                                     << 
180   // }                                         << 
181                                                << 
182   virtual void EndPrimitives2D ();             << 
183   // IMPORTANT: invoke this from your polymorp << 
184   // void MyXXXSceneHandler::EndPrimitives2D ( << 
185   //   ...                                     << 
186   //   G4VSceneHandler::EndPrimitives2D ();    << 
187   // }                                         << 
188                                                << 
189   virtual void AddPrimitive (const G4Polyline&    153   virtual void AddPrimitive (const G4Polyline&)   = 0;
                                                   >> 154   virtual void AddPrimitive (const G4Scale&);
                                                   >> 155   // Default implementation in this class but can be over-ridden.
190   virtual void AddPrimitive (const G4Text&)       156   virtual void AddPrimitive (const G4Text&)       = 0;
191   virtual void AddPrimitive (const G4Circle&)     157   virtual void AddPrimitive (const G4Circle&)     = 0;      
192   virtual void AddPrimitive (const G4Square&)     158   virtual void AddPrimitive (const G4Square&)     = 0;      
193   virtual void AddPrimitive (const G4Polymarke    159   virtual void AddPrimitive (const G4Polymarker&);
194   virtual void AddPrimitive (const G4Polyhedro << 160   // Default implementation in this class but can be over-ridden.
195   virtual void AddPrimitive (const G4Plotter&) << 161   virtual void AddPrimitive (const G4Polyhedron&) = 0;  
196                                                << 162   virtual void AddPrimitive (const G4NURBS&)      = 0;       
197   // Other virtual functions                   << 
198   virtual const G4VisExtent& GetExtent() const << 
199                                                   163 
200   ////////////////////////////////////////////    164   //////////////////////////////////////////////////////////////
201   // Access functions.                            165   // Access functions.
202   const G4String&     GetName           () con    166   const G4String&     GetName           () const;
                                                   >> 167   void                SetName           (const G4String&);
203   G4int               GetSceneHandlerId () con    168   G4int               GetSceneHandlerId () const;
204   G4int               GetViewCount      () con    169   G4int               GetViewCount      () const;
205   G4VGraphicsSystem*  GetGraphicsSystem () con    170   G4VGraphicsSystem*  GetGraphicsSystem () const;
206   G4Scene*            GetScene          () con    171   G4Scene*            GetScene          () const;
207   const G4ViewerList& GetViewerList     () con    172   const G4ViewerList& GetViewerList     () const;
208   G4VModel*           GetModel          () con    173   G4VModel*           GetModel          () const;
209   G4VViewer*          GetCurrentViewer  () con    174   G4VViewer*          GetCurrentViewer  () const;
210   G4bool              GetMarkForClearingTransi    175   G4bool              GetMarkForClearingTransientStore () const;
211   G4bool              IsReadyForTransients ()  << 
212   G4bool              GetTransientsDrawnThisEv << 
213   G4bool              GetTransientsDrawnThisRu << 
214   const G4Transform3D& GetObjectTransformation << 
215   void                SetName          (const  << 
216   void          SetCurrentViewer (G4VViewer*);    176   void          SetCurrentViewer (G4VViewer*);
217   virtual void        SetScene         (G4Scen << 177   void          SetScene         (G4Scene*);
218   G4ViewerList& SetViewerList    ();  // Non-c    178   G4ViewerList& SetViewerList    ();  // Non-const so you can change.
219   void          SetModel         (G4VModel*);     179   void          SetModel         (G4VModel*);
220   void          SetMarkForClearingTransientSto    180   void          SetMarkForClearingTransientStore (G4bool);
221   // Sets flag which will cause transient stor    181   // Sets flag which will cause transient store to be cleared at the
222   // next call to BeginPrimitives().  Maintain << 182   // next call to BeginPrimitives().
223   void          SetTransientsDrawnThisEvent    << 
224   void          SetTransientsDrawnThisRun      << 
225   void          SetObjectTransformation        << 
226   // Maintained by vis manager.                << 
227                                                   183 
228   ////////////////////////////////////////////    184   //////////////////////////////////////////////////////////////
229   // Public utility functions.                    185   // Public utility functions.
230                                                   186 
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&)    187   const G4Colour& GetColour (const G4Visible&);
239   const G4Colour& GetColor  (const G4Visible&)    188   const G4Colour& GetColor  (const G4Visible&);
240   // Returns colour, or viewer default colour. << 189   // The above return 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                                                   190 
246   const G4Colour& GetTextColour (const G4Text&    191   const G4Colour& GetTextColour (const G4Text&);
247   const G4Colour& GetTextColor  (const G4Text&    192   const G4Colour& GetTextColor  (const G4Text&);
248   // Returns colour of G4Text object, or defau << 193   // The above return colour of G4Text object, or default text colour.
249                                                   194 
250   G4double GetLineWidth(const G4VisAttributes* << 195   G4ViewParameters::DrawingStyle GetDrawingStyle (const G4Visible&);
251   // Returns line width of G4VisAttributes mul << 196   // Returns drawing style of G4Visible object, i.e., the global
                                                   >> 197   // default value unless ovewrridden by forced attributes.  And the
                                                   >> 198   // attributes themselves can be specified or the global default is
                                                   >> 199   // used - see next function.  So use this function is you have a
                                                   >> 200   // G4Visible, or the next if all you have is a G4VisAttributes
                                                   >> 201   // pointer.
252                                                   202 
253   G4ViewParameters::DrawingStyle GetDrawingSty    203   G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes*);
254   // Returns drawing style from current view p << 204   // Returns global default drawing style unless forced attributes are set.
255   // has forced through the vis attributes, th << 205   // So always use this to get the applicable drawing style.
256   // current view parameter.                   << 
257                                                << 
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 << 
264   // Returns auxiliary edge visibility from cu << 
265   // unless the user has forced through the vi << 
266   // over-riding the current view parameter.   << 
267                                                << 
268   G4int GetNoOfSides(const G4VisAttributes*);  << 
269   // Returns no. of sides (lines segments per  << 
270   // view parameters, unless the user has forc << 
271   // attributes, thereby over-riding the curre << 
272                                                   206 
273   G4double GetMarkerSize (const G4VMarker&, Ma    207   G4double GetMarkerSize (const G4VMarker&, MarkerSizeType&);
274   // Returns applicable marker size (diameter)    208   // Returns applicable marker size (diameter) and type (in second
275   // argument).  Uses global default marker if    209   // argument).  Uses global default marker if marker sizes are not
276   // set.  Multiplies by GlobalMarkerScale.    << 210   // set.
277                                                   211 
278   G4double GetMarkerDiameter (const G4VMarker&    212   G4double GetMarkerDiameter (const G4VMarker&, MarkerSizeType&);
279   // Alias for GetMarkerSize.                     213   // Alias for GetMarkerSize.
280                                                   214 
281   G4double GetMarkerRadius (const G4VMarker&,     215   G4double GetMarkerRadius (const G4VMarker&, MarkerSizeType&);
282   // GetMarkerSize / 2.                           216   // GetMarkerSize / 2.
283                                                   217 
284   G4ModelingParameters* CreateModelingParamete    218   G4ModelingParameters* CreateModelingParameters ();
285   // Only the scene handler and view know what << 219   // Only the scene and view know what the Modeling Parameters should
286   // be.  For historical reasons, the GEANT4 V    220   // be.  For historical reasons, the GEANT4 Visualization Environment
287   // maintains its own Scene Data and View Par    221   // maintains its own Scene Data and View Parameters, which must be
288   // converted, when needed, to Modeling Param    222   // converted, when needed, to Modeling Parameters.
289                                                   223 
290   void DrawEvent(const G4Event*);              << 
291   // Checks scene's end-of-event model list an << 
292   // hits, etc.                                << 
293                                                << 
294   void DrawEndOfRunModels();                   << 
295   // Draws end-of-run models.                  << 
296                                                << 
297   ////////////////////////////////////////////    224   //////////////////////////////////////////////////////////////
298   // Administration functions.                    225   // Administration functions.
299                                                   226 
300   template <class T> void AddSolidT (const T&  << 
301   template <class T> void AddSolidWithAuxiliar << 
302                                                << 
303   G4int IncrementViewCount ();                    227   G4int IncrementViewCount ();
304                                                   228 
305   virtual void ClearStore ();                     229   virtual void ClearStore ();
306   // Clears graphics database (display lists)  << 230   // Clears graphics database (display lists) if any.  This base class
                                                   >> 231   // implements some common functionality so...
                                                   >> 232   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
                                                   >> 233   // void MyXXXSceneHandler::ClearStore () {
                                                   >> 234   //   G4VSceneHandler::ClearStore ();
                                                   >> 235   //   ...
                                                   >> 236   // }
307                                                   237 
308   virtual void ClearTransientStore ();            238   virtual void ClearTransientStore ();
309   // Clears transient part of graphics databas    239   // Clears transient part of graphics database (display lists) if any.
                                                   >> 240   // This base class implements some common functionality so...
                                                   >> 241   // IMPORTANT: invoke this from your polymorphic versions, e.g.:
                                                   >> 242   // void MyXXXSceneHandler::ClearTransientStore () {
                                                   >> 243   //   G4VSceneHandler::ClearTransientStore ();
                                                   >> 244   //   ...
                                                   >> 245   // }
310                                                   246 
311   void AddViewerToList      (G4VViewer* pView)    247   void AddViewerToList      (G4VViewer* pView);  // Add view to view List.
312   void RemoveViewerFromList (G4VViewer* pView)    248   void RemoveViewerFromList (G4VViewer* pView);  // Remove view from view List.
313                                                   249 
314 protected:                                        250 protected:
315                                                   251 
316   ////////////////////////////////////////////    252   //////////////////////////////////////////////////////////////
317   // Core routine for looping over models, red << 253   // Default routine used by default AddThis ().
318   // Overload with care (see, for example,     << 
319   // G4OpenGLScenehandler::ProcessScene).      << 
320   virtual void ProcessScene ();                << 
321                                                   254 
322   //////////////////////////////////////////// << 
323   // Default routine used by default AddSolid  << 
324   virtual void RequestPrimitives (const G4VSol    255   virtual void RequestPrimitives (const G4VSolid& solid);
325                                                   256 
326   ////////////////////////////////////////////    257   //////////////////////////////////////////////////////////////
327   // Other internal routines...                << 258   // Data members
328                                                   259 
329   virtual G4DisplacedSolid* CreateSectionSolid << 260   G4VGraphicsSystem&     fSystem;          // Graphics system.
330   virtual G4DisplacedSolid* CreateCutawaySolid << 261   const G4int            fSceneHandlerId;  // Id of this instance.
331   // Generic clipping using the BooleanProcess << 262   G4String               fName;
332   // implemented in this class.  Subclasses th << 263   G4int                  fViewCount;       // To determine view ids.
333   // clipping should provide an override that  << 264   G4ViewerList           fViewerList;      // Viewers.
334                                                << 265   G4VViewer*             fpViewer;         // Current viewer.
335   void LoadAtts(const G4Visible&, G4AttHolder* << 266   G4Scene*               fpScene;          // Scene for this scene handler.
336   // Load G4AttValues and G4AttDefs associated << 267   G4bool                 fMarkForClearingTransientStore;
337   // object onto the G4AttHolder object.  It c << 
338   // loads the G4AttValues and G4AttDefs from  << 
339   // G4VTrajectory, G4VTrajectoryPoint, G4VHit << 
340   // appropriate.  The G4AttHolder object is a << 
341   // publicly inherits G4AttHolder - see, e.g. << 
342   // Open Inventor driver.  G4AttHolder delete << 
343   // destructor to ensure proper clean-up of G << 
344                                                   268 
345   ////////////////////////////////////////////    269   //////////////////////////////////////////////////////////////
346   // Special mesh rendering utilities...       << 270   // Workspace...
                                                   >> 271 
                                                   >> 272   G4bool fReadyForTransients;           // I.e., not processing scene.
                                                   >> 273   G4VModel*              fpModel;       // Current model.
                                                   >> 274   const G4Transform3D*   fpObjectTransformation;  // Accum'd obj. transfn.
                                                   >> 275   const G4VisAttributes* fpVisAttribs;  // Working vis attributes.
                                                   >> 276   G4int                  fCurrentDepth; // Current depth of geom. hierarchy.
                                                   >> 277   G4VPhysicalVolume*     fpCurrentPV;   // Current physical volume.
                                                   >> 278   G4LogicalVolume*       fpCurrentLV;   // Current logical volume.
347                                                   279 
348   struct NameAndVisAtts {                      << 280 private:
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                                                   281 
430   G4ThreeVector GetPointInTet(const std::vecto << 282   G4VSceneHandler (const G4VSceneHandler&);
431   // Sample a random point inside the tetrahed << 283   G4VSceneHandler& operator = (const G4VSceneHandler&);
432                                                   284 
433   ////////////////////////////////////////////    285   //////////////////////////////////////////////////////////////
434   // Data members                              << 286   // Friend function accessed only by views of this scene.
435                                                   287 
436   G4VGraphicsSystem& fSystem;          // Grap << 288   friend void G4VViewer::ProcessView ();
437   const G4int        fSceneHandlerId;  // Id o << 
438   G4String           fName;                    << 
439   G4int              fViewCount;       // To d << 
440   G4ViewerList       fViewerList;      // View << 
441   G4VViewer*         fpViewer;         // Curr << 
442   G4Scene*           fpScene;          // Scen << 
443   G4bool             fMarkForClearingTransient << 
444   G4bool             fReadyForTransients;  //  << 
445                          // run-duration part  << 
446   G4bool             fTransientsDrawnThisEvent << 
447   G4bool             fTransientsDrawnThisRun;  << 
448   G4bool             fProcessingSolid; // True << 
449   G4bool             fProcessing2D;    // True << 
450   G4VModel*          fpModel;          // Curr << 
451   G4Transform3D fObjectTransformation; // Curr << 
452                // object transformation.       << 
453   G4int              fNestingDepth;    // For  << 
454   const G4VisAttributes* fpVisAttribs; // Work << 
455   const G4Transform3D fIdentityTransformation; << 
456   std::map<G4VPhysicalVolume*,G4String> fProbl << 
457                                                   289 
458 private:                                       << 290   //////////////////////////////////////////////////////////////
                                                   >> 291   // Private functions, etc..
                                                   >> 292 
                                                   >> 293   void   ProcessScene     (G4VViewer& view);
                                                   >> 294   // Accessed by G4VViewer::ProcessView ().
459                                                   295 
460   G4VSceneHandler (const G4VSceneHandler&);    << 
461   G4VSceneHandler& operator = (const G4VSceneH << 
462 };                                                296 };
463                                                   297 
464 #include "G4VSceneHandler.icc"                    298 #include "G4VSceneHandler.icc"
465                                                   299 
466 #endif                                            300 #endif
467                                                   301