ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
tree
geant4-10.6-release
config
environments
examples
source
analysis
digits_hits
error_propagation
event
externals
g3tog4
geometry
global
graphics_reps
intercoms
interfaces
materials
parameterisations
particles
persistency
physics_lists
processes
readout
run
track
tracking
visualization
externals
FukuiRenderer
gMocren
HepRep
include
src
BHepRepWriter.cc
DefaultHepRep.cc
DefaultHepRepAction.cc
DefaultHepRepAttDef.cc
DefaultHepRepAttribute.cc
DefaultHepRepAttValue.cc
DefaultHepRepDefinition.cc
DefaultHepRepFactory.cc
DefaultHepRepInstance.cc
DefaultHepRepInstanceTree.cc
DefaultHepRepPoint.cc
DefaultHepRepTreeID.cc
DefaultHepRepType.cc
DefaultHepRepTypeTree.cc
DeflateOutputStreamBuffer.cc
G4HepRep.cc
G4HepRepFile.cc
G4HepRepFileSceneHandler.cc
G4HepRepFileViewer.cc
G4HepRepFileXMLWriter.cc
G4HepRepMessenger.cc
G4HepRepSceneHandler.cc
G4HepRepViewer.cc
GZIPOutputStream.cc
GZIPOutputStreamBuffer.cc
IndentPrintWriter.cc
XMLHepRepFactory.cc
XMLHepRepWriter.cc
XMLWriter.cc
ZipOutputStream.cc
ZipOutputStreamBuffer.cc
management
modeling
OpenGL
OpenInventor
RayTracer
Tree
VRML
XXX
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4HepRepViewer.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4HepRepViewer.cc
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
32
//HepRep
33
#include "
HEPREP/HepRep.h
"
34
35
//G4
36
#include "
G4Types.hh
"
37
//#include "G4VInteractorManager.hh"
38
#include "
G4Scene.hh
"
39
#include "
G4HepRep.hh
"
40
#include "
G4HepRepMessenger.hh
"
41
#include "
G4HepRepSceneHandler.hh
"
42
//This
43
#include "
G4HepRepViewer.hh
"
44
45
using namespace
HEPREP;
46
using namespace
std;
47
48
G4HepRepViewer::G4HepRepViewer
(
G4VSceneHandler
& sceneHandler,
const
G4String
&
name
)
49
:
G4VViewer
(sceneHandler, sceneHandler.IncrementViewCount(), name),
50
geometryIncluded(
false
) {
51
52
#ifdef SDEBUG
53
cout <<
"G4HepRepViewer::G4HepRepViewer "
<< name << endl;
54
#endif
55
56
// Make changes to view parameters for HepRep...
57
fVP
.
SetCulling
(
false
);
58
fDefaultVP
.
SetCulling
(
false
);
59
}
60
61
62
63
G4HepRepViewer::~G4HepRepViewer
() {
64
#ifdef SDEBUG
65
cout <<
"G4HepRepViewer::~G4HepRepViewer"
<< endl;
66
#endif
67
G4HepRep
* pHepRepSystem =
68
dynamic_cast<
G4HepRep
*
>
(
GetSceneHandler
()->
GetGraphicsSystem
());
69
if
(pHepRepSystem) pHepRepSystem->
removeViewer
();
70
}
71
72
73
void
G4HepRepViewer::ClearView
() {
74
#ifdef SDEBUG
75
cout <<
"G4HepRepViewer::ClearView"
<< endl;
76
#endif
77
}
78
79
void
G4HepRepViewer::SetView
() {
80
#ifdef SDEBUG
81
cout <<
"G4HepRepViewer::SetView"
<< endl;
82
#endif
83
}
84
85
86
/* NOTE:
87
/run/beamOn calls ShowView for every event (unless accumulate is set)
88
/vis/viewer/flush calls /vis/viewer/refresh followed by /vis/viewer/update
89
/vis/viewer/refresh calls SetView, ClearView, DrawView
90
/vis/viewer/update calls ShowView
91
*/
92
void
G4HepRepViewer::DrawView
() {
93
#ifdef SDEBUG
94
cout <<
"G4HepRepViewer::DrawView"
<< endl;
95
#endif
96
if
(!
geometryIncluded
) {
97
// draws the geometry
98
NeedKernelVisit
();
99
ProcessView
();
100
geometryIncluded
=
true
;
101
}
102
}
103
104
void
G4HepRepViewer::ShowView
() {
105
#ifdef SDEBUG
106
cout <<
"G4HepRepViewer::ShowView"
<< endl;
107
#endif
108
G4VViewer::ShowView
();
109
110
G4HepRepSceneHandler
* sceneHandler =
dynamic_cast<
G4HepRepSceneHandler
*
>
(
GetSceneHandler
());
111
if
(sceneHandler) {
112
if
(sceneHandler->
closeHepRep
()) {
113
sceneHandler->
openHepRep
();
114
115
G4HepRepMessenger
* messenger =
G4HepRepMessenger::GetInstance
();
116
if
(messenger->
appendGeometry
())
geometryIncluded
=
false
;
117
}
118
}
119
}
120
121
void
G4HepRepViewer::FinishView
() {
122
#ifdef SDEBUG
123
cout <<
"G4HepRepViewer::FinishView"
<< endl;
124
#endif
125
G4VViewer::FinishView
();
126
}
127
128
void
G4HepRepViewer::reset
() {
129
geometryIncluded
=
false
;
130
}
geant4
tree
geant4-10.6-release
source
visualization
HepRep
src
G4HepRepViewer.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:55
using
1.8.2 with
ECCE GitHub integration