SourceXtractorPlusPlus 1.0.3
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.

References m_capacity, and m_is_divided.

Referenced by QuadTree().

◆ QuadTree() [2/2]

template<typename T>
SourceXtractor::QuadTree< T >::QuadTree ( const QuadTree< T > & tree)

Definition at line 28 of file QuadTree.icpp.

References m_capacity, m_data, m_is_divided, m_max, m_min, m_sub_trees, and QuadTree().

Here is the call graph for this function:

Member Function Documentation

◆ add()

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

Definition at line 40 of file QuadTree.icpp.

References SourceXtractor::QuadTreeTraits< T >::getCoord(), and m_is_divided.

Referenced by split().

Here is the call graph for this function:

◆ addLocally()

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

Definition at line 111 of file QuadTree.icpp.

References addLocally(), SourceXtractor::QuadTreeTraits< T >::getCoord(), m_data, m_is_divided, m_max, m_min, std::max(), and std::min().

Referenced by addLocally().

Here is the call graph for this function:

◆ expand()

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

◆ 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

Definition at line 171 of file QuadTree.icpp.

References getQuadrant(), m_max, m_min, SourceXtractor::QuadTree< T >::Coord::x, and SourceXtractor::QuadTree< T >::Coord::y.

Referenced by expand(), and getQuadrant().

Here is the call graph for this function:

◆ getQuadrantMax()

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

Definition at line 196 of file QuadTree.icpp.

References getQuadrantMax(), m_max, and m_min.

Referenced by getQuadrantMax().

Here is the call graph for this function:

◆ getQuadrantMin()

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

Definition at line 188 of file QuadTree.icpp.

References getQuadrantMin(), m_max, and m_min.

Referenced by getQuadrantMin().

Here is the call graph for this function:

◆ isContained()

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

Definition at line 183 of file QuadTree.icpp.

References isContained(), m_max, m_min, SourceXtractor::QuadTree< T >::Coord::x, and SourceXtractor::QuadTree< T >::Coord::y.

Referenced by expand(), isContained(), and remove().

Here is the call graph for this function:

◆ remove()

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

Definition at line 64 of file QuadTree.icpp.

References std::find(), SourceXtractor::QuadTreeTraits< T >::getCoord(), isContained(), m_data, m_is_divided, and m_sub_trees.

Here is the call graph for this function:

◆ split()

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

Definition at line 130 of file QuadTree.icpp.

References add(), m_data, m_is_divided, m_max, m_min, std::max(), and split().

Referenced by split().

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 QuadTree(), and 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 addLocally(), getPointsWithinRange(), QuadTree(), remove(), and split().

◆ m_is_divided

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

Definition at line 59 of file QuadTree.h.

Referenced by add(), addLocally(), expand(), getPointsWithinRange(), QuadTree(), QuadTree(), remove(), and split().

◆ m_max

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

◆ m_min

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

◆ 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 expand(), getPointsWithinRange(), QuadTree(), and remove().


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