54template<
typename Po
intT>
class G4KDNode;
99 template<
typename Po
intT>
122 template<
typename Position>
124 const double& range);
127 void *
operator new(size_t);
128 void operator delete(
void *);
143 template<
typename Position>
144 void SetMinMax(
const Position& min,
const Position& max)
146 for (
size_t i = 0; i <
fDim; i++)
165 for (
size_t i = 0; i <
fDim; i++)
172 template<
typename Position>
175 for (
size_t i = 0; i <
fDim; i++)
177 if (pos[i] <
fMin[i])
181 if (pos[i] >
fMax[i])
188 template<
typename Position>
193 for (
size_t i = 0; i <
fDim; i++)
195 if (pos[i] <
fMin[i])
197 result +=
sqr(
fMin[i] - pos[i]);
199 else if (pos[i] >
fMax[i])
201 result +=
sqr(
fMax[i] - pos[i]);
204 if (result >= *bestmatch)
return false;
231 if (
this == &rhs)
return *
this;
240 template<
typename Position>
243 const double& range_sq,
249 template<
typename Position>
253 double *result_dist_sq,
256 template<
typename Position>
260 std::vector<G4KDNode_Base*>& result,
261 double *result_dist_sq,
276#include "G4KDTree.icc"
void InactiveNode(G4KDNode_Base *)
void Free(G4KDNode_Base *&)
G4GLOB_DLL std::ostream G4cout
HyperRect(const HyperRect &rect)
void SetMinMax(const Position &min, const Position &max)
void Extend(const Position &pos)
bool CompareDistSqr(const Position &pos, const double *bestmatch)
int __NearestInRange(G4KDNode_Base *node, const Position &pos, const double &range_sq, const double &range, G4KDTreeResult &list, int ordered, G4KDNode_Base *source_node=0)
G4KDNode_Base * Insert(PointT *pos)
G4KDTreeResultHandle Nearest(const Position &pos)
void __NearestToPosition(G4KDNode_Base *node, const Position &pos, G4KDNode_Base *&result, double *result_dist_sq, HyperRect *fRect)
void NoticeNodeDeactivation()
G4KDNode_Base * Insert(const PointT &pos)
void Print(std::ostream &out=G4cout) const
void __NearestToNode(G4KDNode_Base *source_node, G4KDNode_Base *node, const Position &pos, std::vector< G4KDNode_Base * > &result, double *result_dist_sq, HyperRect *fRect, int &nbresult)
G4KDNode_Base * GetRoot()
G4KDTreeResultHandle NearestInRange(const Position &pos, const double &range)
void __InsertMap(G4KDNode_Base *node)
static G4Allocator< G4KDTree > *& fgAllocator()
G4KDNode_Base * InsertMap(PointT *pos)
void __Clear_Rec(G4KDNode_Base *node)