Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Model.h

00001 // Mesh Algorithms: a library of algorithms to manipulate 3D meshes
00002 // Copyright (C) 2001 Tim Garthwaite and Jason Reposa
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 #ifndef MODEL_H
00019 #define MODEL_H
00020 
00021 #include "options.h"
00022 
00023 #include <cstdio>
00024 #include <cmath>
00025 #include <vector>
00026 #include <map>
00027 #include <string>
00028 #include "Triangle.h"
00029 #include "Vertex.h"
00030 #include "Color.h"
00031 #include "Normal.h"
00032 #include <GL/gl.h>
00033 
00035 class Model {
00040   bool clockwise;
00041 
00043   GLint numCorners;
00044 
00046   Normal * computeNormals(Vertex * x0, Vertex * x1, Vertex * x2);
00048   GLvoid configureVectors(std::vector <Vertex *> * v, std::vector <GLint> * vi, std::vector <Color *> * c);
00049 
00054   VS vertices;
00055 
00060   std::set <Triangle *> triangles;
00061 
00062  public:
00064   Model(std::vector <Vertex *> * v, 
00065    std::vector <GLint> * vi, 
00066    std::vector <Color *> * c, 
00067    bool order);
00068 
00069   const GLuint numVertices(); 
00070   const GLuint numTriangles(); 
00071 
00072   std::string toString(); 
00073 
00074   VS * getVertexList(); 
00075   std::set <Triangle *> * getTriangleList(); //<! Returns a set of the triangles.
00076 
00077   void addTriangle(Triangle * t);
00078   void removeTriangle(Triangle * t);
00079 
00080   void addVertex(Vertex * v);
00081   void removeVertex(Vertex * v);
00082 
00083   bool isClockwise();
00084   
00085   GLint getNumCorners();
00086   GLvoid setNumCorners(GLint i);
00087 };
00088 
00089 #endif

Generated on Fri Dec 21 00:16:48 2001 for Mesh Decimation by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001