Removed redundant voxel base class.

This commit is contained in:
unknown 2012-02-19 17:22:35 +01:00
parent 26ea1d8ad3
commit ee17f72753
4 changed files with 4 additions and 26 deletions

View File

@ -52,7 +52,7 @@ namespace PolyVox
// int32_t template parameter is a dummy, required as the compiler expects to be able to declare an // 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. // instance of VoxelType::MaterialType without knowing that VoxelType doesn't actually have a material.
template <typename Type> template <typename Type>
class Density : public Voxel<Type, int32_t> class Density
{ {
public: public:
//We expose DensityType and MaterialType in this way so that, when code is //We expose DensityType and MaterialType in this way so that, when code is

View File

@ -49,7 +49,7 @@ namespace PolyVox
// int32_t template parameter is a dummy, required as the compiler expects to be able to declare an // 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. // instance of VoxelType::DensityType without knowing that VoxelType doesn't actually have a density.
template <typename Type> template <typename Type>
class Material : public Voxel<int32_t, Type> class Material
{ {
public: public:
//We expose DensityType and MaterialType in this way so that, when code is //We expose DensityType and MaterialType in this way so that, when code is

View File

@ -45,7 +45,7 @@ namespace PolyVox
/// \sa Density, Material /// \sa Density, Material
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template <typename Type, uint8_t NoOfMaterialBits, uint8_t NoOfDensityBits> template <typename Type, uint8_t NoOfMaterialBits, uint8_t NoOfDensityBits>
class MaterialDensityPair : public Voxel<Type, Type> class MaterialDensityPair
{ {
public: public:
//We expose DensityType and MaterialType in this way so that, when code is //We expose DensityType and MaterialType in this way so that, when code is

View File

@ -30,29 +30,7 @@ freely, subject to the following restrictions:
#include <limits> #include <limits>
namespace PolyVox namespace PolyVox
{ {
/// This class represents a voxel
////////////////////////////////////////////////////////////////////////////////
/// Detailed description...
////////////////////////////////////////////////////////////////////////////////
template <typename DenType, typename MatType>
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. // 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 // 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 // to also apply these properties to primative types which might be desirable (the Volume classes do accept primative types as template