csgeom/trimeshlod.h
00001 /* 00002 Copyright (C) 1998,2001 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 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 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_TRIMESHLOD_H__ 00020 #define __CS_TRIMESHLOD_H__ 00021 00022 #include "csextern.h" 00023 00024 #include "csgeom/math3d.h" 00025 #include "csgeom/trimesh.h" 00026 00027 class csTriangleVerticesCost; 00028 00034 class CS_CSGEOM_EXPORT csTriangleVertexCost : public csTriangleVertex 00035 { 00036 public: 00038 bool deleted; 00039 00041 float cost; 00043 int to_vertex; 00044 00046 csTriangleVertexCost () : deleted (false) { } 00048 ~csTriangleVertexCost () { } 00050 bool DelVertex (int idx); 00052 void ReplaceVertex (int old, int replace); 00053 00058 void CalculateCost (csTriangleVerticesCost* vertices); 00059 }; 00060 00067 class CS_CSGEOM_EXPORT csTriangleVerticesCost 00068 { 00069 private: 00070 csTriangleVertexCost* vertices; 00071 int num_vertices; 00072 00073 public: 00075 csTriangleVerticesCost (csTriangleMesh* mesh, csVector3* verts, 00076 int num_verts); 00078 ~csTriangleVerticesCost (); 00083 void UpdateVertices (csVector3* verts); 00084 00086 int GetVertexCount () { return num_vertices; } 00088 csTriangleVertexCost& GetVertex (int idx) { return vertices[idx]; } 00089 00091 void CalculateCost (); 00092 00094 int GetMinimalCostVertex (); 00095 00097 void Dump (); 00098 }; 00099 00104 class CS_CSGEOM_EXPORT csTriangleMeshLOD 00105 { 00106 public: 00122 static void CalculateLOD (csTriangleMesh* mesh, csTriangleVerticesCost* verts, 00123 int* translate, int* emerge_from); 00124 }; 00125 00126 00127 #endif // __CS_TRIMESHLOD_H__ 00128
Generated for Crystal Space by doxygen 1.2.18