Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VGraphicsScene.hh
Go to the documentation of this file.
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// John Allison 19th July 1996
28//
29// Class Description:
30// Abstract interface class for a graphics scene handler.
31// It is a minimal scene handler for the GEANT4 kernel.
32// See G4VSceneHandler for a fuller description. G4VSceneHandler is
33// the full abstract interface to graphics systems.
34
35#ifndef G4VGRAPHICSSCENE_HH
36#define G4VGRAPHICSSCENE_HH
37
38#include "globals.hh"
39#include "G4Transform3D.hh"
40
41class G4VisAttributes;
42class G4VSolid;
43class G4Box;
44class G4Cons;
45class G4Orb;
46class G4Para;
47class G4Torus;
48class G4Trap;
49class G4Trd;
50class G4Tubs;
51class G4Sphere;
52
53class G4Ellipsoid;
54class G4Polycone;
55class G4Polyhedra;
57
59class G4VTrajectory;
60class G4VHit;
61class G4VDigi;
62template <typename T> class G4THitsMap;
63class G4Polyline;
64class G4Scale;
65class G4Text;
66class G4Circle;
67class G4Square;
68class G4Polymarker;
69class G4Polyhedron;
70class G4VisExtent;
71class G4StatDouble;
72
74
75public: // With description
76
78 virtual ~G4VGraphicsScene();
79
80 ///////////////////////////////////////////////////////////////////
81 // Methods for adding solids to the scene handler. They
82 // must always be called in the triplet PreAddSolid, AddSolid and
83 // PostAddSolid. The transformation and visualization attributes
84 // must be set by the call to PreAddSolid. A possible default
85 // implementation is to request the solid to provide a G4Polyhedron
86 // or similar primitive - see, for example, G4VSceneHandler in the
87 // Visualization Category.
88
89 virtual void PreAddSolid (const G4Transform3D& objectTransformation,
90 const G4VisAttributes& visAttribs) = 0;
91 // objectTransformation is the transformation in the world
92 // coordinate system of the object about to be added, and
93 // visAttribs is its visualization attributes.
94
95 virtual void PostAddSolid () = 0;
96
97 // From geometry/solids/CSG
98 virtual void AddSolid (const G4Box&) = 0;
99 virtual void AddSolid (const G4Cons&) = 0;
100 virtual void AddSolid (const G4Orb&) = 0;
101 virtual void AddSolid (const G4Para&) = 0;
102 virtual void AddSolid (const G4Sphere&) = 0;
103 virtual void AddSolid (const G4Torus&) = 0;
104 virtual void AddSolid (const G4Trap&) = 0;
105 virtual void AddSolid (const G4Trd&) = 0;
106 virtual void AddSolid (const G4Tubs&) = 0;
107
108 // From geometry/solids/specific
109 virtual void AddSolid (const G4Ellipsoid&) = 0;
110 virtual void AddSolid (const G4Polycone&) = 0;
111 virtual void AddSolid (const G4Polyhedra&) = 0;
112 virtual void AddSolid (const G4TessellatedSolid&) = 0;
113
114 // For solids not above
115 virtual void AddSolid (const G4VSolid&) = 0;
116
117 ///////////////////////////////////////////////////////////////////
118 // Methods for adding "compound" GEANT4 objects to the scene
119 // handler. These methods may either (a) invoke "user code" that
120 // uses the "user interface", G4VVisManager (see, for example,
121 // G4VSceneHandler in the Visualization Category, which for
122 // trajectories uses G4VTrajectory::DrawTrajectory, via
123 // G4TrajectoriesModel in the Modeling Category) or (b) invoke
124 // AddPrimitives below (between calls to Begin/EndPrimitives) or (c)
125 // use graphics-system-specific code or (d) any combination of the
126 // above.
127
128 virtual void AddCompound (const G4VTrajectory&) = 0;
129 virtual void AddCompound (const G4VHit&) = 0;
130 virtual void AddCompound (const G4VDigi&) = 0;
131 virtual void AddCompound (const G4THitsMap<G4double>&) = 0;
132 virtual void AddCompound (const G4THitsMap<G4StatDouble>&) = 0;
133
134 ///////////////////////////////////////////////////////////////////
135 // Methods for adding graphics primitives to the scene handler. A
136 // sequence of calls to AddPrimitive must be sandwiched between
137 // calls to BeginPrimitives and EndPrimitives. A sequence is any
138 // number of calls that have the same transformation.
139
140 virtual void BeginPrimitives
141 (const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
142 // objectTransformation is the transformation in the world
143 // coordinate system of the object about to be added.
144
145 virtual void EndPrimitives () = 0;
146
147 virtual void BeginPrimitives2D
148 (const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
149
150 virtual void EndPrimitives2D () = 0;
151 // The x,y coordinates of the primitives passed to AddPrimitive are
152 // intrepreted as screen coordinates, -1 < x,y < 1. The
153 // z-coordinate is ignored.
154
155 virtual void AddPrimitive (const G4Polyline&) = 0;
156 virtual void AddPrimitive (const G4Scale&) = 0;
157 virtual void AddPrimitive (const G4Text&) = 0;
158 virtual void AddPrimitive (const G4Circle&) = 0;
159 virtual void AddPrimitive (const G4Square&) = 0;
160 virtual void AddPrimitive (const G4Polymarker&) = 0;
161 virtual void AddPrimitive (const G4Polyhedron&) = 0;
162
163 virtual const G4VisExtent& GetExtent() const;
164 // The concrete class should overload this or a null extent will be returned.
165 // See G4VScenHandler for example.
166
167};
168
169#endif
HepGeom::Transform3D G4Transform3D
Definition: G4Box.hh:56
Definition: G4Cons.hh:78
Definition: G4Orb.hh:56
Definition: G4Para.hh:79
Definition: G4Text.hh:72
Definition: G4Trd.hh:63
Definition: G4Tubs.hh:75
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void AddPrimitive(const G4Square &)=0
virtual void AddPrimitive(const G4Text &)=0
virtual void EndPrimitives2D()=0
virtual void AddPrimitive(const G4Polymarker &)=0
virtual void AddCompound(const G4VHit &)=0
virtual void AddSolid(const G4Orb &)=0
virtual void AddPrimitive(const G4Scale &)=0
virtual void AddCompound(const G4VTrajectory &)=0
virtual void AddSolid(const G4Cons &)=0
virtual void AddCompound(const G4VDigi &)=0
virtual void AddSolid(const G4Tubs &)=0
virtual void AddSolid(const G4Trd &)=0
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void PostAddSolid()=0
virtual void AddPrimitive(const G4Polyline &)=0
virtual const G4VisExtent & GetExtent() const
virtual void AddPrimitive(const G4Polyhedron &)=0
virtual void AddSolid(const G4Polyhedra &)=0
virtual void AddSolid(const G4VSolid &)=0
virtual void AddCompound(const G4THitsMap< G4double > &)=0
virtual void AddCompound(const G4THitsMap< G4StatDouble > &)=0
virtual void AddSolid(const G4Box &)=0
virtual void EndPrimitives()=0
virtual void AddSolid(const G4Para &)=0
virtual void AddSolid(const G4TessellatedSolid &)=0
virtual void AddPrimitive(const G4Circle &)=0
virtual void AddSolid(const G4Polycone &)=0
virtual void AddSolid(const G4Ellipsoid &)=0
virtual ~G4VGraphicsScene()
virtual void AddSolid(const G4Trap &)=0
virtual void AddSolid(const G4Sphere &)=0
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)=0
virtual void AddSolid(const G4Torus &)=0
Definition: G4VHit.hh:48