00001 #ifndef MODEL_H 00002 #define MODEL_H 00003 00004 #include "Vertex.h" 00005 #include "Face.h" 00006 #include "Landmark.h" 00007 #include "Contour.h" 00008 #include "Annotation.h" 00009 #include <vector> 00010 #include "include/matrix/newmat.h" 00011 #include <iostream> 00012 #include <fstream> 00013 #include <string> 00014 #include <func.h> 00015 00016 00017 using namespace std; 00018 00019 namespace model { 00020 00035 class Model { 00036 protected: 00037 #ifdef DOXYGEN_SHOULD_SKIP_THIS 00038 Vertex* m_vertexs; 00039 Face* m_faces; 00040 Landmark* m_landmarks; 00041 Contour* m_contours; 00042 Annotation* m_annotations; 00043 #else 00044 vector<Vertex*> m_vertexs; 00045 vector<Face*> m_faces; 00046 vector<Landmark*> m_landmarks; 00047 vector<Contour*> m_contours; 00048 vector<Annotation*> m_annotations; 00049 #endif 00050 public: 00066 Model() {}; 00067 00068 virtual ~Model()=0; 00069 00070 void setVertexs(vector<Vertex*> vertexs); 00071 Vertex* getVertex(int i); 00072 vector<Vertex*> getVertexs(); 00073 Matrix getModelVertexs(); 00074 void addVertex(Vertex* vertex); 00075 void removeVertex(Vertex* vertex); 00076 void updateVertices(Matrix vertexs); 00077 00078 void setFaces(vector<Face*> faces); 00079 Face* getFace(int i); 00080 vector<Face*> getFaces(); 00081 void addFace(Face* face); 00082 void removeFace(Face* face); 00083 00084 void setLandmarks(vector<Landmark*> landmarks); 00085 vector<Landmark*> getLandmarks(); 00086 void addLandmark(Landmark *landmark); 00087 void removeLandmark(Landmark* landmark); 00088 00089 void setContours(vector<Contour*> contours); 00090 vector<Contour*> getContours(); 00091 void addContour(Contour* contour); 00092 void removeContour(Contour* contour); 00093 00094 void setAnnotations(vector<Annotation*> annotations); 00095 vector<Annotation*> getAnnotations(); 00096 void addAnnotation(Annotation* annotation); 00097 void removeAnnotation(Annotation *annotation); 00098 00099 bool save(char* filename); 00100 bool save(ofstream* saveFile); 00101 bool load(char* filename); 00102 bool load(ifstream* loadFile); 00103 }; 00104 00110 } 00111 00112 #endif //MODEL_H