Applied default Visual Studio formatting to most files. This is a quick fix for the tabs vs spaces issue that messes up the formatting in any editor (esp. Linux) which handles tabs/spaces differently to Visual Studio. Some parts of the formatting look a bit worse but overall it should be better (or at least more consistent).

I didn't apply the changes to a few macro-heavy files as Visual Studio removes all indentation from macros, whereas the indentation can be handy to see nesting.
This commit is contained in:
David Williams
2015-12-26 23:11:27 +00:00
parent b3ca051878
commit e89a55d154
58 changed files with 1117 additions and 1114 deletions

View File

@ -39,25 +39,25 @@ namespace PolyVox
* type to be used. However, the Marching Cubes algorithm does have some requirents about the underlying data in that conceptually it operates
* on a <i>density field</i>. In addition, the PolyVox implementation of the Marching Cubes algorithm also understands the idea of each voxel
* having a material which is copied into the vertex data.
*
*
* Because we want the MarchingCubesSurfaceExtractor to work on <i>any</i> voxel type, we use a <i>Marching Cubes controller</i> (passed as
* a parameter of the MarchingCubesSurfaceExtractor) to expose the required properties. This parameter defaults to the DefaultMarchingCubesController.
* The main implementation of this class is designed to work with primitives data types, and the class is also specialised for the Material,
* Density and MaterialdensityPair classes.
*
*
* If you create a custom class for your voxel data then you probably want to include a specialisation of DefaultMarchingCubesController,
* though you don't have to if you don't want to use the Marching Cubes algorithm or if you prefer to define a seperate Marching Cubes controller
* and pass it as an explicit parameter (rather than relying on the default).
*
*
* For primitive types, the DefaultMarchingCubesController considers the value of the voxel to represent it's density and just returns a constant
* for the material. So you can, for example, run the MarchingCubesSurfaceExtractor on a volume of floats or ints.
*
*
* It is possible to customise the behaviour of the controller by providing a threshold value through the constructor. The extracted surface
* will pass through the density value specified by the threshold, and so you should make sure that the threshold value you choose is between
* the minimum and maximum values found in your volume data. By default it is in the middle of the representable range of the underlying type.
*
*
* \sa MarchingCubesSurfaceExtractor
*
*
*/
template<typename VoxelType>
class DefaultMarchingCubesController
@ -76,7 +76,7 @@ namespace PolyVox
* if the voxel type is 'float' then the representable range is -FLT_MAX to FLT_MAX and the threshold will be set to zero.
*/
DefaultMarchingCubesController(void)
{
{
if (std::is_signed<DensityType>())
{
m_tThreshold = DensityType(0);
@ -119,7 +119,7 @@ namespace PolyVox
*/
MaterialType blendMaterials(VoxelType a, VoxelType b, float /*weight*/)
{
if(convertToDensity(a) > convertToDensity(b))
if (convertToDensity(a) > convertToDensity(b))
{
return convertToMaterial(a);
}