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
processes
electromagnetic
dna
management
include
G4KDNode.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
// $Id: G4KDNode.hh 64057 2012-10-30 15:04:49Z gcosmo $
27
//
28
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29
//
30
// WARNING : This class is released as a prototype.
31
// It might strongly evolve or even disapear in the next releases.
32
//
33
// History:
34
// -----------
35
// 10 Oct 2011 M.Karamitros created
36
//
37
// -------------------------------------------------------------------
38
39
#ifndef G4KDNODE_HH
40
#define G4KDNODE_HH
41
42
#include <list>
43
44
class
G4KDTree
;
45
50
class
G4KDNode
51
{
52
53
public
:
54
// For root node :
55
// parent = 0, axis = 0, side = 0
56
G4KDNode
(
G4KDTree
*,
const
double
*
/*position*/
,
void
*
/*data*/
,
57
G4KDNode
*
/*parent*/
,
int
axis0);
58
virtual
~G4KDNode
();
59
60
inline
G4KDTree
*
GetTree
();
61
inline
void
SetTree
(
G4KDTree
*);
62
63
inline
const
double
*
GetPosition
();
64
65
int
GetDim
();
66
67
inline
int
GetAxis
();
68
inline
void
*
GetData
();
69
inline
void
SetData
(
void
*);
70
inline
G4KDNode
*
GetParent
();
71
inline
G4KDNode
*
GetLeft
();
72
inline
G4KDNode
*
GetRight
();
73
74
G4KDNode
*
FindParent
(
const
double
* x0);
75
G4KDNode
*
Insert
(
const
double
*
p
,
void
*
data
);
76
77
int
Insert
(
G4KDNode
* newNode,
double
* p);
78
int
Insert
(
G4KDNode
* newNode,
const
double
&
x
,
const
double
&
y
,
const
double
&
z
);
79
int
Insert
(
G4KDNode
* newNode);
80
81
void
InactiveNode
();
82
void
PullSubTree
();
83
void
RetrieveNodeList
(std::list<G4KDNode*>& node_list);
84
85
protected
:
86
87
int
SetPosition
(
const
double
* newposition);
88
89
//°°°°°°°°°°°
90
// Members
91
//°°°°°°°°°°°
92
double
*
fPosition
;
93
int
fAxis
;
// axis : x, y, z ...
94
void
*
fData
;
95
int
fSide
;
// left/right
96
/* fSide == 0 : Is the root node
97
* fSide == -1 : It is the left of the parent node
98
* fSide == 1 : It is the right of the parent node
99
*/
100
101
G4KDTree
*
fTree
;
102
G4KDNode
*
fLeft
, *
fRight
, *
fParent
;
103
/* Left : fLeft->fPosition[axis] < this->fPosition[axis]
104
* Right : fRight->fPosition[axis] > this->fPosition[axis]
105
* Root node : fParent = 0
106
*/
107
private
:
108
G4KDNode
(
const
G4KDNode
&
right
);
109
G4KDNode
& operator=(
const
G4KDNode
&
right
);
110
};
111
112
inline
int
G4KDNode::GetAxis
()
113
{
114
return
fAxis
;
115
}
116
117
inline
void
*
G4KDNode::GetData
()
118
{
119
return
fData
;
120
}
121
122
inline
void
G4KDNode::SetData
(
void
*
data
)
123
{
124
fData
=
data
;
125
}
126
127
inline
const
double
*
G4KDNode::GetPosition
()
128
{
129
return
fPosition
;
130
}
131
132
inline
G4KDNode
*
G4KDNode::GetParent
()
133
{
134
return
fParent
;
135
}
136
137
inline
G4KDNode
*
G4KDNode::GetLeft
()
138
{
139
return
fLeft
;
140
}
141
142
inline
G4KDNode
*
G4KDNode::GetRight
()
143
{
144
return
fRight
;
145
}
146
147
inline
G4KDTree
*
G4KDNode::GetTree
()
148
{
149
return
fTree
;
150
}
151
152
inline
void
G4KDNode::SetTree
(
G4KDTree
*
tree
)
153
{
154
fTree
=
tree
;
155
}
156
157
#endif // G4KDNODE_HH
Generated on Sat May 25 2013 14:33:30 for Geant4 by
1.8.4