source: trunk/source/graphics_reps/include/G4VVisManager.hh@ 1345

Last change on this file since 1345 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 8.4 KB
Line 
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: G4VVisManager.hh,v 1.18 2010/05/30 11:15:36 allison Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29// John Allison 19/Oct/1996.
30//
31// Class Description:
32//
33// G4VVisManager is an abstract interface for the GEANT4 Visualization Manager.
34// The inheritance hierarchy is:
35// G4VVisManager <- G4VisManager <- G4VisExecutive
36//
37// You may also write your own vis manager in place of G4VisExecutive.
38//
39// See example/novice/N02 to see how and when to instantiate
40// G4VisExecutive (or your own vis manager). You should *not* access
41// it directly; instead you should obtain a pointer as follows:
42//
43// G4VVisManager* pVVMan = G4VVisManager::GetConcreteInstance ();
44//
45// This ensures your code will link even if G4VisExecutive is not
46// instantiated or even if not provided in a library. Please protect
47// your code by testing the pointer, for example, by:
48//
49// if (pVVMan) pVVMan -> Draw (polyline);
50//
51// The Draw functions draw only "transient" objects. This is useful
52// for debugging, e.g., drawing the step in your UserSteppingAction,
53// since G4Steps are not kept.
54//
55// Note: "permanent" objects, i.e., objects which are always
56// available, such as detector geometry components, or available in an
57// event after tracking has finished, such as hits, digitisations and
58// trajectories, can be drawn in a transient way if you wish but it is
59// usually possible to draw them in a permanent way with /vis/
60// commands. The advantage is that permanent objects can be redrawn,
61// e.g., when you change view or viewer; transient objects get
62// forgotten. Also, it is possible to write a G4VUserVisAction class
63// and register it to "promote" your Draw messages to "permanent" -
64// see documentation.
65//
66// Note that the G4Transform3D argument refers to the transformation
67// of the *object*, not the transformation of the coordinate syste.
68//
69// Note also that where a G4VisAttributes argument is specified, it
70// overrides any attributes belonging to the object itself.
71
72#ifndef G4VVISMANAGER_HH
73#define G4VVISMANAGER_HH
74
75#include "G4Transform3D.hh"
76#include "G4ThreeVector.hh" // Just a typedef Hep3Vector.
77#include "G4RotationMatrix.hh" // Just a typedef HepRotation.
78
79class G4Polyline;
80class G4Text;
81class G4Circle;
82class G4Scale;
83class G4Square;
84class G4Polymarker;
85class G4Polyhedron;
86class G4NURBS;
87class G4VSolid;
88class G4VHit;
89class G4VDigi;
90class G4VTrajectory;
91class G4LogicalVolume;
92class G4VPhysicalVolume;
93class G4VisAttributes;
94
95class G4VVisManager {
96
97public: // With description
98
99 static G4VVisManager* GetConcreteInstance ();
100 // Returns pointer to actual visualization manager if a view is
101 // available for drawing, else returns null. Always check value.
102
103public:
104
105 virtual ~G4VVisManager ();
106
107public: // With description
108
109 ///////////////////////////////////////////////////////////////////////
110 // Draw methods for Geant4 Visualization Primitives, useful
111 // for representing hits, digis, etc.
112
113 virtual void Draw (const G4Circle&,
114 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
115
116 virtual void Draw (const G4NURBS&,
117 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
118
119 virtual void Draw (const G4Polyhedron&,
120 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
121
122 virtual void Draw (const G4Polyline&,
123 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
124
125 virtual void Draw (const G4Polymarker&,
126 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
127
128 virtual void Draw (const G4Scale&,
129 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
130
131 virtual void Draw (const G4Square&,
132 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
133
134 virtual void Draw (const G4Text&,
135 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
136
137 ///////////////////////////////////////////////////////////////////////
138 // For 2D methods, the x,y coordinates are interpreted as screen
139 // coordinates, -1 < x,y < 1. The z-coordinate is ignored.
140
141 virtual void Draw2D (const G4Circle&,
142 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
143
144 virtual void Draw2D (const G4NURBS&,
145 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
146
147 virtual void Draw2D (const G4Polyhedron&,
148 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
149
150 virtual void Draw2D (const G4Polyline&,
151 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
152
153 virtual void Draw2D (const G4Polymarker&,
154 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
155
156 virtual void Draw2D (const G4Square&,
157 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
158
159 virtual void Draw2D (const G4Text&,
160 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
161
162 ///////////////////////////////////////////////////////////////////////
163 // Draw methods for Geant4 Objects as if they were Visualization
164 // Primitives. Note that the visualization attributes needed in
165 // some cases override any visualization attributes that are
166 // associated with the object itself - thus you can, for example,
167 // change the colour of a physical volume.
168
169 virtual void Draw (const G4VHit&) = 0;
170
171 virtual void Draw (const G4VDigi&) = 0;
172
173 virtual void Draw (const G4VTrajectory&, G4int i_mode = 0) = 0;
174 // i_mode is a parameter that can be used to control the drawing of
175 // the trajectory. See, e.g., G4TrajectoryDrawByCharge::Draw in the
176 // modeling sub-category. Its use is deprecated; use trajectory
177 // model commands instead.
178
179 virtual void Draw (const G4LogicalVolume&, const G4VisAttributes&,
180 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
181
182 virtual void Draw (const G4VPhysicalVolume&, const G4VisAttributes&,
183 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
184
185 virtual void Draw (const G4VSolid&, const G4VisAttributes&,
186 const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
187
188 //////////////////////////////////////////////////////////////////////
189 // Other methods...
190
191 virtual void GeometryHasChanged () = 0;
192 // This is used by the run manager to notify a change of geometry.
193
194 virtual void NotifyHandlers () {}
195 // Notify scene handlers (G4VGraphicsScene objects) that the scene
196 // has changed so that they may rebuild their graphics database, if
197 // any, and redraw all views.
198
199 virtual void DispatchToModel(const G4VTrajectory&) = 0;
200 virtual void DispatchToModel(const G4VTrajectory&, G4int i_mode) = 0;
201 // Draw the trajectory.
202
203 virtual G4bool FilterTrajectory(const G4VTrajectory&) = 0;
204 // Trajectory filter
205
206 virtual G4bool FilterHit(const G4VHit&) = 0;
207 // Hit filter
208
209 virtual G4bool FilterDigi(const G4VDigi&) = 0;
210 // Digi filter
211
212protected:
213
214 static void SetConcreteInstance (G4VVisManager*);
215
216 static G4VVisManager* fpConcreteInstance; // Pointer to real G4VisManager.
217};
218
219#endif
Note: See TracBrowser for help on using the repository browser.