LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
voronoi2d::BSTNode Class Reference

BSTNode class definiton specifically for use in constructing Voronoi diagrams. We are trying to follow the prescription described in "Computational Geometry" by Mark de Berg, et al. More...

#include "BeachLine.h"

Public Member Functions

 BSTNode ()
 Constructor. More...
 
 BSTNode (IEvent *event)
 
 BSTNode (IEvent *, BSTNode *, BSTNode *, BSTNode *)
 
int getDepth () const
 recover the data members More...
 
IEventgetEvent () const
 
BSTNodegetParent () const
 
BSTNodegetLeftChild () const
 
BSTNodegetRightChild () const
 
BSTNodegetPredecessor () const
 
BSTNodegetSuccessor () const
 
BSTNodegetAssociated () const
 
dcel2d::HalfEdgegetHalfEdge () const
 
dcel2d::FacegetFace () const
 
void setParent (BSTNode *node)
 Allow setting of the points. More...
 
void setLeftChild (BSTNode *node)
 
void setRightChild (BSTNode *node)
 
void setPredecessor (BSTNode *node)
 
void setSuccessor (BSTNode *node)
 
void setAssociated (BSTNode *node)
 
void setHalfEdge (dcel2d::HalfEdge *half)
 
void setFace (dcel2d::Face *face)
 
void setDepth (int depth)
 
void setDepth ()
 
bool operator< (const BSTNode &) const
 Provide override definition for ordering. More...
 

Private Attributes

int m_depth
 
IEventm_event
 
BSTNodem_parent
 
BSTNodem_leftChild
 
BSTNodem_rightChild
 
BSTNodem_predecessor
 
BSTNodem_successor
 
BSTNodem_associated
 
dcel2d::HalfEdgem_halfEdge
 
dcel2d::Facem_face
 

Detailed Description

BSTNode class definiton specifically for use in constructing Voronoi diagrams. We are trying to follow the prescription described in "Computational Geometry" by Mark de Berg, et al.

Note that in this implementation the internal nodes of the tree will describe the breakpoints in the beach line and the leaves of the tree will describe the arcs (site points).

Definition at line 34 of file BeachLine.h.

Constructor & Destructor Documentation

voronoi2d::BSTNode::BSTNode ( )
inline

Constructor.

Definition at line 39 of file BeachLine.h.

Referenced by voronoi2d::BeachLine::insertNewLeaf().

40  : m_depth(0)
41  , m_event(NULL)
42  , m_parent(NULL)
43  , m_leftChild(NULL)
44  , m_rightChild(NULL)
45  , m_predecessor(NULL)
46  , m_successor(NULL)
47  , m_associated(NULL)
48  , m_halfEdge(NULL)
49  , m_face(NULL)
50  {}
IEvent * m_event
Definition: BeachLine.h:107
BSTNode * m_associated
Definition: BeachLine.h:113
dcel2d::Face * m_face
Definition: BeachLine.h:115
BSTNode * m_successor
Definition: BeachLine.h:112
BSTNode * m_predecessor
Definition: BeachLine.h:111
BSTNode * m_parent
Definition: BeachLine.h:108
BSTNode * m_leftChild
Definition: BeachLine.h:109
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:114
BSTNode * m_rightChild
Definition: BeachLine.h:110
voronoi2d::BSTNode::BSTNode ( IEvent event)
inline

Definition at line 52 of file BeachLine.h.

53  : m_depth(0)
54  , m_event(event)
55  , m_parent(NULL)
56  , m_leftChild(NULL)
57  , m_rightChild(NULL)
58  , m_predecessor(NULL)
59  , m_successor(NULL)
60  , m_associated(NULL)
61  , m_halfEdge(NULL)
62  , m_face(NULL)
63  {
64  if (m_event) m_event->setBSTNode(this);
65  }
IEvent * m_event
Definition: BeachLine.h:107
BSTNode * m_associated
Definition: BeachLine.h:113
dcel2d::Face * m_face
Definition: BeachLine.h:115
BSTNode * m_successor
Definition: BeachLine.h:112
BSTNode * m_predecessor
Definition: BeachLine.h:111
BSTNode * m_parent
Definition: BeachLine.h:108
virtual void setBSTNode(BSTNode *)=0
BSTNode * m_leftChild
Definition: BeachLine.h:109
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:114
BSTNode * m_rightChild
Definition: BeachLine.h:110
Event finding and building.
voronoi2d::BSTNode::BSTNode ( IEvent event,
BSTNode parent,
BSTNode leftChild,
BSTNode rightChild 
)

Definition at line 22 of file BeachLine.cxx.

References m_associated, m_depth, m_event, m_leftChild, m_parent, m_predecessor, m_rightChild, m_successor, voronoi2d::IEvent::setBSTNode(), and setDepth().

23  {
24  m_depth = 0;
25  m_event = event;
26  m_parent = parent;
27  m_leftChild = leftChild;
28  m_rightChild = rightChild;
29  m_predecessor = NULL;
30  m_successor = NULL;
31  m_associated = NULL;
32 
33  m_event->setBSTNode(this);
34 
35  // Reset depth
36  setDepth();
37  }
IEvent * m_event
Definition: BeachLine.h:107
BSTNode * m_associated
Definition: BeachLine.h:113
BSTNode * m_successor
Definition: BeachLine.h:112
BSTNode * m_predecessor
Definition: BeachLine.h:111
BSTNode * m_parent
Definition: BeachLine.h:108
virtual void setBSTNode(BSTNode *)=0
BSTNode * m_leftChild
Definition: BeachLine.h:109
BSTNode * m_rightChild
Definition: BeachLine.h:110
Event finding and building.

Member Function Documentation

int voronoi2d::BSTNode::getDepth ( ) const
inline

recover the data members

Definition at line 72 of file BeachLine.h.

Referenced by voronoi2d::BeachLine::rebalance(), and setDepth().

72 { return m_depth; }
dcel2d::HalfEdge* voronoi2d::BSTNode::getHalfEdge ( ) const
inline

Definition at line 81 of file BeachLine.h.

Referenced by voronoi2d::VoronoiDiagram::handleCircleEvents(), and voronoi2d::VoronoiDiagram::terminateInfiniteEdges().

81 { return m_halfEdge; }
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:114
bool voronoi2d::BSTNode::operator< ( const BSTNode ) const

Provide override definition for ordering.

void voronoi2d::BSTNode::setAssociated ( BSTNode node)
inline
void voronoi2d::BSTNode::setDepth ( int  depth)
inline
void voronoi2d::BSTNode::setDepth ( )

Definition at line 39 of file BeachLine.cxx.

References getDepth(), m_depth, m_leftChild, m_parent, m_rightChild, and setDepth().

Referenced by BSTNode().

40  {
41  if (m_leftChild && m_rightChild) {
42  int maxDepth = std::max(m_leftChild->getDepth(), m_rightChild->getDepth());
43 
44  m_depth = maxDepth + 1;
45  }
46  else
47  m_depth = 0;
48 
49  // If we change depth at this level then need to ripple it up through the tree
50  if (m_parent) m_parent->setDepth();
51 
52  return;
53  }
void setDepth(int depth)
Definition: BeachLine.h:97
BSTNode * m_parent
Definition: BeachLine.h:108
int getDepth() const
recover the data members
Definition: BeachLine.h:72
BSTNode * m_leftChild
Definition: BeachLine.h:109
BSTNode * m_rightChild
Definition: BeachLine.h:110
void voronoi2d::BSTNode::setFace ( dcel2d::Face face)
inline

Definition at line 95 of file BeachLine.h.

Referenced by voronoi2d::VoronoiDiagram::handleSiteEvents(), and voronoi2d::BeachLine::removeLeaf().

95 { m_face = face; }
dcel2d::Face * m_face
Definition: BeachLine.h:115
void voronoi2d::BSTNode::setHalfEdge ( dcel2d::HalfEdge half)
inline
void voronoi2d::BSTNode::setLeftChild ( BSTNode node)
inline
void voronoi2d::BSTNode::setParent ( BSTNode node)
inline
void voronoi2d::BSTNode::setPredecessor ( BSTNode node)
inline

Definition at line 90 of file BeachLine.h.

Referenced by voronoi2d::BeachLine::insertNewLeaf(), and voronoi2d::BeachLine::removeLeaf().

90 { m_predecessor = node; }
BSTNode * m_predecessor
Definition: BeachLine.h:111
void voronoi2d::BSTNode::setRightChild ( BSTNode node)
inline
void voronoi2d::BSTNode::setSuccessor ( BSTNode node)
inline

Definition at line 91 of file BeachLine.h.

Referenced by voronoi2d::BeachLine::insertNewLeaf(), and voronoi2d::BeachLine::removeLeaf().

91 { m_successor = node; }
BSTNode * m_successor
Definition: BeachLine.h:112

Member Data Documentation

BSTNode* voronoi2d::BSTNode::m_associated
private

Definition at line 113 of file BeachLine.h.

Referenced by BSTNode().

int voronoi2d::BSTNode::m_depth
private

Definition at line 106 of file BeachLine.h.

Referenced by BSTNode(), and setDepth().

IEvent* voronoi2d::BSTNode::m_event
private

Definition at line 107 of file BeachLine.h.

Referenced by BSTNode().

dcel2d::Face* voronoi2d::BSTNode::m_face
private

Definition at line 115 of file BeachLine.h.

dcel2d::HalfEdge* voronoi2d::BSTNode::m_halfEdge
private

Definition at line 114 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_leftChild
private

Definition at line 109 of file BeachLine.h.

Referenced by BSTNode(), and setDepth().

BSTNode* voronoi2d::BSTNode::m_parent
private

Definition at line 108 of file BeachLine.h.

Referenced by BSTNode(), and setDepth().

BSTNode* voronoi2d::BSTNode::m_predecessor
private

Definition at line 111 of file BeachLine.h.

Referenced by BSTNode().

BSTNode* voronoi2d::BSTNode::m_rightChild
private

Definition at line 110 of file BeachLine.h.

Referenced by BSTNode(), and setDepth().

BSTNode* voronoi2d::BSTNode::m_successor
private

Definition at line 112 of file BeachLine.h.

Referenced by BSTNode().


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