Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
visualization
management
include
G4Scene.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$
28
//
29
//
30
// Scene John Allison 19th July 1996.
31
//
32
// Class Description:
33
//
34
// Defines the viewable scene.
35
36
#ifndef G4SCENE_HH
37
#define G4SCENE_HH
38
39
#include "
globals.hh
"
40
#include "
G4ios.hh
"
41
42
class
G4VPhysicalVolume
;
43
44
#include "
G4VisExtent.hh
"
45
#include "
G4Point3D.hh
"
46
#include "
G4VModel.hh
"
47
#include <vector>
48
49
class
G4Scene
{
50
51
public
:
// With description
52
53
friend
std::ostream&
operator <<
(std::ostream& os,
const
G4Scene
&
d
);
54
55
enum
{
UNLIMITED
= -1};
56
57
G4Scene
(
const
G4String
&
name
=
"scene-with-unspecified-name"
);
58
~G4Scene
();
59
60
// Makes use of default (compiler generated) copy constructor and
61
// assignment operator.
62
63
G4bool
operator ==
(
const
G4Scene
&)
const
;
64
G4bool
operator !=
(
const
G4Scene
&)
const
;
65
67
// Get functions...
68
69
const
G4String
&
GetName
()
const
;
70
71
G4bool
IsEmpty
()
const
;
72
73
struct
Model
{
74
Model
(
G4VModel
* pModel):
fActive
(true),
fpModel
(pModel) {}
75
G4bool
fActive
;
76
G4VModel
*
fpModel
;
77
};
78
79
const
std::vector<Model>&
GetRunDurationModelList
()
const
;
80
// Contains models which are expected to last for the duration of
81
// the run, for example geometry volumes.
82
83
const
std::vector<Model>&
GetEndOfEventModelList
()
const
;
84
// Contains models which are described at the end of event when the
85
// scene is current.
86
87
const
std::vector<Model>&
GetEndOfRunModelList
()
const
;
88
// Contains models which are described at the end of event when the
89
// scene is current.
90
91
const
G4VisExtent
&
GetExtent
()
const
;
92
// Overall extent of all objects in the scene.
93
94
const
G4Point3D
&
GetStandardTargetPoint
()
const
;
95
// Usually centre of extent. See G4ViewParameters for definition.
96
97
G4bool
GetRefreshAtEndOfEvent
()
const
;
98
// If true, the visualization manager will request viewer to refresh
99
// "transient" objects, such as hits, at end of event. Otherwise
100
// they will be accumulated.
101
102
G4int
GetMaxNumberOfKeptEvents
()
const
;
103
// If RefreshAtEndOfEvent is false, events of the current run are
104
// kept up to this maximum number. A negative value means all
105
// events of current run are kept. The events are available for
106
// viewing at the end of run, but are deleted just before the start
107
// of the next run.
108
109
G4bool
GetRefreshAtEndOfRun
()
const
;
110
// If true, the visualization manager will request viewer to refresh
111
// "transient" objects, such as hits, at end of run. Otherwise
112
// they will be accumulated.
113
115
// Add and Set functions...
116
117
G4bool
AddRunDurationModel
(
G4VModel
*,
G4bool
warn =
false
);
118
// Adds models of type which are expected to last for the duration
119
// of the run, for example geometry volumes.
120
// Returns false if model is already in the list.
121
// Prints warnings if warn is true.
122
123
G4bool
AddWorldIfEmpty
(
G4bool
warn =
false
);
124
// In some situations, if the user asks for a drawing and has not
125
// yet set any run duration models it makes sense to put the "world"
126
// in there by default.
127
// Returns false if model is already in the list.
128
// Prints warnings if warn is true.
129
130
G4bool
AddEndOfEventModel
(
G4VModel
*,
G4bool
warn =
false
);
131
// Adds models of type which are described at the end of event when
132
// the scene is current.
133
// Returns false if model is already in the list.
134
// Prints warnings if warn is true.
135
136
G4bool
AddEndOfRunModel
(
G4VModel
*,
G4bool
warn =
false
);
137
// Adds models of type which are described at the end of run when
138
// the scene is current.
139
// Returns false if model is already in the list.
140
// Prints warnings if warn is true.
141
142
void
SetName
(
const
G4String
&);
143
// Use with care. User normally sets scene name by vis commands.
144
145
std::vector<Model>&
SetRunDurationModelList
();
146
// Allows you to change the model list - do with care!
147
148
std::vector<Model>&
SetEndOfEventModelList
();
149
// Allows you to change the model list - do with care!
150
151
std::vector<Model>&
SetEndOfRunModelList
();
152
// Allows you to change the model list - do with care!
153
154
void
SetRefreshAtEndOfEvent
(
G4bool
);
155
// If set true, the visualization manager will request viewer to
156
// refresh "transient" objects, such as hits, at end of event.
157
// Otherwise they will be accumulated.
158
159
void
SetMaxNumberOfKeptEvents
(
G4int
);
160
// If RefreshAtEndOfEvent is false, events of the current run are
161
// kept up to this maximum number. A negative value means all
162
// events of current run are kept. The events are available for
163
// viewing at the end of run, but are deleted just before the start
164
// of the next run.
165
166
void
SetRefreshAtEndOfRun
(
G4bool
);
167
// If set true, the visualization manager will request viewer to
168
// refresh "transient" objects, such as hits, at end of run.
169
// Otherwise they will be accumulated.
170
172
// Other functions...
173
174
void
CalculateExtent
();
175
// (Re-)calculates the extent from the extents of its models.
176
177
private
:
178
G4String
fName;
179
std::vector<Model> fRunDurationModelList;
180
std::vector<Model> fEndOfEventModelList;
181
std::vector<Model> fEndOfRunModelList;
182
G4VisExtent
fExtent;
183
G4Point3D
fStandardTargetPoint;
184
G4bool
fRefreshAtEndOfEvent;
185
G4bool
fRefreshAtEndOfRun;
186
G4int
fMaxNumberOfKeptEvents;
187
};
188
189
#include "G4Scene.icc"
190
191
#endif
Generated on Sat May 25 2013 14:34:14 for Geant4 by
1.8.4