Geant4
10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenInventor.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
//
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
G4OpenInventorSceneHandler.hh
G4OpenInventor.hh
G4bool
bool G4bool
Definition:
G4Types.hh:86
G4UIbatch.hh
G4UImanager.hh
Geant4_SoPolyhedron.h
SoAlternateRepAction.h
SoBox.h
SoCons.h
SoCounterAction.h
SoDetectorTreeKit.h
SoGL2PSAction.h
SoImageWriter.h
SoMarkerSet.h
SoTrap.h
SoTrd.h
SoTubs.h
G4OpenInventor::CreateSceneHandler
G4VSceneHandler * CreateSceneHandler(const G4String &name)
G4OpenInventor::SetInteractorManager
void SetInteractorManager(G4VInteractorManager *)
G4OpenInventor::InitNodes
void InitNodes()
G4OpenInventor::~G4OpenInventor
virtual ~G4OpenInventor()
G4OpenInventor::IsUISessionCompatible
G4bool IsUISessionCompatible() const
G4OpenInventor::G4OpenInventor
G4OpenInventor(const G4String, const G4String, G4VGraphicsSystem::Functionality)
G4OpenInventor::GetInteractorManager
G4VInteractorManager * GetInteractorManager()
G4String
Definition:
G4String.hh:53
G4UIbatch
Definition:
G4UIbatch.hh:47
G4UImanager
Definition:
G4UImanager.hh:58
G4UImanager::GetSession
G4UIsession * GetSession() const
Definition:
G4UImanager.hh:180
G4UImanager::GetUIpointer
static G4UImanager * GetUIpointer()
Definition:
G4UImanager.cc:77
G4UIsession
Definition:
G4UIsession.hh:43
G4VGraphicsSystem
Definition:
G4VGraphicsSystem.hh:45
G4VGraphicsSystem::Functionality
Functionality
Definition:
G4VGraphicsSystem.hh:49
G4VInteractorManager
Definition:
G4VInteractorManager.hh:50
G4VSceneHandler
Definition:
G4VSceneHandler.hh:61
Geant4_SoPolyhedron::initClass
static void initClass()
HEPVis_SoMarkerSet::initClass
static void initClass()
SoAlternateRepAction::initClass
static void initClass(void)
SoBox::initClass
static void initClass()
Class Initializer, required.
SoCons::initClass
static void initClass()
Class Initializer, required.
SoCounterAction::initClass
static void initClass(void)
SoDetectorTreeKit::initClass
static void initClass()
SoGL2PSAction::initClass
static void initClass()
SoImageWriter::initClass
static void initClass()
SoTrap::initClass
static void initClass()
Class Initializer, required.
SoTrd::initClass
static void initClass()
Class Initializer, required.
SoTubs::initClass
static void initClass()
Class Initializer, required.
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:76
geant4-v10.7.0
source
visualization
OpenInventor
src
G4OpenInventor.cc
Generated by
1.9.6