00001 00006 #ifndef FACE_CM 00007 #define FACE_CM 00008 #include <iostream> 00009 #include "Edge.h" 00010 #include "Vertex.h" 00011 #include "Vector3.h" 00012 00019 class Face 00020 { 00021 public: 00022 00023 // pointers for mesh structure 00024 Edge * edge; 00025 00026 // distinct id 00027 int ID; 00028 int patchID; 00029 00030 // to check various iterations 00031 bool check; 00032 00034 double r; 00035 00036 Face(void): edge(NULL), ID(-1) 00037 { 00038 patchID = 0; 00039 } 00040 00042 class EdgeAroundIterator { 00043 private: 00044 Edge * endI; 00045 Edge * run; 00046 Edge * _e; 00047 public: 00048 00049 EdgeAroundIterator(Edge * e) { 00050 endI = NULL; 00051 run = e; 00052 _e = e; 00053 } 00054 00055 void reset() { 00056 endI = NULL; 00057 run = _e; 00058 } 00059 00060 EdgeAroundIterator& operator++( void ){ 00061 if (!endI) endI = run; 00062 run = run->next; 00063 return *this; 00064 } 00065 EdgeAroundIterator operator++( int ){ 00066 EdgeAroundIterator r = *this; ++*this; return r; 00067 } 00068 00069 Edge * edge( void ) const { return run; } 00070 Edge * & edge( void ) { return run; } 00071 00072 Vertex * vertex( void ) const { return run->vertex; } 00073 Vertex * & vertex( void ) { return run->vertex; } 00074 00075 Face * face( void ) const { return run->pair->face; } 00076 Face * & face( void ) { return run->pair->face; } 00077 00078 bool end(void) { return endI == run;} 00079 }; 00080 00081 EdgeAroundIterator iterator() {return EdgeAroundIterator(edge);} 00082 EdgeAroundIterator iterator(Edge * myE) {return EdgeAroundIterator(myE);} 00083 00084 }; 00085 #endif 00086