diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f8c030..a753edc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,16 +9,16 @@ if( UNIX OR MINGW ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -w") endif() -set( SAMPLE_PROJECT_VERSION_MAJOR 9 ) -set( SAMPLE_PROJECT_VERSION_MINOR 1 ) +set( SAMPLE_PROJECT_VERSION_MAJOR 12 ) +set( SAMPLE_PROJECT_VERSION_MINOR 0 ) file( GLOB header_list Src_CC_wrap/*.h ) -list( APPEND header_list Src/Allocator.h Src/Array.h Src/BinaryNode.h Src/BSplineData.h Src/CmdLineParser.h Src/Factor.h Src/FunctionData.h Src/Geometry.h Src/MarchingCubes.h Src/MAT.h Src/MemoryUsage.h Src/MultiGridOctreeData.h Src/MyTime.h Src/Octree.h Src/Ply.h Src/PointStream.h Src/Polynomial.h Src/PPolynomial.h Src/SparseMatrix.h ) -list( APPEND inline_list Src/Array.inl Src/BSplineData.inl Src/CmdLineParser.inl Src/FunctionData.inl Src/Geometry.inl Src/MAT.inl Src/MultiGridOctreeData.inl Src/MultiGridOctreeData.IsoSurface.inl Src/MultiGridOctreeData.SortedTreeNodes.inl Src/Octree.inl Src/PointStream.inl Src/Polynomial.inl Src/PPolynomial.inl Src/SparseMatrix.inl ) +#list( APPEND header_list Src/Allocator.h Src/Array.h Src/BinaryNode.h Src/BSplineData.h Src/CmdLineParser.h Src/Factor.h Src/FunctionData.h Src/Geometry.h Src/MarchingCubes.h Src/MAT.h Src/MemoryUsage.h Src/MultiGridOctreeData.h Src/MyTime.h Src/Octree.h Src/Ply.h Src/PointStream.h Src/Polynomial.h Src/PPolynomial.h Src/SparseMatrix.h ) +#list( APPEND inline_list Src/Array.inl Src/BSplineData.inl Src/CmdLineParser.inl Src/FunctionData.inl Src/Geometry.inl Src/MAT.inl Src/MultiGridOctreeData.inl Src/MultiGridOctreeData.IsoSurface.inl Src/MultiGridOctreeData.SortedTreeNodes.inl Src/Octree.inl Src/PointStream.inl Src/Polynomial.inl Src/PPolynomial.inl Src/SparseMatrix.inl ) file( GLOB source_list Src_CC_wrap/*.cpp ) -list( APPEND source_list Src/CmdLineParser.cpp Src/Factor.cpp Src/Geometry.cpp Src/MarchingCubes.cpp Src/PlyFile.cpp ) -add_library( ${PROJECT_NAME} STATIC ${header_list} ${inline_list} ${source_list} ) +#add_library( ${PROJECT_NAME} STATIC ${header_list} ${inline_list} ${source_list} ) +add_library( ${PROJECT_NAME} STATIC ${header_list} ${source_list} ) # Add preprocessor definitions set_property( TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS NOMINMAX ) diff --git a/Src_CC_wrap/PoissonReconLib.cpp b/Src_CC_wrap/PoissonReconLib.cpp index fefd6bf..2509aa6 100644 --- a/Src_CC_wrap/PoissonReconLib.cpp +++ b/Src_CC_wrap/PoissonReconLib.cpp @@ -27,16 +27,26 @@ #endif #include +#undef USE_DOUBLE // If enabled, double-precesion is used + +//#define DATA_DEGREE 0 // The order of the B-Spline used to splat in data for color interpolation +//#define WEIGHT_DEGREE 2 // The order of the B-Spline used to splat in the weights for density estimation +//#define NORMAL_DEGREE 2 // The order of the B-Spline used to splat in the normals for constructing the Laplacian constraints +//#define DEFAULT_FEM_DEGREE 1 // The default finite-element degree +//#define DEFAULT_FEM_BOUNDARY BOUNDARY_NEUMANN // The default finite-element boundary type +//#define DIMENSION 3 // The dimension of the system + //PoissonRecon -#include "../Src/MemoryUsage.h" -#include "../Src/MyTime.h" +#include "../Src/MyMiscellany.h" +#include "../Src/PPolynomial.h" +#include "../Src/FEMTree.h" #include "../Src/Ply.h" #include "../Src/Array.h" -#include "../Src/Octree.h" -#include "../Src/SparseMatrix.h" +#include "../Src/PointStreamData.h" +#include "../Src/Image.h" -#define DumpOutput(...) ((void)0) -#include "../Src/MultiGridOctreeData.h" //only after DumpOutput has been defined! +//#define DumpOutput(...) ((void)0) +//#include "../Src/MultiGridOctreeData.h" //only after DumpOutput has been defined! #define BSPLINE_DEGREE 2 @@ -65,6 +75,9 @@ PoissonReconLib::Parameters::Parameters() #endif } +static bool Reconstruct(Parameters params, const std::vector< std::pair< Pointf, TotalPointSampleDataf > >& inCorePoints, const TotalPointSampleDataf::Transform& xForm); + + template< class Real > XForm4x4< Real > GetPointXForm(OrientedPointStream< Real >& stream, Real scaleFactor) { diff --git a/Src_CC_wrap/PoissonReconLib.h b/Src_CC_wrap/PoissonReconLib.h index 53c0a61..f5f9722 100644 --- a/Src_CC_wrap/PoissonReconLib.h +++ b/Src_CC_wrap/PoissonReconLib.h @@ -18,10 +18,15 @@ #ifndef CC_POISSON_RECON_LIB_WRAPPER #define CC_POISSON_RECON_LIB_WRAPPER -#include "../Src/Ply.h" -#include "../Src/Geometry.h" #include "../Src/PointStream.h" +//#define DATA_DEGREE 0 // The order of the B-Spline used to splat in data for color interpolation +//#define WEIGHT_DEGREE 2 // The order of the B-Spline used to splat in the weights for density estimation +//#define NORMAL_DEGREE 2 // The order of the B-Spline used to splat in the normals for constructing the Laplacian constraints +#define DEFAULT_FEM_DEGREE 1 // The default finite-element degree +#define DEFAULT_FEM_BOUNDARY BOUNDARY_NEUMANN // The default finite-element boundary type +#define DIMENSION 3 // The dimension of the system + //! Wrapper to use PoissonRecon (Kazhdan et. al) as a library class PoissonReconLib { @@ -100,15 +105,35 @@ public: int adaptiveExp; }; - //! Main entry point (shortcut to Execute) - static bool Reconstruct(Parameters params, OrientedPointStream< float >* pointStream, CoredVectorMeshData< PlyValueVertex< float > >& mesh, XForm4x4< float >& iXForm); - //! Main entry point (shortcut to Execute) for colored clouds - static bool Reconstruct(Parameters params, OrientedPointStreamWithData< float, Point3D< float > >* pointStream, CoredVectorMeshData< PlyColorAndValueVertex< float > >& mesh, XForm4x4< float >& iXForm); + static const int Degree = DEFAULT_FEM_DEGREE; + static const BoundaryType BType = DEFAULT_FEM_BOUNDARY; + typedef IsotropicUIntPack< DIMENSION, FEMDegreeAndBType< Degree, BType >::Signature > FEMSigs; + static const int Dim = sizeof(FEMSigs); - //! Main entry point (shortcut to Execute) - static bool Reconstruct(Parameters params, OrientedPointStream< double >* pointStream, CoredVectorMeshData< PlyValueVertex< double > >& mesh, XForm4x4< double >& iXForm); - //! Main entry point (shortcut to Execute) for colored clouds - static bool Reconstruct(Parameters params, OrientedPointStreamWithData< double, Point3D< double > >* pointStream, CoredVectorMeshData< PlyColorAndValueVertex< double > >& mesh, XForm4x4< double >& iXForm); + typedef Point< float, Dim > Pointf; + typedef Point< double, Dim > Pointd; + + typedef PointStreamNormal< float, Dim > NormalPointSampleDataf; + typedef PointStreamColor< float > SampleDataf; + typedef MultiPointStreamData< float, SampleDataf > AdditionalPointSampleDataf; + typedef MultiPointStreamData< float, NormalPointSampleDataf, AdditionalPointSampleDataf > TotalPointSampleDataf; + + static bool Reconstruct(Parameters params, const std::vector< std::pair< Pointf, TotalPointSampleDataf > >& inCorePoints, const TotalPointSampleDataf::Transform& xForm); + + //typedef PointStreamColor< double > SampleDatad; + //BinaryInputPointStreamWithData + + //typedef PointStreamNormal< float, 3 > NormalPointSampleData; + + ////! Main entry point (shortcut to Execute) + //static bool Reconstruct(Parameters params, OrientedPointStream< float >* pointStream, CoredVectorMeshData< PlyValueVertex< float > >& mesh, XForm4x4< float >& iXForm); + ////! Main entry point (shortcut to Execute) for colored clouds + //static bool Reconstruct(Parameters params, OrientedPointStreamWithData< float, Point3D< float > >* pointStream, CoredVectorMeshData< PlyColorAndValueVertex< float > >& mesh, XForm4x4< float >& iXForm); + + ////! Main entry point (shortcut to Execute) + //static bool Reconstruct(Parameters params, OrientedPointStream< double >* pointStream, CoredVectorMeshData< PlyValueVertex< double > >& mesh, XForm4x4< double >& iXForm); + ////! Main entry point (shortcut to Execute) for colored clouds + //static bool Reconstruct(Parameters params, OrientedPointStreamWithData< double, Point3D< double > >* pointStream, CoredVectorMeshData< PlyColorAndValueVertex< double > >& mesh, XForm4x4< double >& iXForm); };