|
||||
File indexing completed on 2025-01-18 09:59:21
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // 0027 // John Allison 19th July 1996 0028 // 0029 // Class Description: 0030 // Abstract interface class for a graphics scene handler. 0031 // It is a minimal scene handler for the GEANT4 kernel. 0032 // See G4VSceneHandler for a fuller description. G4VSceneHandler is 0033 // the full abstract interface to graphics systems. 0034 0035 #ifndef G4VGRAPHICSSCENE_HH 0036 #define G4VGRAPHICSSCENE_HH 0037 0038 #include "globals.hh" 0039 #include "G4Transform3D.hh" 0040 0041 class G4VisAttributes; 0042 class G4VSolid; 0043 class G4Box; 0044 class G4Cons; 0045 class G4Orb; 0046 class G4Para; 0047 class G4Torus; 0048 class G4Trap; 0049 class G4Trd; 0050 class G4Tubs; 0051 class G4Sphere; 0052 0053 class G4Ellipsoid; 0054 class G4Polycone; 0055 class G4Polyhedra; 0056 class G4TessellatedSolid; 0057 0058 class G4PhysicalVolumeModel; 0059 class G4VTrajectory; 0060 class G4VHit; 0061 class G4VDigi; 0062 template <typename T> class G4THitsMap; 0063 class G4Polyline; 0064 class G4Text; 0065 class G4Circle; 0066 class G4Square; 0067 class G4Polymarker; 0068 class G4Polyhedron; 0069 class G4VisExtent; 0070 class G4StatDouble; 0071 class G4Mesh; 0072 class G4Plotter; 0073 0074 class G4VGraphicsScene { 0075 0076 public: // With description 0077 0078 G4VGraphicsScene(); 0079 virtual ~G4VGraphicsScene(); 0080 0081 /////////////////////////////////////////////////////////////////// 0082 // Methods for adding solids to the scene handler. They 0083 // must always be called in the triplet PreAddSolid, AddSolid and 0084 // PostAddSolid. The transformation and visualization attributes 0085 // must be set by the call to PreAddSolid. A possible default 0086 // implementation is to request the solid to provide a G4Polyhedron 0087 // or similar primitive - see, for example, G4VSceneHandler in the 0088 // Visualization Category. 0089 0090 virtual void PreAddSolid (const G4Transform3D& objectTransformation, 0091 const G4VisAttributes& visAttribs) = 0; 0092 // objectTransformation is the transformation in the world 0093 // coordinate system of the object about to be added, and 0094 // visAttribs is its visualization attributes. 0095 0096 virtual void PostAddSolid () = 0; 0097 0098 // From geometry/solids/CSG 0099 virtual void AddSolid (const G4Box&) = 0; 0100 virtual void AddSolid (const G4Cons&) = 0; 0101 virtual void AddSolid (const G4Orb&) = 0; 0102 virtual void AddSolid (const G4Para&) = 0; 0103 virtual void AddSolid (const G4Sphere&) = 0; 0104 virtual void AddSolid (const G4Torus&) = 0; 0105 virtual void AddSolid (const G4Trap&) = 0; 0106 virtual void AddSolid (const G4Trd&) = 0; 0107 virtual void AddSolid (const G4Tubs&) = 0; 0108 0109 // From geometry/solids/specific 0110 virtual void AddSolid (const G4Ellipsoid&) = 0; 0111 virtual void AddSolid (const G4Polycone&) = 0; 0112 virtual void AddSolid (const G4Polyhedra&) = 0; 0113 virtual void AddSolid (const G4TessellatedSolid&) = 0; 0114 0115 // For solids not above 0116 virtual void AddSolid (const G4VSolid&) = 0; 0117 0118 /////////////////////////////////////////////////////////////////// 0119 // Methods for adding "compound" GEANT4 objects to the scene 0120 // handler. These methods may either (a) invoke "user code" that 0121 // uses the "user interface", G4VVisManager (see, for example, 0122 // G4VSceneHandler in the Visualization Category, which for 0123 // trajectories uses G4VTrajectory::DrawTrajectory, via 0124 // G4TrajectoriesModel in the Modeling Category) or (b) invoke 0125 // AddPrimitives below (between calls to Begin/EndPrimitives) or (c) 0126 // use graphics-system-specific code or (d) any combination of the 0127 // above. 0128 0129 virtual void AddCompound (const G4VTrajectory&) = 0; 0130 virtual void AddCompound (const G4VHit&) = 0; 0131 virtual void AddCompound (const G4VDigi&) = 0; 0132 virtual void AddCompound (const G4THitsMap<G4double>&) = 0; 0133 virtual void AddCompound (const G4THitsMap<G4StatDouble>&) = 0; 0134 virtual void AddCompound (const G4Mesh&) = 0; 0135 0136 /////////////////////////////////////////////////////////////////// 0137 // Methods for adding graphics primitives to the scene handler. A 0138 // sequence of calls to AddPrimitive must be sandwiched between 0139 // calls to BeginPrimitives and EndPrimitives. A sequence is any 0140 // number of calls that have the same transformation. 0141 0142 virtual void BeginPrimitives 0143 (const G4Transform3D& objectTransformation = G4Transform3D()) = 0; 0144 // objectTransformation is the transformation in the world 0145 // coordinate system of the object about to be added. 0146 0147 virtual void EndPrimitives () = 0; 0148 0149 virtual void BeginPrimitives2D 0150 (const G4Transform3D& objectTransformation = G4Transform3D()) = 0; 0151 0152 virtual void EndPrimitives2D () = 0; 0153 // The x,y coordinates of the primitives passed to AddPrimitive are 0154 // intrepreted as screen coordinates, -1 < x,y < 1. The 0155 // z-coordinate is ignored. 0156 0157 virtual void AddPrimitive (const G4Polyline&) = 0; 0158 virtual void AddPrimitive (const G4Text&) = 0; 0159 virtual void AddPrimitive (const G4Circle&) = 0; 0160 virtual void AddPrimitive (const G4Square&) = 0; 0161 virtual void AddPrimitive (const G4Polymarker&) = 0; 0162 virtual void AddPrimitive (const G4Polyhedron&) = 0; 0163 virtual void AddPrimitive (const G4Plotter&) = 0; 0164 0165 virtual const G4VisExtent& GetExtent() const; 0166 // The concrete class should overload this or a null extent will be returned. 0167 // See G4VScenHandler for example. 0168 0169 }; 0170 0171 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |