While trying to wrap my surfacePointExtractor I ran into the same problems that the CubicSurfaceExtractor had so I went ahead trying to fix that before working on the point extractor further. I got it working after a while...
So I made two major (but not breaking changes), I moved the declaration of the volumeSampler from inside the execute() function to a private member. I also moved the body of the execute() function to a private member function, and having execute() simply call that. That solved the problems with swig not being able to handle nested functions.
Also instead of using
Code:
typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel();
for example, I used
Code:
auto currentVoxel = ...
Secondly I made a dirty fix in the interface file for the Cubic extractor by using %rename(getDensity) getMaterial; because for some reason swig claims that there is no member getMaterial for the voxels.
[edit] After writing all that I found another solution is using the SurfaceExtractionController and use it's converToMaterial method instead of calling getMaterial on the voxel directly, this removed the nasty %rename directive in the interface file.
[edit] I checked git and SurfaceExtractorController has been renamed to DefaultMarchingCubesController.
Ah, these ExtractionControllers will allow us to have a custom threshold values and it fixes some of the swig binding issues? Neat!