Marked some parts of PolyVox as deprecated.

This commit is contained in:
unknown 2012-11-09 16:12:26 +01:00
parent 4be56378e4
commit c59a659964
6 changed files with 42 additions and 29 deletions

View File

@ -2,6 +2,18 @@ Changes for PolyVox version 0.2
===============================
This is the first revision for which we have produced a changelog, as we are now trying to streamline our development and release process. Hence this changelog entry is not going to be as structured as we hope they will be in the future. I'm writing it from memory, rather than having carefully kept track of all the relevent changes as I made them.
Deprecated functionality
------------------------
The following functionality is considered deprecated in this release of PolyVox and will probably be removed in future versions.
MeshDecimator: The mesh decimator was intended to reduce the amount of trianges in generated meshes but it has always had problems. It's far too slow and not very robust. For cubic mehes it is no longer needed anyway as the CubicSurfaceExtractor has built in decimation which is much more effective. For smooth (marching cubes) meshes there is no single alternative. You can consider downsampling the volume before you run the surface extractor (see the SmoothLODExample), and in the future we may add support for an external mesh processing library.
SimpleInterface: This was added so that people could create volumes without knowing about templates, and also to provide a target which was easier to wrap with SWIG. But overall we'd rather focus on geting the real SWIG bindings to work. The SimpleInterface is also extreamly limited in the functionality it provides.
Serialisation: This is a difficult one. The current serialisation is rather old and only deals with loading/saving a whole volume at a time. It would make much more sense if it could serialise regions instead of whole volumes, and if it could handle compression. It would then be useful for serialising the data which is paged into and out of the LargeVolume, as well as other uses. Both these changes would likely require braking the current format and interface. It is likely that serialisation will return to PolyVox in the future, but for now we would suggest just implementing your own.
VolumeChangeTracker: The idea behind this was was to provide a utility class to help the user keep track of which regions have been modified so they know when they need the surface extractor to be run again. But overall we'd rather keep such higher level functionality in user code as there are multiple ways it can be implemented. The current implementation is also old and does not support very large/infinite volumes, for example.
Refactor of basic voxel types
-----------------------------
Previous versions of PolyVox provided classes representing voxel data, such as MaterialDensityPair88. These classes were required to expose certain function such as getDensity() and getMaterial(). This is no longer the case as now even primitive data types such as floats and ints can be used as voxels. You can also create new classes to represent voxel data and it is entirely up to you what kind of properties they have.
@ -26,7 +38,7 @@ The new system simplifies the behaviour of this surface extractor but does requi
Changes to Raycast
------------------
The raaycasting functionality was previously in a class (Raycast) but now it is provided by standalone functions. This is basically because there is no need for it to be a class, and it complicated usage. The new functions are called 'raycastWithDirection' and 'raycastWithEndpoints' which helps remove the previous ambiguity regarding the meaning of the two vectors which are passed as parameters.
The raycasting functionality was previously in a class (Raycast) but now it is provided by standalone functions. This is basically because there is no need for it to be a class, and it complicated usage. The new functions are called 'raycastWithDirection' and 'raycastWithEndpoints' which helps remove the previous ambiguity regarding the meaning of the two vectors which are passed as parameters.
The callback functionalilty (called for each processed voxel to determine whether to continue and also perform additional processing) is no longer implemented as an std::function. Instead the standard STL approach is used where a function or function object is used a a template parameter. This is faster than the std::function solution and should also be easier to integrate with other languages.

View File

@ -27,7 +27,6 @@ freely, subject to the following restrictions:
#include "PolyVoxCore/GradientEstimators.h"
#include "PolyVoxCore/MaterialDensityPair.h"
#include "PolyVoxCore/MeshDecimator.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
//Some namespaces we need
@ -92,10 +91,6 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume<MaterialDensityPair44>* volDat
MarchingCubesSurfaceExtractor< LargeVolume<MaterialDensityPair44> > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get());
surfaceExtractor.execute();
polyvox_shared_ptr< SurfaceMesh<PositionMaterialNormal> > decimatedMesh(new SurfaceMesh<PositionMaterialNormal>);
MeshDecimator<PositionMaterialNormal> decimator(mesh.get(), decimatedMesh.get(), 0.95f);
decimator.execute();
//decimatedMesh->generateAveragedFaceNormals(true);
//computeNormalsForVertices(m_volData, *(decimatedMesh.get()), SOBEL_SMOOTHED);
@ -110,12 +105,12 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume<MaterialDensityPair44>* volDat
Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ);
if(m_bUseOpenGLVertexBufferObjects)
{
OpenGLSurfaceMesh openGLSurfaceMesh = BuildOpenGLSurfaceMesh(*(decimatedMesh.get()));
OpenGLSurfaceMesh openGLSurfaceMesh = BuildOpenGLSurfaceMesh(*(mesh.get()));
m_mapOpenGLSurfaceMeshes.insert(make_pair(v3dRegPos, openGLSurfaceMesh));
}
//else
//{
m_mapSurfaceMeshes.insert(make_pair(v3dRegPos, decimatedMesh));
m_mapSurfaceMeshes.insert(make_pair(v3dRegPos, mesh));
//}
//delete meshCurrent;
}

View File

@ -64,8 +64,10 @@ namespace PolyVox
/// The above applies for a cubic mesh, for a Marching Cubes mesh you need to parametise
/// the MeshDecimator and resulting SurfaceMesh on the 'PositionMaterialNormal' type
/// instead of the 'PositionMaterial' type.
///
/// \deprecated
template <typename VertexType>
class MeshDecimator
class POLYVOX_DEPRECATED MeshDecimator
{
//Used to keep track of when a vertex is
//on one or more faces of the region

View File

@ -36,8 +36,10 @@ namespace PolyVox
typedef SimpleVolume<MaterialDensityPair88> Volume;
typedef SurfaceMesh<PositionMaterialNormal> Mesh;
void extractCubicMesh(Volume& volume, const Region& region, Mesh& resultMesh);
void extractSmoothMesh(Volume& volume, const Region& region, Mesh& resultMesh);
/// \deprecated
POLYVOX_DEPRECATED void extractCubicMesh(Volume& volume, const Region& region, Mesh& resultMesh);
/// \deprecated
POLYVOX_DEPRECATED void extractSmoothMesh(Volume& volume, const Region& region, Mesh& resultMesh);
}

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_Serialization_H__
#define __PolyVox_Serialization_H__
#include "Impl/Utility.h"
#include "PolyVoxCore/Impl/Utility.h"
#include "PolyVoxCore/Region.h"
@ -33,42 +33,43 @@ freely, subject to the following restrictions:
namespace PolyVox
{
class VolumeSerializationProgressListener
/// \deprecated
class POLYVOX_DEPRECATED VolumeSerializationProgressListener
{
public:
virtual void onProgressUpdated(float fProgress) = 0;
};
////////////////////////////////////////////////////////////////////////////////
// THESE FUNCTIONS ARE DEPRECATED. USE VERSIONED 'loadVolume' AND 'saveVolume' INSTEAD.
// THESE FUNCTIONS ARE DEPRECATED.
////////////////////////////////////////////////////////////////////////////////
/// \deprecated Use versioned loadVolume instead
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED polyvox_shared_ptr< VolumeType > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated Use versioned saveVolume instead
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED void saveVolumeRaw(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated Use versioned loadVolume instead
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED polyvox_shared_ptr< VolumeType > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated Use versioned saveVolume instead
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED void saveVolumeRle(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
////////////////////////////////////////////////////////////////////////////////
// END OF DEPRECATED FUNCTIONS
////////////////////////////////////////////////////////////////////////////////
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED bool loadVolume(std::istream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated
template< typename VolumeType >
POLYVOX_DEPRECATED bool saveVolume(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated
template< typename VolumeType >
bool loadVolume(std::istream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
POLYVOX_DEPRECATED bool loadVersion0(std::istream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
/// \deprecated
template< typename VolumeType >
bool saveVolume(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
template< typename VolumeType >
bool loadVersion0(std::istream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
template< typename VolumeType >
bool saveVersion0(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
POLYVOX_DEPRECATED bool saveVersion0(std::ostream& stream, VolumeType& volume, VolumeSerializationProgressListener* progressListener = 0);
}
#include "PolyVoxUtil/Serialization.inl"

View File

@ -33,8 +33,9 @@ freely, subject to the following restrictions:
namespace PolyVox
{
/// Voxel scene manager
/// \deprecated
template <typename VoxelType>
class VolumeChangeTracker
class POLYVOX_DEPRECATED VolumeChangeTracker
{
public:
//Constructors, etc