Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::QuadTree Class Reference

Quadtree search. More...

#include <QuadTree.hh>

Public Member Functions

 QuadTree (const double x0, const double y0, const double hx, const double hy)
 Constructor.
 ~QuadTree ()
 Destructor.
void InsertMeshNode (const double x, const double y, const int index)
 Insert a mesh node (a vertex/point) to the tree.
void InsertMeshElement (const double bb[4], const int index)
 Insert a mesh element with given bounding box and index to the tree.
const std::vector< int > & GetElementsInBlock (const double x, const double y) const
 Get all elements linked to a block corresponding to the given point.

Private Member Functions

bool DoesBoxOverlap (const double bb[4]) const
int GetQuadrant (const double x, const double y) const
bool IsLeafNode () const
const QuadTreeGetBlockFromPoint (const double x, const double y) const
const QuadTreeGetBlockFromPointHelper (const double x, const double y) const

Private Attributes

double m_x0
double m_y0
double m_hx
double m_hy
double m_xmin
double m_ymin
double m_xmax
double m_ymax
QuadTreechildren [4]
std::vector< std::tuple< float, float, int > > nodes
std::vector< int > elements

Static Private Attributes

static std::vector< int > emptyBlock
static const size_t BlockCapacity = 10

Detailed Description

Quadtree search.

Definition at line 12 of file QuadTree.hh.

Constructor & Destructor Documentation

◆ QuadTree()

Garfield::QuadTree::QuadTree ( const double x0,
const double y0,
const double hx,
const double hy )

Constructor.

◆ ~QuadTree()

Garfield::QuadTree::~QuadTree ( )

Destructor.

Member Function Documentation

◆ DoesBoxOverlap()

bool Garfield::QuadTree::DoesBoxOverlap ( const double bb[4]) const
private

◆ GetBlockFromPoint()

const QuadTree * Garfield::QuadTree::GetBlockFromPoint ( const double x,
const double y ) const
private

◆ GetBlockFromPointHelper()

const QuadTree * Garfield::QuadTree::GetBlockFromPointHelper ( const double x,
const double y ) const
private

◆ GetElementsInBlock()

const std::vector< int > & Garfield::QuadTree::GetElementsInBlock ( const double x,
const double y ) const

Get all elements linked to a block corresponding to the given point.

◆ GetQuadrant()

int Garfield::QuadTree::GetQuadrant ( const double x,
const double y ) const
private

◆ InsertMeshElement()

void Garfield::QuadTree::InsertMeshElement ( const double bb[4],
const int index )

Insert a mesh element with given bounding box and index to the tree.

◆ InsertMeshNode()

void Garfield::QuadTree::InsertMeshNode ( const double x,
const double y,
const int index )

Insert a mesh node (a vertex/point) to the tree.

◆ IsLeafNode()

bool Garfield::QuadTree::IsLeafNode ( ) const
private

Member Data Documentation

◆ BlockCapacity

const size_t Garfield::QuadTree::BlockCapacity = 10
staticprivate

Definition at line 52 of file QuadTree.hh.

◆ children

QuadTree* Garfield::QuadTree::children[4]
private

Definition at line 41 of file QuadTree.hh.

◆ elements

std::vector<int> Garfield::QuadTree::elements
private

Definition at line 50 of file QuadTree.hh.

◆ emptyBlock

std::vector<int> Garfield::QuadTree::emptyBlock
staticprivate

Definition at line 31 of file QuadTree.hh.

◆ m_hx

double Garfield::QuadTree::m_hx
private

Definition at line 36 of file QuadTree.hh.

◆ m_hy

double Garfield::QuadTree::m_hy
private

Definition at line 36 of file QuadTree.hh.

◆ m_x0

double Garfield::QuadTree::m_x0
private

Definition at line 34 of file QuadTree.hh.

◆ m_xmax

double Garfield::QuadTree::m_xmax
private

Definition at line 38 of file QuadTree.hh.

◆ m_xmin

double Garfield::QuadTree::m_xmin
private

Definition at line 38 of file QuadTree.hh.

◆ m_y0

double Garfield::QuadTree::m_y0
private

Definition at line 34 of file QuadTree.hh.

◆ m_ymax

double Garfield::QuadTree::m_ymax
private

Definition at line 38 of file QuadTree.hh.

◆ m_ymin

double Garfield::QuadTree::m_ymin
private

Definition at line 38 of file QuadTree.hh.

◆ nodes

std::vector<std::tuple<float, float, int> > Garfield::QuadTree::nodes
private

Definition at line 49 of file QuadTree.hh.


The documentation for this class was generated from the following file:
  • /builds/garfield/docs/source/Include/Garfield/QuadTree.hh