1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4VGraphicsScene.hh,v 1.13 2010/05/30 11:15:36 allison Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
29 | // John Allison 19th July 1996 |
---|
30 | // |
---|
31 | // Class Description: |
---|
32 | // Abstract interface class for a graphics scene handler. |
---|
33 | // It is a minimal scene handler for the GEANT4 kernel. |
---|
34 | // See G4VSceneHandler for a fuller description. G4VSceneHandler is |
---|
35 | // the full abstract interface to graphics systems. |
---|
36 | |
---|
37 | #ifndef G4VGRAPHICSSCENE_HH |
---|
38 | #define G4VGRAPHICSSCENE_HH |
---|
39 | |
---|
40 | #include "globals.hh" |
---|
41 | #include "G4Transform3D.hh" |
---|
42 | |
---|
43 | class G4VisAttributes; |
---|
44 | class G4VSolid; |
---|
45 | class G4Box; |
---|
46 | class G4Cons; |
---|
47 | class G4Tubs; |
---|
48 | class G4Trd; |
---|
49 | class G4Trap; |
---|
50 | class G4Sphere; |
---|
51 | class G4Ellipsoid; |
---|
52 | class G4Para; |
---|
53 | class G4Torus; |
---|
54 | class G4PhysicalVolumeModel; |
---|
55 | class G4Polycone; |
---|
56 | class G4Polyhedra; |
---|
57 | class G4VTrajectory; |
---|
58 | class G4VHit; |
---|
59 | class G4VDigi; |
---|
60 | template <typename T> class G4THitsMap; |
---|
61 | class G4Polyline; |
---|
62 | class G4Scale; |
---|
63 | class G4Text; |
---|
64 | class G4Circle; |
---|
65 | class G4Square; |
---|
66 | class G4Polymarker; |
---|
67 | class G4Polyhedron; |
---|
68 | class G4NURBS; |
---|
69 | |
---|
70 | class G4VGraphicsScene { |
---|
71 | |
---|
72 | public: // With description |
---|
73 | |
---|
74 | G4VGraphicsScene(); |
---|
75 | virtual ~G4VGraphicsScene(); |
---|
76 | |
---|
77 | /////////////////////////////////////////////////////////////////// |
---|
78 | // Methods for adding solids to the scene handler. They |
---|
79 | // must always be called in the triplet PreAddSolid, AddSolid and |
---|
80 | // PostAddSolid. The transformation and visualization attributes |
---|
81 | // must be set by the call to PreAddSolid. A possible default |
---|
82 | // implementation is to request the solid to provide a G4Polyhedron |
---|
83 | // or similar primitive - see, for example, G4VSceneHandler in the |
---|
84 | // Visualization Category. |
---|
85 | |
---|
86 | virtual void PreAddSolid (const G4Transform3D& objectTransformation, |
---|
87 | const G4VisAttributes& visAttribs) = 0; |
---|
88 | // objectTransformation is the transformation in the world |
---|
89 | // coordinate system of the object about to be added, and |
---|
90 | // visAttribs is its visualization attributes. |
---|
91 | |
---|
92 | virtual void PostAddSolid () = 0; |
---|
93 | |
---|
94 | virtual void AddSolid (const G4Box&) = 0; |
---|
95 | virtual void AddSolid (const G4Cons&) = 0; |
---|
96 | virtual void AddSolid (const G4Tubs&) = 0; |
---|
97 | virtual void AddSolid (const G4Trd&) = 0; |
---|
98 | virtual void AddSolid (const G4Trap&) = 0; |
---|
99 | virtual void AddSolid (const G4Sphere&) = 0; |
---|
100 | virtual void AddSolid (const G4Para&) = 0; |
---|
101 | virtual void AddSolid (const G4Torus&) = 0; |
---|
102 | virtual void AddSolid (const G4Polycone&) = 0; |
---|
103 | virtual void AddSolid (const G4Polyhedra&) = 0; |
---|
104 | virtual void AddSolid (const G4VSolid&) = 0; // For solids not above. |
---|
105 | |
---|
106 | /////////////////////////////////////////////////////////////////// |
---|
107 | // Methods for adding "compound" GEANT4 objects to the scene |
---|
108 | // handler. These methods may either (a) invoke "user code" that |
---|
109 | // uses the "user interface", G4VVisManager (see, for example, |
---|
110 | // G4VSceneHandler in the Visualization Category, which for |
---|
111 | // trajectories uses G4VTrajectory::DrawTrajectory, via |
---|
112 | // G4TrajectoriesModel in the Modeling Category) or (b) invoke |
---|
113 | // AddPrimitives below (between calls to Begin/EndPrimitives) or (c) |
---|
114 | // use graphics-system-specific code or (d) any combination of the |
---|
115 | // above. |
---|
116 | |
---|
117 | virtual void AddCompound (const G4VTrajectory&) = 0; |
---|
118 | virtual void AddCompound (const G4VHit&) = 0; |
---|
119 | virtual void AddCompound (const G4VDigi&) = 0; |
---|
120 | virtual void AddCompound (const G4THitsMap<G4double>&) = 0; |
---|
121 | |
---|
122 | /////////////////////////////////////////////////////////////////// |
---|
123 | // Methods for adding graphics primitives to the scene handler. A |
---|
124 | // sequence of calls to AddPrimitive must be sandwiched between |
---|
125 | // calls to BeginPrimitives and EndPrimitives. A sequence is any |
---|
126 | // number of calls that have the same transformation. |
---|
127 | |
---|
128 | virtual void BeginPrimitives |
---|
129 | (const G4Transform3D& objectTransformation = G4Transform3D()) = 0; |
---|
130 | // objectTransformation is the transformation in the world |
---|
131 | // coordinate system of the object about to be added. |
---|
132 | |
---|
133 | virtual void EndPrimitives () = 0; |
---|
134 | |
---|
135 | virtual void BeginPrimitives2D |
---|
136 | (const G4Transform3D& objectTransformation = G4Transform3D()) = 0; |
---|
137 | |
---|
138 | virtual void EndPrimitives2D () = 0; |
---|
139 | // The x,y coordinates of the primitives passed to AddPrimitive are |
---|
140 | // intrepreted as screen coordinates, -1 < x,y < 1. The |
---|
141 | // z-coordinate is ignored. |
---|
142 | |
---|
143 | virtual void AddPrimitive (const G4Polyline&) = 0; |
---|
144 | virtual void AddPrimitive (const G4Scale&) = 0; |
---|
145 | virtual void AddPrimitive (const G4Text&) = 0; |
---|
146 | virtual void AddPrimitive (const G4Circle&) = 0; |
---|
147 | virtual void AddPrimitive (const G4Square&) = 0; |
---|
148 | virtual void AddPrimitive (const G4Polymarker&) = 0; |
---|
149 | virtual void AddPrimitive (const G4Polyhedron&) = 0; |
---|
150 | virtual void AddPrimitive (const G4NURBS&) = 0; |
---|
151 | |
---|
152 | }; |
---|
153 | |
---|
154 | #endif |
---|