//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00017 #ifndef GENERICTRIMESH_H 00018 #define GENERICTRIMESH_H 00019 00020 00021 #include "GoTools/tesselator/GeneralMesh.h" 00022 #include <vector> 00023 /* #ifdef _MSC_VER */ 00024 /* #include <windows.h> */ 00025 /* #endif */ 00026 /* #include <GL/gl.h> */ 00027 00028 namespace Go 00029 { 00030 00035 class GO_API GenericTriMesh : public GeneralMesh 00036 { 00037 public: 00038 GenericTriMesh(int num_vert = 0, int num_tri = 0, 00039 bool use_normals = true, 00040 bool use_texcoords = false); 00041 00042 ~GenericTriMesh(); 00043 00044 bool useNormals() 00045 { return use_norm_; } 00046 00047 bool useTexCoords() 00048 { return use_texc_; } 00049 00051 virtual int numTriangles() 00052 { return triangles_.size()/3; } 00053 00054 virtual int numVertices() 00055 { return vert_.size()/3; } 00056 00057 void resize(int num_vert, int num_tri); 00058 00059 virtual double* vertexArray(); 00060 virtual double* paramArray(); 00061 virtual int atBoundary(int idx); 00062 int* boundaryArray(); 00063 double* normalArray(); 00064 double* texcoordArray(); 00065 virtual unsigned int* triangleIndexArray(); 00066 00067 virtual GenericTriMesh* asGenericTriMesh(); 00068 00069 private: 00070 bool use_norm_; 00071 bool use_texc_; 00072 00073 std::vector<double> vert_; 00074 std::vector<double> param_; 00075 std::vector<int> bd_; 00076 std::vector<double> norm_; 00077 std::vector<double> texc_; 00078 std::vector<unsigned int> triangles_; 00079 00080 }; 00081 00082 } // namespace Go 00083 00084 00085 00086 #endif // GENERICTRIMESH_H 00087
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3