LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 *)
 
 ~BSTNode ()
 Virtual Destructor. More...
 
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 32 of file BeachLine.h.

Constructor & Destructor Documentation

voronoi2d::BSTNode::BSTNode ( )
inline

Constructor.

Definition at line 38 of file BeachLine.h.

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

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

Definition at line 51 of file BeachLine.h.

References BSTNode(), m_event, and voronoi2d::IEvent::setBSTNode().

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

Definition at line 24 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().

25 {
26  m_depth = 0;
27  m_event = event;
28  m_parent = parent;
29  m_leftChild = leftChild;
30  m_rightChild = rightChild;
31  m_predecessor = NULL;
32  m_successor = NULL;
33  m_associated = NULL;
34 
35  m_event->setBSTNode(this);
36 
37  // Reset depth
38  setDepth();
39 }
IEvent * m_event
Definition: BeachLine.h:111
BSTNode * m_associated
Definition: BeachLine.h:117
BSTNode * m_successor
Definition: BeachLine.h:116
BSTNode * m_predecessor
Definition: BeachLine.h:115
BSTNode * m_parent
Definition: BeachLine.h:112
virtual void setBSTNode(BSTNode *)=0
BSTNode * m_leftChild
Definition: BeachLine.h:113
BSTNode * m_rightChild
Definition: BeachLine.h:114
Event finding and building.
voronoi2d::BSTNode::~BSTNode ( )
inline

Virtual Destructor.

Definition at line 71 of file BeachLine.h.

71 {}

Member Function Documentation

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

recover the data members

Definition at line 76 of file BeachLine.h.

References m_depth.

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

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

Definition at line 85 of file BeachLine.h.

References m_halfEdge.

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

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

Provide override definition for ordering.

Referenced by setDepth().

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

Definition at line 41 of file BeachLine.cxx.

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

Referenced by BSTNode(), and setDepth().

42 {
44  {
45  int maxDepth = std::max(m_leftChild->getDepth(),m_rightChild->getDepth());
46 
47  m_depth = maxDepth + 1;
48  }
49  else m_depth = 0;
50 
51  // If we change depth at this level then need to ripple it up through the tree
52  if (m_parent) m_parent->setDepth();
53 
54  return;
55 }
void setDepth(int depth)
Definition: BeachLine.h:101
Int_t max
Definition: plot.C:27
BSTNode * m_parent
Definition: BeachLine.h:112
int getDepth() const
recover the data members
Definition: BeachLine.h:76
BSTNode * m_leftChild
Definition: BeachLine.h:113
BSTNode * m_rightChild
Definition: BeachLine.h:114
void voronoi2d::BSTNode::setFace ( dcel2d::Face face)
inline

Definition at line 99 of file BeachLine.h.

References m_face.

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

99 {m_face = face;}
dcel2d::Face * m_face
Definition: BeachLine.h:119
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 94 of file BeachLine.h.

References m_predecessor.

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

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

Definition at line 95 of file BeachLine.h.

References m_successor.

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

95 {m_successor = node;}
BSTNode * m_successor
Definition: BeachLine.h:116

Member Data Documentation

BSTNode* voronoi2d::BSTNode::m_associated
private

Definition at line 117 of file BeachLine.h.

Referenced by BSTNode(), getAssociated(), and setAssociated().

int voronoi2d::BSTNode::m_depth
private

Definition at line 110 of file BeachLine.h.

Referenced by BSTNode(), getDepth(), and setDepth().

IEvent* voronoi2d::BSTNode::m_event
private

Definition at line 111 of file BeachLine.h.

Referenced by BSTNode(), and getEvent().

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

Definition at line 119 of file BeachLine.h.

Referenced by getFace(), and setFace().

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

Definition at line 118 of file BeachLine.h.

Referenced by getHalfEdge(), and setHalfEdge().

BSTNode* voronoi2d::BSTNode::m_leftChild
private

Definition at line 113 of file BeachLine.h.

Referenced by BSTNode(), getLeftChild(), setDepth(), and setLeftChild().

BSTNode* voronoi2d::BSTNode::m_parent
private

Definition at line 112 of file BeachLine.h.

Referenced by BSTNode(), getParent(), setDepth(), and setParent().

BSTNode* voronoi2d::BSTNode::m_predecessor
private

Definition at line 115 of file BeachLine.h.

Referenced by BSTNode(), getPredecessor(), and setPredecessor().

BSTNode* voronoi2d::BSTNode::m_rightChild
private

Definition at line 114 of file BeachLine.h.

Referenced by BSTNode(), getRightChild(), setDepth(), and setRightChild().

BSTNode* voronoi2d::BSTNode::m_successor
private

Definition at line 116 of file BeachLine.h.

Referenced by BSTNode(), getSuccessor(), and setSuccessor().


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