SourceXtractorPlusPlus 0.22
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::QuadTree< T > Class Template Reference

#include <QuadTree.h>

Collaboration diagram for SourceXtractor::QuadTree< T >:

Classes

struct  Coord
 

Public Types

using Traits = QuadTreeTraits<T>
 

Public Member Functions

 QuadTree (size_t capacity=100)
 
 QuadTree (const QuadTree &tree)
 
void add (const T &data)
 
void remove (const T &data)
 
std::vector< T > getPointsWithinRange (Coord c, double range) const
 

Private Member Functions

void addLocally (const T &data)
 
void split ()
 
void expand (Coord c)
 
size_t getQuadrant (Coord c) const
 
bool isContained (Coord c) const
 
Coord getQuadrantMin (size_t quadrant) const
 
Coord getQuadrantMax (size_t quadrant) const
 

Private Attributes

size_t m_capacity
 
bool m_is_divided
 
Coord m_min
 
Coord m_max
 
std::vector< T > m_data
 
std::shared_ptr< QuadTree< T > > m_sub_trees [4]
 

Detailed Description

template<typename T>
class SourceXtractor::QuadTree< T >

Definition at line 32 of file QuadTree.h.

Member Typedef Documentation

◆ Traits

template<typename T >
using SourceXtractor::QuadTree< T >::Traits = QuadTreeTraits<T>

Definition at line 34 of file QuadTree.h.

Constructor & Destructor Documentation

◆ QuadTree() [1/2]

template<typename T >
SourceXtractor::QuadTree< T >::QuadTree ( size_t capacity = 100)

Definition at line 24 of file QuadTree.icpp.

◆ QuadTree() [2/2]

Member Function Documentation

◆ add()

template<typename T >
void SourceXtractor::QuadTree< T >::add ( const T & data)

Definition at line 40 of file QuadTree.icpp.

◆ addLocally()

template<typename T >
void SourceXtractor::QuadTree< T >::addLocally ( const T & data)
private

Definition at line 110 of file QuadTree.icpp.

References std::max(), and std::min().

Here is the call graph for this function:

◆ expand()

template<typename T >
void SourceXtractor::QuadTree< T >::expand ( Coord c)
private

Definition at line 144 of file QuadTree.icpp.

References std::make_shared(), SourceXtractor::QuadTree< T >::Coord::x, and SourceXtractor::QuadTree< T >::Coord::y.

Here is the call graph for this function:

◆ getPointsWithinRange()

template<typename T >
std::vector< T > SourceXtractor::QuadTree< T >::getPointsWithinRange ( Coord c,
double range ) const

◆ getQuadrant()

template<typename T >
size_t SourceXtractor::QuadTree< T >::getQuadrant ( Coord c) const
private

◆ getQuadrantMax()

template<typename T >
QuadTree< T >::Coord SourceXtractor::QuadTree< T >::getQuadrantMax ( size_t quadrant) const
private

Definition at line 195 of file QuadTree.icpp.

◆ getQuadrantMin()

template<typename T >
QuadTree< T >::Coord SourceXtractor::QuadTree< T >::getQuadrantMin ( size_t quadrant) const
private

Definition at line 187 of file QuadTree.icpp.

◆ isContained()

template<typename T >
bool SourceXtractor::QuadTree< T >::isContained ( Coord c) const
private

◆ remove()

template<typename T >
void SourceXtractor::QuadTree< T >::remove ( const T & data)

Definition at line 64 of file QuadTree.icpp.

References std::find().

Here is the call graph for this function:

◆ split()

template<typename T >
void SourceXtractor::QuadTree< T >::split ( )
private

Definition at line 129 of file QuadTree.icpp.

References std::max().

Here is the call graph for this function:

Member Data Documentation

◆ m_capacity

template<typename T >
size_t SourceXtractor::QuadTree< T >::m_capacity
private

Definition at line 57 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().

◆ m_data

template<typename T >
std::vector<T> SourceXtractor::QuadTree< T >::m_data
private

Definition at line 61 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().

◆ m_is_divided

template<typename T >
bool SourceXtractor::QuadTree< T >::m_is_divided
private

Definition at line 59 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().

◆ m_max

template<typename T >
Coord SourceXtractor::QuadTree< T >::m_max
private

Definition at line 60 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().

◆ m_min

template<typename T >
Coord SourceXtractor::QuadTree< T >::m_min
private

Definition at line 60 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().

◆ m_sub_trees

template<typename T >
std::shared_ptr<QuadTree<T> > SourceXtractor::QuadTree< T >::m_sub_trees[4]
private

Definition at line 62 of file QuadTree.h.

Referenced by SourceXtractor::QuadTree< T >::QuadTree().


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