29 #ifndef __ProgressiveMeshGenerator_H_
30 #define __ProgressiveMeshGenerator_H_
49 virtual void generateLodLevels(
LodConfig& lodConfig) = 0;
56 virtual void generateAutoconfiguredLodLevels(
MeshPtr& mesh);
81 void generateLodLevels(
LodConfig& lodConfig);
89 template<
typename T,
unsigned S>
94 void addNotExists(
const T& item);
97 void removeExists(
const T& item);
98 bool remove(
const T& item);
99 void replaceExists(
const T& oldItem,
const T& newItem);
100 bool has(
const T& item);
110 struct PMCollapseCostLess;
132 size_t operator() (
const PMVertex* v)
const;
168 unsigned int vertexID[3];
170 void computeNormal();
171 bool hasVertex(
const PMVertex* v)
const;
172 unsigned int getVertexID(
const PMVertex* v)
const;
214 size_t calcLodVertexCount(
const LodLevel& lodConfig);
215 void tuneContainerSize();
216 void addVertexData(
VertexData* vertexData,
bool useSharedVertexLookup);
217 template<
typename IndexType>
218 void addIndexDataImpl(IndexType* iPos,
const IndexType* iEnd,
VertexLookupList& lookup,
unsigned short submeshID);
219 void addIndexData(
IndexData* indexData,
bool useSharedVertexLookup,
unsigned short submeshID);
222 bool isBorderVertex(
const PMVertex* vertex)
const;
224 void computeVertexCollapseCost(
PMVertex* vertex);
226 virtual void bakeLods();
230 void updateVertexCollapseCost(
PMVertex* src);
232 bool hasSrcID(
unsigned int srcID,
unsigned short submeshID);
233 size_t findDstID(
unsigned int srcID,
unsigned short submeshID);
234 void replaceVertexID(
PMTriangle* triangle,
unsigned int oldID,
unsigned int newID,
PMVertex* dst);
237 void assertValidVertex(
PMVertex* v);
238 void assertValidMesh();
239 void assertOutdatedCollapseCost(
PMVertex* vertex);
240 #endif // ifndef NDEBUG
242 void addTriangleToEdges(
PMTriangle* triangle);
251 void cleanupMemory();