Initial function wrapper around CubicSurfaceExtractorWithNormals.
This commit is contained in:
parent
1cf5f4c899
commit
67ec0d2db8
@ -81,11 +81,14 @@ int main(int argc, char *argv[])
|
|||||||
SurfaceMesh<PositionMaterialNormal> mesh;
|
SurfaceMesh<PositionMaterialNormal> mesh;
|
||||||
|
|
||||||
//Create a surface extractor. Comment out one of the following two lines to decide which type gets created.
|
//Create a surface extractor. Comment out one of the following two lines to decide which type gets created.
|
||||||
CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
//CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
||||||
//MarchingCubesSurfaceExtractor< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
//MarchingCubesSurfaceExtractor< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
||||||
|
|
||||||
//Execute the surface extractor.
|
//Execute the surface extractor.
|
||||||
surfaceExtractor.execute();
|
//surfaceExtractor.execute();
|
||||||
|
|
||||||
|
DefaultIsQuadNeeded< uint8_t > isQuadNeeded;
|
||||||
|
mesh = extractCubicSurfaceWithNormals< SimpleVolume<uint8_t>, DefaultIsQuadNeeded< uint8_t > >(&volData, volData.getEnclosingRegion(), WrapModes::Border, 0, isQuadNeeded);
|
||||||
|
|
||||||
//Pass the surface to the OpenGL window
|
//Pass the surface to the OpenGL window
|
||||||
openGLWidget.setSurfaceMeshToRender(mesh);
|
openGLWidget.setSurfaceMeshToRender(mesh);
|
||||||
|
@ -63,6 +63,15 @@ namespace PolyVox
|
|||||||
WrapMode m_eWrapMode;
|
WrapMode m_eWrapMode;
|
||||||
typename VolumeType::VoxelType m_tBorderValue;
|
typename VolumeType::VoxelType m_tBorderValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename VolumeType, typename IsQuadNeeded>
|
||||||
|
SurfaceMesh<PositionMaterialNormal> extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, IsQuadNeeded isQuadNeeded)
|
||||||
|
{
|
||||||
|
SurfaceMesh<PositionMaterialNormal> result;
|
||||||
|
CubicSurfaceExtractorWithNormals<VolumeType, IsQuadNeeded> extractor(volData, region, &result, eWrapMode, tBorderValue, isQuadNeeded);
|
||||||
|
extractor.execute();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "PolyVoxCore/CubicSurfaceExtractorWithNormals.inl"
|
#include "PolyVoxCore/CubicSurfaceExtractorWithNormals.inl"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user