Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4KDTreeResult Class Reference

#include <G4KDTreeResult.hh>

+ Inheritance diagram for G4KDTreeResult:

Public Member Functions

 G4KDTreeResult (G4KDTree *)
 
virtual ~G4KDTreeResult ()
 
void * operator new (size_t)
 
void operator delete (void *)
 
void Insert (double, G4KDNode_Base *)
 
void Clear ()
 
void Sort ()
 
size_t GetSize () const
 
size_t size () const
 
void Rewind ()
 
bool End ()
 
void Next ()
 
template<typename PointT >
PointT * GetItem () const
 
G4KDNode_BaseGetNode () const
 
template<typename PointT >
PointT * GetItemNDistanceSQ (double &) const
 
double GetDistanceSqr () const
 

Protected Attributes

G4KDTreefTree
 
KDTR_parent::iterator fIterator
 

Detailed Description

Definition at line 69 of file G4KDTreeResult.hh.

Constructor & Destructor Documentation

◆ G4KDTreeResult()

G4KDTreeResult::G4KDTreeResult ( G4KDTree tree)

Definition at line 87 of file G4KDTreeResult.cc.

87 :
88//std::list<ResNode>()
90{
91 fTree = tree;
92}
#define KDTR_parent
G4KDTree * fTree

◆ ~G4KDTreeResult()

G4KDTreeResult::~G4KDTreeResult ( )
virtual

Definition at line 94 of file G4KDTreeResult.cc.

95{
96 KDTR_parent::erase(begin(),end());
97 //std::list<ResNode>::erase(begin(),end());
98}

Member Function Documentation

◆ Clear()

void G4KDTreeResult::Clear ( )

Definition at line 106 of file G4KDTreeResult.cc.

107{
108// std::list<ResNode>::erase(begin(),end());
109// fIterator = std::list<ResNode>::begin();
110 KDTR_parent::erase(begin(),end());
111 fIterator = KDTR_parent::begin();
112}
KDTR_parent::iterator fIterator

◆ End()

bool G4KDTreeResult::End ( )

Definition at line 137 of file G4KDTreeResult.cc.

138{
139 return (fIterator == end());
140}

◆ GetDistanceSqr()

double G4KDTreeResult::GetDistanceSqr ( ) const

Definition at line 147 of file G4KDTreeResult.cc.

148{
149 return (*fIterator).GetDistanceSqr();
150}

Referenced by GetItemNDistanceSQ().

◆ GetItem()

template<typename PointT >
PointT * G4KDTreeResult::GetItem

Definition at line 139 of file G4KDTreeResult.hh.

140 {
142 return node->GetPoint();
143 }
PointT * GetPoint()
Definition: G4KDNode.hh:144
G4KDNode_Base * GetNode() const

◆ GetItemNDistanceSQ()

template<typename PointT >
PointT * G4KDTreeResult::GetItemNDistanceSQ ( double &  dist_sq) const

Definition at line 146 of file G4KDTreeResult.hh.

147 {
148 dist_sq = GetDistanceSqr();
149 return this->GetItem<PointT>();
150 }
double GetDistanceSqr() const

◆ GetNode()

G4KDNode_Base * G4KDTreeResult::GetNode ( ) const

Definition at line 152 of file G4KDTreeResult.cc.

152 {
153 return (*fIterator).GetNode();
154}

Referenced by GetItem().

◆ GetSize()

size_t G4KDTreeResult::GetSize ( ) const

Definition at line 120 of file G4KDTreeResult.cc.

121{
122 //return std::list<ResNode>::size();
123 return KDTR_parent::size();
124}

◆ Insert()

void G4KDTreeResult::Insert ( double  dis_sq,
G4KDNode_Base node 
)

Definition at line 100 of file G4KDTreeResult.cc.

101{
102 //std::list<ResNode>::push_back(ResNode(dis_sq,node));
103 KDTR_parent::push_back(ResNode(dis_sq,node));
104}

◆ Next()

void G4KDTreeResult::Next ( )

Definition at line 142 of file G4KDTreeResult.cc.

143{
144 ++fIterator;
145}

◆ operator delete()

void G4KDTreeResult::operator delete ( void *  object)
inline

Definition at line 133 of file G4KDTreeResult.hh.

134{
135 aKDTreeAllocator()->FreeSingle((G4KDTreeResult *) object);
136}
G4DLLIMPORT G4Allocator< G4KDTreeResult > *& aKDTreeAllocator()

◆ operator new()

void * G4KDTreeResult::operator new ( size_t  )
inline

Definition at line 127 of file G4KDTreeResult.hh.

128{
130 return (void *) aKDTreeAllocator()->MallocSingle();
131}

◆ Rewind()

void G4KDTreeResult::Rewind ( )

Definition at line 132 of file G4KDTreeResult.cc.

133{
134 fIterator = begin();
135}

Referenced by G4KDTree::NearestInRange().

◆ size()

size_t G4KDTreeResult::size ( ) const

Definition at line 126 of file G4KDTreeResult.cc.

127{
128 return KDTR_parent::size();
129 //return std::list<ResNode>::size();
130}

◆ Sort()

void G4KDTreeResult::Sort ( )

Definition at line 114 of file G4KDTreeResult.cc.

115{
116 //std::list<ResNode>::sort(CompareResNode);
117 std::sort(begin(), end(), CompareResNode);
118}
bool CompareResNode(const ResNode &left, const ResNode &right)

Referenced by G4KDTree::NearestInRange().

Member Data Documentation

◆ fIterator

KDTR_parent::iterator G4KDTreeResult::fIterator
protected

Definition at line 74 of file G4KDTreeResult.hh.

Referenced by Clear(), End(), Next(), and Rewind().

◆ fTree

G4KDTree* G4KDTreeResult::fTree
protected

Definition at line 72 of file G4KDTreeResult.hh.

Referenced by G4KDTreeResult().


The documentation for this class was generated from the following files: