FlightGear next
quadtree::Node< T, GetBox, Equal > Class Template Reference

#include <QuadTree.hxx>

Public Member Functions

 Node (std::size_t depth, int fQuadtrant)
 
size_t size ()
 
bool isLeaf ()
 
void resize (const SGRectd &bounds)
 
bool add (const SGRectd &pos, SGSharedPtr< T > value, const Equal &equalFkt, const GetBox &getBoxFunction)
 
bool move (const SGRectd &newPos, const SGRectd &oldPos, SGSharedPtr< T > value, const Equal &equalFkt, const GetBox &getBoxFunction)
 
bool removeValue (SGSharedPtr< T > value, const Equal &equalFkt)
 
bool remove (const SGRectd &pos, SGSharedPtr< T > value, const Equal &equalFunction)
 
bool findFullScan (SGSharedPtr< T > value, const Equal &equalFkt, const std::string &path)
 For debugging.
 
bool removeFullScan (SGSharedPtr< T > value, const Equal &equalFkt, const std::string &path)
 For debugging.
 
bool printPath (const SGRectd &pos, SGSharedPtr< T > value, const Equal &equalFkt, const std::string &path)
 
bool printPath (const SGRectd &pos, const std::string &path)
 
bool tryMerge ()
 
int split (const SGRectd &pos, const Equal &equalFkt, const GetBox &getBoxFunction)
 
SGRectd computeBox (const SGRectd &box, int i) const
 
SGRectd computeBoxCenter (const SGRectd &box, int i) const
 
void query (const SGRectd &queryBox, const GetBox &getBoxFunction, std::vector< SGSharedPtr< T > > &values)
 
Quadrant getQuadrant (const SGRectd &nodeBox, const SGRectd &valueBox) const
 
SGRectd getBounds ()
 
bool intersection (const SGRectd &firstBox, const SGRectd &secondBox)
 
void dumpGeoJson (const std::unique_ptr< sg_ofstream > &o, const SGRectd &box)
 
void dumpGeoJson (const std::unique_ptr< sg_ofstream > &o, const GetBox &getBoxFunction)
 

Detailed Description

template<class T, typename GetBox, typename Equal>
class quadtree::Node< T, GetBox, Equal >

Definition at line 50 of file QuadTree.hxx.

Constructor & Destructor Documentation

◆ Node()

template<class T, typename GetBox, typename Equal>
quadtree::Node< T, GetBox, Equal >::Node ( std::size_t depth,
int fQuadtrant )
inline

Definition at line 61 of file QuadTree.hxx.

Member Function Documentation

◆ add()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::add ( const SGRectd & pos,
SGSharedPtr< T > value,
const Equal & equalFkt,
const GetBox & getBoxFunction )
inline

Definition at line 86 of file QuadTree.hxx.

◆ computeBox()

template<class T, typename GetBox, typename Equal>
SGRectd quadtree::Node< T, GetBox, Equal >::computeBox ( const SGRectd & box,
int i ) const
inline

Definition at line 363 of file QuadTree.hxx.

◆ computeBoxCenter()

template<class T, typename GetBox, typename Equal>
SGRectd quadtree::Node< T, GetBox, Equal >::computeBoxCenter ( const SGRectd & box,
int i ) const
inline

Definition at line 384 of file QuadTree.hxx.

◆ dumpGeoJson() [1/2]

template<class T, typename GetBox, typename Equal>
void quadtree::Node< T, GetBox, Equal >::dumpGeoJson ( const std::unique_ptr< sg_ofstream > & o,
const GetBox & getBoxFunction )
inline

Definition at line 494 of file QuadTree.hxx.

◆ dumpGeoJson() [2/2]

template<class T, typename GetBox, typename Equal>
void quadtree::Node< T, GetBox, Equal >::dumpGeoJson ( const std::unique_ptr< sg_ofstream > & o,
const SGRectd & box )
inline

Definition at line 481 of file QuadTree.hxx.

◆ findFullScan()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::findFullScan ( SGSharedPtr< T > value,
const Equal & equalFkt,
const std::string & path )
inline

For debugging.

Find path to value

Definition at line 231 of file QuadTree.hxx.

◆ getBounds()

template<class T, typename GetBox, typename Equal>
SGRectd quadtree::Node< T, GetBox, Equal >::getBounds ( )
inline

Definition at line 470 of file QuadTree.hxx.

◆ getQuadrant()

template<class T, typename GetBox, typename Equal>
Quadrant quadtree::Node< T, GetBox, Equal >::getQuadrant ( const SGRectd & nodeBox,
const SGRectd & valueBox ) const
inline

Definition at line 440 of file QuadTree.hxx.

◆ intersection()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::intersection ( const SGRectd & firstBox,
const SGRectd & secondBox )
inline

Definition at line 474 of file QuadTree.hxx.

◆ isLeaf()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::isLeaf ( )
inline

Definition at line 76 of file QuadTree.hxx.

◆ move()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::move ( const SGRectd & newPos,
const SGRectd & oldPos,
SGSharedPtr< T > value,
const Equal & equalFkt,
const GetBox & getBoxFunction )
inline

Definition at line 142 of file QuadTree.hxx.

◆ printPath() [1/2]

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::printPath ( const SGRectd & pos,
const std::string & path )
inline

Definition at line 307 of file QuadTree.hxx.

◆ printPath() [2/2]

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::printPath ( const SGRectd & pos,
SGSharedPtr< T > value,
const Equal & equalFkt,
const std::string & path )
inline

Definition at line 284 of file QuadTree.hxx.

◆ query()

template<class T, typename GetBox, typename Equal>
void quadtree::Node< T, GetBox, Equal >::query ( const SGRectd & queryBox,
const GetBox & getBoxFunction,
std::vector< SGSharedPtr< T > > & values )
inline

Definition at line 405 of file QuadTree.hxx.

◆ remove()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::remove ( const SGRectd & pos,
SGSharedPtr< T > value,
const Equal & equalFunction )
inline

Definition at line 204 of file QuadTree.hxx.

◆ removeFullScan()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::removeFullScan ( SGSharedPtr< T > value,
const Equal & equalFkt,
const std::string & path )
inline

For debugging.

Find path to value

Definition at line 259 of file QuadTree.hxx.

◆ removeValue()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::removeValue ( SGSharedPtr< T > value,
const Equal & equalFkt )
inline

Definition at line 191 of file QuadTree.hxx.

◆ resize()

template<class T, typename GetBox, typename Equal>
void quadtree::Node< T, GetBox, Equal >::resize ( const SGRectd & bounds)
inline

Definition at line 78 of file QuadTree.hxx.

◆ size()

template<class T, typename GetBox, typename Equal>
size_t quadtree::Node< T, GetBox, Equal >::size ( )
inline

Definition at line 64 of file QuadTree.hxx.

◆ split()

template<class T, typename GetBox, typename Equal>
int quadtree::Node< T, GetBox, Equal >::split ( const SGRectd & pos,
const Equal & equalFkt,
const GetBox & getBoxFunction )
inline

Definition at line 339 of file QuadTree.hxx.

◆ tryMerge()

template<class T, typename GetBox, typename Equal>
bool quadtree::Node< T, GetBox, Equal >::tryMerge ( )
inline

Definition at line 323 of file QuadTree.hxx.


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