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