#include "MySimpleMesh.h" #include using namespace std; MySimpleMesh::MySimpleMesh() { } MySimpleMesh::~MySimpleMesh() { } void MySimpleMesh::addVertex(float x, float y, float z) { MyVertex v; v.x = x; v.y = y; v.z = z; _vertexArray.push_back(v); } void MySimpleMesh::addFace(const std::list &indexes) { _indexArray.push_back(indexes); } void MySimpleMesh::print() const { cout << "Vertices: " << endl; for (vector::const_iterator v = _vertexArray.begin(); v != _vertexArray.end(); ++v) cout << " " << (*v).x << ", " << (*v).y << ", " << (*v).z << endl; cout << "Indexes: " << endl; for (vector::const_iterator i = _indexArray.begin(); i != _indexArray.end(); ++i) { MyFace face = *i; cout << " "; for (MyFace::const_iterator f = face.begin(); f != face.end(); ++f) cout << *f << " "; cout << endl; } }