Renamed MarchingCubesController to DefaultMarchingCubesController.
This commit is contained in:
		| @@ -29,18 +29,18 @@ freely, subject to the following restrictions: | ||||
| namespace PolyVox | ||||
| { | ||||
| 	template<typename VoxelType> | ||||
| 	class MarchingCubesController | ||||
| 	class DefaultMarchingCubesController | ||||
| 	{ | ||||
| 	public: | ||||
| 		typedef VoxelType DensityType; | ||||
| 		typedef float MaterialType; | ||||
| 
 | ||||
| 		MarchingCubesController(void) | ||||
| 		DefaultMarchingCubesController(void) | ||||
| 		{ | ||||
| 			m_tThreshold = ((std::numeric_limits<DensityType>::min)() + (std::numeric_limits<DensityType>::max)()) / 2; | ||||
| 		} | ||||
| 
 | ||||
| 		MarchingCubesController(DensityType tThreshold) | ||||
| 		DefaultMarchingCubesController(DensityType tThreshold) | ||||
| 		{ | ||||
| 			m_tThreshold = tThreshold; | ||||
| 		} | ||||
| @@ -24,7 +24,7 @@ freely, subject to the following restrictions: | ||||
| #ifndef __PolyVox_Density_H__ | ||||
| #define __PolyVox_Density_H__ | ||||
|  | ||||
| #include "PolyVoxCore/MarchingCubesController.h" //We'll specialise the controller contained in here | ||||
| #include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here | ||||
| #include "PolyVoxCore/Voxel.h" | ||||
|  | ||||
| #include "PolyVoxImpl/TypeDef.h" | ||||
| @@ -103,19 +103,19 @@ namespace PolyVox | ||||
| 	typedef Density<uint8_t> Density8; | ||||
|  | ||||
| 	template <typename Type> | ||||
| 	class MarchingCubesController< Density<Type> > | ||||
| 	class DefaultMarchingCubesController< Density<Type> > | ||||
| 	{ | ||||
| 	public: | ||||
| 		typedef Type DensityType; | ||||
| 		typedef float MaterialType; | ||||
|  | ||||
| 		MarchingCubesController(void) | ||||
| 		DefaultMarchingCubesController(void) | ||||
| 		{ | ||||
| 			// Default to a threshold value halfway between the min and max possible values. | ||||
| 			m_tThreshold = (Density<Type>::getMinDensity() + Density<Type>::getMaxDensity()) / 2; | ||||
| 		} | ||||
|  | ||||
| 		MarchingCubesController(DensityType tThreshold) | ||||
| 		DefaultMarchingCubesController(DensityType tThreshold) | ||||
| 		{ | ||||
| 			m_tThreshold = tThreshold; | ||||
| 		} | ||||
|   | ||||
| @@ -29,11 +29,11 @@ freely, subject to the following restrictions: | ||||
|  | ||||
| #include "PolyVoxCore/Array.h" | ||||
| #include "PolyVoxCore/SurfaceMesh.h" | ||||
| #include "PolyVoxCore/MarchingCubesController.h" | ||||
| #include "PolyVoxCore/DefaultMarchingCubesController.h" | ||||
|  | ||||
| namespace PolyVox | ||||
| { | ||||
| 	template< typename VolumeType, typename Controller = MarchingCubesController<typename VolumeType::VoxelType> > | ||||
| 	template< typename VolumeType, typename Controller = DefaultMarchingCubesController<typename VolumeType::VoxelType> > | ||||
| 	class MarchingCubesSurfaceExtractor | ||||
| 	{ | ||||
| 	public: | ||||
| @@ -209,10 +209,10 @@ namespace PolyVox | ||||
|  | ||||
| 		//Our threshold value | ||||
| 		//typename VoxelTypeTraits<typename VolumeType::VoxelType>::DensityType m_tThreshold; | ||||
| 		typename MarchingCubesController<typename VolumeType::VoxelType>::DensityType m_tThreshold; | ||||
| 		typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::DensityType m_tThreshold; | ||||
|  | ||||
| 		//Used to convert arbitrary voxel types in densities and materials. | ||||
| 		//MarchingCubesController<typename VolumeType::VoxelType> m_controller; | ||||
| 		//DefaultMarchingCubesController<typename VolumeType::VoxelType> m_controller; | ||||
| 		Controller m_controller; | ||||
| 	}; | ||||
| } | ||||
|   | ||||
| @@ -444,9 +444,9 @@ namespace PolyVox | ||||
| 					//Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of | ||||
| 					//material IDs does not make sense). We take the largest, so that if we are working on a material-only | ||||
| 					//volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial100 = m_controller.convertToMaterial(v100); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100); | ||||
|  | ||||
| 					PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast<float>(uMaterial)); | ||||
| 					uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); | ||||
| @@ -470,9 +470,9 @@ namespace PolyVox | ||||
| 					//Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of | ||||
| 					//material IDs does not make sense). We take the largest, so that if we are working on a material-only | ||||
| 					//volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial010 = m_controller.convertToMaterial(v010); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial010); | ||||
|  | ||||
| 					PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast<float>(uMaterial)); | ||||
| 					uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); | ||||
| @@ -496,9 +496,9 @@ namespace PolyVox | ||||
| 					//Choose one of the two materials to use for the vertex (we don't interpolate as interpolation of | ||||
| 					//material IDs does not make sense). We take the largest, so that if we are working on a material-only | ||||
| 					//volume we get the one which is non-zero. Both materials can be non-zero if our volume has a density component. | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); | ||||
| 					typename MarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial000 = m_controller.convertToMaterial(v000); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial001 = m_controller.convertToMaterial(v001); | ||||
| 					typename DefaultMarchingCubesController<typename VolumeType::VoxelType>::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial001); | ||||
|  | ||||
| 					PositionMaterialNormal surfaceVertex(v3dPosition, v3dNormal, static_cast<float>(uMaterial)); | ||||
| 					uint32_t uLastVertexIndex = m_meshCurrent->addVertex(surfaceVertex); | ||||
|   | ||||
| @@ -24,7 +24,7 @@ freely, subject to the following restrictions: | ||||
| #ifndef __PolyVox_MaterialDensityPair_H__ | ||||
| #define __PolyVox_MaterialDensityPair_H__ | ||||
|  | ||||
| #include "PolyVoxCore/MarchingCubesController.h" //We'll specialise the controller contained in here | ||||
| #include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here | ||||
| #include "PolyVoxCore/Voxel.h" | ||||
|  | ||||
| #include "PolyVoxImpl/TypeDef.h" | ||||
| @@ -115,19 +115,19 @@ namespace PolyVox | ||||
| 	}; | ||||
|  | ||||
| 	template <typename Type, uint8_t NoOfMaterialBits, uint8_t NoOfDensityBits> | ||||
| 	class MarchingCubesController< MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits> > | ||||
| 	class DefaultMarchingCubesController< MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits> > | ||||
| 	{ | ||||
| 	public: | ||||
| 		typedef Type DensityType; | ||||
| 		typedef Type MaterialType; | ||||
|  | ||||
| 		MarchingCubesController(void) | ||||
| 		DefaultMarchingCubesController(void) | ||||
| 		{ | ||||
| 			// Default to a threshold value halfway between the min and max possible values. | ||||
| 			m_tThreshold = (MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits>::getMinDensity() + MaterialDensityPair<Type, NoOfMaterialBits, NoOfDensityBits>::getMaxDensity()) / 2; | ||||
| 		} | ||||
|  | ||||
| 		MarchingCubesController(DensityType tThreshold) | ||||
| 		DefaultMarchingCubesController(DensityType tThreshold) | ||||
| 		{ | ||||
| 			m_tThreshold = tThreshold; | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user