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