Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::VisibilityPolygon::EdgeStatusTree Class Reference

BST-based sweep status for active edges, ordered by ray-intersection distance. More...

Collaboration diagram for Aleph::VisibilityPolygon::EdgeStatusTree:
[legend]

Classes

struct  EdgeKey
 
struct  EdgeKeyCmp
 

Public Member Functions

 EdgeStatusTree (const Array< Point > &verts, const size_t n, const Point &query)
 
void insert (const size_t edge, const Point &dir)
 
void erase (const size_t edge)
 
size_t min () const
 Return the nearest edge (smallest ray_param).
 
bool contains (const size_t edge) const
 
bool is_empty () const
 

Private Attributes

DynSetTree< EdgeKey, Treap, EdgeKeyCmptree_
 
Array< Geom_Numberparams_
 
Array< boolin_tree_
 
const Array< Point > & verts_
 
const size_t n_
 
const Pointquery_
 

Detailed Description

BST-based sweep status for active edges, ordered by ray-intersection distance.

Each edge is keyed by (ray_param, edge_index) computed at insertion time. Since the distance ordering of non-crossing edges is invariant between consecutive vertex events, the BST ordering remains valid throughout the sweep.

Backed by Aleph's Treap via DynSetTree. Provides O(log n) insert, erase and min (nearest edge).

Definition at line 9671 of file geom_algorithms.H.

Constructor & Destructor Documentation

◆ EdgeStatusTree()

Aleph::VisibilityPolygon::EdgeStatusTree::EdgeStatusTree ( const Array< Point > &  verts,
const size_t  n,
const Point query 
)
inline

Definition at line 9696 of file geom_algorithms.H.

References Aleph::Array< T >::append(), in_tree_, and params_.

Member Function Documentation

◆ contains()

bool Aleph::VisibilityPolygon::EdgeStatusTree::contains ( const size_t  edge) const
inline

Definition at line 9737 of file geom_algorithms.H.

References in_tree_.

◆ erase()

void Aleph::VisibilityPolygon::EdgeStatusTree::erase ( const size_t  edge)
inline

◆ insert()

void Aleph::VisibilityPolygon::EdgeStatusTree::insert ( const size_t  edge,
const Point dir 
)
inline

◆ is_empty()

bool Aleph::VisibilityPolygon::EdgeStatusTree::is_empty ( ) const
inline

Definition at line 9742 of file geom_algorithms.H.

References tree_.

◆ min()

size_t Aleph::VisibilityPolygon::EdgeStatusTree::min ( ) const
inline

Return the nearest edge (smallest ray_param).

Returns n_ if the tree is empty.

Definition at line 9730 of file geom_algorithms.H.

References n_, and tree_.

Referenced by Aleph::VisibilityPolygon::operator()().

Member Data Documentation

◆ in_tree_

Array<bool> Aleph::VisibilityPolygon::EdgeStatusTree::in_tree_
private

Definition at line 9690 of file geom_algorithms.H.

Referenced by EdgeStatusTree(), contains(), erase(), and insert().

◆ n_

const size_t Aleph::VisibilityPolygon::EdgeStatusTree::n_
private

Definition at line 9692 of file geom_algorithms.H.

Referenced by insert(), and min().

◆ params_

Array<Geom_Number> Aleph::VisibilityPolygon::EdgeStatusTree::params_
private

Definition at line 9689 of file geom_algorithms.H.

Referenced by EdgeStatusTree(), erase(), and insert().

◆ query_

const Point& Aleph::VisibilityPolygon::EdgeStatusTree::query_
private

Definition at line 9693 of file geom_algorithms.H.

Referenced by insert().

◆ tree_

DynSetTree<EdgeKey, Treap, EdgeKeyCmp> Aleph::VisibilityPolygon::EdgeStatusTree::tree_
private

Definition at line 9688 of file geom_algorithms.H.

Referenced by erase(), insert(), is_empty(), and min().

◆ verts_

const Array<Point>& Aleph::VisibilityPolygon::EdgeStatusTree::verts_
private

Definition at line 9691 of file geom_algorithms.H.

Referenced by insert().


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