polyvox/library/PolyVoxCore/source/SurfaceExtractors.cpp
2009-05-05 07:58:04 +00:00

34 lines
828 B
C++

#include "SurfaceExtractors.h"
#include "Volume.h"
#include "GradientEstimators.h"
#include "IndexedSurfacePatch.h"
#include "PolyVoxImpl/MarchingCubesTables.h"
#include "Region.h"
#include "SurfaceAdjusters.h"
#include "VolumeIterator.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();
}
}