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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4OpenInventor.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4OpenInventor.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
//
28
#ifdef G4VIS_BUILD_OI_DRIVER
29
30
// this :
31
#include "
G4OpenInventor.hh
"
32
33
#include "
HEPVis/nodes/SoBox.h
"
34
#include "
HEPVis/nodes/SoTubs.h
"
35
#include "
HEPVis/nodes/SoCons.h
"
36
#include "
HEPVis/nodes/SoTrd.h
"
37
#include "
HEPVis/nodes/SoTrap.h
"
38
#include "
HEPVis/nodes/SoMarkerSet.h
"
39
#include "
HEPVis/nodes/SoImageWriter.h
"
40
#include "
HEPVis/nodekits/SoDetectorTreeKit.h
"
41
#include "
HEPVis/actions/SoGL2PSAction.h
"
42
#include "
HEPVis/actions/SoCounterAction.h
"
43
#include "
HEPVis/actions/SoAlternateRepAction.h
"
44
45
#include "
Geant4_SoPolyhedron.h
"
46
47
#include "
G4OpenInventorSceneHandler.hh
"
48
49
#include "
G4UImanager.hh
"
50
#include "
G4UIbatch.hh
"
51
52
G4OpenInventor::G4OpenInventor
(
53
const
G4String
name
54
,
const
G4String
nickname
55
,
G4VGraphicsSystem::Functionality
f
56
)
57
:
G4VGraphicsSystem
(name,nickname,f)
58
,interactorManager(0)
59
{
60
}
61
62
G4OpenInventor::~G4OpenInventor
() {}
63
64
void
G4OpenInventor::SetInteractorManager
(
G4VInteractorManager
* im) {
65
interactorManager
= im;
66
}
67
G4VInteractorManager
*
G4OpenInventor::GetInteractorManager
() {
68
return
interactorManager
;
69
}
70
G4VSceneHandler
*
G4OpenInventor::CreateSceneHandler
(
const
G4String
&
name
) {
71
Initialize
();
72
G4VSceneHandler
*
p
=
new
G4OpenInventorSceneHandler (*
this
, name);
73
return
p
;
74
}
75
76
void
G4OpenInventor::InitNodes
()
77
{
78
SoBox::initClass
();
79
SoTubs::initClass
();
80
SoCons::initClass
();
81
SoTrd::initClass
();
82
SoTrap::initClass
();
83
SoDetectorTreeKit::initClass
();
84
HEPVis_SoMarkerSet::initClass
();
85
SoImageWriter::initClass
();
86
Geant4_SoPolyhedron::initClass
();
87
88
SoGL2PSAction::initClass
();
89
SoCounterAction::initClass
();
90
SoAlternateRepAction::initClass
();
91
}
92
93
G4bool
G4OpenInventor::IsUISessionCompatible
()
const
94
{
95
G4bool
isCompatible =
false
;
96
G4UImanager
* ui =
G4UImanager::GetUIpointer
();
97
G4UIsession
*
session
= ui->
GetSession
();
98
99
// If session is a batch session, it may be:
100
// a) this is a batch job (the user has not instantiated any UI session);
101
// b) we are currently processing a UI command, in which case the UI
102
// manager creates a temporary batch session and to find out if there is
103
// a genuine UI session that the user has instantiated we must drill
104
// down through previous sessions to a possible non-batch session.
105
while
(
G4UIbatch
* batch = dynamic_cast<G4UIbatch*>(session)) {
106
session = batch->GetPreviousSession();
107
}
108
109
// OI windows are not appropriate in a batch session.
110
if
(session) {
111
// If non-zero, this is the originating non-batch session
112
// The user has instantiated a UI session...
113
isCompatible =
true
;
114
}
115
116
return
isCompatible;
117
}
118
119
#endif
geant4
tree
geant4-10.6-release
source
visualization
OpenInventor
src
G4OpenInventor.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:57
using
1.8.2 with
ECCE GitHub integration