Geant4
10.00.p02
|
G4KDTree is used by the ITManager to locate the neareast neighbours. More...
#include <G4KDTree.hh>
Public Member Functions | |
G4KDTree (int dim=3) | |
virtual | ~G4KDTree () |
void | Clear () |
int | GetDim () |
void | SetDataDestructor (void(*fDestr)(void *)) |
int | GetNbNodes () |
G4KDNode * | GetRoot () |
G4KDNode * | InsertMap (const double &x, const double &y, const double &z, void *data) |
G4KDNode * | InsertMap (const double *pos, void *data) |
void | Build () |
G4KDNode * | Insert (const double *pos, void *data) |
G4KDNode * | Insert (const double &x, const double &y, const double &z, void *data) |
G4KDTreeResultHandle | Nearest (const double *pos) |
G4KDTreeResultHandle | Nearest (const double &x, const double &y, const double &z) |
G4KDTreeResultHandle | Nearest (G4KDNode *node) |
G4KDTreeResultHandle | NearestInRange (const double *pos, const double &range) |
G4KDTreeResultHandle | NearestInRange (const double &x, const double &y, const double &z, const double &range) |
G4KDTreeResultHandle | NearestInRange (G4KDNode *node, const double &range) |
Protected Member Functions | |
void | __Clear_Rec (G4KDNode *node) |
int | __NearestInRange (G4KDNode *node, const double *pos, const double &range_sq, const double &range, G4KDTreeResult &list, int ordered, G4KDNode *source_node=0) |
void | __NearestToPosition (G4KDNode *node, const double *pos, G4KDNode *&result, double *result_dist_sq, struct HyperRect *fRect) |
void | __NearestToNode (G4KDNode *source_node, G4KDNode *node, const double *pos, std::vector< G4KDNode * > &result, double *result_dist_sq, struct HyperRect *fRect, int &nbresult) |
Protected Attributes | |
G4KDNode * | fRoot |
Private Attributes | |
int | fDim |
struct HyperRect * | fRect |
void(* | fDestr )(void *) |
int | fNbNodes |
G4KDMap * | fKDMap |
Friends | |
class | G4KDNode |
G4KDTree is used by the ITManager to locate the neareast neighbours.
A kdtree sorts out node in such a way that it reduces the number of node check. The results of this search can be retrieved by G4KDTreeResultHandle.
Definition at line 62 of file G4KDTree.hh.
G4KDTree::G4KDTree | ( | int | dim = 3 | ) |
|
virtual |
Definition at line 179 of file G4KDTree.cc.
References __Clear_Rec(), fKDMap, fRect, and fRoot.
|
protected |
Definition at line 206 of file G4KDTree.cc.
References fDestr, G4KDNode::GetData(), G4KDNode::GetLeft(), G4KDNode::GetRight(), and G4KDNode::SetData().
Referenced by Clear(), and ~G4KDTree().
|
protected |
Definition at line 303 of file G4KDTree.cc.
References DBL_MAX, fDim, G4KDNode::GetAxis(), GetData(), G4KDNode::GetLeft(), G4KDNode::GetPosition(), G4KDNode::GetRight(), G4KDTreeResult::Insert(), pos, and sqr().
Referenced by NearestInRange().
|
protected |
Definition at line 462 of file G4KDTree.cc.
References HyperRect::CompareDistSqr(), fDim, G4KDNode::GetAxis(), G4KDNode::GetData(), G4KDNode::GetLeft(), HyperRect::GetMax(), HyperRect::GetMin(), G4KDNode::GetPosition(), G4KDNode::GetRight(), and sqr().
Referenced by Nearest().
|
protected |
Definition at line 350 of file G4KDTree.cc.
References HyperRect::CompareDistSqr(), fDim, G4KDNode::GetAxis(), G4KDNode::GetData(), G4KDNode::GetLeft(), HyperRect::GetMax(), HyperRect::GetMin(), G4KDNode::GetPosition(), G4KDNode::GetRight(), and sqr().
Referenced by Nearest().
void G4KDTree::Build | ( | ) |
Definition at line 241 of file G4KDTree.cc.
References HyperRect::Extend(), fDim, fKDMap, fRect, fRoot, G4KDNode::GetPosition(), G4KDMap::GetSize(), G4KDNode::Insert(), n, and G4KDMap::PopOutMiddle().
void G4KDTree::Clear | ( | ) |
Definition at line 193 of file G4KDTree.cc.
References __Clear_Rec(), fNbNodes, fRect, and fRoot.
|
inline |
Definition at line 143 of file G4KDTree.hh.
References fDim.
Referenced by G4KDNode::GetDim(), and G4KDTreeResult::GetItem().
|
inline |
Definition at line 83 of file G4KDTree.hh.
References fNbNodes.
|
inline |
Definition at line 84 of file G4KDTree.hh.
References fRoot.
G4KDNode * G4KDTree::Insert | ( | const double * | pos, |
void * | data | ||
) |
Definition at line 263 of file G4KDTree.cc.
References HyperRect::Extend(), fDim, fNbNodes, fRect, fRoot, G4KDNode, and G4KDNode::Insert().
Referenced by Insert().
G4KDNode * G4KDTree::Insert | ( | const double & | x, |
const double & | y, | ||
const double & | z, | ||
void * | data | ||
) |
G4KDNode * G4KDTree::InsertMap | ( | const double & | x, |
const double & | y, | ||
const double & | z, | ||
void * | data | ||
) |
Definition at line 224 of file G4KDTree.cc.
References z.
G4KDNode * G4KDTree::InsertMap | ( | const double * | pos, |
void * | data | ||
) |
Definition at line 233 of file G4KDTree.cc.
References fKDMap, G4KDNode, and G4KDMap::Insert().
G4KDTreeResultHandle G4KDTree::Nearest | ( | const double * | pos | ) |
Definition at line 428 of file G4KDTree.cc.
References __NearestToPosition(), DBL_MAX, fRect, and fRoot.
Referenced by Nearest().
G4KDTreeResultHandle G4KDTree::Nearest | ( | const double & | x, |
const double & | y, | ||
const double & | z | ||
) |
Definition at line 594 of file G4KDTree.cc.
References Nearest(), pos, and z.
G4KDTreeResultHandle G4KDTree::Nearest | ( | G4KDNode * | node | ) |
Definition at line 550 of file G4KDTree.cc.
References __NearestToNode(), DBL_MAX, fRect, fRoot, G4cout, G4endl, G4KDNode::GetPosition(), and pos.
G4KDTreeResultHandle G4KDTree::NearestInRange | ( | const double * | pos, |
const double & | range | ||
) |
Definition at line 603 of file G4KDTree.cc.
References __NearestInRange(), fRoot, and sqr().
Referenced by NearestInRange().
G4KDTreeResultHandle G4KDTree::NearestInRange | ( | const double & | x, |
const double & | y, | ||
const double & | z, | ||
const double & | range | ||
) |
Definition at line 620 of file G4KDTree.cc.
References NearestInRange(), and z.
G4KDTreeResultHandle G4KDTree::NearestInRange | ( | G4KDNode * | node, |
const double & | range | ||
) |
Definition at line 632 of file G4KDTree.cc.
References __NearestInRange(), fRoot, G4KDNode::GetPosition(), and sqr().
|
inline |
Definition at line 148 of file G4KDTree.hh.
References fDestr.
|
friend |
Definition at line 64 of file G4KDTree.hh.
Referenced by Insert(), and InsertMap().
|
private |
Definition at line 67 of file G4KDTree.hh.
Referenced by __Clear_Rec(), G4KDTree(), and SetDataDestructor().
|
private |
Definition at line 65 of file G4KDTree.hh.
Referenced by __NearestInRange(), __NearestToNode(), __NearestToPosition(), Build(), G4KDTree(), GetDim(), G4KDNode::Insert(), Insert(), and G4KDNode::SetPosition().
|
private |
Definition at line 69 of file G4KDTree.hh.
Referenced by Build(), InsertMap(), and ~G4KDTree().
|
private |
Definition at line 68 of file G4KDTree.hh.
Referenced by Clear(), G4KDTree(), GetNbNodes(), and Insert().
|
private |
Definition at line 66 of file G4KDTree.hh.
Referenced by Build(), Clear(), G4KDTree(), Insert(), Nearest(), and ~G4KDTree().
|
protected |
Definition at line 72 of file G4KDTree.hh.
Referenced by Build(), Clear(), G4KDTree(), GetRoot(), Insert(), Nearest(), NearestInRange(), and ~G4KDTree().