Added some class documentation to DefaultMarchingCubesController.

This commit is contained in:
unknown 2012-07-15 23:59:21 +02:00
parent 66035c6d13
commit 825f1a4555
2 changed files with 29 additions and 1 deletions

View File

@ -28,6 +28,34 @@ freely, subject to the following restrictions:
namespace PolyVox
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// This class provides a default implementation of a controller for the MarchingCubesSurfaceExtractor. It controls the behaviour of the
/// MarchingCubesSurfaceExtractor and provides the required properties from the underlying voxel type.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// PolyVox does not enforce any requirements regarding what data must be present in a voxel, and instead allows any primitive or user-defined
/// 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
{

View File

@ -42,7 +42,7 @@ freely, subject to the following restrictions:
namespace PolyVox
{
///The LargeVolume class provides a memory efficient method of storing voxel data while also allowing fast access and modification.
/// The LargeVolume class provides a memory efficient method of storing voxel data while also allowing fast access and modification.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// A LargeVolume is essentially a 3D array in which each element (or <i>voxel</i>) is identified by a three dimensional (x,y,z) coordinate.
/// We use the LargeVolume class to store our data in an efficient way, and it is the input to many of the algorithms (such as the surface