From 04c4e49aa19705ad03ddf9b117df818527c1736e Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 25 May 2015 21:23:27 +0200 Subject: [PATCH] Fully eliminated MarchingCubesSurfaceExtractor class. It's now only a standalone function called 'extractMarchingCubesMesh'. --- include/PolyVox/MarchingCubesSurfaceExtractor.h | 16 +--------------- .../PolyVox/MarchingCubesSurfaceExtractor.inl | 9 ++------- include/PolyVox/PolyVoxForwardDeclarations.h | 5 ----- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/include/PolyVox/MarchingCubesSurfaceExtractor.h b/include/PolyVox/MarchingCubesSurfaceExtractor.h index ee6fd518..0bd2df59 100644 --- a/include/PolyVox/MarchingCubesSurfaceExtractor.h +++ b/include/PolyVox/MarchingCubesSurfaceExtractor.h @@ -148,16 +148,6 @@ namespace PolyVox return result; } - /// Do not use this class directly. Use the 'extractMarchingCubesSurface' function instead (see examples). - template< typename VolumeType, typename MeshType, typename ControllerType> - class MarchingCubesSurfaceExtractor - { - public: - MarchingCubesSurfaceExtractor(); - - void execute(VolumeType* volData, Region region, MeshType* result, ControllerType controller); - }; - // This version of the function performs the extraction into a user-provided mesh rather than allocating a mesh automatically. // There are a few reasons why this might be useful to more advanced users: // @@ -172,11 +162,7 @@ namespace PolyVox // are provided (would the third parameter be a controller or a mesh?). It seems this can be fixed by using enable_if/static_assert to emulate concepts, // but this is relatively complex and I haven't done it yet. Could always add it later as another overload. template< typename VolumeType, typename MeshType, typename ControllerType = DefaultMarchingCubesController > - void extractMarchingCubesMeshCustom(VolumeType* volData, Region region, MeshType* result, ControllerType controller = ControllerType()) - { - MarchingCubesSurfaceExtractor extractor; - extractor.execute(volData, region, result, controller); - } + void extractMarchingCubesMeshCustom(VolumeType* volData, Region region, MeshType* result, ControllerType controller = ControllerType()); template< typename VolumeType, typename ControllerType = DefaultMarchingCubesController > Mesh > extractMarchingCubesMesh(VolumeType* volData, Region region, ControllerType controller = ControllerType()) diff --git a/include/PolyVox/MarchingCubesSurfaceExtractor.inl b/include/PolyVox/MarchingCubesSurfaceExtractor.inl index 0ed3d28d..cc6b1c97 100644 --- a/include/PolyVox/MarchingCubesSurfaceExtractor.inl +++ b/include/PolyVox/MarchingCubesSurfaceExtractor.inl @@ -48,13 +48,8 @@ namespace PolyVox ); } - template - MarchingCubesSurfaceExtractor::MarchingCubesSurfaceExtractor() - { - } - - template - void MarchingCubesSurfaceExtractor::execute(VolumeType* volData, Region region, MeshType* result, ControllerType controller) + template< typename VolumeType, typename MeshType, typename ControllerType > + void extractMarchingCubesMeshCustom(VolumeType* volData, Region region, MeshType* result, ControllerType controller) { POLYVOX_THROW_IF(result == nullptr, std::invalid_argument, "Provided mesh cannot be null"); diff --git a/include/PolyVox/PolyVoxForwardDeclarations.h b/include/PolyVox/PolyVoxForwardDeclarations.h index 9dbc44ca..c0c1f872 100644 --- a/include/PolyVox/PolyVoxForwardDeclarations.h +++ b/include/PolyVox/PolyVoxForwardDeclarations.h @@ -98,11 +98,6 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template class FilePager; - //////////////////////////////////////////////////////////////////////////////// - // MarchingCubesSurfaceExtractor - //////////////////////////////////////////////////////////////////////////////// - template class MarchingCubesSurfaceExtractor; - //////////////////////////////////////////////////////////////////////////////// // MarchingCubesVertex ////////////////////////////////////////////////////////////////////////////////