#include <Model.h>
Inheritance diagram for model::Model:
Public Member Functions | |
Model () | |
virtual | ~Model ()=0 |
void | setVertexs (vector< Vertex * > vertexs) |
Vertex * | getVertex (int i) |
vector< Vertex * > | getVertexs () |
Matrix | getModelVertexs () |
void | addVertex (Vertex *vertex) |
void | removeVertex (Vertex *vertex) |
void | updateVertices (Matrix vertexs) |
void | setFaces (vector< Face * > faces) |
Face * | getFace (int i) |
vector< Face * > | getFaces () |
void | addFace (Face *face) |
void | removeFace (Face *face) |
void | setLandmarks (vector< Landmark * > landmarks) |
vector< Landmark * > | getLandmarks () |
void | addLandmark (Landmark *landmark) |
void | removeLandmark (Landmark *landmark) |
void | setContours (vector< Contour * > contours) |
vector< Contour * > | getContours () |
void | addContour (Contour *contour) |
void | removeContour (Contour *contour) |
void | setAnnotations (vector< Annotation * > annotations) |
vector< Annotation * > | getAnnotations () |
void | addAnnotation (Annotation *annotation) |
void | removeAnnotation (Annotation *annotation) |
bool | save (char *filename) |
bool | save (ofstream *saveFile) |
bool | load (char *filename) |
bool | load (ifstream *loadFile) |
Protected Attributes | |
Vertex * | m_vertexs |
Face * | m_faces |
Landmark * | m_landmarks |
Contour * | m_contours |
Annotation * | m_annotations |
It contains Vertex's, Face's, Landmark's, Contour's, and Annotation's.
Definition at line 35 of file Model.h.
|
Write brief comment for Model here.
Definition at line 66 of file Model.h. 00066 {};
|
|
Write brief comment for ~Model here.
Definition at line 20 of file Model.cpp. 00020 { 00021 00022 }
|
|
Write brief comment for addAnnotation here.
Definition at line 548 of file Model.cpp. References m_annotations. 00548 { 00549 m_annotations.push_back(annotation); 00550 }
|
|
Write brief comment for addContour here.
Definition at line 460 of file Model.cpp. References m_contours. 00460 { 00461 m_contours.push_back(contour); 00462 }
|
|
Write brief comment for addFace here.
Definition at line 284 of file Model.cpp. References m_faces. Referenced by pcggui::CovertScene(), load(), and functions::Importer::readAttributes(). 00284 { 00285 m_faces.push_back(face); 00286 }
|
|
Write brief comment for addLandmark here.
Definition at line 372 of file Model.cpp. References m_landmarks. 00372 { 00373 m_landmarks.push_back(landmark); 00374 }
|
|
Write brief comment for addVertex here.
Definition at line 141 of file Model.cpp. References m_vertexs, and model::Vertex::setIndex(). Referenced by pcggui::CovertScene(), load(), and functions::Importer::readAttributes().
|
Here is the call graph for this function:
|
Write brief comment for getAnnotations here.
Definition at line 526 of file Model.cpp. 00526 {
00527 return m_annotations;
00528 }
|
|
Write brief comment for getContours here.
Definition at line 438 of file Model.cpp. 00438 {
00439 return m_contours;
00440 }
|
|
Write brief comment for getFace here.
Definition at line 240 of file Model.cpp. References m_faces. Referenced by functions::Importer::readAttributes(), and pcggui::Render(). 00240 { 00241 return m_faces[i]; 00242 }
|
|
Write brief comment for getFaces here.
Definition at line 262 of file Model.cpp. Referenced by functions::Exporter::exportModel(), pcggui::Render(), and log::write(). 00262 {
00263 return m_faces;
00264 }
|
|
Write brief comment for getLandmarks here.
Definition at line 350 of file Model.cpp. 00350 {
00351 return m_landmarks;
00352 }
|
|
Write brief comment for getModelVertexs here.
Definition at line 111 of file Model.cpp. References model::Vertex::getCoordinates(), and m_vertexs. Referenced by model::Analyzer::mergeData(). 00111 { 00112 int size = m_vertexs.size(); 00113 Matrix v(size*3,1); 00114 for(int i=0; i<(int)m_vertexs.size(); i++) { 00115 IvVector3* tmp = m_vertexs[i]->getCoordinates(); 00116 v((i*3)+1,1) = tmp->x; 00117 v((i*3)+2,1) = tmp->y; 00118 v((i*3)+3,1) = tmp->z; 00119 } 00120 return v; 00121 }
|
Here is the call graph for this function:
|
Write brief comment for getVertex here.
Definition at line 67 of file Model.cpp. References m_vertexs. Referenced by pcggui::CovertScene(), load(), functions::Importer::readAttributes(), and pcggui::Render(). 00067 { 00068 return m_vertexs[i]; 00069 }
|
|
Write brief comment for getVertexs here.
Definition at line 89 of file Model.cpp. Referenced by functions::Exporter::exportModel(), pcggui::Render(), and log::write(). 00089 {
00090 return m_vertexs;
00091 }
|
|
Write brief comment for load here.
Reimplemented in model::ReferenceModel. Definition at line 711 of file Model.cpp. References addFace(), addVertex(), getVertex(), m_annotations, m_contours, m_faces, m_landmarks, m_vertexs, model::Vertex::setCoordinates(), model::Vertex::setNormal(), model::Face::setVertices(), and Tokenize(). 00711 { 00712 m_vertexs.clear(); 00713 m_faces.clear(); 00714 m_landmarks.clear(); 00715 m_contours.clear(); 00716 m_annotations.clear(); 00717 00718 00719 string line; 00720 vector<string> tokens; 00721 vector<string> coords; 00722 if(loadFile->is_open()) { 00723 getline(*loadFile,line);//Vertex 00724 getline(*loadFile,line);//Coords 00725 tokens.clear(); 00726 Tokenize(line,tokens,","); 00727 for(int i=0;i<(int)tokens.size();i++) { 00728 coords.clear(); 00729 Tokenize(tokens[i],coords," "); 00730 Vertex* vertex = new Vertex(); 00731 vertex->setCoordinates(convertTo<float>(coords[0]),convertTo<float>(coords[1]),convertTo<float>(coords[2])); 00732 addVertex(vertex); 00733 } 00734 getline(*loadFile,line);//Normals 00735 tokens.clear(); 00736 Tokenize(line,tokens,","); 00737 for(int i=0;i<(int)tokens.size();i++) { 00738 coords.clear(); 00739 Tokenize(tokens[i],coords," "); 00740 Vertex* vertex = getVertex(i); 00741 vertex->setNormal(convertTo<float>(coords[0]),convertTo<float>(coords[1]),convertTo<float>(coords[2])); 00742 } 00743 getline(*loadFile,line);//Face 00744 getline(*loadFile,line);//Indexs 00745 tokens.clear(); 00746 Tokenize(line,tokens,","); 00747 for(int i=0;i<(int)tokens.size();i++) { 00748 coords.clear(); 00749 Tokenize(tokens[i],coords," "); 00750 Face* face = new Face(); 00751 face->setVertices(m_vertexs[convertTo<int>(coords[0])],m_vertexs[convertTo<int>(coords[1])],m_vertexs[convertTo<int>(coords[2])]); 00752 addFace(face); 00753 } 00754 getline(*loadFile,line);//Landmark 00755 getline(*loadFile,line);//Data 00756 tokens.clear(); 00757 Tokenize(line,tokens,","); 00758 for(int i=0;i<(int)tokens.size();i++) { 00759 coords.clear(); 00760 Tokenize(tokens[i],coords," "); 00761 //addLandmark 00762 } 00763 getline(*loadFile,line);//Contour 00764 getline(*loadFile,line);//Data 00765 tokens.clear(); 00766 Tokenize(line,tokens,","); 00767 for(int i=0;i<(int)tokens.size();i++) { 00768 coords.clear(); 00769 Tokenize(tokens[i],coords," "); 00770 } 00771 getline(*loadFile,line);//Annotation 00772 getline(*loadFile,line);//Data 00773 tokens.clear(); 00774 Tokenize(line,tokens,","); 00775 for(int i=0;i<(int)tokens.size();i++) { 00776 coords.clear(); 00777 Tokenize(tokens[i],coords," "); 00778 } 00779 return true; 00780 } else { 00781 return false; 00782 } 00783 }
|
Here is the call graph for this function:
|
Write brief comment for load here.
Reimplemented in model::ReferenceModel. Definition at line 683 of file Model.cpp. Referenced by model::ReferenceModel::load(), and pcggui::LoadAll(). 00683 { 00684 ifstream loadFile(filename); 00685 bool res = load(&loadFile); 00686 loadFile.close(); 00687 return res; 00688 }
|
|
Write brief comment for removeAnnotation here.
Definition at line 570 of file Model.cpp. 00570 {
00571 //m_annotations.remove(annotation);
00572 }
|
|
Write brief comment for removeContour here.
Definition at line 482 of file Model.cpp. 00482 {
00483 //m_contours.remove(contour);
00484 }
|
|
Write brief comment for removeFace here.
Definition at line 306 of file Model.cpp. 00306 {
00307 //m_faces.remove(face);
00308 }
|
|
Write brief comment for removeLandmark here.
Definition at line 394 of file Model.cpp. 00394 {
00395 //m_landmarks.remove(landmark);
00396 }
|
|
Write brief comment for removeVertex here.
Definition at line 164 of file Model.cpp. 00164 {
00165 //m_vertexs.erase(vertex);
00166 }
|
|
Write brief comment for save here.
Reimplemented in model::ReferenceModel. Definition at line 623 of file Model.cpp. References model::Vertex::getCoordinates(), model::Vertex::getIndex(), model::Vertex::getNormal(), model::Face::getVertex(), m_annotations, m_contours, m_faces, m_landmarks, and m_vertexs. 00623 { 00624 if(saveFile->is_open()) { 00625 *saveFile << "Vertex\n"; 00626 for(int i=0;i<(int)m_vertexs.size();i++) { 00627 *saveFile << m_vertexs[i]->getCoordinates()->x << " "; 00628 *saveFile << m_vertexs[i]->getCoordinates()->y << " "; 00629 *saveFile << m_vertexs[i]->getCoordinates()->z << ","; 00630 } 00631 *saveFile << "\n"; 00632 for(int i=0;i<(int)m_vertexs.size();i++) { 00633 *saveFile << m_vertexs[i]->getNormal()->x << " "; 00634 *saveFile << m_vertexs[i]->getNormal()->y << " "; 00635 *saveFile << m_vertexs[i]->getNormal()->z << ","; 00636 } 00637 *saveFile << "\nFace\n"; 00638 for(int i=0;i<(int)m_faces.size();i++) { 00639 *saveFile << m_faces[i]->getVertex(0)->getIndex() << " "; 00640 *saveFile << m_faces[i]->getVertex(1)->getIndex() << " "; 00641 *saveFile << m_faces[i]->getVertex(2)->getIndex() << ","; 00642 } 00643 *saveFile << "\nLandmark\n"; 00644 for(int i=0;i<(int)m_landmarks.size();i++) { 00645 //saveFile << m_landmarks[i] << " "; 00646 } 00647 *saveFile << "\nContour\n"; 00648 for(int i=0;i<(int)m_contours.size();i++) { 00649 //saveFile << m_contours[i] << " "; 00650 } 00651 *saveFile << "\nAnnotation\n"; 00652 for(int i=0;i<(int)m_annotations.size();i++) { 00653 //saveFile << m_annotations[i] << " "; 00654 } 00655 *saveFile << "\n"; 00656 return true; 00657 } else { 00658 return false; 00659 } 00660 }
|
Here is the call graph for this function:
|
Write brief comment for save here.
Reimplemented in model::ReferenceModel. Definition at line 595 of file Model.cpp. Referenced by model::ReferenceModel::save(). 00595 { 00596 ofstream saveFile(filename); 00597 bool res = save(&saveFile); 00598 saveFile.close(); 00599 return res; 00600 }
|
|
Write brief comment for setAnnotations here.
Definition at line 504 of file Model.cpp. References m_annotations. 00504 { 00505 m_annotations = annotations; 00506 }
|
|
Write brief comment for setContours here.
Definition at line 416 of file Model.cpp. References m_contours. 00416 { 00417 m_contours = contours; 00418 }
|
|
Write brief comment for setFaces here.
Definition at line 215 of file Model.cpp. References m_faces. Referenced by Batch::analyzeModel(), and Batch::TestAnalyzer(). 00215 { 00216 m_faces = faces; 00217 }
|
|
Write brief comment for setLandmarks here.
Definition at line 328 of file Model.cpp. References m_landmarks. 00328 { 00329 m_landmarks = landmarks; 00330 }
|
|
Write brief comment for setVertexs here.
Definition at line 42 of file Model.cpp. References m_vertexs. Referenced by Batch::analyzeModel(), and Batch::TestAnalyzer(). 00042 { 00043 m_vertexs = vertexs; 00044 }
|
|
Write brief comment for updateVertices here.
Definition at line 186 of file Model.cpp. References m_vertexs, and model::Vertex::updateCoordinates(). Referenced by model::Analyzer::getModel(). 00186 { 00187 printf("Model::updateVertices\n"); 00188 for(int i=0; i<(int)m_vertexs.size();i++) { 00189 float x = (float)vertexs(i*3+1,1); 00190 float y = (float)vertexs(i*3+2,1); 00191 float z = (float)vertexs(i*3+3,1); 00192 m_vertexs[i]->updateCoordinates(x,y,z); 00193 } 00194 }
|
Here is the call graph for this function:
|
A Collection of Annotation's Definition at line 42 of file Model.h. Referenced by addAnnotation(), load(), model::ReferenceModel::operator=(), model::ReferenceModel::ReferenceModel(), save(), and setAnnotations(). |
|
A Collection of Contour's Definition at line 41 of file Model.h. Referenced by addContour(), load(), model::ReferenceModel::operator=(), model::ReferenceModel::ReferenceModel(), save(), and setContours(). |
|
A Collection of Face's Definition at line 39 of file Model.h. Referenced by addFace(), getFace(), load(), model::ReferenceModel::operator=(), model::ReferenceModel::ReferenceModel(), save(), and setFaces(). |
|
A Collection of Landmark's Definition at line 40 of file Model.h. Referenced by addLandmark(), load(), model::ReferenceModel::operator=(), model::ReferenceModel::ReferenceModel(), save(), and setLandmarks(). |
|
A Collection of Vertex's Definition at line 38 of file Model.h. Referenced by addVertex(), getModelVertexs(), getVertex(), load(), model::ReferenceModel::operator=(), model::ReferenceModel::ReferenceModel(), save(), setVertexs(), and updateVertices(). |