Working on refactoring code into namespaces - DOES NOT BUILD
This commit is contained in:
parent
0758f81b54
commit
4f546d1dc4
@ -3,6 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(PolyVox)
|
||||
|
||||
ADD_SUBDIRECTORY(PolyVoxCore)
|
||||
ADD_SUBDIRECTORY(PolyVoxUtil)
|
||||
ADD_SUBDIRECTORY(examples/OpenGL)
|
||||
|
||||
ADD_DEPENDENCIES(OpenGLExample PolyVoxCore)
|
||||
ADD_DEPENDENCIES(OpenGLExample PolyVoxCore PolyVoxUtil)
|
@ -19,7 +19,6 @@ SET(SRC_FILES
|
||||
source/SurfaceExtractorsDecimated.cpp
|
||||
source/SurfaceVertex.cpp
|
||||
source/Utility.cpp
|
||||
source/VolumeChangeTracker.cpp
|
||||
source/VoxelFilters.cpp
|
||||
)
|
||||
|
||||
@ -51,7 +50,6 @@ SET(INC_FILES
|
||||
include/Utility.h
|
||||
include/Vector.h
|
||||
include/Vector.inl
|
||||
include/VolumeChangeTracker.h
|
||||
include/VoxelFilters.h
|
||||
)
|
||||
|
||||
|
@ -55,7 +55,6 @@ namespace PolyVox
|
||||
typedef Vector<3,uint32> Vector3DUint32;
|
||||
//----------------------------
|
||||
|
||||
class VolumeChangeTracker;
|
||||
template <typename VoxelType> class BlockVolumeIterator;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
POLYVOX_API std::list<RegionGeometry> getChangedRegionGeometry(VolumeChangeTracker& volume);
|
||||
|
||||
uint32 getIndex(uint32 x, uint32 y);
|
||||
|
||||
POLYVOX_API void generateRoughMeshDataForRegion(BlockVolume<uint8>* volumeData, Region region, IndexedSurfacePatch* singleMaterialPatch);
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "RegionGeometry.h"
|
||||
#include "SurfaceAdjusters.h"
|
||||
#include "SurfaceExtractorsDecimated.h"
|
||||
#include "VolumeChangeTracker.h"
|
||||
#include "BlockVolumeIterator.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -17,50 +16,6 @@ using namespace std;
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
std::list<RegionGeometry> getChangedRegionGeometry(VolumeChangeTracker& volume)
|
||||
{
|
||||
std::list<Region> listChangedRegions;
|
||||
volume.getChangedRegions(listChangedRegions);
|
||||
|
||||
std::list<RegionGeometry> listChangedRegionGeometry;
|
||||
for(std::list<Region>::const_iterator iterChangedRegions = listChangedRegions.begin(); iterChangedRegions != listChangedRegions.end(); ++iterChangedRegions)
|
||||
{
|
||||
//Generate the surface
|
||||
RegionGeometry regionGeometry;
|
||||
regionGeometry.m_patchSingleMaterial = new IndexedSurfacePatch();
|
||||
regionGeometry.m_v3dRegionPosition = iterChangedRegions->getLowerCorner();
|
||||
|
||||
//generateDecimatedMeshDataForRegion(volume.getVolumeData(), 1, *iterChangedRegions, regionGeometry.m_patchSingleMaterial);
|
||||
|
||||
generateReferenceMeshDataForRegion(volume.getVolumeData(), *iterChangedRegions, regionGeometry.m_patchSingleMaterial);
|
||||
|
||||
//for(int ct = 0; ct < 2; ct++)
|
||||
Vector3DInt32 temp = regionGeometry.m_v3dRegionPosition;
|
||||
//temp /= 16;
|
||||
/*if(temp.getY() % 32 == 0)
|
||||
{
|
||||
//smoothRegionGeometry(volume.getVolumeData(), regionGeometry);
|
||||
generateDecimatedMeshDataForRegion(volume.getVolumeData(), 0, *iterChangedRegions, regionGeometry.m_patchSingleMaterial);
|
||||
}
|
||||
else
|
||||
{
|
||||
generateDecimatedMeshDataForRegion(volume.getVolumeData(), 1, *iterChangedRegions, regionGeometry.m_patchSingleMaterial);
|
||||
//adjustDecimatedGeometry(volume.getVolumeData(), regionGeometry, 1);
|
||||
}*/
|
||||
|
||||
//computeNormalsForVertices(volume.getVolumeData(), regionGeometry, CENTRAL_DIFFERENCE);
|
||||
|
||||
//genMultiFromSingle(regionGeometry.m_patchSingleMaterial, regionGeometry.m_patchMultiMaterial);
|
||||
|
||||
regionGeometry.m_bContainsSingleMaterialPatch = regionGeometry.m_patchSingleMaterial->getVertices().size() > 0;
|
||||
regionGeometry.m_bIsEmpty = (regionGeometry.m_patchSingleMaterial->getVertices().size() == 0) || (regionGeometry.m_patchSingleMaterial->getIndices().size() == 0);
|
||||
|
||||
listChangedRegionGeometry.push_back(regionGeometry);
|
||||
}
|
||||
|
||||
return listChangedRegionGeometry;
|
||||
}
|
||||
|
||||
uint32 getIndex(uint32 x, uint32 y)
|
||||
{
|
||||
return x + (y * (POLYVOX_REGION_SIDE_LENGTH+1));
|
||||
|
@ -6,9 +6,10 @@
|
||||
#include "MarchingCubesTables.h"
|
||||
#include "Region.h"
|
||||
#include "RegionGeometry.h"
|
||||
#include "VolumeChangeTracker.h"
|
||||
#include "BlockVolumeIterator.h"
|
||||
|
||||
#include "../../PolyVoxUtil/include/VolumeChangeTracker.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
48
PolyVoxUtil/CMakeLists.txt
Normal file
48
PolyVoxUtil/CMakeLists.txt
Normal file
@ -0,0 +1,48 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
PROJECT(PolyVoxUtil)
|
||||
|
||||
SET(POLYVOX_VERSION_MAJOR "0")
|
||||
SET(POLYVOX_VERSION_MINOR "1")
|
||||
SET(POLYVOX_VERSION_PATCH "0")
|
||||
SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}")
|
||||
|
||||
#Projects source files
|
||||
SET(SRC_FILES
|
||||
source/VolumeChangeTracker.cpp
|
||||
)
|
||||
|
||||
#Projects headers files
|
||||
SET(INC_FILES
|
||||
include/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 ${SRC_FILES})
|
||||
SOURCE_GROUP("Headers" FILES ${INC_FILES})
|
||||
|
||||
#Tell CMake the paths
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
#Build
|
||||
ADD_LIBRARY(PolyVoxUtil SHARED ${SRC_FILES} ${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
|
||||
)
|
||||
|
||||
INSTALL(FILES ${INC_FILES} DESTINATION include/PolyVoxUtil)
|
@ -24,12 +24,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "PolyVoxCStdInt.h"
|
||||
|
||||
#include "Constants.h"
|
||||
#include "PolyVoxForwardDeclarations.h"
|
||||
#include "Region.h"
|
||||
#include "TypeDef.h"
|
||||
#include "../../PolyVoxCore/include/Constants.h"
|
||||
#include "../../PolyVoxCore/include/PolyVoxForwardDeclarations.h"
|
||||
#include "../../PolyVoxCore/include/Region.h"
|
||||
#include "../../PolyVoxCore/include/TypeDef.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
@ -19,18 +19,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "GradientEstimators.h"
|
||||
#include "IndexedSurfacePatch.h"
|
||||
#include "LinearVolume.h"
|
||||
#include "MarchingCubesTables.h"
|
||||
#include "VolumeChangeTracker.h"
|
||||
#include "RegionGeometry.h"
|
||||
#include "SurfaceExtractors.h"
|
||||
#include "SurfaceVertex.h"
|
||||
#include "Utility.h"
|
||||
#include "Vector.h"
|
||||
#include "BlockVolume.h"
|
||||
#include "BlockVolumeIterator.h"
|
||||
|
||||
#include "../../PolyVoxCore/include/GradientEstimators.h"
|
||||
#include "../../PolyVoxCore/include/IndexedSurfacePatch.h"
|
||||
#include "../../PolyVoxCore/include/LinearVolume.h"
|
||||
#include "../../PolyVoxCore/include/MarchingCubesTables.h"
|
||||
#include "../../PolyVoxCore/include/RegionGeometry.h"
|
||||
#include "../../PolyVoxCore/include/SurfaceExtractors.h"
|
||||
#include "../../PolyVoxCore/include/SurfaceVertex.h"
|
||||
#include "../../PolyVoxCore/include/Utility.h"
|
||||
#include "../../PolyVoxCore/include/Vector.h"
|
||||
#include "../../PolyVoxCore/include/BlockVolume.h"
|
||||
#include "../../PolyVoxCore/include/BlockVolumeIterator.h"
|
||||
|
||||
using namespace std;
|
||||
|
Loading…
x
Reference in New Issue
Block a user