Geant4
10.03
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
G4HepRepViewer.cc
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
// $Id: G4HepRepViewer.cc 68043 2013-03-13 14:27:49Z gcosmo $
27
//
28
33
//HepRep
34
#include "HEPREP/HepRep.h"
35
36
//G4
37
#include "
G4Types.hh
"
38
//#include "G4VInteractorManager.hh"
39
#include "
G4Scene.hh
"
40
#include "
G4HepRep.hh
"
41
#include "
G4HepRepMessenger.hh
"
42
#include "
G4HepRepSceneHandler.hh
"
43
//This
44
#include "
G4HepRepViewer.hh
"
45
46
using namespace
HEPREP
;
47
using namespace
std
;
48
49
G4HepRepViewer::G4HepRepViewer
(
G4VSceneHandler
& sceneHandler,
const
G4String
&
name
)
50
:
G4VViewer
(sceneHandler, sceneHandler.IncrementViewCount(), name),
51
geometryIncluded(false) {
52
53
#ifdef SDEBUG
54
cout <<
"G4HepRepViewer::G4HepRepViewer "
<< name << endl;
55
#endif
56
57
// Make changes to view parameters for HepRep...
58
fVP
.
SetCulling
(
false
);
59
fDefaultVP
.
SetCulling
(
false
);
60
}
61
62
63
64
G4HepRepViewer::~G4HepRepViewer
() {
65
#ifdef SDEBUG
66
cout <<
"G4HepRepViewer::~G4HepRepViewer"
<< endl;
67
#endif
68
G4HepRep
* pHepRepSystem =
69
dynamic_cast<
G4HepRep
*
>
(
GetSceneHandler
()->
GetGraphicsSystem
());
70
if
(pHepRepSystem) pHepRepSystem->
removeViewer
();
71
}
72
73
74
void
G4HepRepViewer::ClearView
() {
75
#ifdef SDEBUG
76
cout <<
"G4HepRepViewer::ClearView"
<< endl;
77
#endif
78
}
79
80
void
G4HepRepViewer::SetView
() {
81
#ifdef SDEBUG
82
cout <<
"G4HepRepViewer::SetView"
<< endl;
83
#endif
84
}
85
86
87
/* NOTE:
88
/run/beamOn calls ShowView for every event (unless accumulate is set)
89
/vis/viewer/flush calls /vis/viewer/refresh followed by /vis/viewer/update
90
/vis/viewer/refresh calls SetView, ClearView, DrawView
91
/vis/viewer/update calls ShowView
92
*/
93
void
G4HepRepViewer::DrawView
() {
94
#ifdef SDEBUG
95
cout <<
"G4HepRepViewer::DrawView"
<< endl;
96
#endif
97
if
(!
geometryIncluded
) {
98
// draws the geometry
99
NeedKernelVisit
();
100
ProcessView
();
101
geometryIncluded
=
true
;
102
}
103
}
104
105
void
G4HepRepViewer::ShowView
() {
106
#ifdef SDEBUG
107
cout <<
"G4HepRepViewer::ShowView"
<< endl;
108
#endif
109
G4VViewer::ShowView
();
110
111
G4HepRepSceneHandler
* sceneHandler =
dynamic_cast<
G4HepRepSceneHandler
*
>
(
GetSceneHandler
());
112
if
(sceneHandler) {
113
if
(sceneHandler->
closeHepRep
()) {
114
sceneHandler->
openHepRep
();
115
116
G4HepRepMessenger
* messenger =
G4HepRepMessenger::GetInstance
();
117
if
(messenger->
appendGeometry
())
geometryIncluded
=
false
;
118
}
119
}
120
}
121
122
void
G4HepRepViewer::FinishView
() {
123
#ifdef SDEBUG
124
cout <<
"G4HepRepViewer::FinishView"
<< endl;
125
#endif
126
G4VViewer::FinishView
();
127
}
128
129
void
G4HepRepViewer::reset
() {
130
geometryIncluded
=
false
;
131
}
G4HepRepSceneHandler::openHepRep
void openHepRep()
Definition:
G4HepRepSceneHandler.cc:265
G4Scene.hh
G4Types.hh
G4HepRepViewer::FinishView
void FinishView()
Definition:
G4HepRepViewer.cc:122
G4HepRepSceneHandler::closeHepRep
bool closeHepRep(bool final=false)
Returns true if the HepRep was (already) closed, false if the HepRep is still open.
Definition:
G4HepRepSceneHandler.cc:295
G4VViewer::ShowView
virtual void ShowView()
Definition:
G4VViewer.cc:103
std
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:77
G4HepRepViewer::SetView
void SetView()
Definition:
G4HepRepViewer.cc:80
G4VViewer::fDefaultVP
G4ViewParameters fDefaultVP
Definition:
G4VViewer.hh:206
G4VSceneHandler
Definition:
G4VSceneHandler.hh:61
G4HepRepSceneHandler
Definition:
G4HepRepSceneHandler.hh:64
G4VViewer
Definition:
G4VViewer.hh:46
G4HepRepMessenger::GetInstance
static G4HepRepMessenger * GetInstance()
Definition:
G4HepRepMessenger.cc:34
G4VSceneHandler::GetGraphicsSystem
G4VGraphicsSystem * GetGraphicsSystem() const
G4HepRepViewer::reset
void reset()
Definition:
G4HepRepViewer.cc:129
G4HepRep.hh
G4VViewer::fVP
G4ViewParameters fVP
Definition:
G4VViewer.hh:205
G4HepRepMessenger::appendGeometry
virtual G4bool appendGeometry()
Definition:
G4HepRepMessenger.cc:254
G4HepRepMessenger.hh
G4HepRep::removeViewer
void removeViewer()
Definition:
G4HepRep.cc:84
G4HepRepViewer::ShowView
void ShowView()
Definition:
G4HepRepViewer.cc:105
G4VViewer::GetSceneHandler
G4VSceneHandler * GetSceneHandler() const
G4HepRepViewer::ClearView
void ClearView()
Definition:
G4HepRepViewer.cc:74
G4HepRep
Definition:
G4HepRep.hh:38
G4HepRepMessenger
Definition:
G4HepRepMessenger.hh:41
G4HepRepViewer::~G4HepRepViewer
virtual ~G4HepRepViewer()
Definition:
G4HepRepViewer.cc:64
G4VViewer::NeedKernelVisit
void NeedKernelVisit()
Definition:
G4VViewer.cc:78
G4HepRepViewer::geometryIncluded
bool geometryIncluded
Definition:
G4HepRepViewer.hh:55
HEPREP
G4VViewer::ProcessView
void ProcessView()
Definition:
G4VViewer.cc:105
G4HepRepViewer::G4HepRepViewer
G4HepRepViewer(G4VSceneHandler &scene, const G4String &name="")
Definition:
G4HepRepViewer.cc:49
G4HepRepViewer::DrawView
void DrawView()
Definition:
G4HepRepViewer.cc:93
G4ViewParameters::SetCulling
void SetCulling(G4bool)
G4VViewer::FinishView
virtual void FinishView()
Definition:
G4VViewer.cc:101
G4HepRepSceneHandler.hh
G4String
Definition:
G4String.hh:45
G4HepRepViewer.hh
geant4.10.03
source
visualization
HepRep
src
G4HepRepViewer.cc
Generated on Thu Feb 14 2002 02:29:29 for Geant4 by
1.8.8