Changed interface to SurfaceExtractor.
This commit is contained in:
@ -82,11 +82,12 @@ int main(int argc, char *argv[])
|
||||
createSphereInVolume(volData, 30);
|
||||
|
||||
//Extract the surface
|
||||
SurfaceExtractor<MaterialDensityPair44> surfaceExtractor(volData);
|
||||
shared_ptr<SurfaceMesh> surface = surfaceExtractor.extractSurfaceForRegion(volData.getEnclosingRegion());
|
||||
SurfaceMesh mesh;
|
||||
SurfaceExtractor<MaterialDensityPair44> surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
||||
surfaceExtractor.execute();
|
||||
|
||||
//Pass the surface to the OpenGL window
|
||||
openGLWidget.setSurfaceMeshToRender(*surface);
|
||||
openGLWidget.setSurfaceMeshToRender(mesh);
|
||||
|
||||
//Run the message pump.
|
||||
return app.exec();
|
||||
|
@ -63,8 +63,6 @@ void OpenGLWidget::setVolume(PolyVox::Volume<MaterialDensityPair44>* volData)
|
||||
m_uVolumeHeightInRegions = volData->getHeight() / m_uRegionSideLength;
|
||||
m_uVolumeDepthInRegions = volData->getDepth() / m_uRegionSideLength;
|
||||
|
||||
SurfaceExtractor<MaterialDensityPair44> surfaceExtractor(*volData);
|
||||
|
||||
//Our volume is broken down into cuboid regions, and we create one mesh for each region.
|
||||
//This three-level for loop iterates over each region.
|
||||
for(uint16_t uRegionZ = 0; uRegionZ < m_uVolumeDepthInRegions; ++uRegionZ)
|
||||
@ -90,7 +88,10 @@ void OpenGLWidget::setVolume(PolyVox::Volume<MaterialDensityPair44>* volData)
|
||||
|
||||
//Extract the surface for this region
|
||||
//extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent);
|
||||
shared_ptr<SurfaceMesh> mesh = surfaceExtractor.extractSurfaceForRegion(PolyVox::Region(regLowerCorner, regUpperCorner));
|
||||
|
||||
shared_ptr<SurfaceMesh> mesh(new SurfaceMesh);
|
||||
SurfaceExtractor<MaterialDensityPair44> surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get());
|
||||
surfaceExtractor.execute();
|
||||
|
||||
//computeNormalsForVertices(m_volData, *(mesh.get()), SOBEL_SMOOTHED);
|
||||
//*meshCurrent = getSmoothedSurface(*meshCurrent);
|
||||
|
Reference in New Issue
Block a user