Removed redundant voxel base class.
This commit is contained in:
parent
26ea1d8ad3
commit
ee17f72753
@ -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 <typename Type>
|
||||
class Density : public Voxel<Type, int32_t>
|
||||
class Density
|
||||
{
|
||||
public:
|
||||
//We expose DensityType and MaterialType in this way so that, when code is
|
||||
|
@ -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 <typename Type>
|
||||
class Material : public Voxel<int32_t, Type>
|
||||
class Material
|
||||
{
|
||||
public:
|
||||
//We expose DensityType and MaterialType in this way so that, when code is
|
||||
|
@ -45,7 +45,7 @@ namespace PolyVox
|
||||
/// \sa Density, Material
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
template <typename Type, uint8_t NoOfMaterialBits, uint8_t NoOfDensityBits>
|
||||
class MaterialDensityPair : public Voxel<Type, Type>
|
||||
class MaterialDensityPair
|
||||
{
|
||||
public:
|
||||
//We expose DensityType and MaterialType in this way so that, when code is
|
||||
|
@ -31,28 +31,6 @@ freely, subject to the following restrictions:
|
||||
|
||||
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.
|
||||
// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user