00001 // Author: Justin Kinney 00002 // Date: Sep 2008 00003 00004 #ifndef VERTEX_SCHEDULE_H 00005 #define VERTEX_SCHEDULE_H 1 00006 00007 #include "meshmorph.h" 00008 00009 class Vertex_Schedule 00010 { 00011 private: 00012 static Vertex_Schedule * only_one; 00013 Vertex * cv; // Vertex* moving now 00014 Vertex * seed; // candidate vertex with largest vd 00015 vec_vp vset; // set of vertex*s to move next 00016 vector3 pH; // destination of vertex move 00017 int count; // number of moved vertices in group 00018 int count_ref; // detect if any vertices from set were moved 00019 Vertex_Schedule (void); 00020 Vertex_Schedule (Vertex_Schedule const &); 00021 Vertex_Schedule& operator= (Vertex_Schedule const &); 00022 ~Vertex_Schedule (void); 00023 public: 00024 static Vertex_Schedule & instance (void); 00025 void calculateMoveLocation (Vertex * const); 00026 void collectVerticesToMoveNext (const int &); 00027 void readVertexSequence (const char *filename); 00028 00034 vp_cit beginVset (void) const 00035 { 00036 return vset.begin(); 00037 } 00038 00044 vp_cit endVset (void) const 00045 { 00046 return vset.end(); 00047 } 00048 00052 void incrementNumMovedVertsGroup (void) 00053 { 00054 count++; 00055 } 00056 00061 vector3 const * getVertexDestination (void) const 00062 { 00063 return &pH; 00064 } 00065 00070 Vertex * getCurrentVertex (void) const 00071 { 00072 return cv; 00073 } 00074 00079 Vertex * getSeedVertex (void) const 00080 { 00081 return seed; 00082 } 00083 00088 int getNumMovedVertsGroup (void) const 00089 { 00090 return count; 00091 } 00092 00097 void setNumMovedVertsGroup (int const & init_value) 00098 { 00099 count = init_value; 00100 } 00101 00106 bool noMoreVerticesToMove (void) const 00107 { 00108 return vset.empty(); 00109 } 00110 00116 int getReferenceCountMovedVerts (void) const 00117 { 00118 return count_ref; 00119 } 00120 00125 bool noSetVerticesMoved (void) const 00126 { 00127 return count_ref==count; 00128 } 00129 00130 }; 00131 00132 #endif