00001
00002
00003 #include "params.h"
00004
00005 #ifndef FACE_H
00006 #define FACE_H
00007
00012 class Face {
00013
00014 private:
00015 VertexID v[MAX_FACE_VERTICES];
00016
00017 public:
00021 Face(VertexID v[MAX_FACE_VERTICES] = NULL) {
00022 if (v==NULL) {
00023 for (int i=0; i<MAX_FACE_VERTICES; i++)
00024 this->v[i] = -1;
00025 } else {
00026 for (int i=0; i<MAX_FACE_VERTICES; i++)
00027 this->v[i] = v[i];
00028 }
00029 }
00033 void set(VertexID v[MAX_FACE_VERTICES] = NULL) {
00034 if (v==NULL) {
00035 for (int i=0; i<MAX_FACE_VERTICES; i++)
00036 this->v[i] = -1;
00037 } else {
00038 for (int i=0; i<MAX_FACE_VERTICES; i++)
00039 this->v[i] = v[i];
00040 }
00041 }
00046 VertexID getV(int vNum) const {
00047 if (vNum>=MAX_FACE_VERTICES || vNum<0)
00048 return -1;
00049 return v[vNum];
00050 }
00051
00058 bool operator==(const Face &face) const {
00059 for (int i=0; i<3; i++) {
00060 if (face.v[i]==v[0] && face.v[(i+1)%3]==v[1] && face.v[(i+2)%3]==v[2]) return true;
00061 }
00062 return false;
00063 }
00067 void operator=(const Face &face) {
00068 for (int i=0; i<3; i++)
00069 v[i]=face.v[i];
00070 }
00071 };
00072
00073 #endif