55 template<
typename Po
intT>
101 template<
typename Po
intT>
124 template<
typename Position>
126 const double& range);
129 void *
operator new(size_t);
130 void operator delete(
void *);
145 template<
typename Position>
148 for (
size_t i = 0; i <
fDim; i++)
167 for (
size_t i = 0; i <
fDim; i++)
174 template<
typename Position>
177 for (
size_t i = 0; i <
fDim; i++)
179 if (pos[i] <
fMin[i])
183 if (pos[i] >
fMax[i])
190 template<
typename Position>
195 for (
size_t i = 0; i <
fDim; i++)
197 if (pos[i] <
fMin[i])
199 result +=
sqr(
fMin[i] - pos[i]);
201 else if (pos[i] >
fMax[i])
203 result +=
sqr(
fMax[i] - pos[i]);
206 if (result >= *bestmatch)
return false;
233 if (
this == &rhs)
return *
this;
242 template<
typename Position>
245 const double& range_sq,
251 template<
typename Position>
255 double *result_dist_sq,
258 template<
typename Position>
262 std::vector<G4KDNode_Base*>& result,
263 double *result_dist_sq,
280 #endif // G4KDTREE_HH
G4KDNode_Base * GetRoot()
void Print(std::ostream &out=G4cout) const
void SetMinMax(const Position &min, const Position &max)
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)
G4KDTree is used by the ITManager to locate the neareast neighbours.
#define G4ThreadLocalStatic
G4KDTreeResultHandle Nearest(const Position &pos)
HyperRect(const HyperRect &rect)
G4GLOB_DLL std::ostream G4cout
bool CompareDistSqr(const Position &pos, const double *bestmatch)
void InactiveNode(G4KDNode_Base *)
G4KDNode stores one entity in G4KDTree This class is for internal use only.
void Extend(const Position &pos)
void Free(G4KDNode_Base *&)
G4KDTreeResultHandle NearestInRange(const Position &pos, const double &range)
void __InsertMap(G4KDNode_Base *node)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
HyperRect & operator=(const HyperRect &rhs)
void __Clear_Rec(G4KDNode_Base *node)
void __NearestToPosition(G4KDNode_Base *node, const Position &pos, G4KDNode_Base *&result, double *result_dist_sq, HyperRect *fRect)
G4KDNode_Base * Insert(PointT *pos)
int __NearestInRange(G4KDNode_Base *node, const Position &pos, const double &range_sq, const double &range, G4KDTreeResult &list, int ordered, G4KDNode_Base *source_node=0)
G4ThreadLocalStatic G4Allocator< G4KDTree > * fgAllocator
void NoticeNodeDeactivation()
static const G4double pos
G4KDNode_Base * InsertMap(PointT *pos)
G4KDTreeResult enables to go through the nearest entities found by G4KDTree.