edge.cpp

Go to the documentation of this file.
00001 /*:
00002 **     edge.c - edge and hedge
00003 **
00004 **  Copyright (C) 2004 Luiz Velho, Hélio Lopes, Esdras Medeiros.
00005 */
00006 
00007 #include "mesh.h"
00008 
00009 using namespace Mesh;
00010 
00016 Edge::Edge(Vertex *p0, Vertex *p1) 
00017 {
00018   h_[0].set_org(p0); h_[1].set_org(p1);
00019   h_[0].set_face(NULL); h_[1].set_face(NULL);;
00020   h_[0].set_next(NULL); h_[1].set_next(NULL);
00021   h_[0].set_edge(this); h_[1].set_edge(this);
00022 }
00023 
00031 Hedge* Edge::hedge(int i)
00032 {
00033   switch (i) {
00034   case 0: return &h_[0];
00035   case 1: return &h_[1];
00036   }
00037   throw Error("edge n");
00038 }
00043 Hedge* Hedge::mate()
00044 { 
00045   return (this == e_->hedge(0))? e_->hedge(1): e_->hedge(0);
00046 };
00047 
00054 Hedge* Hedge::reuse(Vertex *v0, Vertex *v1)
00055 {
00056   set_org(v0); mate()->set_org(v1);
00057   set_next(NULL); mate()->set_next(NULL);
00058   set_face(NULL); mate()->set_face(NULL);
00059   return this;
00060 }
00061 
00062 
00063 

Generated on Fri Feb 24 12:23:21 2006 for TOPs by  doxygen 1.4.6-NO