Massive changes to the organisation of PolyVoxCore and PolyVoxYtil.

Also added start of logging capability.
This commit is contained in:
David Williams 2009-04-03 21:36:22 +00:00
parent dbf7257edd
commit df1bf690c9
222 changed files with 3353 additions and 186 deletions

View File

@ -33,7 +33,7 @@ SET(CMAKE_DEBUG_POSTFIX "_d")
#"Sources" and "Headers" are the group names in Visual Studio. #"Sources" and "Headers" are the group names in Visual Studio.
#They may have other uses too... #They may have other uses too...
SOURCE_GROUP("Sources" FILES ${SRC_FILES}) SOURCE_GROUP("Sources" FILES ${SRC_FILES})
#SOURCE_GROUP("Headers" FILES ${INC_FILES}) SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(Qt4) FIND_PACKAGE(Qt4)
SET(QT_USE_QTGUI 1) SET(QT_USE_QTGUI 1)
@ -48,8 +48,9 @@ FIND_PACKAGE(OpenGL REQUIRED)
#Also, glut32.dll goes in C:\Windows\System. Using C:\Windows\System32 doesn't seem to work #Also, glut32.dll goes in C:\Windows\System. Using C:\Windows\System32 doesn't seem to work
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location) #Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} "../../library/include") INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} "../../library/PolyVoxCore/include")
LINK_DIRECTORIES("../../library") #There has to be a better way!
LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxCore/debug ${CMAKE_CURRENT_BINARY_DIR}/../../library/PolyVoxCore/release)
#Build #Build
ADD_EXECUTABLE(OpenGLExample ${SRC_FILES}) ADD_EXECUTABLE(OpenGLExample ${SRC_FILES})
@ -57,8 +58,8 @@ TARGET_LINK_LIBRARIES(OpenGLExample ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} debug P
#Install #Install
INSTALL(TARGETS OpenGLExample INSTALL(TARGETS OpenGLExample
RUNTIME DESTINATION bin RUNTIME DESTINATION Examples/OpenGL/bin
LIBRARY DESTINATION lib LIBRARY DESTINATION Examples/OpenGL/lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example COMPONENT example
) )

View File

@ -1,7 +1,7 @@
#include "OpenGLImmediateModeSupport.h" #include "OpenGLImmediateModeSupport.h"
#include "OpenGLSupport.h" #include "OpenGLSupport.h"
#include "PolyVoxCore/IndexedSurfacePatch.h" #include "IndexedSurfacePatch.h"
using namespace PolyVox; using namespace PolyVox;
using namespace std; using namespace std;

View File

@ -1,7 +1,7 @@
#ifndef __OpenGLExample_OpenGLImmediateModeSupport_H__ #ifndef __OpenGLExample_OpenGLImmediateModeSupport_H__
#define __OpenGLExample_OpenGLImmediateModeSupport_H__ #define __OpenGLExample_OpenGLImmediateModeSupport_H__
#include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxForwardDeclarations.h"
#include "glew/glew.h" #include "glew/glew.h"

View File

@ -1,7 +1,7 @@
#ifndef __OpenGLExample_OpenGLSupport_H__ #ifndef __OpenGLExample_OpenGLSupport_H__
#define __OpenGLExample_OpenGLSupport_H__ #define __OpenGLExample_OpenGLSupport_H__
#include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxForwardDeclarations.h"
#include "glew/glew.h" #include "glew/glew.h"

View File

@ -1,7 +1,7 @@
#include "OpenGLSupport.h" #include "OpenGLSupport.h"
#include "OpenGLVertexBufferObjectSupport.h" #include "OpenGLVertexBufferObjectSupport.h"
#include "PolyVoxCore/IndexedSurfacePatch.h" #include "IndexedSurfacePatch.h"
using namespace PolyVox; using namespace PolyVox;
using namespace std; using namespace std;

View File

@ -1,7 +1,7 @@
#ifndef __OpenGLExample_OpenGLVertexBufferObjectSupport_H__ #ifndef __OpenGLExample_OpenGLVertexBufferObjectSupport_H__
#define __OpenGLExample_OpenGLVertexBufferObjectSupport_H__ #define __OpenGLExample_OpenGLVertexBufferObjectSupport_H__
#include "PolyVoxCore/PolyVoxForwardDeclarations.h" #include "PolyVoxForwardDeclarations.h"
#include "glew/glew.h" #include "glew/glew.h"

View File

@ -5,10 +5,10 @@
#include <QGLWidget> #include <QGLWidget>
#include "PolyVoxCore/Volume.h" #include "Volume.h"
#include "PolyVoxCore/IndexedSurfacePatch.h" #include "IndexedSurfacePatch.h"
#include "PolyVoxCore/SurfaceExtractors.h" #include "SurfaceExtractors.h"
#include "PolyVoxCore/PolyVoxImpl/Utility.h" #include "PolyVoxImpl/Utility.h"
#include "OpenGLImmediateModeSupport.h" #include "OpenGLImmediateModeSupport.h"
#include "OpenGLVertexBufferObjectSupport.h" #include "OpenGLVertexBufferObjectSupport.h"

View File

@ -1,7 +1,7 @@
#ifndef __OpenGLExample_Shapes_H__ #ifndef __OpenGLExample_Shapes_H__
#define __OpenGLExample_Shapes_H__ #define __OpenGLExample_Shapes_H__
#include "PolyVoxCore/Volume.h" #include "Volume.h"
void createSphereInVolume(PolyVox::Volume<PolyVox::uint8_t>& volData, float fRadius, PolyVox::uint8_t uValue); void createSphereInVolume(PolyVox::Volume<PolyVox::uint8_t>& volData, float fRadius, PolyVox::uint8_t uValue);
void createCubeInVolume(PolyVox::Volume<PolyVox::uint8_t>& volData, PolyVox::Vector3DUint16 lowerCorner, PolyVox::Vector3DUint16 upperCorner, PolyVox::uint8_t uValue); void createCubeInVolume(PolyVox::Volume<PolyVox::uint8_t>& volData, PolyVox::Vector3DUint16 lowerCorner, PolyVox::Vector3DUint16 upperCorner, PolyVox::uint8_t uValue);

View File

@ -1,7 +1,8 @@
#include "PolyVoxCore/Volume.h" #include "Log.h"
#include "PolyVoxCore/IndexedSurfacePatch.h" #include "Volume.h"
#include "PolyVoxCore/SurfaceExtractors.h" #include "IndexedSurfacePatch.h"
#include "PolyVoxCore/PolyVoxImpl/Utility.h" #include "SurfaceExtractors.h"
#include "PolyVoxImpl/Utility.h"
#include "OpenGLImmediateModeSupport.h" #include "OpenGLImmediateModeSupport.h"
#include "OpenGLVertexBufferObjectSupport.h" #include "OpenGLVertexBufferObjectSupport.h"
@ -20,8 +21,14 @@ using namespace std;
using namespace PolyVox; using namespace PolyVox;
using namespace std; using namespace std;
void exampleLog(string message)
{
cout << message << endl;
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
logImpl = &exampleLog;
Volume<PolyVox::uint8_t> volData(g_uVolumeSideLength); Volume<PolyVox::uint8_t> volData(g_uVolumeSideLength);
//Make our volume contain a sphere in the center. //Make our volume contain a sphere in the center.

View File

@ -1,131 +1,9 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(PolyVoxCore) PROJECT(PolyVox)
#Projects source files add_subdirectory(PolyVoxCore)
SET(CORE_SRC_FILES add_subdirectory(PolyVoxUtil)
source/PolyVoxCore/GradientEstimators.cpp
source/PolyVoxCore/IndexedSurfacePatch.cpp
source/PolyVoxCore/Region.cpp
source/PolyVoxCore/SurfaceAdjusters.cpp
source/PolyVoxCore/SurfaceExtractors.cpp
source/PolyVoxCore/SurfaceVertex.cpp
source/PolyVoxCore/VoxelFilters.cpp
)
#Projects headers files
SET(CORE_INC_FILES
include/PolyVoxCore/GradientEstimators.h
include/PolyVoxCore/GradientEstimators.inl
include/PolyVoxCore/IndexedSurfacePatch.h
include/PolyVoxCore/PolyVoxForwardDeclarations.h
include/PolyVoxCore/Region.h
include/PolyVoxCore/SurfaceAdjusters.h
include/PolyVoxCore/SurfaceExtractors.h
include/PolyVoxCore/SurfaceVertex.h
include/PolyVoxCore/Vector.h
include/PolyVoxCore/Vector.inl
include/PolyVoxCore/Volume.h
include/PolyVoxCore/Volume.inl
include/PolyVoxCore/VolumeIterator.h
include/PolyVoxCore/VolumeIterator.inl
include/PolyVoxCore/VoxelFilters.h
)
SET(IMPL_SRC_FILES
source/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.cpp
source/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.cpp
source/PolyVoxCore/PolyVoxImpl/MarchingCubesTables.cpp
source/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.cpp
source/PolyVoxCore/PolyVoxImpl/Utility.cpp
)
SET(IMPL_INC_FILES
include/PolyVoxCore/PolyVoxImpl/Block.h
include/PolyVoxCore/PolyVoxImpl/Block.inl
include/PolyVoxCore/PolyVoxImpl/BlockData.h
include/PolyVoxCore/PolyVoxImpl/BlockData.inl
include/PolyVoxCore/PolyVoxImpl/CPlusPlusZeroXSupport.h
include/PolyVoxCore/PolyVoxImpl/DecimatedSurfaceExtractor.h
include/PolyVoxCore/PolyVoxImpl/FastSurfaceExtractor.h
include/PolyVoxCore/PolyVoxImpl/MarchingCubesTables.h
include/PolyVoxCore/PolyVoxImpl/ReferenceSurfaceExtractor.h
include/PolyVoxCore/PolyVoxImpl/TypeDef.h
include/PolyVoxCore/PolyVoxImpl/Utility.h
)
#Projects source files
SET(UTIL_SRC_FILES
source/PolyVoxUtil/Serialization.cpp
source/PolyVoxUtil/VolumeChangeTracker.cpp
)
#Projects headers files
SET(UTIL_INC_FILES
include/PolyVoxUtil/Serialization.h
include/PolyVoxUtil/VolumeChangeTracker.h
)
ADD_DEFINITIONS(-DPOLYVOX_EXPORT) #Export symbols in the .dll
#Appends "_d" to the generated library when in debug mode
SET(CMAKE_DEBUG_POSTFIX "_d")
#"Sources" and "Headers" are the group names in Visual Studio.
#They may have other uses too...
SOURCE_GROUP("Sources" FILES ${CORE_SRC_FILES})
SOURCE_GROUP("Headers" FILES ${CORE_INC_FILES})
SOURCE_GROUP("Sources\\PolyVoxImpl" FILES ${IMPL_SRC_FILES})
SOURCE_GROUP("Headers\\PolyVoxImpl" FILES ${IMPL_INC_FILES})
SOURCE_GROUP("Sources" FILES ${UTIL_SRC_FILES})
SOURCE_GROUP("Headers" FILES ${UTIL_INC_FILES})
#Tell CMake the paths
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
#Core
#Build
ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR})
IF(WIN32)
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/wd4251") #Disable warning on STL exports
ENDIF(WIN32)
#Install
INSTALL(TARGETS PolyVoxCore
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT library
)
#Install the core header files, including the ones in the PolyVoxImpl subfolder.
INSTALL(DIRECTORY include/PolyVoxCore DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE)
#Util
#Build
ADD_LIBRARY(PolyVoxUtil SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES})
TARGET_LINK_LIBRARIES(PolyVoxUtil PolyVoxCore)
SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR})
IF(WIN32)
SET_TARGET_PROPERTIES(PolyVoxUtil PROPERTIES COMPILE_FLAGS "/wd4251") #Disable warning on STL exports
ENDIF(WIN32)
#Install
INSTALL(TARGETS PolyVoxUtil
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT library
)
#Install the util header files.
INSTALL(DIRECTORY include/PolyVoxUtil DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE)
#Copy the boost files which we a re using to mimic C++0x
INSTALL(DIRECTORY include/boost DESTINATION include COMPONENT development PATTERN "*.svn*" EXCLUDE)
#Set up PolyVoxConfig.cmake #Set up PolyVoxConfig.cmake
if(WIN32) if(WIN32)

View File

@ -14,8 +14,8 @@
include(FindPackageMessage) include(FindPackageMessage)
set(PREFIX "@CMAKE_INSTALL_PREFIX@") set(PREFIX "@CMAKE_INSTALL_PREFIX@")
set(PolyVox_LIBRARY_DIRS "${PREFIX}/lib") set(PolyVox_LIBRARY_DIRS "${PREFIX}/PolyVoxCore/lib" "${PREFIX}/PolyVoxUtil/lib")
set(PolyVox_INCLUDE_DIRS "${PREFIX}/include/PolyVoxCore" "${PREFIX}/include/PolyVoxUtil" "${PREFIX}/include") set(PolyVox_INCLUDE_DIRS "${PREFIX}/PolyVoxCore/include" "${PREFIX}/PolyVoxUtil/include" "${PREFIX}/include")
set(PolyVox_LIBRARIES "PolyVoxUtil" "PolyVoxCore") set(PolyVox_LIBRARIES "PolyVoxUtil" "PolyVoxCore")
message(STATUS "Found PolyVox") message(STATUS "Found PolyVox")

View File

@ -0,0 +1,92 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(PolyVoxCore)
#Projects source files
SET(CORE_SRC_FILES
source/GradientEstimators.cpp
source/IndexedSurfacePatch.cpp
source/Log.cpp
source/Region.cpp
source/SurfaceAdjusters.cpp
source/SurfaceExtractors.cpp
source/SurfaceVertex.cpp
source/VoxelFilters.cpp
)
#Projects headers files
SET(CORE_INC_FILES
include/GradientEstimators.inl
include/IndexedSurfacePatch.h
include/Log.h
include/PolyVoxForwardDeclarations.h
include/Region.h
include/SurfaceAdjusters.h
include/SurfaceExtractors.h
include/SurfaceVertex.h
include/Vector.h
include/Vector.inl
include/Volume.h
include/Volume.inl
include/VolumeIterator.h
include/VolumeIterator.inl
include/VoxelFilters.h
)
SET(IMPL_SRC_FILES
source/PolyVoxImpl/DecimatedSurfaceExtractor.cpp
source/PolyVoxImpl/FastSurfaceExtractor.cpp
source/PolyVoxImpl/MarchingCubesTables.cpp
source/PolyVoxImpl/ReferenceSurfaceExtractor.cpp
source/PolyVoxImpl/Utility.cpp
)
SET(IMPL_INC_FILES
include/PolyVoxImpl/Block.h
include/PolyVoxImpl/Block.inl
include/PolyVoxImpl/BlockData.h
include/PolyVoxImpl/BlockData.inl
include/PolyVoxImpl/CPlusPlusZeroXSupport.h
include/PolyVoxImpl/DecimatedSurfaceExtractor.h
include/PolyVoxImpl/FastSurfaceExtractor.h
include/PolyVoxImpl/MarchingCubesTables.h
include/PolyVoxImpl/ReferenceSurfaceExtractor.h
include/PolyVoxImpl/TypeDef.h
include/PolyVoxImpl/Utility.h
)
ADD_DEFINITIONS(-DPOLYVOXCORE_EXPORT) #Export symbols in the .dll
#Appends "_d" to the generated library when in debug mode
SET(CMAKE_DEBUG_POSTFIX "_d")
#"Sources" and "Headers" are the group names in Visual Studio.
#They may have other uses too...
SOURCE_GROUP("Sources" FILES ${CORE_SRC_FILES})
SOURCE_GROUP("Headers" FILES ${CORE_INC_FILES})
SOURCE_GROUP("Sources\\PolyVoxImpl" FILES ${IMPL_SRC_FILES})
SOURCE_GROUP("Headers\\PolyVoxImpl" FILES ${IMPL_INC_FILES})
#Tell CMake the paths
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
#Core
#Build
ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR})
IF(WIN32)
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/wd4251") #Disable warning on STL exports
ENDIF(WIN32)
#Install
INSTALL(TARGETS PolyVoxCore
RUNTIME DESTINATION PolyVoxCore/bin
LIBRARY DESTINATION PolyVoxCore/lib
ARCHIVE DESTINATION PolyVoxCore/lib
COMPONENT library
)
#Install the core header files, including the ones in the PolyVoxImpl subfolder.
INSTALL(DIRECTORY include DESTINATION PolyVoxCore COMPONENT development PATTERN "*.svn*" EXCLUDE)

View File

@ -51,8 +51,8 @@ namespace PolyVox
template <typename VoxelType> template <typename VoxelType>
Vector3DFloat computeSmoothSobelGradient(VolumeIterator<VoxelType>& volIter); Vector3DFloat computeSmoothSobelGradient(VolumeIterator<VoxelType>& volIter);
POLYVOX_API void computeNormalsForVertices(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod); POLYVOXCORE_API void computeNormalsForVertices(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, NormalGenerationMethod normalGenerationMethod);
POLYVOX_API Vector3DFloat computeNormal(Volume<uint8_t>* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod); POLYVOXCORE_API Vector3DFloat computeNormal(Volume<uint8_t>* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod);
} }
#include "GradientEstimators.inl" #include "GradientEstimators.inl"

View File

@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
class POLYVOX_API IndexedSurfacePatch class POLYVOXCORE_API IndexedSurfacePatch
{ {
public: public:
IndexedSurfacePatch(); IndexedSurfacePatch();

View File

@ -0,0 +1,10 @@
#ifndef __PolyVox_Log_H__
#define __PolyVox_Log_H__
#include "PolyVoxImpl/TypeDef.h"
#include <string>
POLYVOXCORE_API extern void (*logImpl)(std::string);
#endif

View File

@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma region Headers #pragma region Headers
#include "Utility.h" #include "Utility.h"
#include "../Vector.h" #include "Vector.h"
#include "../Volume.h" #include "Volume.h"
#include <cassert> #include <cassert>
#include <cstring> //For memcpy #include <cstring> //For memcpy

View File

@ -19,19 +19,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
******************************************************************************/ ******************************************************************************/
#pragma endregion #pragma endregion
//Dave, maybe make use of OgrePlatform.h instead?
// I think use _OgreExport instead of POLYVOX_API and define OGRE_NONCLIENT_BUILD instead of POLYVOX_EXPORT?
#ifndef __PolyVox_TypeDef_H__ #ifndef __PolyVox_TypeDef_H__
#define __PolyVox_TypeDef_H__ #define __PolyVox_TypeDef_H__
#ifdef WIN32 #ifdef WIN32
#ifdef POLYVOX_EXPORT #ifdef POLYVOXCORE_EXPORT
#define POLYVOX_API __declspec(dllexport) #define POLYVOXCORE_API __declspec(dllexport)
#else #else
#define POLYVOX_API __declspec(dllimport) #define POLYVOXCORE_API __declspec(dllimport)
#endif #endif
#else #else
#define POLYVOX_API __attribute__ ((visibility("default"))) #define POLYVOXCORE_API __attribute__ ((visibility("default")))
#endif #endif
#endif #endif

View File

@ -29,8 +29,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
POLYVOX_API uint8_t logBase2(uint32_t uInput); POLYVOXCORE_API uint8_t logBase2(uint32_t uInput);
POLYVOX_API bool isPowerOf2(uint32_t uInput); POLYVOXCORE_API bool isPowerOf2(uint32_t uInput);
template <typename Type> template <typename Type>
Type trilinearlyInterpolate( Type trilinearlyInterpolate(

View File

@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
class POLYVOX_API Region class POLYVOXCORE_API Region
{ {
public: public:
Region(); Region();

View File

@ -31,8 +31,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
POLYVOX_API void smoothRegionGeometry(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp); POLYVOXCORE_API void smoothRegionGeometry(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp);
POLYVOX_API void adjustDecimatedGeometry(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, uint8_t val); POLYVOXCORE_API void adjustDecimatedGeometry(Volume<uint8_t>* volumeData, IndexedSurfacePatch& isp, uint8_t val);
} }
#endif #endif

View File

@ -33,8 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
POLYVOX_API void extractSurface(Volume<uint8_t>* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch); POLYVOXCORE_API void extractSurface(Volume<uint8_t>* volumeData, uint8_t uLevel, Region region, IndexedSurfacePatch* singleMaterialPatch);
POLYVOX_API void extractReferenceSurface(Volume<uint8_t>* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch); POLYVOXCORE_API void extractReferenceSurface(Volume<uint8_t>* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch);
} }
#endif #endif

View File

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace PolyVox namespace PolyVox
{ {
class POLYVOX_API SurfaceVertex class POLYVOXCORE_API SurfaceVertex
{ {
public: public:
SurfaceVertex(); SurfaceVertex();

View File

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma region Headers #pragma region Headers
#include "PolyVoxImpl/BlockData.h" #include "PolyVoxImpl/BlockData.h"
#include "Log.h"
#include "VolumeIterator.h" #include "VolumeIterator.h"
#include "Region.h" #include "Region.h"
#include "Vector.h" #include "Vector.h"
@ -37,6 +38,7 @@ namespace PolyVox
Volume<VoxelType>::Volume(uint16_t uSideLength, uint16_t uBlockSideLength) Volume<VoxelType>::Volume(uint16_t uSideLength, uint16_t uBlockSideLength)
:m_pBlocks(0) :m_pBlocks(0)
{ {
logImpl("In volume constructor");
//Debug mode validation //Debug mode validation
assert(isPowerOf2(uSideLength)); assert(isPowerOf2(uSideLength));
assert(isPowerOf2(uBlockSideLength)); assert(isPowerOf2(uBlockSideLength));
@ -163,11 +165,6 @@ namespace PolyVox
const uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower); const uint16_t yOffset = uYPos - (blockY << m_uBlockSideLengthPower);
const uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower); const uint16_t zOffset = uZPos - (blockZ << m_uBlockSideLengthPower);
/*const uint32_t uBlockIndex =
blockX +
blockY * m_uSideLengthInBlocks +
blockZ * m_uSideLengthInBlocks * m_uSideLengthInBlocks;*/
Block<VoxelType>& block = m_pBlocks Block<VoxelType>& block = m_pBlocks
[ [
blockX + blockX +
@ -175,7 +172,6 @@ namespace PolyVox
blockZ * m_uSideLengthInBlocks * m_uSideLengthInBlocks blockZ * m_uSideLengthInBlocks * m_uSideLengthInBlocks
]; ];
//const bool bIsShared = m_pBlocks[uBlockIndex].m_bIsShared;
if(block.m_bIsShared) if(block.m_bIsShared)
{ {
const VoxelType tHomogenousValue = block.m_pHomogenousValue; const VoxelType tHomogenousValue = block.m_pHomogenousValue;

View File

@ -56,8 +56,8 @@ namespace PolyVox
void setValidRegion(uint16_t xFirst, uint16_t yFirst, uint16_t zFirst, uint16_t xLast, uint16_t yLast, uint16_t zLast); void setValidRegion(uint16_t xFirst, uint16_t yFirst, uint16_t zFirst, uint16_t xLast, uint16_t yLast, uint16_t zLast);
bool isValidForRegion(void) const; bool isValidForRegion(void) const;
void moveForwardInRegionFast(void);
bool moveForwardInRegionXYZ(void); bool moveForwardInRegionXYZ(void);
void moveForwardInRegionXYZFast(void);
VoxelType peekVoxel1nx1ny1nz(void) const; VoxelType peekVoxel1nx1ny1nz(void) const;
VoxelType peekVoxel1nx1ny0pz(void) const; VoxelType peekVoxel1nx1ny0pz(void) const;

View File

@ -245,7 +245,7 @@ namespace PolyVox
} }
template <typename VoxelType> template <typename VoxelType>
void VolumeIterator<VoxelType>::moveForwardInRegionFast(void) void VolumeIterator<VoxelType>::moveForwardInRegionXYZFast(void)
{ {
mXPosInBlock++; mXPosInBlock++;
mCurrentVoxel++; mCurrentVoxel++;

Some files were not shown because too many files have changed in this diff Show More