Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

edge.h

Go to the documentation of this file.
00001 00006 /* Copyright (C) 2004 Luiz Velho. */ 00007 00008 #ifndef EDGE_H 00009 #define EDGE_H 00010 00011 namespace A48 { 00012 00017 class Hedge { 00018 friend class Mesh; 00019 friend class Face; 00020 friend class Edge; 00021 00022 Vertex *o_; 00023 Hedge *n_; 00024 Face *f_; 00025 Edge *e_; 00026 00027 public: 00028 00031 Face* face() { return f_; }; 00032 00035 Vertex* org() { return o_; }; 00036 00039 Vertex* dst() { return mate()->org(); }; 00040 00043 Edge* edge() { return e_; }; 00044 00047 Hedge* prev() { return (n_)? n_->next() : NULL; }; 00048 00051 Hedge* next() { return n_; }; 00052 00055 Hedge* mate(); 00056 00058 int level(); 00059 00061 bool is_bdry(); 00062 00065 bool is_subdiv_itself() { 00066 return (face() != NULL && face()->subd_edge() == this); 00067 } 00068 00069 private: 00070 00072 void set_face(Face* f) { f_ = f; }; 00073 00075 void set_org(Vertex* v) { o_ = v; }; 00076 00078 void set_next(Hedge* h) { n_ = h; }; 00079 00081 void set_edge(Edge* e) { e_ = e; }; 00082 00084 Hedge* reuse(Vertex *v0, Vertex *v1); 00085 }; 00086 00087 00098 class Edge : public Markable, public MxHeapable { 00099 friend class Mesh; 00100 00101 Hedge h_[2]; 00102 00103 public: 00104 00105 /* @brief The construtctor initializes the vertices of the edge.*/ 00106 Edge(Vertex *p0, Vertex *p1); 00107 00108 /* @brief Returns a half-edge specified by the index i.*/ 00109 Hedge* hedge(int i); 00110 00112 Vertex* org() { return h_[0].org(); } 00113 00115 Vertex* dst() { return h_[1].org(); } 00116 00118 int level() { return h_[0].level(); } 00119 00122 bool is_bdry() { return (h_[0].face() == NULL || h_[1].face() == NULL); } 00123 00127 bool is_subdiv() { return (h_[0].is_subdiv_itself() || h_[1].is_subdiv_itself()); } 00128 }; 00129 00130 } 00131 00132 #endif

Generated on Mon Oct 11 19:32:06 2004 for A48 by doxygen 1.3.7