Public Member Functions | Private Attributes | List of all members
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 32 of file BeachLine.h.

Constructor & Destructor Documentation

voronoi2d::BSTNode::BSTNode ( )
inline

Constructor.

Definition at line 38 of file BeachLine.h.

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:106
BSTNode * m_associated
Definition: BeachLine.h:112
dcel2d::Face * m_face
Definition: BeachLine.h:114
BSTNode * m_successor
Definition: BeachLine.h:111
BSTNode * m_predecessor
Definition: BeachLine.h:110
BSTNode * m_parent
Definition: BeachLine.h:107
BSTNode * m_leftChild
Definition: BeachLine.h:108
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:113
BSTNode * m_rightChild
Definition: BeachLine.h:109
voronoi2d::BSTNode::BSTNode ( IEvent event)
inline

Definition at line 51 of file BeachLine.h.

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:106
BSTNode * m_associated
Definition: BeachLine.h:112
dcel2d::Face * m_face
Definition: BeachLine.h:114
BSTNode * m_successor
Definition: BeachLine.h:111
BSTNode * m_predecessor
Definition: BeachLine.h:110
BSTNode * m_parent
Definition: BeachLine.h:107
virtual void setBSTNode(BSTNode *)=0
BSTNode * m_leftChild
Definition: BeachLine.h:108
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:113
BSTNode * m_rightChild
Definition: BeachLine.h:109
Event finding and building.
voronoi2d::BSTNode::BSTNode ( IEvent event,
BSTNode parent,
BSTNode leftChild,
BSTNode rightChild 
)

Definition at line 22 of file BeachLine.cxx.

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:106
BSTNode * m_associated
Definition: BeachLine.h:112
BSTNode * m_successor
Definition: BeachLine.h:111
BSTNode * m_predecessor
Definition: BeachLine.h:110
BSTNode * m_parent
Definition: BeachLine.h:107
virtual void setBSTNode(BSTNode *)=0
BSTNode * m_leftChild
Definition: BeachLine.h:108
def parent(G, child, parent_type)
Definition: graph.py:67
BSTNode * m_rightChild
Definition: BeachLine.h:109

Member Function Documentation

BSTNode* voronoi2d::BSTNode::getAssociated ( ) const
inline

Definition at line 78 of file BeachLine.h.

78 {return m_associated;}
BSTNode * m_associated
Definition: BeachLine.h:112
int voronoi2d::BSTNode::getDepth ( ) const
inline

recover the data members

Definition at line 71 of file BeachLine.h.

71 {return m_depth;}
IEvent* voronoi2d::BSTNode::getEvent ( ) const
inline

Definition at line 72 of file BeachLine.h.

72 {return m_event;}
IEvent * m_event
Definition: BeachLine.h:106
dcel2d::Face* voronoi2d::BSTNode::getFace ( ) const
inline

Definition at line 81 of file BeachLine.h.

81 {return m_face;}
dcel2d::Face * m_face
Definition: BeachLine.h:114
dcel2d::HalfEdge* voronoi2d::BSTNode::getHalfEdge ( ) const
inline

Definition at line 80 of file BeachLine.h.

80 {return m_halfEdge;}
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:113
BSTNode* voronoi2d::BSTNode::getLeftChild ( ) const
inline

Definition at line 74 of file BeachLine.h.

74 {return m_leftChild;}
BSTNode * m_leftChild
Definition: BeachLine.h:108
BSTNode* voronoi2d::BSTNode::getParent ( ) const
inline

Definition at line 73 of file BeachLine.h.

73 {return m_parent;}
BSTNode * m_parent
Definition: BeachLine.h:107
BSTNode* voronoi2d::BSTNode::getPredecessor ( ) const
inline

Definition at line 76 of file BeachLine.h.

76 {return m_predecessor;}
BSTNode * m_predecessor
Definition: BeachLine.h:110
BSTNode* voronoi2d::BSTNode::getRightChild ( ) const
inline

Definition at line 75 of file BeachLine.h.

75 {return m_rightChild;}
BSTNode * m_rightChild
Definition: BeachLine.h:109
BSTNode* voronoi2d::BSTNode::getSuccessor ( ) const
inline

Definition at line 77 of file BeachLine.h.

77 {return m_successor;}
BSTNode * m_successor
Definition: BeachLine.h:111
bool voronoi2d::BSTNode::operator< ( const BSTNode ) const

Provide override definition for ordering.

void voronoi2d::BSTNode::setAssociated ( BSTNode node)
inline

Definition at line 91 of file BeachLine.h.

91 {m_associated = node;}
BSTNode * m_associated
Definition: BeachLine.h:112
void voronoi2d::BSTNode::setDepth ( int  depth)
inline

Definition at line 96 of file BeachLine.h.

96 {m_depth = depth;}
void voronoi2d::BSTNode::setDepth ( )

Definition at line 39 of file BeachLine.cxx.

40 {
42  {
43  int maxDepth = std::max(m_leftChild->getDepth(),m_rightChild->getDepth());
44 
45  m_depth = maxDepth + 1;
46  }
47  else 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:96
BSTNode * m_parent
Definition: BeachLine.h:107
static int max(int a, int b)
int getDepth() const
recover the data members
Definition: BeachLine.h:71
BSTNode * m_leftChild
Definition: BeachLine.h:108
BSTNode * m_rightChild
Definition: BeachLine.h:109
void voronoi2d::BSTNode::setFace ( dcel2d::Face face)
inline

Definition at line 94 of file BeachLine.h.

94 {m_face = face;}
dcel2d::Face * m_face
Definition: BeachLine.h:114
void voronoi2d::BSTNode::setHalfEdge ( dcel2d::HalfEdge half)
inline

Definition at line 93 of file BeachLine.h.

93 {m_halfEdge = half;}
dcel2d::HalfEdge * m_halfEdge
Definition: BeachLine.h:113
void voronoi2d::BSTNode::setLeftChild ( BSTNode node)
inline

Definition at line 87 of file BeachLine.h.

87 {m_leftChild = node;}
BSTNode * m_leftChild
Definition: BeachLine.h:108
void voronoi2d::BSTNode::setParent ( BSTNode node)
inline

Allow setting of the points.

Definition at line 86 of file BeachLine.h.

86 {m_parent = node;}
BSTNode * m_parent
Definition: BeachLine.h:107
void voronoi2d::BSTNode::setPredecessor ( BSTNode node)
inline

Definition at line 89 of file BeachLine.h.

89 {m_predecessor = node;}
BSTNode * m_predecessor
Definition: BeachLine.h:110
void voronoi2d::BSTNode::setRightChild ( BSTNode node)
inline

Definition at line 88 of file BeachLine.h.

88 {m_rightChild = node;}
BSTNode * m_rightChild
Definition: BeachLine.h:109
void voronoi2d::BSTNode::setSuccessor ( BSTNode node)
inline

Definition at line 90 of file BeachLine.h.

90 {m_successor = node;}
BSTNode * m_successor
Definition: BeachLine.h:111

Member Data Documentation

BSTNode* voronoi2d::BSTNode::m_associated
private

Definition at line 112 of file BeachLine.h.

int voronoi2d::BSTNode::m_depth
private

Definition at line 105 of file BeachLine.h.

IEvent* voronoi2d::BSTNode::m_event
private

Definition at line 106 of file BeachLine.h.

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

Definition at line 114 of file BeachLine.h.

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

Definition at line 113 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_leftChild
private

Definition at line 108 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_parent
private

Definition at line 107 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_predecessor
private

Definition at line 110 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_rightChild
private

Definition at line 109 of file BeachLine.h.

BSTNode* voronoi2d::BSTNode::m_successor
private

Definition at line 111 of file BeachLine.h.


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