The MarchingCubesSurfaceExtractor is currently used something like this:
SurfaceMesh<PositionMaterialNormal> mesh; CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh); surfaceExtractor.execute();
Note how you have to decalre a (fairly complex) mesh type first. I'd actually like to templatise the 'PositionMaterialNormal' on the material type as this is proving useful in Cubqiuity, but this would complicate the above sample even further.
Instead of being passed as a parameter, the mesh could be the return type of the execute() function. This should mean the user doesn't need to see the type but can instead handle it with the 'auto' keyword. Something like:
CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion()); auto mesh = surfaceExtractor.execute();
In practice the returned mesh would probably be some kind of C++11 smart pointer to simplify resource handling.
There's also the question of whether this surface extractor should be 'unclassed' into a simple function, but I think that is orthogonal to the problem at hand.