polyvox/library/PolyVoxCore/source/SurfaceExtractors.cpp
2009-05-27 21:36:52 +00:00

33 lines
796 B
C++

#include "SurfaceExtractors.h"
#include "Volume.h"
#include "GradientEstimators.h"
#include "IndexedSurfacePatch.h"
#include "PolyVoxImpl/MarchingCubesTables.h"
#include "Region.h"
#include "VolumeSampler.h"
#include "PolyVoxImpl/DecimatedSurfaceExtractor.h"
#include "PolyVoxImpl/FastSurfaceExtractor.h"
#include <algorithm>
using namespace std;
namespace PolyVox
{
void extractSurface(Volume<uint8_t>* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch)
{
if(uLevel == 0)
{
extractFastSurfaceImpl(volumeData, region, singleMaterialPatch);
}
else
{
extractDecimatedSurfaceImpl(volumeData, uLevel, region, singleMaterialPatch);
}
singleMaterialPatch->m_v3dRegionPosition = region.getLowerCorner();
}
}