Added template template parameters to CubicSurfaceExtractorWithNormals.
This commit is contained in:
parent
87d97436ea
commit
36a9be83db
@ -83,7 +83,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
//Extract the surface
|
||||
SurfaceMesh<PositionMaterialNormal> mesh;
|
||||
CubicSurfaceExtractorWithNormals<SimpleVolume <MaterialDensityPair44>, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
||||
CubicSurfaceExtractorWithNormals<SimpleVolume, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
|
||||
surfaceExtractor.execute();
|
||||
|
||||
//Pass the surface to the OpenGL window
|
||||
|
@ -31,18 +31,18 @@ freely, subject to the following restrictions:
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VolumeType, typename VoxelType>
|
||||
template< template<typename> class VolumeType, typename VoxelType>
|
||||
class CubicSurfaceExtractorWithNormals
|
||||
{
|
||||
public:
|
||||
CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result);
|
||||
CubicSurfaceExtractorWithNormals(VolumeType<VoxelType>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result);
|
||||
|
||||
void execute();
|
||||
|
||||
private:
|
||||
//The volume data and a sampler to access it.
|
||||
VolumeType* m_volData;
|
||||
typename VolumeType::Sampler m_sampVolume;
|
||||
VolumeType<VoxelType>* m_volData;
|
||||
typename VolumeType<VoxelType>::Sampler m_sampVolume;
|
||||
|
||||
//The surface patch we are currently filling.
|
||||
SurfaceMesh<PositionMaterialNormal>* m_meshCurrent;
|
||||
|
@ -29,8 +29,8 @@ freely, subject to the following restrictions:
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename VolumeType, typename VoxelType>
|
||||
CubicSurfaceExtractorWithNormals<VolumeType, VoxelType>::CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result)
|
||||
template< template<typename> class VolumeType, typename VoxelType>
|
||||
CubicSurfaceExtractorWithNormals<VolumeType, VoxelType>::CubicSurfaceExtractorWithNormals(VolumeType<VoxelType>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result)
|
||||
:m_volData(volData)
|
||||
,m_sampVolume(volData)
|
||||
,m_regSizeInVoxels(region)
|
||||
@ -39,7 +39,7 @@ namespace PolyVox
|
||||
m_meshCurrent->clear();
|
||||
}
|
||||
|
||||
template <typename VolumeType, typename VoxelType>
|
||||
template< template<typename> class VolumeType, typename VoxelType>
|
||||
void CubicSurfaceExtractorWithNormals<VolumeType, VoxelType>::execute()
|
||||
{
|
||||
for(int32_t z = m_regSizeInVoxels.getLowerCorner().getZ(); z < m_regSizeInVoxels.getUpperCorner().getZ(); z++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user