FlightGear next
flightgear::Octree Namespace Reference

Classes

class  Branch
 
class  Leaf
 
class  Node
 Octree node base class, tracks its bounding box and provides various queries relating to it. More...
 
class  Ordered
 Decorate an object with a double value, and use that value to order items, for the purpoises of the STL algorithms. More...
 

Typedefs

typedef Ordered< Node * > OrderedNode
 
typedef std::greater< OrderedNodeFNPQCompare
 
typedef std::priority_queue< OrderedNode, std::vector< OrderedNode >, FNPQCompareFindNearestPQueue
 the priority queue is fundamental to our search algorithm.
 
typedef Ordered< FGPositioned * > OrderedPositioned
 
typedef std::vector< OrderedPositionedFindNearestResults
 
typedef std::deque< Node * > FindLinesDeque
 

Functions

NodeglobalTransientOctree ()
 
NodeglobalPersistentOctree ()
 
static bool boxContainsBox (const SGBoxd &a, const SGBoxd &b)
 
bool findNearestN (const SGVec3d &aPos, unsigned int aN, double aCutoffM, FGPositioned::Filter *aFilter, FGPositionedList &aResults, int aCutoffMsec)
 
bool findAllWithinRange (const SGVec3d &aPos, double aRangeM, FGPositioned::Filter *aFilter, FGPositionedList &aResults, int aCutoffMsec)
 

Variables

static std::unique_ptr< Nodeglobal_spatialOctree
 
static std::unique_ptr< Nodeglobal_transientOctree
 
double RADIUS_EARTH_M = 7000 * 1000.0
 
const double LEAF_SIZE = SG_NM_TO_METER * 8.0
 
const double LEAF_SIZE_SQR = LEAF_SIZE * LEAF_SIZE
 

Typedef Documentation

◆ FindLinesDeque

Definition at line 106 of file PositionedOctree.hxx.

◆ FindNearestPQueue

typedef std::priority_queue<OrderedNode, std::vector<OrderedNode>, FNPQCompare> flightgear::Octree::FindNearestPQueue

the priority queue is fundamental to our search algorithm.

When searching, we know the front of the queue is the nearest unexpanded node (to the search location). The default STL pqueue returns the 'largest' item from top(), so to get the smallest, we need to replace the default Compare functor (less<>) with greater<>.

Definition at line 99 of file PositionedOctree.hxx.

◆ FindNearestResults

Definition at line 102 of file PositionedOctree.hxx.

◆ FNPQCompare

Definition at line 90 of file PositionedOctree.hxx.

◆ OrderedNode

Definition at line 89 of file PositionedOctree.hxx.

◆ OrderedPositioned

Function Documentation

◆ boxContainsBox()

static bool flightgear::Octree::boxContainsBox ( const SGBoxd & a,
const SGBoxd & b )
static

Definition at line 217 of file PositionedOctree.cxx.

◆ findAllWithinRange()

bool flightgear::Octree::findAllWithinRange ( const SGVec3d & aPos,
double aRangeM,
FGPositioned::Filter * aFilter,
FGPositionedList & aResults,
int aCutoffMsec )

Definition at line 373 of file PositionedOctree.cxx.

◆ findNearestN()

bool flightgear::Octree::findNearestN ( const SGVec3d & aPos,
unsigned int aN,
double aCutoffM,
FGPositioned::Filter * aFilter,
FGPositionedList & aResults,
int aCutoffMsec )

Definition at line 331 of file PositionedOctree.cxx.

◆ globalPersistentOctree()

Node * flightgear::Octree::globalPersistentOctree ( )

Definition at line 44 of file PositionedOctree.cxx.

◆ globalTransientOctree()

Node * flightgear::Octree::globalTransientOctree ( )

Definition at line 34 of file PositionedOctree.cxx.

Variable Documentation

◆ global_spatialOctree

std::unique_ptr<Node> flightgear::Octree::global_spatialOctree
static

Definition at line 29 of file PositionedOctree.cxx.

◆ global_transientOctree

std::unique_ptr<Node> flightgear::Octree::global_transientOctree
static

Definition at line 30 of file PositionedOctree.cxx.

◆ LEAF_SIZE

const double flightgear::Octree::LEAF_SIZE = SG_NM_TO_METER * 8.0

Definition at line 36 of file PositionedOctree.hxx.

◆ LEAF_SIZE_SQR

const double flightgear::Octree::LEAF_SIZE_SQR = LEAF_SIZE * LEAF_SIZE

Definition at line 37 of file PositionedOctree.hxx.

◆ RADIUS_EARTH_M

double flightgear::Octree::RADIUS_EARTH_M = 7000 * 1000.0

Definition at line 32 of file PositionedOctree.cxx.