hed::Dart Class Reference

Dart class for the half-edge data structure. More...

#include <ttl/halfedge/HeDart.h>

List of all members.

Public Member Functions

 Dart ()
 Default constructor.
 Dart (Edge *edge, bool dir=true)
 Constructor.
 Dart (const Dart &dart)
 Copy constructor.
 ~Dart ()
 Destructor.
Dartoperator= (const Dart &dart)
 Assignment operator.
bool operator== (const Dart &dart) const
 Comparing dart objects.
bool operator!= (const Dart &dart) const
 Comparing dart objects.
Dartalpha0 ()
 Maps the dart to a different node.
Dartalpha1 ()
 Maps the dart to a different edge.
Dartalpha2 ()
 Maps the dart to a different triangle. Note: the dart is not changed if it is at the boundary!
Utilities not required by TTL



void init (Edge *edge, bool dir=true)
double x () const
double y () const
bool isCounterClockWise () const
NodegetNode () const
NodegetOppositeNode () const
EdgegetEdge () const

Private Attributes

Edgeedge_
bool dir_

Detailed Description

Dart class for the half-edge data structure.

See Application Programming Interface to TTL (API) for a detailed description of how the member functions should be implemented.

Definition at line 47 of file HeDart.h.


Constructor & Destructor Documentation

hed::Dart::Dart (  )  [inline]

Default constructor.

Definition at line 54 of file HeDart.h.

References dir_, and edge_.

00054 { edge_ = NULL; dir_ = true; }

hed::Dart::Dart ( Edge edge,
bool  dir = true 
) [inline]

Constructor.

Definition at line 57 of file HeDart.h.

References dir_, and edge_.

00057 { edge_ = edge; dir_ = dir; }

hed::Dart::Dart ( const Dart dart  )  [inline]

Copy constructor.

Definition at line 60 of file HeDart.h.

References dir_, and edge_.

00060 { edge_ = dart.edge_; dir_ = dart.dir_; }

hed::Dart::~Dart (  )  [inline]

Destructor.

Definition at line 63 of file HeDart.h.

00063 {}


Member Function Documentation

Dart& hed::Dart::alpha0 (  )  [inline]

Maps the dart to a different node.

Definition at line 87 of file HeDart.h.

References dir_.

Referenced by hed::TTLtraits::crossProduct2d(), and hed::TTLtraits::scalarProduct2d().

00087 { dir_ = !dir_; return *this; }

Dart& hed::Dart::alpha1 (  )  [inline]

Maps the dart to a different edge.

Definition at line 90 of file HeDart.h.

References dir_, edge_, and hed::Edge::getNextEdgeInFace().

00090                    {
00091       if (dir_) {
00092         edge_ = edge_->getNextEdgeInFace()->getNextEdgeInFace();
00093         dir_ = false;
00094       }
00095       else {
00096         edge_ = edge_->getNextEdgeInFace();
00097         dir_ = true;
00098       }
00099       return *this;
00100     }

Dart& hed::Dart::alpha2 (  )  [inline]

Maps the dart to a different triangle. Note: the dart is not changed if it is at the boundary!

Definition at line 103 of file HeDart.h.

References dir_, edge_, and hed::Edge::getTwinEdge().

00103                    {
00104       if (edge_->getTwinEdge()) {
00105         edge_ = edge_->getTwinEdge();
00106         dir_ = !dir_;
00107       }
00108       // else, the dart is at the boundary and should not be changed
00109       return *this;
00110     }

Edge* hed::Dart::getEdge (  )  const [inline]
Node* hed::Dart::getNode (  )  const [inline]

Definition at line 126 of file HeDart.h.

References dir_, edge_, hed::Edge::getSourceNode(), and hed::Edge::getTargetNode().

Referenced by x(), and y().

00126 { return dir_ ? edge_->getSourceNode() : edge_->getTargetNode(); }

Node* hed::Dart::getOppositeNode (  )  const [inline]

Definition at line 127 of file HeDart.h.

References dir_, edge_, hed::Edge::getSourceNode(), and hed::Edge::getTargetNode().

00127 { return dir_ ? edge_->getTargetNode() : edge_->getSourceNode(); }

void hed::Dart::init ( Edge edge,
bool  dir = true 
) [inline]

Definition at line 119 of file HeDart.h.

References dir_, and edge_.

Referenced by hed::TTLtraits::splitTriangle().

00119 { edge_ = edge; dir_ = dir; }

bool hed::Dart::isCounterClockWise (  )  const [inline]

Definition at line 124 of file HeDart.h.

References dir_.

00124 { return dir_; }

bool hed::Dart::operator!= ( const Dart dart  )  const [inline]

Comparing dart objects.

Definition at line 82 of file HeDart.h.

00082                                             {
00083       return !(dart==*this);
00084     }

Dart& hed::Dart::operator= ( const Dart dart  )  [inline]

Assignment operator.

Definition at line 66 of file HeDart.h.

References dir_, and edge_.

00066                                         {
00067       if (this == &dart)
00068         return *this;
00069       edge_ = dart.edge_;
00070       dir_  = dart.dir_;
00071       return *this;
00072     }

bool hed::Dart::operator== ( const Dart dart  )  const [inline]

Comparing dart objects.

Definition at line 75 of file HeDart.h.

References dir_, and edge_.

00075                                             {
00076       if (dart.edge_ == edge_ && dart.dir_ == dir_)
00077         return true;
00078       return false;
00079     }

double hed::Dart::x (  )  const [inline]

Definition at line 121 of file HeDart.h.

References getNode(), and hed::Node::x().

Referenced by hed::TTLtraits::crossProduct2d(), hed::TTLtraits::orient2d(), and hed::TTLtraits::scalarProduct2d().

00121 { return getNode()->x(); } // x-coordinate of source node

double hed::Dart::y (  )  const [inline]

Definition at line 122 of file HeDart.h.

References getNode(), and hed::Node::y().

Referenced by hed::TTLtraits::crossProduct2d(), hed::TTLtraits::orient2d(), and hed::TTLtraits::scalarProduct2d().

00122 { return getNode()->y(); } // y-coordinate of source node


Member Data Documentation

bool hed::Dart::dir_ [private]
Edge* hed::Dart::edge_ [private]

Definition at line 49 of file HeDart.h.

Referenced by alpha1(), alpha2(), Dart(), getEdge(), getNode(), getOppositeNode(), init(), operator=(), and operator==().


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

Generated on Wed Nov 17 17:44:27 2010 for TTL by  doxygen 1.6.1