Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
visualization
XXX
include
G4XXXSGSceneHandler.hh
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
// $Id$
28
//
29
//
30
// John Allison 10th March 2006
31
// A template for a sophisticated graphics driver with a scene graph.
32
//?? Lines beginning like this require specialisation for your driver.
33
34
#ifndef G4XXXSGSCENEHANDLER_HH
35
#define G4XXXSGSCENEHANDLER_HH
36
37
#include "
G4VSceneHandler.hh
"
38
39
#include "
G4PhysicalVolumeModel.hh
"
40
#include <iostream>
41
42
namespace
JA {
43
// Ad hoc tree class and utilities.
44
45
typedef
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID
PVNodeID
;
46
typedef
std::vector<PVNodeID>
PVPath
;
47
48
struct
Node
{
49
Node
(
PVNodeID
pvNodeID =
PVNodeID
(),
G4int
index
= -1):
50
fPVNodeID
(pvNodeID),
fIndex
(
index
) {}
51
PVNodeID
fPVNodeID
;
52
G4int
fIndex
;
53
std::vector<Node*>
fDaughters
;
54
};
55
56
void
Insert
(
const
PVNodeID
* pvPath,
size_t
pathLength,
57
G4int
index
,
Node
* node);
58
59
void
PrintTree
(std::ostream&,
Node
*);
60
61
void
Clear
(
Node
*);
62
}
63
64
typedef
JA::Node
SceneGraph
;
65
66
class
G4XXXSGSceneHandler
:
public
G4VSceneHandler
{
67
68
friend
class
G4XXXSGViewer
;
69
70
public
:
71
G4XXXSGSceneHandler
(
G4VGraphicsSystem
& system,
72
const
G4String
&
name
);
73
virtual
~G4XXXSGSceneHandler
();
74
76
// Optional virtual functions...
77
void
AddSolid
(
const
G4Box
&);
78
// Further optional AddSolid functions. Explicitly invoke base
79
// class methods if not otherwise defined to avoid warnings about
80
// hiding of base class methods.
81
void
AddSolid
(
const
G4Cons
& cons)
82
{
G4VSceneHandler::AddSolid
(cons);}
83
void
AddSolid
(
const
G4Tubs
& tubs)
84
{
G4VSceneHandler::AddSolid
(tubs);}
85
void
AddSolid
(
const
G4Trd
& trd)
86
{
G4VSceneHandler::AddSolid
(trd);}
87
void
AddSolid
(
const
G4Trap
& trap)
88
{
G4VSceneHandler::AddSolid
(trap);}
89
void
AddSolid
(
const
G4Sphere
& sphere)
90
{
G4VSceneHandler::AddSolid
(sphere);}
91
void
AddSolid
(
const
G4Para
& para)
92
{
G4VSceneHandler::AddSolid
(para);}
93
void
AddSolid
(
const
G4Torus
& torus)
94
{
G4VSceneHandler::AddSolid
(torus);}
95
void
AddSolid
(
const
G4Polycone
& polycone)
96
{
G4VSceneHandler::AddSolid
(polycone);}
97
void
AddSolid
(
const
G4Polyhedra
& polyhedra)
98
{
G4VSceneHandler::AddSolid
(polyhedra);}
99
void
AddSolid
(
const
G4VSolid
& solid)
100
{
G4VSceneHandler::AddSolid
(solid);}
101
// More optional functions...
102
// void AddCompound(const G4VTrajectory&);
103
// void AddCompound(const G4VHit&);
104
// void AddCompound(const G4THitsMap<G4double>&);
105
void
PreAddSolid
(
const
G4Transform3D
& objectTransformation,
106
const
G4VisAttributes
&);
107
void
PostAddSolid
();
108
110
// Required implementation of pure virtual functions...
111
112
void
AddPrimitive
(
const
G4Polyline
&);
113
void
AddPrimitive
(
const
G4Text
&);
114
void
AddPrimitive
(
const
G4Circle
&);
115
void
AddPrimitive
(
const
G4Square
&);
116
void
AddPrimitive
(
const
G4Polyhedron
&);
117
void
AddPrimitive
(
const
G4NURBS
&);
118
// Further optional AddPrimitive methods. Explicitly invoke base
119
// class methods if not otherwise defined to avoid warnings about
120
// hiding of base class methods.
121
void
AddPrimitive
(
const
G4Polymarker
& polymarker)
122
{
G4VSceneHandler::AddPrimitive
(polymarker);}
123
void
AddPrimitive
(
const
G4Scale
&
scale
)
124
{
G4VSceneHandler::AddPrimitive
(scale);}
125
// Further related optional virtual functions...
126
void
BeginPrimitives
(
const
G4Transform3D
& objectTransformation);
127
void
EndPrimitives
();
128
130
// Further optional virtual functions...
131
132
// void BeginModeling();
133
// void EndModeling();
134
136
// Administration functions.
137
138
void
ClearStore
();
139
void
ClearTransientStore
();
140
141
protected
:
142
143
static
G4int
fSceneIdCount
;
// Counter for XXXSG scene handlers.
144
145
// Utility for PreAddSolid and BeginPrimitives.
146
void
CreateCurrentItem
(
const
G4String
&);
147
148
//?? Define the scene graph. (For emulation, use an ad hoc tree class.)
149
SceneGraph
fSceneGraph
;
150
151
private
:
152
153
#ifdef G4XXXFileDEBUG
154
void
PrintThings();
155
#endif
156
157
};
158
159
#endif
Generated on Sat May 25 2013 14:34:19 for Geant4 by
1.8.4