Geant4 11.2.2
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.

88{
89 fTree = tree;
90}

◆ ~G4KDTreeResult()

G4KDTreeResult::~G4KDTreeResult ( )
virtual

Definition at line 92 of file G4KDTreeResult.cc.

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

Member Function Documentation

◆ Clear()

void G4KDTreeResult::Clear ( )

Definition at line 104 of file G4KDTreeResult.cc.

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

◆ End()

bool G4KDTreeResult::End ( )

Definition at line 135 of file G4KDTreeResult.cc.

136{
137 return (fIterator == end());
138}

◆ GetDistanceSqr()

double G4KDTreeResult::GetDistanceSqr ( ) const

Definition at line 145 of file G4KDTreeResult.cc.

146{
147 return (*fIterator).GetDistanceSqr();
148}

Referenced by GetItemNDistanceSQ().

◆ GetItem()

template<typename PointT >
PointT * G4KDTreeResult::GetItem ( ) const

Definition at line 139 of file G4KDTreeResult.hh.

140 {
141 auto node = (G4KDNode<PointT>*) (GetNode());
142 return node->GetPoint();
143 }
G4KDNode_Base * GetNode() const

Referenced by GetItemNDistanceSQ().

◆ 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
PointT * GetItem() const

◆ GetNode()

G4KDNode_Base * G4KDTreeResult::GetNode ( ) const

Definition at line 150 of file G4KDTreeResult.cc.

150 {
151 return (*fIterator).GetNode();
152}

Referenced by GetItem().

◆ GetSize()

size_t G4KDTreeResult::GetSize ( ) const

Definition at line 118 of file G4KDTreeResult.cc.

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

◆ Insert()

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

Definition at line 98 of file G4KDTreeResult.cc.

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

◆ Next()

void G4KDTreeResult::Next ( )

Definition at line 140 of file G4KDTreeResult.cc.

141{
142 ++fIterator;
143}

◆ 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}
Type * MallocSingle()

◆ Rewind()

void G4KDTreeResult::Rewind ( )

Definition at line 130 of file G4KDTreeResult.cc.

131{
132 fIterator = begin();
133}

◆ size()

size_t G4KDTreeResult::size ( ) const

Definition at line 124 of file G4KDTreeResult.cc.

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

◆ Sort()

void G4KDTreeResult::Sort ( )

Definition at line 112 of file G4KDTreeResult.cc.

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

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: