diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index 745fda3d..b6826319 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -52,7 +52,7 @@ namespace PolyVox // int32_t template parameter is a dummy, required as the compiler expects to be able to declare an // instance of VoxelType::MaterialType without knowing that VoxelType doesn't actually have a material. template - class Density : public Voxel + class Density { public: //We expose DensityType and MaterialType in this way so that, when code is diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/library/PolyVoxCore/include/PolyVoxCore/Material.h index a5473f5a..8b905a0b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Material.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Material.h @@ -49,7 +49,7 @@ namespace PolyVox // int32_t template parameter is a dummy, required as the compiler expects to be able to declare an // instance of VoxelType::DensityType without knowing that VoxelType doesn't actually have a density. template - class Material : public Voxel + class Material { public: //We expose DensityType and MaterialType in this way so that, when code is diff --git a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h index e8a89ecc..7fb8bd74 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MaterialDensityPair.h @@ -45,7 +45,7 @@ namespace PolyVox /// \sa Density, Material //////////////////////////////////////////////////////////////////////////////// template - class MaterialDensityPair : public Voxel + class MaterialDensityPair { public: //We expose DensityType and MaterialType in this way so that, when code is diff --git a/library/PolyVoxCore/include/PolyVoxCore/Voxel.h b/library/PolyVoxCore/include/PolyVoxCore/Voxel.h index ecd70ac5..48a8f406 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Voxel.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Voxel.h @@ -30,29 +30,7 @@ freely, subject to the following restrictions: #include namespace PolyVox -{ - /// This class represents a voxel - //////////////////////////////////////////////////////////////////////////////// - /// Detailed description... - //////////////////////////////////////////////////////////////////////////////// - template - class Voxel - { - public: - // We expose DensityType and MaterialType in this way so that, when code is - // templatised on voxel type, it can determine the underlying storage type - // using code such as 'VoxelType::DensityType value = voxel.getDensity()' - // or 'VoxelType::MaterialType value = voxel.getMaterial()'. - typedef DenType DensityType; - typedef MatType MaterialType; - - DensityType getDensity() const throw() { assert(false); return 0; } - MaterialType getMaterial() const throw() { assert(false); return 0; } - - void setDensity(DensityType uDensity) { assert(false); } - void setMaterial(MaterialType /*uMaterial*/) { assert(false); } - }; - +{ // Various properties of the voxel types can be expressed via types traits, similar to the way std::numeric_limits is implemented. // This has some advantages compared to storing the properties directly in the voxel class. For example, by using traits it is possible // to also apply these properties to primative types which might be desirable (the Volume classes do accept primative types as template