diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h index 6b122323..45f78930 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.h @@ -38,12 +38,13 @@ freely, subject to the following restrictions: namespace PolyVox { - template + template class Mesh { public: typedef VertexType VertexType; + typedef IndexType IndexType; Mesh(); ~Mesh(); diff --git a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl index d2363046..7a57c748 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Mesh.inl @@ -23,54 +23,54 @@ freely, subject to the following restrictions: namespace PolyVox { - template - Mesh::Mesh() + template + Mesh::Mesh() { } - template - Mesh::~Mesh() + template + Mesh::~Mesh() { } - template - const std::vector& Mesh::getIndices(void) const + template + const std::vector& Mesh::getIndices(void) const { return m_vecTriangleIndices; } - template - uint32_t Mesh::getNoOfIndices(void) const + template + uint32_t Mesh::getNoOfIndices(void) const { return m_vecTriangleIndices.size(); } - template - uint32_t Mesh::getNoOfVertices(void) const + template + uint32_t Mesh::getNoOfVertices(void) const { return m_vecVertices.size(); } - template - const std::vector& Mesh::getVertices(void) const + template + const std::vector& Mesh::getVertices(void) const { return m_vecVertices; } - template - const Vector3DInt32& Mesh::getOffset(void) const + template + const Vector3DInt32& Mesh::getOffset(void) const { return m_offset; } - template - void Mesh::setOffset(const Vector3DInt32& offset) + template + void Mesh::setOffset(const Vector3DInt32& offset) { m_offset = offset; } - template - void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) + template + void Mesh::addTriangle(uint32_t index0, uint32_t index1, uint32_t index2) { //Make sure the specified indices correspond to valid vertices. POLYVOX_ASSERT(index0 < m_vecVertices.size(), "Index points at an invalid vertex."); @@ -82,28 +82,28 @@ namespace PolyVox m_vecTriangleIndices.push_back(index2); } - template - uint32_t Mesh::addVertex(const VertexType& vertex) + template + uint32_t Mesh::addVertex(const VertexType& vertex) { m_vecVertices.push_back(vertex); return m_vecVertices.size() - 1; } - template - void Mesh::clear(void) + template + void Mesh::clear(void) { m_vecVertices.clear(); m_vecTriangleIndices.clear(); } - template - bool Mesh::isEmpty(void) const + template + bool Mesh::isEmpty(void) const { return (getNoOfVertices() == 0) || (getNoOfIndices() == 0); } - template - void Mesh::removeUnusedVertices(void) + template + void Mesh::removeUnusedVertices(void) { std::vector isVertexUsed(m_vecVertices.size()); std::fill(isVertexUsed.begin(), isVertexUsed.end(), false); diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 49bd882c..e4555893 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -108,6 +108,11 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class LargeVolume; + //////////////////////////////////////////////////////////////////////////////// + // MarchingCubesSurfaceExtractor + //////////////////////////////////////////////////////////////////////////////// + template class MarchingCubesSurfaceExtractor; + //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex //////////////////////////////////////////////////////////////////////////////// @@ -134,6 +139,11 @@ namespace PolyVox typedef MaterialDensityPair MaterialDensityPair44; typedef MaterialDensityPair MaterialDensityPair88; + //////////////////////////////////////////////////////////////////////////////// + // Mesh + //////////////////////////////////////////////////////////////////////////////// + template class Mesh; + //////////////////////////////////////////////////////////////////////////////// // Pager //////////////////////////////////////////////////////////////////////////////// @@ -154,16 +164,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class SimpleVolume; - //////////////////////////////////////////////////////////////////////////////// - // MarchingCubesSurfaceExtractor - //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; - - //////////////////////////////////////////////////////////////////////////////// - // Mesh - //////////////////////////////////////////////////////////////////////////////// - template class Mesh; - //////////////////////////////////////////////////////////////////////////////// // Vector ////////////////////////////////////////////////////////////////////////////////