• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

PolyVoxUtil/include/PolyVoxUtil/Serialization.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 Copyright (c) 2005-2009 David Williams
00003 
00004 This software is provided 'as-is', without any express or implied
00005 warranty. In no event will the authors be held liable for any damages
00006 arising from the use of this software.
00007 
00008 Permission is granted to anyone to use this software for any purpose,
00009 including commercial applications, and to alter it and redistribute it
00010 freely, subject to the following restrictions:
00011 
00012     1. The origin of this software must not be misrepresented; you must not
00013     claim that you wrote the original software. If you use this software
00014     in a product, an acknowledgment in the product documentation would be
00015     appreciated but is not required.
00016 
00017     2. Altered source versions must be plainly marked as such, and must not be
00018     misrepresented as being the original software.
00019 
00020     3. This notice may not be removed or altered from any source
00021     distribution.   
00022 *******************************************************************************/
00023 
00024 #ifndef __PolyVox_Serialization_H__
00025 #define __PolyVox_Serialization_H__
00026 
00027 #include "PolyVoxImpl/Utility.h"
00028 
00029 #include "PolyVoxCore/Region.h"
00030 
00031 #include <iostream>
00032 #include <memory>
00033 
00034 namespace PolyVox
00035 {   
00036     class VolumeSerializationProgressListener
00037     {
00038     public:
00039         virtual void onProgressUpdated(float fProgress) = 0;
00040     };
00041 
00043     // THESE FUNCTIONS ARE DEPRECATED. USE VERSIONED 'loadVolume' AND 'saveVolume' INSTEAD.
00045     template< template<typename> class VolumeType, typename VoxelType>
00046     polyvox_shared_ptr< VolumeType<VoxelType> > loadVolumeRaw(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
00047     template< template<typename> class VolumeType, typename VoxelType>
00048     void saveVolumeRaw(std::ostream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00049 
00050     template< template<typename> class VolumeType, typename VoxelType>
00051     polyvox_shared_ptr< VolumeType<VoxelType> > loadVolumeRle(std::istream& stream, VolumeSerializationProgressListener* progressListener = 0);
00052     template< template<typename> class VolumeType, typename VoxelType>
00053     void saveVolumeRle(std::ostream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00054 
00056     // END OF DEPRECATED FUNCTIONS
00058 
00059     template< template<typename> class VolumeType, typename VoxelType>
00060     bool loadVolume(std::istream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00061     template< template<typename> class VolumeType, typename VoxelType>
00062     bool saveVolume(std::ostream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00063 
00064     template< template<typename> class VolumeType, typename VoxelType>
00065     bool loadVersion0(std::istream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00066     template< template<typename> class VolumeType, typename VoxelType>
00067     bool saveVersion0(std::ostream& stream, VolumeType<VoxelType>& volume, VolumeSerializationProgressListener* progressListener = 0);
00068 }
00069 
00070 #include "PolyVoxUtil/Serialization.inl"
00071 
00072 #endif

Generated on Sat Nov 19 2011 00:27:31 for PolyVox by  doxygen 1.7.1