source: trunk/source/visualization/management/include/G4Scene.hh @ 954

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

remise a jour

  • Property svn:mime-type set to text/cpp
File size: 6.1 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: G4Scene.hh,v 1.18 2006/11/14 14:59:54 allison Exp $
28// GEANT4 tag $Name:  $
29//
30//
31// Scene  John Allison  19th July 1996.
32//
33// Class Description:
34//
35// Defines the viewable scene.
36
37#ifndef G4SCENE_HH
38#define G4SCENE_HH
39
40#include "globals.hh"
41#include "G4ios.hh"
42
43class G4VPhysicalVolume;
44
45#include "G4VisExtent.hh"
46#include "G4Point3D.hh"
47#include "G4VModel.hh"
48#include <vector>
49
50class G4Scene {
51
52public: // With description
53
54  friend std::ostream& operator << (std::ostream& os, const G4Scene& d);
55
56  enum {UNLIMITED = -1};
57
58  G4Scene (const G4String& name = "scene-with-unspecified-name");
59  ~G4Scene ();
60
61  // Makes use of default (compiler generated) copy constructor and
62  // assignment operator.
63
64  G4bool operator == (const G4Scene&) const;
65  G4bool operator != (const G4Scene&) const;
66
67  //////////////////////////////////////////////////////
68  // Get functions...
69
70  const G4String& GetName () const;
71
72  G4bool IsEmpty () const;
73
74  const std::vector<G4VModel*>& GetRunDurationModelList () const;
75  // Contains models which are expected to last for the duration of
76  // the run, for example geometry volumes.
77
78  const std::vector<G4VModel*>& GetEndOfEventModelList () const;
79  // Contains models which are described at the end of event when the
80  // scene is current.
81
82  const G4VisExtent& GetExtent () const;
83  // Overall extent of all objects in the scene.
84
85  const G4Point3D& GetStandardTargetPoint () const;
86  // Usually centre of extent.  See G4ViewParameters for definition.
87
88  G4bool GetRefreshAtEndOfEvent () const;
89  // If true, the visualization manager will request viewer to refresh
90  // "transient" objects, such as hits, at end of event.  Otherwise
91  // they will be accumulated.
92
93  G4int GetMaxNumberOfKeptEvents() const;
94  // If RefreshAtEndOfEvent is false, events of the current run are
95  // kept up to this maximum number.  A negative value means all
96  // events of current run are kept.  The events are available for
97  // viewing at the end of run, but are deleted just before the start
98  // of the next run.
99
100  G4bool GetRefreshAtEndOfRun () const;
101  // If true, the visualization manager will request viewer to refresh
102  // "transient" objects, such as hits, at end of run.  Otherwise
103  // they will be accumulated.
104
105  //////////////////////////////////////////////
106  // Add and Set functions...
107
108  G4bool AddRunDurationModel (G4VModel*, G4bool warn = false);
109  // Adds models of type which are expected to last for the duration
110  // of the run, for example geometry volumes.
111  // Returns false if model is already in the list.
112  // Prints warnings if warn is true.
113
114  G4bool AddWorldIfEmpty (G4bool warn = false);
115  // In some situations, if the user asks for a drawing and has not
116  // yet set any run duration models it makes sense to put the "world"
117  // in there by default.
118  // Returns false if model is already in the list.
119  // Prints warnings if warn is true.
120
121  G4bool AddEndOfEventModel (G4VModel*, G4bool warn = false);
122  // Adds models of type which are described at the end of event when
123  // the scene is current.
124  // Returns false if model is already in the list.
125  // Prints warnings if warn is true.
126
127  std::vector<G4VModel*>& SetRunDurationModelList ();
128  // Allows you to change the model list - do with care!
129
130  std::vector<G4VModel*>& SetEndOfEventModelList ();
131  // Allows you to change the model list - do with care!
132
133  void SetRefreshAtEndOfEvent(G4bool);
134  // If set true, the visualization manager will request viewer to
135  // refresh "transient" objects, such as hits, at end of event.
136  // Otherwise they will be accumulated.
137
138  void SetMaxNumberOfKeptEvents(G4int);
139  // If RefreshAtEndOfEvent is false, events of the current run are
140  // kept up to this maximum number.  A negative value means all
141  // events of current run are kept.  The events are available for
142  // viewing at the end of run, but are deleted just before the start
143  // of the next run.
144
145  void SetRefreshAtEndOfRun(G4bool);
146  // If set true, the visualization manager will request viewer to
147  // refresh "transient" objects, such as hits, at end of run.
148  // Otherwise they will be accumulated.
149
150  //////////////////////////////////////////////
151  // Other functions...
152
153  void CalculateExtent();
154  // (Re-)calculates the extent from the extents of its models.
155
156private:
157  G4String fName;
158  std::vector<G4VModel*> fRunDurationModelList;
159  std::vector<G4VModel*> fEndOfEventModelList;
160  G4VisExtent fExtent;
161  G4Point3D   fStandardTargetPoint;
162  G4bool      fRefreshAtEndOfEvent;
163  G4bool      fRefreshAtEndOfRun;
164  G4int       fMaxNumberOfKeptEvents;
165};
166
167#include "G4Scene.icc"
168
169#endif
Note: See TracBrowser for help on using the repository browser.