├── src ├── Eigen │ ├── Eigen │ ├── src │ │ ├── Core │ │ │ ├── util │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ └── DisableStupidWarnings.h │ │ │ ├── arch │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── SSE │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── NEON │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── AltiVec │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── Default │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── Settings.h │ │ │ ├── products │ │ │ │ └── CMakeLists.txt │ │ │ ├── CMakeLists.txt │ │ │ ├── CoreIterators.h │ │ │ ├── ReturnByValue.h │ │ │ ├── NestByValue.h │ │ │ └── VectorBlock.h │ │ ├── QR │ │ │ ├── CMakeLists.txt │ │ │ └── HouseholderQR_MKL.h │ │ ├── SVD │ │ │ └── CMakeLists.txt │ │ ├── misc │ │ │ ├── CMakeLists.txt │ │ │ ├── Solve.h │ │ │ ├── Kernel.h │ │ │ └── Image.h │ │ ├── Jacobi │ │ │ └── CMakeLists.txt │ │ ├── LU │ │ │ ├── arch │ │ │ │ └── CMakeLists.txt │ │ │ ├── CMakeLists.txt │ │ │ ├── Determinant.h │ │ │ └── PartialPivLU_MKL.h │ │ ├── plugins │ │ │ ├── CMakeLists.txt │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ └── MatrixCwiseUnaryOps.h │ │ ├── Cholesky │ │ │ └── CMakeLists.txt │ │ ├── SparseLU │ │ │ ├── CMakeLists.txt │ │ │ ├── SparseLU_Utils.h │ │ │ └── SparseLU_relax_snode.h │ │ ├── SparseQR │ │ │ └── CMakeLists.txt │ │ ├── StlSupport │ │ │ ├── CMakeLists.txt │ │ │ └── details.h │ │ ├── Eigenvalues │ │ │ └── CMakeLists.txt │ │ ├── Householder │ │ │ ├── CMakeLists.txt │ │ │ └── BlockHouseholder.h │ │ ├── SPQRSupport │ │ │ └── CMakeLists.txt │ │ ├── SparseCore │ │ │ ├── CMakeLists.txt │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseView.h │ │ │ └── SparseDot.h │ │ ├── MetisSupport │ │ │ └── CMakeLists.txt │ │ ├── Geometry │ │ │ ├── arch │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── PaStiXSupport │ │ │ └── CMakeLists.txt │ │ ├── CholmodSupport │ │ │ └── CMakeLists.txt │ │ ├── OrderingMethods │ │ │ └── CMakeLists.txt │ │ ├── PardisoSupport │ │ │ └── CMakeLists.txt │ │ ├── SparseCholesky │ │ │ └── CMakeLists.txt │ │ ├── SuperLUSupport │ │ │ └── CMakeLists.txt │ │ ├── UmfPackSupport │ │ │ └── CMakeLists.txt │ │ ├── Eigen2Support │ │ │ ├── Geometry │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── All.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Macros.h │ │ │ ├── TriangularSolver.h │ │ │ ├── Memory.h │ │ │ ├── QR.h │ │ │ ├── Lazy.h │ │ │ ├── MathFunctions.h │ │ │ ├── VectorBlock.h │ │ │ └── Meta.h │ │ ├── IterativeLinearSolvers │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ ├── Dense │ ├── Array │ ├── Householder │ ├── CMakeLists.txt │ ├── Sparse │ ├── Jacobi │ ├── StdList │ ├── QtAlignedMalloc │ ├── MetisSupport │ ├── LeastSquares │ ├── StdDeque │ ├── StdVector │ ├── Cholesky │ ├── PardisoSupport │ ├── SVD │ ├── SPQRSupport │ ├── SparseQR │ ├── QR │ ├── LU │ ├── UmfPackSupport │ ├── Eigenvalues │ ├── SparseCholesky │ ├── PaStiXSupport │ ├── IterativeLinearSolvers │ ├── CholmodSupport │ ├── Geometry │ ├── SparseLU │ ├── SparseCore │ ├── SuperLUSupport │ ├── OrderingMethods │ └── Eigen2Support ├── Denoising │ ├── Icons │ │ ├── about.ico │ │ ├── edges.ico │ │ ├── enjoy.ico │ │ ├── faces.ico │ │ ├── open.ico │ │ ├── points.ico │ │ ├── save.ico │ │ ├── MeshDenoise.ico │ │ ├── background.ico │ │ ├── clear_mesh.png │ │ ├── noisy_mesh.png │ │ ├── denoised_mesh.png │ │ └── original_mesh.png │ ├── main.cpp │ ├── Algorithms │ │ ├── meshdenoisebase.cpp │ │ ├── BilateralMeshDenoising.h │ │ ├── meshdenoisebase.h │ │ ├── FastAndEffectiveFeaturePreservingMeshDenoising.h │ │ ├── BilateralNormalFilteringForMeshDenoising.h │ │ ├── Noise.h │ │ ├── NonIterativeFeaturePreservingMeshFiltering.h │ │ ├── MeshDenoisingBase.h │ │ ├── MeshDenoisingViaL0Minimization.h │ │ └── GuidedMeshNormalFiltering.h │ ├── mainwindow.qrc │ ├── datamanager.cpp │ ├── Console.h │ ├── mainwindow.ui │ ├── iothread.h │ ├── meshexaminer.h │ ├── Console.cpp │ ├── mesh.h │ ├── iothread.cpp │ ├── glviewer.cpp │ ├── datamanager.h │ ├── calculationthread.h │ ├── glviewer.h │ ├── parametersetwidget.h │ ├── Denoising.pro │ ├── glexaminer.h │ ├── calculationthread.cpp │ └── mainwindow.h ├── MeshDenoising.pro ├── OpenMesh │ └── Core │ │ ├── Mesh │ │ ├── gen │ │ │ └── footer.hh │ │ └── ACGMakefile │ │ ├── Templates │ │ ├── newClass.sh │ │ └── newClassT.sh │ │ ├── IO │ │ ├── ACGMakefile │ │ ├── exporter │ │ │ └── ACGMakefile │ │ ├── importer │ │ │ └── ACGMakefile │ │ ├── reader │ │ │ └── ACGMakefile │ │ ├── writer │ │ │ ├── ACGMakefile │ │ │ ├── VTKWriter.hh │ │ │ └── VTKWriter.cc │ │ ├── SR_binary_vector_of_string.inl │ │ ├── SR_binary_vector_of_bool.inl │ │ └── SR_binary_vector_of_fundamentals.inl │ │ ├── System │ │ ├── ACGMakefile │ │ └── config.hh │ │ ├── Utils │ │ ├── ACGMakefile │ │ └── BaseProperty.cc │ │ └── Geometry │ │ └── ACGMakefile └── LibsInclude.pri ├── models └── RealData │ └── iron │ └── iron.ply └── README.md /src/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | //#include "Sparse" 3 | -------------------------------------------------------------------------------- /models/RealData/iron/iron.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/models/RealData/iron/iron.ply -------------------------------------------------------------------------------- /src/Denoising/Icons/about.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/about.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/edges.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/edges.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/enjoy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/enjoy.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/faces.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/faces.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/open.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/open.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/points.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/points.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/save.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/save.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/MeshDenoise.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/MeshDenoise.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/background.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/background.ico -------------------------------------------------------------------------------- /src/Denoising/Icons/clear_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/clear_mesh.png -------------------------------------------------------------------------------- /src/Denoising/Icons/noisy_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/noisy_mesh.png -------------------------------------------------------------------------------- /src/Denoising/Icons/denoised_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/denoised_mesh.png -------------------------------------------------------------------------------- /src/Denoising/Icons/original_mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bldeng/GuidedDenoising/HEAD/src/Denoising/Icons/original_mesh.png -------------------------------------------------------------------------------- /src/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(SSE) 2 | ADD_SUBDIRECTORY(AltiVec) 3 | ADD_SUBDIRECTORY(NEON) 4 | ADD_SUBDIRECTORY(Default) 5 | -------------------------------------------------------------------------------- /src/MeshDenoising.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | OpenMesh \ 5 | Denoising 6 | 7 | Denoising.depends = OpenMesh 8 | 9 | -------------------------------------------------------------------------------- /src/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /src/Eigen/src/QR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_QR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_QR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/QR COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SVD COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/misc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_misc_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_misc_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/misc COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Jacobi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Jacobi_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Jacobi_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Jacobi COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/LU/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_plugins_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_plugins_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/plugins COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Cholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Cholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Cholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Cholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseLU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseLU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseLU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseLU COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseQR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseQR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseQR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseQR/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_util_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_util_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/util COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/StlSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_StlSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_StlSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/StlSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigenvalues/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_EIGENVALUES_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_EIGENVALUES_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigenvalues COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Householder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Householder_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Householder_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Householder COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/LU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /src/Eigen/src/SPQRSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SPQRSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SPQRSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SPQRSupport/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCore_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCore_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCore COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/SSE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_SSE_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_SSE_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/SSE COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/products/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_Product_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_Product_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/products COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/MetisSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MetisSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MetisSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/MetisSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/NEON/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_NEON_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_NEON_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/NEON COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Geometry/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/PaStiXSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PastixSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PastixSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PaStiXSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/CholmodSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_CholmodSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_CholmodSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/CholmodSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/OrderingMethods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_OrderingMethods_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_OrderingMethods_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/OrderingMethods COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/PardisoSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PardisoSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PardisoSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PardisoSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/SuperLUSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SuperLUSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SuperLUSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SuperLUSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/UmfPackSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_UmfPackSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_UmfPackSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/UmfPackSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/AltiVec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_AltiVec_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/AltiVec COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/Default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_Default_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_Default_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/Default COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support/Geometry 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(Geometry) -------------------------------------------------------------------------------- /src/Eigen/src/IterativeLinearSolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_IterativeLinearSolvers_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/IterativeLinearSolvers COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(products) 9 | ADD_SUBDIRECTORY(util) 10 | ADD_SUBDIRECTORY(arch) 11 | -------------------------------------------------------------------------------- /src/Denoising/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication::setStyle(QStyleFactory::create("cleanlooks")); 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Mesh/gen/footer.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | } // namespace Iterators 3 | } // namespace OpenMesh 4 | //============================================================================= 5 | #endif 6 | //============================================================================= 7 | -------------------------------------------------------------------------------- /src/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB Eigen_src_subdirectories "*") 2 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 3 | foreach(f ${Eigen_src_subdirectories}) 4 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" ) 5 | add_subdirectory(${f}) 6 | endif() 7 | endforeach() 8 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/meshdenoisebase.cpp: -------------------------------------------------------------------------------- 1 | #include "meshdenoisebase.h" 2 | 3 | MeshDenoiseBase::MeshDenoiseBase(DataManager *_data_manager, ParameterSet *_parameter_set) 4 | { 5 | if((_data_manager == NULL) || (_parameter_set == NULL)) 6 | return; 7 | 8 | data_manager_ = _data_manager; 9 | parameter_set_ = _parameter_set; 10 | } 11 | -------------------------------------------------------------------------------- /src/Eigen/Array: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ARRAY_MODULE_H 2 | #define EIGEN_ARRAY_MODULE_H 3 | 4 | // include Core first to handle Eigen2 support macros 5 | #include "Core" 6 | 7 | #ifndef EIGEN2_SUPPORT 8 | #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core. 9 | #endif 10 | 11 | #endif // EIGEN_ARRAY_MODULE_H 12 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Templates/newClass.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | A=`echo $1_ | tr '[:lower:]' '[:upper:]'` 4 | 5 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClass.cc > tmp_newClass.cc 6 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClass.hh > tmp_newClass.hh 7 | 8 | mv -i tmp_newClass.cc $1.cc && echo $1.cc - ok 9 | mv -i tmp_newClass.hh $1.hh && echo $1.hh - ok 10 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Templates/newClassT.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | A=`echo $1_ | tr '[:lower:]' '[:upper:]'` 4 | 5 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClassT.cc > tmp_newClass.cc 6 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClassT.hh > tmp_newClass.hh 7 | 8 | mv -i tmp_newClass.cc $1.cc && echo $1.cc - ok 9 | mv -i tmp_newClass.hh $1.hh && echo $1.hh - ok 10 | -------------------------------------------------------------------------------- /src/Denoising/mainwindow.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Icons/edges.ico 4 | Icons/open.ico 5 | Icons/points.ico 6 | Icons/save.ico 7 | Icons/faces.ico 8 | Icons/background.ico 9 | Icons/about.ico 10 | Icons/MeshDenoise.ico 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED 2 | #undef EIGEN_WARNINGS_DISABLED 3 | 4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 5 | #ifdef _MSC_VER 6 | #pragma warning( pop ) 7 | #elif defined __INTEL_COMPILER 8 | #pragma warning pop 9 | #elif defined __clang__ 10 | #pragma clang diagnostic pop 11 | #endif 12 | #endif 13 | 14 | #endif // EIGEN_WARNINGS_DISABLED 15 | -------------------------------------------------------------------------------- /src/LibsInclude.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $${_PRO_FILE_PWD_}/../ 2 | 3 | #Generate binary executables at the root of the build folder 4 | DESTDIR = $${OUT_PWD}/../ 5 | DEFINES += OM_STATIC_BUILD 6 | 7 | win32{ 8 | LIBS += "$${OUT_PWD}/../OpenMesh/OpenMesh.lib" 9 | LIBS += opengl32.lib 10 | LIBS += glu32.lib 11 | } 12 | 13 | unix{ 14 | LIBS += -L$${OUT_PWD}/../OpenMesh -lOpenMesh 15 | 16 | macx{ 17 | LIBS += -framework OpenGL 18 | } 19 | else{ 20 | LIBS += -lGLU 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Mesh/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/System/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Utils/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Geometry/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/exporter/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/importer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/reader/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/writer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/Denoising/datamanager.cpp: -------------------------------------------------------------------------------- 1 | #include "datamanager.h" 2 | 3 | DataManager::DataManager() 4 | { 5 | 6 | } 7 | 8 | bool DataManager::ImportMeshFromFile(std::string filename) 9 | { 10 | if(!OpenMesh::IO::read_mesh(mesh_, filename)) 11 | return false; 12 | else 13 | { 14 | original_mesh_ = mesh_; 15 | noisy_mesh_ = mesh_; 16 | denoised_mesh_ = mesh_; 17 | return true; 18 | } 19 | } 20 | 21 | bool DataManager::ExportMeshToFile(std::string filename) 22 | { 23 | return OpenMesh::IO::write_mesh(mesh_, filename); 24 | } 25 | -------------------------------------------------------------------------------- /src/Eigen/Householder: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 2 | #define EIGEN_HOUSEHOLDER_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Householder_Module Householder module 9 | * This module provides Householder transformations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | */ 15 | 16 | #include "src/Householder/Householder.h" 17 | #include "src/Householder/HouseholderSequence.h" 18 | #include "src/Householder/BlockHouseholder.h" 19 | 20 | #include "src/Core/util/ReenableStupidWarnings.h" 21 | 22 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 23 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 24 | -------------------------------------------------------------------------------- /src/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | add_subdirectory(src) 20 | -------------------------------------------------------------------------------- /src/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSE_MODULE_H 2 | #define EIGEN_SPARSE_MODULE_H 3 | 4 | /** \defgroup Sparse_Module Sparse meta-module 5 | * 6 | * Meta-module including all related modules: 7 | * - \ref SparseCore_Module 8 | * - \ref OrderingMethods_Module 9 | * - \ref SparseCholesky_Module 10 | * - \ref SparseLU_Module 11 | * - \ref SparseQR_Module 12 | * - \ref IterativeLinearSolvers_Module 13 | * 14 | * \code 15 | * #include 16 | * \endcode 17 | */ 18 | 19 | #include "SparseCore" 20 | #include "OrderingMethods" 21 | #include "SparseCholesky" 22 | #include "SparseLU" 23 | #include "SparseQR" 24 | #include "IterativeLinearSolvers" 25 | 26 | #endif // EIGEN_SPARSE_MODULE_H 27 | 28 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Macros.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MACROS_H 11 | #define EIGEN2_MACROS_H 12 | 13 | #define ei_assert eigen_assert 14 | #define ei_internal_assert eigen_internal_assert 15 | 16 | #define EIGEN_ALIGN_128 EIGEN_ALIGN16 17 | 18 | #define EIGEN_ARCH_WANTS_ALIGNMENT EIGEN_ALIGN_STATICALLY 19 | 20 | #endif // EIGEN2_MACROS_H 21 | -------------------------------------------------------------------------------- /src/Denoising/Console.h: -------------------------------------------------------------------------------- 1 | /************************************************************************/ 2 | /* console output the debug info. */ 3 | /************************************************************************/ 4 | 5 | #ifndef _CONSOLE_H 6 | #define _CONSOLE_H 7 | #include 8 | #include 9 | using namespace std; 10 | 11 | class CConsoleOutput 12 | { 13 | public: 14 | //output information in console 15 | static void Destory(); 16 | static CConsoleOutput * Instance(); 17 | public: 18 | virtual ~CConsoleOutput(); 19 | 20 | protected: 21 | CConsoleOutput(); 22 | 23 | private: 24 | static CConsoleOutput* m_instance; 25 | FILE *file; 26 | }; 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /src/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_JACOBI_MODULE_H 2 | #define EIGEN_JACOBI_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Jacobi_Module Jacobi module 9 | * This module provides Jacobi and Givens rotations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | * 15 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 16 | * - MatrixBase::applyOnTheLeft() 17 | * - MatrixBase::applyOnTheRight(). 18 | */ 19 | 20 | #include "src/Jacobi/Jacobi.h" 21 | 22 | #include "src/Core/util/ReenableStupidWarnings.h" 23 | 24 | #endif // EIGEN_JACOBI_MODULE_H 25 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 26 | 27 | -------------------------------------------------------------------------------- /src/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /src/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EIGEN_QTMALLOC_MODULE_H 3 | #define EIGEN_QTMALLOC_MODULE_H 4 | 5 | #include "Core" 6 | 7 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 8 | 9 | #include "src/Core/util/DisableStupidWarnings.h" 10 | 11 | void *qMalloc(size_t size) 12 | { 13 | return Eigen::internal::aligned_malloc(size); 14 | } 15 | 16 | void qFree(void *ptr) 17 | { 18 | Eigen::internal::aligned_free(ptr); 19 | } 20 | 21 | void *qRealloc(void *ptr, size_t size) 22 | { 23 | void* newPtr = Eigen::internal::aligned_malloc(size); 24 | memcpy(newPtr, ptr, size); 25 | Eigen::internal::aligned_free(ptr); 26 | return newPtr; 27 | } 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif 32 | 33 | #endif // EIGEN_QTMALLOC_MODULE_H 34 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 35 | -------------------------------------------------------------------------------- /src/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_METISSUPPORT_MODULE_H 2 | #define EIGEN_METISSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | 13 | /** \ingroup Support_modules 14 | * \defgroup MetisSupport_Module MetisSupport module 15 | * 16 | * \code 17 | * #include 18 | * \endcode 19 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 20 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 21 | */ 22 | 23 | 24 | #include "src/MetisSupport/MetisSupport.h" 25 | 26 | #include "src/Core/util/ReenableStupidWarnings.h" 27 | 28 | #endif // EIGEN_METISSUPPORT_MODULE_H 29 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/BilateralMeshDenoising.h: -------------------------------------------------------------------------------- 1 | #ifndef BILATERALMESHDENOISING_H 2 | #define BILATERALMESHDENOISING_H 3 | 4 | /* 5 | @brief: "Bilateral Mesh Denoising" class 6 | @reference: Bilateral Mesh Denoising, SIGGRAPH 2003 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include 11 | #include 12 | 13 | class BilateralMeshDenoising : public MeshDenoisingBase 14 | { 15 | public: 16 | BilateralMeshDenoising(DataManager *_data_manager, ParameterSet *_parameter_set); 17 | ~BilateralMeshDenoising() {} 18 | 19 | private: 20 | void denoise(); 21 | void initParameters(); 22 | 23 | void getAdaptiveVertexNeighbor(TriMesh &mesh, TriMesh::VertexHandle vh, double sigma_c, 24 | std::vector &vertex_neighbor); 25 | }; 26 | 27 | #endif // BILATERALMESHDENOISING_H 28 | -------------------------------------------------------------------------------- /src/Eigen/LeastSquares: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_REGRESSION_MODULE_H 2 | #define EIGEN_REGRESSION_MODULE_H 3 | 4 | #ifndef EIGEN2_SUPPORT 5 | #error LeastSquares is only available in Eigen2 support mode (define EIGEN2_SUPPORT) 6 | #endif 7 | 8 | // exclude from normal eigen3-only documentation 9 | #ifdef EIGEN2_SUPPORT 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Eigenvalues" 16 | #include "Geometry" 17 | 18 | /** \defgroup LeastSquares_Module LeastSquares module 19 | * This module provides linear regression and related features. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/Eigen2Support/LeastSquares.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN2_SUPPORT 31 | 32 | #endif // EIGEN_REGRESSION_MODULE_H 33 | -------------------------------------------------------------------------------- /src/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /src/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /src/Denoising/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Guided Denoising 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 400 23 | 23 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Denoising/iothread.h: -------------------------------------------------------------------------------- 1 | #ifndef IOTHREAD_H 2 | #define IOTHREAD_H 3 | 4 | #include 5 | #include 6 | #include "datamanager.h" 7 | 8 | class ioThread : public QThread 9 | { 10 | Q_OBJECT 11 | public: 12 | ioThread(DataManager *_data_manager); 13 | ~ioThread(); 14 | 15 | enum ioType{kNon, kImport, kExport}; 16 | 17 | signals: 18 | void statusShowMessage(QString); 19 | void setActionAndWidget(bool, bool); 20 | void needToUpdateGL(bool); 21 | 22 | public: 23 | void setFileName(const QString file_name) {file_name_ = file_name;} 24 | void ImportMesh(QString &file_name); 25 | void ExportMesh(QString &file_name); 26 | 27 | public: 28 | void run(); 29 | 30 | public: 31 | QString file_name_; 32 | ioType io_type_; 33 | QWidget *widget_; 34 | DataManager *data_manager_; 35 | }; 36 | 37 | #endif // IOTHREAD_H 38 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/meshdenoisebase.h: -------------------------------------------------------------------------------- 1 | #ifndef MESHDENOISEBASE_H 2 | #define MESHDENOISEBASE_H 3 | 4 | #include "../datamanager.h" 5 | #include "../parameterset.h" 6 | 7 | class MeshDenoiseBase 8 | { 9 | public: 10 | MeshDenoiseBase(DataManager *_data_manager, ParameterSet *_parameter_set); 11 | virtual ~MeshDenoiseBase() {} 12 | 13 | DataManager *getDataManager() const {return data_manager_;} 14 | void setDataManager(DataManager *_data_manager) {data_manager_ = _data_manager;} 15 | ParameterSet *getParameterSet() const {return parameter_set_;} 16 | void setParameterSet(ParameterSet *_parameter_set) {parameter_set_ = _parameter_set;} 17 | 18 | virtual void denoise() = 0; 19 | 20 | private: 21 | virtual void initParameters() = 0; 22 | 23 | private: 24 | DataManager *data_manager_; 25 | ParameterSet *parameter_set_; 26 | }; 27 | 28 | #endif // MESHDENOISEBASE_H 29 | -------------------------------------------------------------------------------- /src/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLESKY_MODULE_H 2 | #define EIGEN_CHOLESKY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Cholesky_Module Cholesky module 9 | * 10 | * 11 | * 12 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 13 | * Those decompositions are accessible via the following MatrixBase methods: 14 | * - MatrixBase::llt(), 15 | * - MatrixBase::ldlt() 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | */ 21 | 22 | #include "src/misc/Solve.h" 23 | #include "src/Cholesky/LLT.h" 24 | #include "src/Cholesky/LDLT.h" 25 | #ifdef EIGEN_USE_LAPACKE 26 | #include "src/Cholesky/LLT_MKL.h" 27 | #endif 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_CHOLESKY_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/FastAndEffectiveFeaturePreservingMeshDenoising.h: -------------------------------------------------------------------------------- 1 | #ifndef FASTANDEFFECTIVEFEATUREPRESERVINGMESHDENOISING_H 2 | #define FASTANDEFFECTIVEFEATUREPRESERVINGMESHDENOISING_H 3 | 4 | /* 5 | @brief: "Fast and Effective Feature Preserving Mesh Denoising" class 6 | @reference: Fast and Effective Feature Preserving Mesh Denoising, TVCG 2007 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include 11 | #include 12 | 13 | class FastAndEffectiveFeaturePreservingMeshDenoising : public MeshDenoisingBase 14 | { 15 | public: 16 | FastAndEffectiveFeaturePreservingMeshDenoising(DataManager *_data_manager, ParameterSet *_parameter_set); 17 | ~FastAndEffectiveFeaturePreservingMeshDenoising() {} 18 | 19 | private: 20 | void denoise(); 21 | void initParameters(); 22 | 23 | void updateFilteredNormals(TriMesh &mesh, std::vector &filtered_normals); 24 | }; 25 | 26 | #endif // FASTANDEFFECTIVEFEATUREPRESERVINGMESHDENOISING_H 27 | -------------------------------------------------------------------------------- /src/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 2 | #define EIGEN_PARDISOSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | 10 | #include 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup PardisoSupport_Module PardisoSupport module 14 | * 15 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 22 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 23 | * 24 | */ 25 | 26 | #include "src/PardisoSupport/PardisoSupport.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 31 | -------------------------------------------------------------------------------- /src/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #define EIGEN_SVD_MODULE_H 3 | 4 | #include "QR" 5 | #include "Householder" 6 | #include "Jacobi" 7 | 8 | #include "src/Core/util/DisableStupidWarnings.h" 9 | 10 | /** \defgroup SVD_Module SVD module 11 | * 12 | * 13 | * 14 | * This module provides SVD decomposition for matrices (both real and complex). 15 | * This decomposition is accessible via the following MatrixBase method: 16 | * - MatrixBase::jacobiSvd() 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/misc/Solve.h" 24 | #include "src/SVD/JacobiSVD.h" 25 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 26 | #include "src/SVD/JacobiSVD_MKL.h" 27 | #endif 28 | #include "src/SVD/UpperBidiagonalization.h" 29 | 30 | #ifdef EIGEN2_SUPPORT 31 | #include "src/Eigen2Support/SVD.h" 32 | #endif 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_SVD_MODULE_H 37 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 38 | -------------------------------------------------------------------------------- /src/Denoising/meshexaminer.h: -------------------------------------------------------------------------------- 1 | #ifndef MESHEXAMINER_H 2 | #define MESHEXAMINER_H 3 | 4 | #include "glexaminer.h" 5 | #include "mesh.h" 6 | 7 | class MeshExaminer : public GLExaminer 8 | { 9 | public: 10 | MeshExaminer(); 11 | virtual ~MeshExaminer(); 12 | 13 | // draw the scene 14 | virtual void draw(); 15 | 16 | void resetMesh(const TriMesh &_mesh, bool _need_normalize); 17 | 18 | void updateMesh(const TriMesh &_mesh); 19 | 20 | void setDrawPointsStatus(bool _val){ 21 | draw_points_status_ = _val; 22 | } 23 | 24 | void setDrawFacesStatus(bool _val){ 25 | draw_faces_status_ = _val; 26 | } 27 | 28 | void setDrawEdgesStatus(bool _val){ 29 | draw_edges_status_ = _val; 30 | } 31 | 32 | protected: 33 | TriMesh mesh_show_; 34 | 35 | bool draw_points_status_; 36 | bool draw_edges_status_; 37 | bool draw_faces_status_; 38 | 39 | // compute the bounding box of a mesh 40 | bool meshBoundingBox(TriMesh::Point &min_coord, TriMesh::Point &max_coord); 41 | }; 42 | 43 | #endif // MESHEXAMINER_H 44 | -------------------------------------------------------------------------------- /src/Denoising/Console.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "Console.h" 6 | 7 | CConsoleOutput* CConsoleOutput::m_instance = NULL; 8 | CConsoleOutput::CConsoleOutput() 9 | { 10 | //creat a new console to the process. 11 | AllocConsole(); 12 | int hCrun; 13 | hCrun = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT); 14 | file = _fdopen(hCrun, "w"); 15 | // use default stream buffer 16 | setvbuf(file, NULL, _IONBF, 0); 17 | *stdout = *file; 18 | 19 | std::cout << "\tReady! Debug Informations...\n\n"; 20 | } 21 | 22 | CConsoleOutput::~CConsoleOutput() 23 | { 24 | FreeConsole(); 25 | fclose(file); 26 | } 27 | 28 | void CConsoleOutput::Destory() 29 | { 30 | if (m_instance) 31 | { 32 | delete m_instance; 33 | m_instance = NULL; 34 | } 35 | return ; 36 | } 37 | 38 | CConsoleOutput* CConsoleOutput::Instance() 39 | { 40 | if (m_instance==NULL) 41 | { 42 | m_instance = new CConsoleOutput; 43 | } 44 | return m_instance; 45 | } 46 | -------------------------------------------------------------------------------- /src/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 2 | #define EIGEN_SPQRSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "SuiteSparseQR.hpp" 9 | 10 | /** \ingroup Support_modules 11 | * \defgroup SPQRSupport_Module SuiteSparseQR module 12 | * 13 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 14 | * 15 | * \code 16 | * #include 17 | * \endcode 18 | * 19 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 20 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | #include "src/CholmodSupport/CholmodSupport.h" 27 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | // template 14 | // template 15 | // bool SparseMatrixBase::isApprox( 16 | // const OtherDerived& other, 17 | // typename NumTraits::Real prec 18 | // ) const 19 | // { 20 | // const typename internal::nested::type nested(derived()); 21 | // const typename internal::nested::type otherNested(other.derived()); 22 | // return (nested - otherNested).cwise().abs2().sum() 23 | // <= prec * prec * (std::min)(nested.cwise().abs2().sum(), otherNested.cwise().abs2().sum()); 24 | // } 25 | 26 | #endif // EIGEN_SPARSE_FUZZY_H 27 | -------------------------------------------------------------------------------- /src/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSEQR_MODULE_H 2 | #define EIGEN_SPARSEQR_MODULE_H 3 | 4 | #include "SparseCore" 5 | #include "OrderingMethods" 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup SparseQR_Module SparseQR module 9 | * \brief Provides QR decomposition for sparse matrices 10 | * 11 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 12 | * The columns of the input matrix should be reordered to limit the fill-in during the 13 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 14 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 15 | * of built-in and external ordering methods. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | 27 | #include "OrderingMethods" 28 | #include "src/SparseCore/SparseColEtree.h" 29 | #include "src/SparseQR/SparseQR.h" 30 | 31 | #include "src/Core/util/ReenableStupidWarnings.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/Eigen/QR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QR_MODULE_H 2 | #define EIGEN_QR_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "Cholesky" 9 | #include "Jacobi" 10 | #include "Householder" 11 | 12 | /** \defgroup QR_Module QR module 13 | * 14 | * 15 | * 16 | * This module provides various QR decompositions 17 | * This module also provides some MatrixBase methods, including: 18 | * - MatrixBase::qr(), 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include "src/misc/Solve.h" 26 | #include "src/QR/HouseholderQR.h" 27 | #include "src/QR/FullPivHouseholderQR.h" 28 | #include "src/QR/ColPivHouseholderQR.h" 29 | #ifdef EIGEN_USE_LAPACKE 30 | #include "src/QR/HouseholderQR_MKL.h" 31 | #include "src/QR/ColPivHouseholderQR_MKL.h" 32 | #endif 33 | 34 | #ifdef EIGEN2_SUPPORT 35 | #include "src/Eigen2Support/QR.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #ifdef EIGEN2_SUPPORT 41 | #include "Eigenvalues" 42 | #endif 43 | 44 | #endif // EIGEN_QR_MODULE_H 45 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 46 | -------------------------------------------------------------------------------- /src/Eigen/LU: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_LU_MODULE_H 2 | #define EIGEN_LU_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup LU_Module LU module 9 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 10 | * This module defines the following MatrixBase methods: 11 | * - MatrixBase::inverse() 12 | * - MatrixBase::determinant() 13 | * 14 | * \code 15 | * #include 16 | * \endcode 17 | */ 18 | 19 | #include "src/misc/Solve.h" 20 | #include "src/misc/Kernel.h" 21 | #include "src/misc/Image.h" 22 | #include "src/LU/FullPivLU.h" 23 | #include "src/LU/PartialPivLU.h" 24 | #ifdef EIGEN_USE_LAPACKE 25 | #include "src/LU/PartialPivLU_MKL.h" 26 | #endif 27 | #include "src/LU/Determinant.h" 28 | #include "src/LU/Inverse.h" 29 | 30 | #if defined EIGEN_VECTORIZE_SSE 31 | #include "src/LU/arch/Inverse_SSE.h" 32 | #endif 33 | 34 | #ifdef EIGEN2_SUPPORT 35 | #include "src/Eigen2Support/LU.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_LU_MODULE_H 41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 42 | -------------------------------------------------------------------------------- /src/Denoising/mesh.h: -------------------------------------------------------------------------------- 1 | #ifndef MESH_H 2 | #define MESH_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | struct MyTraits : OpenMesh::DefaultTraits 9 | { 10 | // Let Point and Normal be a vector of doubles 11 | typedef OpenMesh::Vec3d Point; 12 | typedef OpenMesh::Vec3d Normal; 13 | 14 | // The default 1D texture coordinate type is float. 15 | typedef double TexCoord1D; 16 | // The default 2D texture coordinate type is OpenMesh::Vec2f. 17 | typedef OpenMesh::Vec2d TexCoord2D; 18 | // The default 3D texture coordinate type is OpenMesh::Vec3f. 19 | typedef OpenMesh::Vec3d TexCoord3D; 20 | 21 | //enable standart properties 22 | VertexAttributes (OpenMesh::Attributes::Status|OpenMesh::Attributes::Normal|OpenMesh::Attributes::Color); 23 | HalfedgeAttributes (OpenMesh::Attributes::Status|OpenMesh::Attributes::PrevHalfedge); 24 | FaceAttributes (OpenMesh::Attributes::Status|OpenMesh::Attributes::Normal|OpenMesh::Attributes::Color); 25 | EdgeAttributes (OpenMesh::Attributes::Status|OpenMesh::Attributes::Color); 26 | }; 27 | 28 | typedef OpenMesh::TriMesh_ArrayKernelT TriMesh; 29 | 30 | #endif // MESH_H 31 | 32 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/BilateralNormalFilteringForMeshDenoising.h: -------------------------------------------------------------------------------- 1 | #ifndef BILATERALNORMALFILTERINGFORMESHDENOISING_H 2 | #define BILATERALNORMALFILTERINGFORMESHDENOISING_H 3 | 4 | /* 5 | @brief: "Bilateral Normal Filtering for Mesh Denoising" class 6 | @reference: Bilateral Normal Filtering for Mesh Denoising, TVCG 2011 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include "Eigen/Dense" 11 | #include "Eigen/Sparse" 12 | 13 | class BilateralNormalFilteringForMeshDenoising : public MeshDenoisingBase 14 | { 15 | public: 16 | BilateralNormalFilteringForMeshDenoising(DataManager *_data_manager, ParameterSet *_parameter_set); 17 | ~BilateralNormalFilteringForMeshDenoising() {} 18 | 19 | private: 20 | void denoise(); 21 | void initParameters(); 22 | 23 | double getSigmaC(TriMesh &mesh, std::vector &face_centroid, double multiple_sigma_c); 24 | void updateFilteredNormals(TriMesh &mesh, std::vector &filtered_normals); 25 | void updateFilteredNormalsLocalScheme(TriMesh &mesh, std::vector &filtered_normals); 26 | void updateFilteredNormalsGlobalScheme(TriMesh &mesh, std::vector &filtered_normals); 27 | }; 28 | 29 | #endif // BILATERALNORMALFILTERINGFORMESHDENOISING_H 30 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/Noise.h: -------------------------------------------------------------------------------- 1 | #ifndef NOISE_H 2 | #define NOISE_H 3 | 4 | #include "../parameterset.h" 5 | #include "../datamanager.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class Noise 12 | { 13 | public: 14 | explicit Noise(DataManager *_data_manager, ParameterSet *_paramter_set); 15 | ~Noise() {} 16 | 17 | public: 18 | void addNoise(); 19 | 20 | private: 21 | enum NoiseType{kGaussian, kImpulsive}; 22 | enum NoiseDirection{kNormal, kRandom}; 23 | 24 | void initParameters(); 25 | 26 | double generateRandomGaussian(double mean, double StandardDerivation); 27 | TriMesh::Normal generateRandomDirection(); 28 | 29 | void randomGaussianNumbers(double mean, double StandardDerivation, int number, std::vector &RandomNumbers); 30 | void randomImpulsiveNumbers(int min, int max, int number, 31 | double mean, double StandardDerivation, 32 | std::vector< std::pair > &VertexListAndRandomNumbers); 33 | void randomDirections(int number, std::vector &RandomDirections); 34 | 35 | private: 36 | ParameterSet *parameter_set_; 37 | DataManager *data_manager_; 38 | }; 39 | 40 | #endif // NOISE_H 41 | -------------------------------------------------------------------------------- /src/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 2 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup UmfPackSupport_Module UmfPackSupport module 14 | * 15 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 16 | * It provides the following factorization class: 17 | * - class UmfPackLU: a multifrontal sequential LU factorization. 18 | * 19 | * \code 20 | * #include 21 | * \endcode 22 | * 23 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 24 | * The dependencies depend on how umfpack has been compiled. 25 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 26 | * 27 | */ 28 | 29 | #include "src/misc/Solve.h" 30 | #include "src/misc/SparseSolve.h" 31 | 32 | #include "src/UmfPackSupport/UmfPackSupport.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 37 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector< std::string > > 3 | { 4 | // struct binary interface 5 | 6 | typedef std::vector< std::string > value_type; 7 | typedef value_type::value_type elem_type; 8 | 9 | static const bool is_streamable = true; 10 | 11 | // Helper 12 | 13 | struct Sum 14 | { 15 | size_t operator() ( size_t _v1, const elem_type& _s2 ) 16 | { return _v1 + binary::size_of(_s2); } 17 | }; 18 | 19 | // struct binary interface 20 | 21 | static size_t size_of(void) { return UnknownSize; } 22 | 23 | static size_t size_of(const value_type& _v) 24 | { return std::accumulate( _v.begin(), _v.end(), size_t(0), Sum() ); } 25 | 26 | static 27 | size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) 28 | { 29 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 30 | FunctorStore(_os, _swap) ); 31 | } 32 | 33 | static 34 | size_t restore(std::istream& _is, value_type& _v, bool _swap=false) 35 | { 36 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 37 | FunctorRestore(_is, _swap) ); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/NonIterativeFeaturePreservingMeshFiltering.h: -------------------------------------------------------------------------------- 1 | #ifndef NONITERATIVEFEATUREPRESERVINGMESHFILTERING_H 2 | #define NONITERATIVEFEATUREPRESERVINGMESHFILTERING_H 3 | 4 | /* 5 | @brief: "Non-Iterative, Feature-Preserving Mesh Smoothing" class 6 | @reference: Non-Iterative, Feature-Preserving Mesh Smoothing, SIGGRAPH 2003 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include 11 | #include 12 | #include 13 | 14 | class NonIterativeFeaturePreservingMeshFiltering : public MeshDenoisingBase 15 | { 16 | public: 17 | NonIterativeFeaturePreservingMeshFiltering(DataManager *_data_manager, ParameterSet *_parameter_set); 18 | ~NonIterativeFeaturePreservingMeshFiltering() {} 19 | 20 | private: 21 | void denoise(); 22 | void initParameters(); 23 | 24 | void getVertexFaceNeighbor(TriMesh &mesh, std::vector &face_centroid, TriMesh::VertexHandle vertex_handle, double r, 25 | std::vector &vertex_face_neighbor); 26 | void mollifiedNormals(TriMesh &mesh, std::vector &face_centroid, std::vector &face_area, double sigma_f, 27 | std::vector &mollified_normals); 28 | TriMesh::Point projectPoint(TriMesh::Point pt, TriMesh::Point centroid, TriMesh::Normal n); 29 | }; 30 | 31 | #endif // NONITERATIVEFEATUREPRESERVINGMESHFILTERING_H 32 | -------------------------------------------------------------------------------- /src/Denoising/iothread.cpp: -------------------------------------------------------------------------------- 1 | #include "iothread.h" 2 | 3 | ioThread::ioThread(DataManager *_data_manager) 4 | { 5 | if(_data_manager != NULL) 6 | data_manager_ = _data_manager; 7 | } 8 | 9 | ioThread::~ioThread() 10 | { 11 | 12 | } 13 | 14 | void ioThread::ImportMesh(QString &file_name) 15 | { 16 | emit(setActionAndWidget(false, false)); 17 | emit(statusShowMessage("Now loading mesh " + file_name + " ...")); 18 | if(!data_manager_->ImportMeshFromFile(file_name.toStdString())) 19 | { 20 | emit(statusShowMessage("Loading mesh " + file_name + " failed.")); 21 | return; 22 | } 23 | else 24 | emit(statusShowMessage("Loading mesh " + file_name + " successful.")); 25 | 26 | emit(needToUpdateGL(true)); 27 | emit(setActionAndWidget(true, true)); 28 | } 29 | 30 | void ioThread::ExportMesh(QString &file_name) 31 | { 32 | emit(statusShowMessage("Now writing mesh " + file_name + " ...")); 33 | if(!data_manager_->ExportMeshToFile(file_name.toStdString())) 34 | { 35 | emit(statusShowMessage("Writing mesh " + file_name + " failed.")); 36 | return; 37 | } 38 | else 39 | emit(statusShowMessage("Writing mesh " + file_name + " successful.")); 40 | } 41 | 42 | void ioThread::run() 43 | { 44 | if(io_type_ == kImport) 45 | ImportMesh(file_name_); 46 | else 47 | ExportMesh(file_name_); 48 | } 49 | -------------------------------------------------------------------------------- /src/Denoising/glviewer.cpp: -------------------------------------------------------------------------------- 1 | #include "glviewer.h" 2 | #include 3 | #include 4 | 5 | GLViewer::GLViewer(QWidget *parent) 6 | :QGLWidget(parent) 7 | { 8 | examiner_ = new MeshExaminer(); 9 | } 10 | 11 | GLViewer::~GLViewer() 12 | { 13 | if(examiner_) delete examiner_; 14 | examiner_ = NULL; 15 | } 16 | 17 | void GLViewer::mousePressEvent(QMouseEvent *event) 18 | { 19 | examiner_->mousePressEvent(event); 20 | } 21 | 22 | void GLViewer::mouseReleaseEvent(QMouseEvent *event) 23 | { 24 | examiner_->mouseReleaseEvent(event); 25 | } 26 | 27 | void GLViewer::mouseMoveEvent(QMouseEvent *event) 28 | { 29 | examiner_->mouseMoveEvent(event); 30 | this->updateGL(); 31 | } 32 | 33 | void GLViewer::wheelEvent(QWheelEvent *event) 34 | { 35 | examiner_->wheelEvent(event); 36 | this->updateGL(); 37 | } 38 | 39 | void GLViewer::mouseDoubleClickEvent(QMouseEvent*) 40 | { 41 | } 42 | 43 | void GLViewer::paintGL() 44 | { 45 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 46 | examiner_->draw(); 47 | } 48 | 49 | void GLViewer::initializeGL() 50 | { 51 | examiner_->init(); 52 | } 53 | 54 | void GLViewer::resizeGL(int _w, int _h) 55 | { 56 | examiner_->reshape(_w, _h); 57 | } 58 | 59 | void GLViewer::updateMesh(const TriMesh &_mesh) 60 | { 61 | examiner_->updateMesh(_mesh); 62 | } 63 | 64 | void GLViewer::resetMesh(const TriMesh &_mesh, bool _need_normalize) 65 | { 66 | examiner_->resetMesh(_mesh, _need_normalize); 67 | } 68 | -------------------------------------------------------------------------------- /src/Denoising/datamanager.h: -------------------------------------------------------------------------------- 1 | #ifndef DATAMANAGER_H 2 | #define DATAMANAGER_H 3 | 4 | #include "mesh.h" 5 | #include 6 | 7 | class DataManager 8 | { 9 | public: 10 | DataManager(); 11 | 12 | public: 13 | bool ImportMeshFromFile(std::string filename); 14 | bool ExportMeshToFile(std::string filename); 15 | 16 | TriMesh getMesh() const {return mesh_;} 17 | TriMesh getNoisyMesh() const {return noisy_mesh_;} 18 | TriMesh getOriginalMesh() const {return original_mesh_;} 19 | TriMesh getDenoisedMesh() const {return denoised_mesh_;} 20 | void setMesh(const TriMesh &_mesh) {mesh_ = _mesh;} 21 | void setNoisyMesh(const TriMesh &_noisy_mesh) {noisy_mesh_ = _noisy_mesh;} 22 | void setOriginalMesh(const TriMesh &_original_mesh) {original_mesh_ = _original_mesh;} 23 | void setDenoisedMesh(const TriMesh &_denoised_mesh) {denoised_mesh_ = _denoised_mesh;} 24 | 25 | void MeshToNoisyMesh() {mesh_ = noisy_mesh_;} 26 | void MeshToOriginalMesh() {mesh_ = original_mesh_;} 27 | void MeshToDenoisedMesh() {mesh_ = denoised_mesh_;} 28 | void ClearMesh() { 29 | TriMesh new_mesh; 30 | setMesh(new_mesh); 31 | setOriginalMesh(new_mesh); 32 | setNoisyMesh(new_mesh); 33 | setDenoisedMesh(new_mesh); 34 | } 35 | 36 | private: 37 | TriMesh original_mesh_; 38 | TriMesh noisy_mesh_; 39 | TriMesh denoised_mesh_; 40 | TriMesh mesh_; 41 | }; 42 | 43 | #endif // DATAMANAGER_H 44 | -------------------------------------------------------------------------------- /src/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_EIGENVALUES_MODULE_H 2 | #define EIGEN_EIGENVALUES_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "Cholesky" 9 | #include "Jacobi" 10 | #include "Householder" 11 | #include "LU" 12 | #include "Geometry" 13 | 14 | /** \defgroup Eigenvalues_Module Eigenvalues module 15 | * 16 | * 17 | * 18 | * This module mainly provides various eigenvalue solvers. 19 | * This module also provides some MatrixBase methods, including: 20 | * - MatrixBase::eigenvalues(), 21 | * - MatrixBase::operatorNorm() 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | */ 27 | 28 | #include "src/Eigenvalues/Tridiagonalization.h" 29 | #include "src/Eigenvalues/RealSchur.h" 30 | #include "src/Eigenvalues/EigenSolver.h" 31 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 32 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 33 | #include "src/Eigenvalues/HessenbergDecomposition.h" 34 | #include "src/Eigenvalues/ComplexSchur.h" 35 | #include "src/Eigenvalues/ComplexEigenSolver.h" 36 | #include "src/Eigenvalues/RealQZ.h" 37 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 38 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 39 | #ifdef EIGEN_USE_LAPACKE 40 | #include "src/Eigenvalues/RealSchur_MKL.h" 41 | #include "src/Eigenvalues/ComplexSchur_MKL.h" 42 | #include "src/Eigenvalues/SelfAdjointEigenSolver_MKL.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_EIGENVALUES_MODULE_H 48 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 49 | -------------------------------------------------------------------------------- /src/Denoising/calculationthread.h: -------------------------------------------------------------------------------- 1 | #ifndef CALCULATIONTHREAD_H 2 | #define CALCULATIONTHREAD_H 3 | 4 | #include 5 | #include "Algorithms/Noise.h" 6 | #include "Algorithms/MeshDenoisingBase.h" 7 | #include "Algorithms/BilateralMeshDenoising.h" 8 | #include "Algorithms/NonIterativeFeaturePreservingMeshFiltering.h" 9 | #include "Algorithms/FastAndEffectiveFeaturePreservingMeshDenoising.h" 10 | #include "Algorithms/BilateralNormalFilteringForMeshDenoising.h" 11 | #include "Algorithms/MeshDenoisingViaL0Minimization.h" 12 | #include "Algorithms/GuidedMeshNormalFiltering.h" 13 | 14 | class CalculationThread : public QThread 15 | { 16 | Q_OBJECT 17 | public: 18 | CalculationThread(); 19 | ~CalculationThread(); 20 | 21 | enum AlgorithmsType{kNon, kNoise, kBilateralMeshDenoising, kNonIterativeFeaturePreservingMeshFiltering, 22 | kFastAndEffectiveFeaturePreservingMeshDenoising, kBilateralNormalFilteringForMeshDenoising, 23 | kMeshDenoisingViaL0Minimization, kGuidedMeshNormalFiltering}; 24 | 25 | void initAlgorithm(DataManager *_data_manager, ParameterSet *_parameter_set); 26 | void setAlgorithmName(const QString algorithm_name) {algorithm_name_ = algorithm_name;} 27 | 28 | void run(); 29 | 30 | signals: 31 | void needToUpdateGL(bool value); 32 | void setActionAndWidget(bool, bool); 33 | void statusShowMessage(QString message); 34 | 35 | public: 36 | QString algorithm_name_; 37 | AlgorithmsType algorithms_type_; 38 | Noise *noise_; 39 | MeshDenoisingBase *mesh_denoise_base_; 40 | }; 41 | 42 | #endif // CALCULATIONTHREAD_H 43 | -------------------------------------------------------------------------------- /src/Denoising/glviewer.h: -------------------------------------------------------------------------------- 1 | #ifndef GLVIEWER_H 2 | #define GLVIEWER_H 3 | 4 | #include 5 | #include "meshexaminer.h" 6 | 7 | #include 8 | 9 | class GLViewer : public QGLWidget 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | GLViewer(QWidget *parent = 0); 15 | ~GLViewer(); 16 | 17 | void updateMesh(const TriMesh &_mesh); 18 | void resetMesh(const TriMesh &_mesh, bool _needNormalize = false); 19 | 20 | MeshExaminer* getExaminer(){ 21 | return examiner_; 22 | } 23 | 24 | public slots: 25 | void setDrawPointsStatus(bool _val){ 26 | examiner_->setDrawPointsStatus(_val); 27 | this->updateGL(); 28 | } 29 | 30 | void setDrawFacesStatus(bool _val){ 31 | examiner_->setDrawFacesStatus(_val); 32 | this->updateGL(); 33 | } 34 | 35 | void setDrawEdgesStatus(bool _val){ 36 | examiner_->setDrawEdgesStatus(_val); 37 | this->updateGL(); 38 | } 39 | 40 | void setBackgroundColor(){ 41 | QColor color = QColorDialog::getColor(Qt::black, this, tr("Set Background Color!")); 42 | if(!color.isValid()) return; 43 | this->qglClearColor(color); 44 | this->updateGL(); 45 | } 46 | 47 | protected: 48 | void mousePressEvent(QMouseEvent *event); 49 | void mouseReleaseEvent(QMouseEvent *event); 50 | void mouseMoveEvent(QMouseEvent *event); 51 | void wheelEvent(QWheelEvent *event); 52 | void mouseDoubleClickEvent(QMouseEvent *event); 53 | 54 | void initializeGL(); 55 | void resizeGL(int _w, int _h); 56 | void paintGL(); 57 | 58 | private: 59 | MeshExaminer *examiner_; 60 | }; 61 | 62 | #endif // GLVIEWER_H 63 | -------------------------------------------------------------------------------- /src/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #ifdef EIGEN_MPL2_ONLY 34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode 35 | #endif 36 | 37 | #include "src/misc/Solve.h" 38 | #include "src/misc/SparseSolve.h" 39 | #include "src/SparseCholesky/SimplicialCholesky.h" 40 | 41 | #ifndef EIGEN_MPL2_ONLY 42 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 48 | -------------------------------------------------------------------------------- /src/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 2 | #define EIGEN_PASTIXSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | extern "C" { 10 | #include 11 | #include 12 | } 13 | 14 | #ifdef complex 15 | #undef complex 16 | #endif 17 | 18 | /** \ingroup Support_modules 19 | * \defgroup PaStiXSupport_Module PaStiXSupport module 20 | * 21 | * This module provides an interface to the PaSTiX library. 22 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 23 | * It provides the two following main factorization classes: 24 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 25 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 26 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 33 | * The dependencies depend on how PaSTiX has been compiled. 34 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 35 | * 36 | */ 37 | 38 | #include "src/misc/Solve.h" 39 | #include "src/misc/SparseSolve.h" 40 | 41 | #include "src/PaStiXSupport/PaStiXSupport.h" 42 | 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 47 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/TriangularSolver.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TRIANGULAR_SOLVER2_H 11 | #define EIGEN_TRIANGULAR_SOLVER2_H 12 | 13 | namespace Eigen { 14 | 15 | const unsigned int UnitDiagBit = UnitDiag; 16 | const unsigned int SelfAdjointBit = SelfAdjoint; 17 | const unsigned int UpperTriangularBit = Upper; 18 | const unsigned int LowerTriangularBit = Lower; 19 | 20 | const unsigned int UpperTriangular = Upper; 21 | const unsigned int LowerTriangular = Lower; 22 | const unsigned int UnitUpperTriangular = UnitUpper; 23 | const unsigned int UnitLowerTriangular = UnitLower; 24 | 25 | template 26 | template 27 | typename ExpressionType::PlainObject 28 | Flagged::solveTriangular(const MatrixBase& other) const 29 | { 30 | return m_matrix.template triangularView().solve(other.derived()); 31 | } 32 | 33 | template 34 | template 35 | void Flagged::solveTriangularInPlace(const MatrixBase& other) const 36 | { 37 | m_matrix.template triangularView().solveInPlace(other.derived()); 38 | } 39 | 40 | } // end namespace Eigen 41 | 42 | #endif // EIGEN_TRIANGULAR_SOLVER2_H 43 | -------------------------------------------------------------------------------- /src/Denoising/parametersetwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef PARAMETERWIDGET_H 2 | #define PARAMETERWIDGET_H 3 | 4 | #include "parameterset.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | class ParameterWidget : public QWidget 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit ParameterWidget(QWidget *parent, Parameter *_parameter); 21 | 22 | enum WidgetType{kNon, kCheckBox, kLineEdit, kComboBox}; 23 | 24 | void setParameter(); 25 | void resetParameter(); 26 | void updateParameter(); 27 | 28 | QLabel *getLabel() const {return label_;} 29 | QWidget *getWidget() const {return widget_;} 30 | 31 | WidgetType widget_type_; 32 | private: 33 | Parameter *parameter_; 34 | QLabel *label_; 35 | QWidget *widget_; 36 | }; 37 | 38 | class ParameterSetWidget : public QDockWidget 39 | { 40 | Q_OBJECT 41 | public: 42 | explicit ParameterSetWidget(QWidget *parent, ParameterSet *_parameter_set); 43 | 44 | signals: 45 | void ReadyToApply(QString _algorithms_name); 46 | void TransToNoisyMesh(); 47 | void TransToOriginalMesh(); 48 | void TransToDenoisedMesh(); 49 | 50 | public slots: 51 | void OnDefaultClick(); 52 | void OnApplyClick(); 53 | 54 | public: 55 | void showWidget(); 56 | 57 | private: 58 | QFrame *Frame_; 59 | ParameterSet *parameter_set_; 60 | QVBoxLayout *VBoxLayout_; 61 | QVBoxLayout *VBoxLayout_Setting_; 62 | QLabel *Label_; 63 | QList parameter_widget_list_; 64 | }; 65 | 66 | #endif // PARAMETERWIDGET_H 67 | -------------------------------------------------------------------------------- /src/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 2 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 3 | 4 | #include "SparseCore" 5 | #include "OrderingMethods" 6 | 7 | #include "src/Core/util/DisableStupidWarnings.h" 8 | 9 | /** 10 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 11 | * 12 | * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. 13 | * Those solvers are accessible via the following classes: 14 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 15 | * - BiCGSTAB for general square matrices. 16 | * 17 | * These iterative solvers are associated with some preconditioners: 18 | * - IdentityPreconditioner - not really useful 19 | * - DiagonalPreconditioner - also called JAcobi preconditioner, work very well on diagonal dominant matrices. 20 | * - IncompleteILUT - incomplete LU factorization with dual thresholding 21 | * 22 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | 29 | #include "src/misc/Solve.h" 30 | #include "src/misc/SparseSolve.h" 31 | 32 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 33 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 34 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 35 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 36 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 41 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | for (Index j=0; j 28 | typename internal::traits >::Scalar 29 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 30 | { 31 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 32 | return Matrix::Map(&m_data.value(0), m_data.size()).sum(); 33 | } 34 | 35 | template 36 | typename internal::traits >::Scalar 37 | SparseVector<_Scalar,_Options,_Index>::sum() const 38 | { 39 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 40 | return Matrix::Map(&m_data.value(0), m_data.size()).sum(); 41 | } 42 | 43 | } // end namespace Eigen 44 | 45 | #endif // EIGEN_SPARSEREDUX_H 46 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/MeshDenoisingBase.h: -------------------------------------------------------------------------------- 1 | #ifndef MESHDENOISINGBASE_H 2 | #define MESHDENOISINGBASE_H 3 | 4 | #include "../datamanager.h" 5 | #include "../parameterset.h" 6 | 7 | class MeshDenoisingBase 8 | { 9 | public: 10 | MeshDenoisingBase(DataManager *_data_manager, ParameterSet *_parameter_set); 11 | ~MeshDenoisingBase() {} 12 | 13 | public: 14 | virtual void denoise() = 0; 15 | virtual void initParameters() = 0; 16 | 17 | // some basic function 18 | double getAverageEdgeLength(TriMesh &mesh); 19 | void getFaceArea(TriMesh &mesh, std::vector &area); 20 | void getFaceCentroid(TriMesh &mesh, std::vector ¢roid); 21 | void getFaceNormal(TriMesh &mesh, std::vector &normals); 22 | 23 | // two stage method, first update normals, second update vertices 24 | enum FaceNeighborType{kVertexBased, kEdgeBased, kRadiusBased}; 25 | enum DenoiseType{kLocal, kGlobal}; 26 | void getFaceNeighbor(TriMesh &mesh, TriMesh::FaceHandle fh, FaceNeighborType face_neighbor_type, std::vector &face_neighbor); 27 | void getAllFaceNeighbor(TriMesh &mesh, std::vector< std::vector > &all_face_neighbor, FaceNeighborType face_neighbor_type = kVertexBased, bool include_central_face = false); 28 | virtual void updateFilteredNormals(TriMesh &mesh, std::vector &filtered_normals) {} 29 | void updateVertexPosition(TriMesh &mesh, std::vector &filtered_normals, int iteration_number, bool fixed_boundary = false); 30 | 31 | // error metric 32 | double getMeanSquareAngleError(TriMesh &DenoisedMesh, TriMesh &OriginalMesh); 33 | 34 | public: 35 | DataManager *data_manager_; 36 | ParameterSet *parameter_set_; 37 | }; 38 | 39 | #endif // MESHDENOISINGBASE_H 40 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/MeshDenoisingViaL0Minimization.h: -------------------------------------------------------------------------------- 1 | #ifndef MESHDENOISINGVIAL0MINIMIZATION_H 2 | #define MESHDENOISINGVIAL0MINIMIZATION_H 3 | 4 | /* 5 | @brief: "Mesh Denoising via L0 Minimization" class 6 | @reference: Mesh Denoising via L0 Minimization, TOG 2013 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include 11 | #include 12 | #include 13 | #include "Eigen/Dense" 14 | #include "Eigen/Sparse" 15 | 16 | class MeshDenoisingViaL0Minimization : public MeshDenoisingBase 17 | { 18 | public: 19 | MeshDenoisingViaL0Minimization(DataManager *_data_manager, ParameterSet *_parameter_set); 20 | ~MeshDenoisingViaL0Minimization() {} 21 | 22 | private: 23 | void denoise(); 24 | void initParameters(); 25 | 26 | double getAverageDihedralAngle(TriMesh &mesh); 27 | void calculateAreaBasedEdgeOperator(TriMesh &mesh, 28 | std::vector &area_based_edge_operator, 29 | std::vector > &edge_vertex_handle, 30 | std::vector< std::vector > &coef); 31 | void solveDelta(std::vector &area_based_edge_operator, double lambda, double beta, 32 | std::vector &delta); 33 | void getInitialVerticesMatrix(TriMesh &noisy_mesh, Eigen::MatrixXd &initial_vertices_matrix); 34 | void solveVertices(TriMesh &mesh, Eigen::MatrixXd &initial_vertices_matrix, 35 | std::vector< std::vector > &edge_vertex_handle, 36 | std::vector< std::vector > &coef, std::vector &delta, 37 | double alpha, double beta); 38 | }; 39 | 40 | #endif // MESHDENOISINGVIAL0MINIMIZATION_H 41 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Memory.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MEMORY_H 11 | #define EIGEN2_MEMORY_H 12 | 13 | namespace Eigen { 14 | 15 | inline void* ei_aligned_malloc(size_t size) { return internal::aligned_malloc(size); } 16 | inline void ei_aligned_free(void *ptr) { internal::aligned_free(ptr); } 17 | inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size) { return internal::aligned_realloc(ptr, new_size, old_size); } 18 | inline void* ei_handmade_aligned_malloc(size_t size) { return internal::handmade_aligned_malloc(size); } 19 | inline void ei_handmade_aligned_free(void *ptr) { internal::handmade_aligned_free(ptr); } 20 | 21 | template inline void* ei_conditional_aligned_malloc(size_t size) 22 | { 23 | return internal::conditional_aligned_malloc(size); 24 | } 25 | template inline void ei_conditional_aligned_free(void *ptr) 26 | { 27 | internal::conditional_aligned_free(ptr); 28 | } 29 | template inline void* ei_conditional_aligned_realloc(void* ptr, size_t new_size, size_t old_size) 30 | { 31 | return internal::conditional_aligned_realloc(ptr, new_size, old_size); 32 | } 33 | 34 | template inline T* ei_aligned_new(size_t size) 35 | { 36 | return internal::aligned_new(size); 37 | } 38 | template inline void ei_aligned_delete(T *ptr, size_t size) 39 | { 40 | return internal::aligned_delete(ptr, size); 41 | } 42 | 43 | } // end namespace Eigen 44 | 45 | #endif // EIGEN2_MACROS_H 46 | -------------------------------------------------------------------------------- /src/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 2 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup CholmodSupport_Module CholmodSupport module 14 | * 15 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 16 | * It provides the two following main factorization classes: 17 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 18 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 19 | * 20 | * For the sake of completeness, this module also propose the two following classes: 21 | * - class CholmodSimplicialLLT 22 | * - class CholmodSimplicialLDLT 23 | * Note that these classes does not bring any particular advantage compared to the built-in 24 | * SimplicialLLT and SimplicialLDLT factorization classes. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 31 | * The dependencies depend on how cholmod has been compiled. 32 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/misc/Solve.h" 37 | #include "src/misc/SparseSolve.h" 38 | 39 | #include "src/CholmodSupport/CholmodSupport.h" 40 | 41 | 42 | #include "src/Core/util/ReenableStupidWarnings.h" 43 | 44 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 45 | 46 | -------------------------------------------------------------------------------- /src/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_GEOMETRY_MODULE_H 2 | #define EIGEN_GEOMETRY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "SVD" 9 | #include "LU" 10 | #include 11 | 12 | #ifndef M_PI 13 | #define M_PI 3.14159265358979323846 14 | #endif 15 | 16 | /** \defgroup Geometry_Module Geometry module 17 | * 18 | * 19 | * 20 | * This module provides support for: 21 | * - fixed-size homogeneous transformations 22 | * - translation, scaling, 2D and 3D rotations 23 | * - quaternions 24 | * - \ref MatrixBase::cross() "cross product" 25 | * - \ref MatrixBase::unitOrthogonal() "orthognal vector generation" 26 | * - some linear components: parametrized-lines and hyperplanes 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/Geometry/OrthoMethods.h" 34 | #include "src/Geometry/EulerAngles.h" 35 | 36 | #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS 37 | #include "src/Geometry/Homogeneous.h" 38 | #include "src/Geometry/RotationBase.h" 39 | #include "src/Geometry/Rotation2D.h" 40 | #include "src/Geometry/Quaternion.h" 41 | #include "src/Geometry/AngleAxis.h" 42 | #include "src/Geometry/Transform.h" 43 | #include "src/Geometry/Translation.h" 44 | #include "src/Geometry/Scaling.h" 45 | #include "src/Geometry/Hyperplane.h" 46 | #include "src/Geometry/ParametrizedLine.h" 47 | #include "src/Geometry/AlignedBox.h" 48 | #include "src/Geometry/Umeyama.h" 49 | 50 | #if defined EIGEN_VECTORIZE_SSE 51 | #include "src/Geometry/arch/Geometry_SSE.h" 52 | #endif 53 | #endif 54 | 55 | #ifdef EIGEN2_SUPPORT 56 | #include "src/Eigen2Support/Geometry/All.h" 57 | #endif 58 | 59 | #include "src/Core/util/ReenableStupidWarnings.h" 60 | 61 | #endif // EIGEN_GEOMETRY_MODULE_H 62 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 63 | 64 | -------------------------------------------------------------------------------- /src/Denoising/Denoising.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-03-31T15:50:41 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui opengl 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = MeshDenoising 12 | TEMPLATE = app 13 | 14 | DEFINES += _USE_MATH_DEFINES 15 | 16 | SOURCES += main.cpp\ 17 | mainwindow.cpp \ 18 | glviewer.cpp \ 19 | glexaminer.cpp \ 20 | meshexaminer.cpp \ 21 | datamanager.cpp \ 22 | parameterset.cpp \ 23 | parametersetwidget.cpp \ 24 | calculationthread.cpp \ 25 | Algorithms/Noise.cpp \ 26 | Algorithms/BilateralMeshDenoising.cpp \ 27 | Algorithms/NonIterativeFeaturePreservingMeshFiltering.cpp \ 28 | Algorithms/FastAndEffectiveFeaturePreservingMeshDenoising.cpp \ 29 | Algorithms/BilateralNormalFilteringForMeshDenoising.cpp \ 30 | Algorithms/MeshDenoisingViaL0Minimization.cpp \ 31 | Algorithms/MeshDenoisingBase.cpp \ 32 | iothread.cpp \ 33 | Algorithms/GuidedMeshNormalFiltering.cpp 34 | 35 | HEADERS += mainwindow.h \ 36 | glviewer.h \ 37 | glwrapper.h \ 38 | glexaminer.h \ 39 | meshexaminer.h \ 40 | mesh.h \ 41 | datamanager.h \ 42 | parameterset.h \ 43 | parametersetwidget.h \ 44 | calculationthread.h \ 45 | Algorithms/Noise.h \ 46 | Algorithms/BilateralMeshDenoising.h \ 47 | Algorithms/NonIterativeFeaturePreservingMeshFiltering.h \ 48 | Algorithms/FastAndEffectiveFeaturePreservingMeshDenoising.h \ 49 | Algorithms/BilateralNormalFilteringForMeshDenoising.h \ 50 | Algorithms/MeshDenoisingViaL0Minimization.h \ 51 | Algorithms/MeshDenoisingBase.h \ 52 | iothread.h \ 53 | Algorithms/GuidedMeshNormalFiltering.h 54 | 55 | FORMS += mainwindow.ui 56 | 57 | include(../LibsInclude.pri) 58 | 59 | RESOURCES += \ 60 | mainwindow.qrc 61 | -------------------------------------------------------------------------------- /src/Denoising/glexaminer.h: -------------------------------------------------------------------------------- 1 | #ifndef GLEXAMINER_H 2 | #define GLEXAMINER_H 3 | 4 | #include 5 | class QMouseEvent; 6 | class QWheelEvent; 7 | 8 | class GLExaminer 9 | { 10 | public: 11 | GLExaminer(); 12 | virtual ~GLExaminer(); 13 | 14 | void setScene(const OpenMesh::Vec3f &_center, float _radius); 15 | void viewAll(); 16 | 17 | virtual void draw() = 0; 18 | virtual void init(); 19 | virtual void mousePressEvent(QMouseEvent*); 20 | virtual void mouseMoveEvent(QMouseEvent*); 21 | virtual void mouseReleaseEvent(QMouseEvent*); 22 | virtual void wheelEvent(QWheelEvent*); 23 | virtual void reshape(int _w, int _h); 24 | 25 | protected: 26 | 27 | // updates projection matrix 28 | void updateProjectionMatrix(); 29 | // translate the scene and update modelview matrix 30 | void translate(const OpenMesh::Vec3f& _trans); 31 | // rotate the scene (around its center) and update modelview matrix 32 | void rotate(const OpenMesh::Vec3f& _axis, float _angle); 33 | 34 | // virtual trackball: map 2D screen point to unit sphere 35 | bool mapToSphere(const OpenMesh::Vec2i &_point, OpenMesh::Vec3f &_result); 36 | 37 | // mouse processing functions 38 | void rotation(int _x, int _y); 39 | void translation(int _x, int _y); 40 | void zoom(float _x); 41 | 42 | protected: 43 | int width_, height_; 44 | 45 | // scene position and dimension 46 | OpenMesh::Vec3f center_; 47 | float radius_; 48 | 49 | // projection parameters 50 | float near_, far_, fovy_; 51 | 52 | // OpenGL matrices 53 | double projection_matrix_[16], 54 | modelview_matrix_[16]; 55 | 56 | // trackball helpers 57 | OpenMesh::Vec2i last_point_2D_; 58 | OpenMesh::Vec3f last_point_3D_; 59 | bool last_point_ok_; 60 | bool left_button_down_, right_button_down_; 61 | int modifiers_; 62 | }; 63 | 64 | #endif // GLEXAMINER_H 65 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 100 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /src/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | #include "src/misc/Solve.h" 24 | #include "src/misc/SparseSolve.h" 25 | 26 | // Ordering interface 27 | #include "OrderingMethods" 28 | 29 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 30 | 31 | #include "src/SparseLU/SparseLU_Structs.h" 32 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 33 | #include "src/SparseLU/SparseLUImpl.h" 34 | #include "src/SparseCore/SparseColEtree.h" 35 | #include "src/SparseLU/SparseLU_Memory.h" 36 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_relax_snode.h" 38 | #include "src/SparseLU/SparseLU_pivotL.h" 39 | #include "src/SparseLU/SparseLU_panel_dfs.h" 40 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 41 | #include "src/SparseLU/SparseLU_panel_bmod.h" 42 | #include "src/SparseLU/SparseLU_column_dfs.h" 43 | #include "src/SparseLU/SparseLU_column_bmod.h" 44 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 45 | #include "src/SparseLU/SparseLU_pruneL.h" 46 | #include "src/SparseLU/SparseLU_Utils.h" 47 | #include "src/SparseLU/SparseLU.h" 48 | 49 | #endif // EIGEN_SPARSELU_MODULE_H 50 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/writer/VTKWriter.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // 3 | // Implements an IOManager writer module for VTK files 4 | // 5 | //============================================================================= 6 | 7 | #ifndef __VTKWRITER_HH__ 8 | #define __VTKWRITER_HH__ 9 | 10 | //=== INCLUDES ================================================================ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | //== NAMESPACES =============================================================== 21 | 22 | namespace OpenMesh { 23 | namespace IO { 24 | 25 | //=== IMPLEMENTATION ========================================================== 26 | 27 | class OPENMESHDLLEXPORT _VTKWriter_ : public BaseWriter 28 | { 29 | public: 30 | _VTKWriter_(); 31 | 32 | std::string get_description() const { return "VTK"; } 33 | std::string get_extensions() const { return "vtk"; } 34 | 35 | bool write(const std::string&, BaseExporter&, Options, std::streamsize _precision = 6) const; 36 | bool write(std::ostream&, BaseExporter&, Options, std::streamsize _precision = 6) const; 37 | 38 | size_t binary_size(BaseExporter&, Options) const { return 0; } 39 | }; 40 | 41 | //== TYPE DEFINITION ========================================================== 42 | 43 | /// Declare the single entity of the OBJ writer 44 | extern _VTKWriter_ __VTKWriterinstance; 45 | OPENMESHDLLEXPORT _VTKWriter_& VTKWriter(); 46 | 47 | //============================================================================= 48 | } // namespace IO 49 | } // namespace OpenMesh 50 | //============================================================================= 51 | #endif 52 | //============================================================================= 53 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/QR.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2011 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN2_QR_H 12 | #define EIGEN2_QR_H 13 | 14 | namespace Eigen { 15 | 16 | template 17 | class QR : public HouseholderQR 18 | { 19 | public: 20 | 21 | typedef HouseholderQR Base; 22 | typedef Block MatrixRBlockType; 23 | 24 | QR() : Base() {} 25 | 26 | template 27 | explicit QR(const T& t) : Base(t) {} 28 | 29 | template 30 | bool solve(const MatrixBase& b, ResultType *result) const 31 | { 32 | *result = static_cast(this)->solve(b); 33 | return true; 34 | } 35 | 36 | MatrixType matrixQ(void) const { 37 | MatrixType ret = MatrixType::Identity(this->rows(), this->cols()); 38 | ret = this->householderQ() * ret; 39 | return ret; 40 | } 41 | 42 | bool isFullRank() const { 43 | return true; 44 | } 45 | 46 | const TriangularView 47 | matrixR(void) const 48 | { 49 | int cols = this->cols(); 50 | return MatrixRBlockType(this->matrixQR(), 0, 0, cols, cols).template triangularView(); 51 | } 52 | }; 53 | 54 | /** \return the QR decomposition of \c *this. 55 | * 56 | * \sa class QR 57 | */ 58 | template 59 | const QR::PlainObject> 60 | MatrixBase::qr() const 61 | { 62 | return QR(eval()); 63 | } 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN2_QR_H 68 | -------------------------------------------------------------------------------- /src/Eigen/SparseCore: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSECORE_MODULE_H 2 | #define EIGEN_SPARSECORE_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /** 15 | * \defgroup SparseCore_Module SparseCore module 16 | * 17 | * This module provides a sparse matrix representation, and basic associatd matrix manipulations 18 | * and operations. 19 | * 20 | * See the \ref TutorialSparse "Sparse tutorial" 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * This module depends on: Core. 27 | */ 28 | 29 | namespace Eigen { 30 | 31 | /** The type used to identify a general sparse storage. */ 32 | struct Sparse {}; 33 | 34 | } 35 | 36 | #include "src/SparseCore/SparseUtil.h" 37 | #include "src/SparseCore/SparseMatrixBase.h" 38 | #include "src/SparseCore/CompressedStorage.h" 39 | #include "src/SparseCore/AmbiVector.h" 40 | #include "src/SparseCore/SparseMatrix.h" 41 | #include "src/SparseCore/MappedSparseMatrix.h" 42 | #include "src/SparseCore/SparseVector.h" 43 | #include "src/SparseCore/SparseBlock.h" 44 | #include "src/SparseCore/SparseTranspose.h" 45 | #include "src/SparseCore/SparseCwiseUnaryOp.h" 46 | #include "src/SparseCore/SparseCwiseBinaryOp.h" 47 | #include "src/SparseCore/SparseDot.h" 48 | #include "src/SparseCore/SparsePermutation.h" 49 | #include "src/SparseCore/SparseRedux.h" 50 | #include "src/SparseCore/SparseFuzzy.h" 51 | #include "src/SparseCore/ConservativeSparseSparseProduct.h" 52 | #include "src/SparseCore/SparseSparseProductWithPruning.h" 53 | #include "src/SparseCore/SparseProduct.h" 54 | #include "src/SparseCore/SparseDenseProduct.h" 55 | #include "src/SparseCore/SparseDiagonalProduct.h" 56 | #include "src/SparseCore/SparseTriangularView.h" 57 | #include "src/SparseCore/SparseSelfAdjointView.h" 58 | #include "src/SparseCore/TriangularSolver.h" 59 | #include "src/SparseCore/SparseView.h" 60 | 61 | #include "src/Core/util/ReenableStupidWarnings.h" 62 | 63 | #endif // EIGEN_SPARSECORE_MODULE_H 64 | 65 | -------------------------------------------------------------------------------- /src/Eigen/src/plugins/CommonCwiseBinaryOps.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | // This file is a base class plugin containing common coefficient wise functions. 12 | 13 | /** \returns an expression of the difference of \c *this and \a other 14 | * 15 | * \note If you want to substract a given scalar from all coefficients, see Cwise::operator-(). 16 | * 17 | * \sa class CwiseBinaryOp, operator-=() 18 | */ 19 | EIGEN_MAKE_CWISE_BINARY_OP(operator-,internal::scalar_difference_op) 20 | 21 | /** \returns an expression of the sum of \c *this and \a other 22 | * 23 | * \note If you want to add a given scalar to all coefficients, see Cwise::operator+(). 24 | * 25 | * \sa class CwiseBinaryOp, operator+=() 26 | */ 27 | EIGEN_MAKE_CWISE_BINARY_OP(operator+,internal::scalar_sum_op) 28 | 29 | /** \returns an expression of a custom coefficient-wise operator \a func of *this and \a other 30 | * 31 | * The template parameter \a CustomBinaryOp is the type of the functor 32 | * of the custom operator (see class CwiseBinaryOp for an example) 33 | * 34 | * Here is an example illustrating the use of custom functors: 35 | * \include class_CwiseBinaryOp.cpp 36 | * Output: \verbinclude class_CwiseBinaryOp.out 37 | * 38 | * \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct() 39 | */ 40 | template 41 | EIGEN_STRONG_INLINE const CwiseBinaryOp 42 | binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other, const CustomBinaryOp& func = CustomBinaryOp()) const 43 | { 44 | return CwiseBinaryOp(derived(), other.derived(), func); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/Eigen/SuperLUSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 2 | #define EIGEN_SUPERLUSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #ifdef EMPTY 9 | #define EIGEN_EMPTY_WAS_ALREADY_DEFINED 10 | #endif 11 | 12 | typedef int int_t; 13 | #include 14 | #include 15 | #include 16 | 17 | // slu_util.h defines a preprocessor token named EMPTY which is really polluting, 18 | // so we remove it in favor of a SUPERLU_EMPTY token. 19 | // If EMPTY was already defined then we don't undef it. 20 | 21 | #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) 22 | # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED 23 | #elif defined(EMPTY) 24 | # undef EMPTY 25 | #endif 26 | 27 | #define SUPERLU_EMPTY (-1) 28 | 29 | namespace Eigen { struct SluMatrix; } 30 | 31 | /** \ingroup Support_modules 32 | * \defgroup SuperLUSupport_Module SuperLUSupport module 33 | * 34 | * This module provides an interface to the SuperLU library. 35 | * It provides the following factorization class: 36 | * - class SuperLU: a supernodal sequential LU factorization. 37 | * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). 38 | * 39 | * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. 40 | * 41 | * \code 42 | * #include 43 | * \endcode 44 | * 45 | * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. 46 | * The dependencies depend on how superlu has been compiled. 47 | * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. 48 | * 49 | */ 50 | 51 | #include "src/misc/Solve.h" 52 | #include "src/misc/SparseSolve.h" 53 | 54 | #include "src/SuperLUSupport/SuperLUSupport.h" 55 | 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_SUPERLUSUPPORT_MODULE_H 60 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/CoreIterators.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_COREITERATORS_H 11 | #define EIGEN_COREITERATORS_H 12 | 13 | namespace Eigen { 14 | 15 | /* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core 16 | */ 17 | 18 | /** \ingroup SparseCore_Module 19 | * \class InnerIterator 20 | * \brief An InnerIterator allows to loop over the element of a sparse (or dense) matrix or expression 21 | * 22 | * todo 23 | */ 24 | 25 | // generic version for dense matrix and expressions 26 | template class DenseBase::InnerIterator 27 | { 28 | protected: 29 | typedef typename Derived::Scalar Scalar; 30 | typedef typename Derived::Index Index; 31 | 32 | enum { IsRowMajor = (Derived::Flags&RowMajorBit)==RowMajorBit }; 33 | public: 34 | EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, Index outer) 35 | : m_expression(expr), m_inner(0), m_outer(outer), m_end(expr.innerSize()) 36 | {} 37 | 38 | EIGEN_STRONG_INLINE Scalar value() const 39 | { 40 | return (IsRowMajor) ? m_expression.coeff(m_outer, m_inner) 41 | : m_expression.coeff(m_inner, m_outer); 42 | } 43 | 44 | EIGEN_STRONG_INLINE InnerIterator& operator++() { m_inner++; return *this; } 45 | 46 | EIGEN_STRONG_INLINE Index index() const { return m_inner; } 47 | inline Index row() const { return IsRowMajor ? m_outer : index(); } 48 | inline Index col() const { return IsRowMajor ? index() : m_outer; } 49 | 50 | EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } 51 | 52 | protected: 53 | const Derived& m_expression; 54 | Index m_inner; 55 | const Index m_outer; 56 | const Index m_end; 57 | }; 58 | 59 | } // end namespace Eigen 60 | 61 | #endif // EIGEN_COREITERATORS_H 62 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/util/DisableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_WARNINGS_DISABLED 2 | #define EIGEN_WARNINGS_DISABLED 3 | 4 | #ifdef _MSC_VER 5 | // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p)) 6 | // 4101 - unreferenced local variable 7 | // 4127 - conditional expression is constant 8 | // 4181 - qualifier applied to reference type ignored 9 | // 4211 - nonstandard extension used : redefined extern to static 10 | // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data 11 | // 4273 - QtAlignedMalloc, inconsistent DLL linkage 12 | // 4324 - structure was padded due to declspec(align()) 13 | // 4512 - assignment operator could not be generated 14 | // 4522 - 'class' : multiple assignment operators specified 15 | // 4700 - uninitialized local variable 'xyz' used 16 | // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow 17 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 18 | #pragma warning( push ) 19 | #endif 20 | #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4512 4522 4700 4717 ) 21 | #elif defined __INTEL_COMPILER 22 | // 2196 - routine is both "inline" and "noinline" ("noinline" assumed) 23 | // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body 24 | // typedef that may be a reference type. 25 | // 279 - controlling expression is constant 26 | // ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case. 27 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 28 | #pragma warning push 29 | #endif 30 | #pragma warning disable 2196 279 31 | #elif defined __clang__ 32 | // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant 33 | // this is really a stupid warning as it warns on compile-time expressions involving enums 34 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 35 | #pragma clang diagnostic push 36 | #endif 37 | #pragma clang diagnostic ignored "-Wconstant-logical-operand" 38 | #endif 39 | 40 | #endif // not EIGEN_WARNINGS_DISABLED 41 | -------------------------------------------------------------------------------- /src/Denoising/calculationthread.cpp: -------------------------------------------------------------------------------- 1 | #include "calculationthread.h" 2 | 3 | CalculationThread::CalculationThread() 4 | { 5 | noise_ = NULL; 6 | mesh_denoise_base_ = NULL; 7 | algorithm_name_ = ""; 8 | } 9 | 10 | CalculationThread::~CalculationThread() 11 | { 12 | if(noise_ != NULL) 13 | delete noise_; 14 | noise_ = NULL; 15 | 16 | if(mesh_denoise_base_ != NULL) 17 | delete mesh_denoise_base_; 18 | mesh_denoise_base_ = NULL; 19 | } 20 | 21 | void CalculationThread::initAlgorithm(DataManager *_data_manager, ParameterSet *_parameter_set) 22 | { 23 | switch (algorithms_type_) { 24 | case kNoise: 25 | noise_ = new Noise(_data_manager, _parameter_set); 26 | break; 27 | case kBilateralMeshDenoising: 28 | mesh_denoise_base_ = new BilateralMeshDenoising(_data_manager, _parameter_set); 29 | break; 30 | case kNonIterativeFeaturePreservingMeshFiltering: 31 | mesh_denoise_base_ = new NonIterativeFeaturePreservingMeshFiltering(_data_manager, _parameter_set); 32 | break; 33 | case kFastAndEffectiveFeaturePreservingMeshDenoising: 34 | mesh_denoise_base_ = new FastAndEffectiveFeaturePreservingMeshDenoising(_data_manager, _parameter_set); 35 | break; 36 | case kBilateralNormalFilteringForMeshDenoising: 37 | mesh_denoise_base_ = new BilateralNormalFilteringForMeshDenoising(_data_manager, _parameter_set); 38 | break; 39 | case kMeshDenoisingViaL0Minimization: 40 | mesh_denoise_base_ = new MeshDenoisingViaL0Minimization(_data_manager, _parameter_set); 41 | break; 42 | case kGuidedMeshNormalFiltering: 43 | mesh_denoise_base_ = new GuidedMeshNormalFiltering(_data_manager, _parameter_set); 44 | break; 45 | default: 46 | break; 47 | } 48 | } 49 | 50 | void CalculationThread::run() 51 | { 52 | emit(statusShowMessage("Now applying algorithm --" + algorithm_name_ + "-- ...")); 53 | emit(setActionAndWidget(false, false)); 54 | if(algorithms_type_ == kNoise) 55 | noise_->addNoise(); 56 | else 57 | mesh_denoise_base_->denoise(); 58 | emit(setActionAndWidget(true, false)); 59 | emit(statusShowMessage("Applying algorithm --" + algorithm_name_ + "-- done.")); 60 | 61 | emit(needToUpdateGL(false)); 62 | } 63 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseLU/SparseLU_Utils.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_SPARSELU_UTILS_H 12 | #define EIGEN_SPARSELU_UTILS_H 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | /** 18 | * \brief Count Nonzero elements in the factors 19 | */ 20 | template 21 | void SparseLUImpl::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu) 22 | { 23 | nnzL = 0; 24 | nnzU = (glu.xusub)(n); 25 | Index nsuper = (glu.supno)(n); 26 | Index jlen; 27 | Index i, j, fsupc; 28 | if (n <= 0 ) return; 29 | // For each supernode 30 | for (i = 0; i <= nsuper; i++) 31 | { 32 | fsupc = glu.xsup(i); 33 | jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc); 34 | 35 | for (j = fsupc; j < glu.xsup(i+1); j++) 36 | { 37 | nnzL += jlen; 38 | nnzU += j - fsupc + 1; 39 | jlen--; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * \brief Fix up the data storage lsub for L-subscripts. 46 | * 47 | * It removes the subscripts sets for structural pruning, 48 | * and applies permutation to the remaining subscripts 49 | * 50 | */ 51 | template 52 | void SparseLUImpl::fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu) 53 | { 54 | Index fsupc, i, j, k, jstart; 55 | 56 | Index nextl = 0; 57 | Index nsuper = (glu.supno)(n); 58 | 59 | // For each supernode 60 | for (i = 0; i <= nsuper; i++) 61 | { 62 | fsupc = glu.xsup(i); 63 | jstart = glu.xlsub(fsupc); 64 | glu.xlsub(fsupc) = nextl; 65 | for (j = jstart; j < glu.xlsub(fsupc + 1); j++) 66 | { 67 | glu.lsub(nextl) = perm_r(glu.lsub(j)); // Now indexed into P*A 68 | nextl++; 69 | } 70 | for (k = fsupc+1; k < glu.xsup(i+1); k++) 71 | glu.xlsub(k) = nextl; // other columns in supernode i 72 | } 73 | 74 | glu.xlsub(n) = nextl; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | #endif // EIGEN_SPARSELU_UTILS_H 81 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Lazy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LAZY_H 11 | #define EIGEN_LAZY_H 12 | 13 | namespace Eigen { 14 | 15 | /** \deprecated it is only used by lazy() which is deprecated 16 | * 17 | * \returns an expression of *this with added flags 18 | * 19 | * Example: \include MatrixBase_marked.cpp 20 | * Output: \verbinclude MatrixBase_marked.out 21 | * 22 | * \sa class Flagged, extract(), part() 23 | */ 24 | template 25 | template 26 | inline const Flagged 27 | MatrixBase::marked() const 28 | { 29 | return derived(); 30 | } 31 | 32 | /** \deprecated use MatrixBase::noalias() 33 | * 34 | * \returns an expression of *this with the EvalBeforeAssigningBit flag removed. 35 | * 36 | * Example: \include MatrixBase_lazy.cpp 37 | * Output: \verbinclude MatrixBase_lazy.out 38 | * 39 | * \sa class Flagged, marked() 40 | */ 41 | template 42 | inline const Flagged 43 | MatrixBase::lazy() const 44 | { 45 | return derived(); 46 | } 47 | 48 | 49 | /** \internal 50 | * Overloaded to perform an efficient C += (A*B).lazy() */ 51 | template 52 | template 53 | Derived& MatrixBase::operator+=(const Flagged, 0, 54 | EvalBeforeAssigningBit>& other) 55 | { 56 | other._expression().derived().addTo(derived()); return derived(); 57 | } 58 | 59 | /** \internal 60 | * Overloaded to perform an efficient C -= (A*B).lazy() */ 61 | template 62 | template 63 | Derived& MatrixBase::operator-=(const Flagged, 0, 64 | EvalBeforeAssigningBit>& other) 65 | { 66 | other._expression().derived().subTo(derived()); return derived(); 67 | } 68 | 69 | } // end namespace Eigen 70 | 71 | #endif // EIGEN_LAZY_H 72 | -------------------------------------------------------------------------------- /src/Eigen/OrderingMethods: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H 2 | #define EIGEN_ORDERINGMETHODS_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** 9 | * \defgroup OrderingMethods_Module OrderingMethods module 10 | * 11 | * This module is currently for internal use only 12 | * 13 | * It defines various built-in and external ordering methods for sparse matrices. 14 | * They are typically used to reduce the number of elements during 15 | * the sparse matrix decomposition (LLT, LU, QR). 16 | * Precisely, in a preprocessing step, a permutation matrix P is computed using 17 | * those ordering methods and applied to the columns of the matrix. 18 | * Using for instance the sparse Cholesky decomposition, it is expected that 19 | * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). 20 | * 21 | * 22 | * Usage : 23 | * \code 24 | * #include 25 | * \endcode 26 | * 27 | * A simple usage is as a template parameter in the sparse decomposition classes : 28 | * 29 | * \code 30 | * SparseLU > solver; 31 | * \endcode 32 | * 33 | * \code 34 | * SparseQR > solver; 35 | * \endcode 36 | * 37 | * It is possible as well to call directly a particular ordering method for your own purpose, 38 | * \code 39 | * AMDOrdering ordering; 40 | * PermutationMatrix perm; 41 | * SparseMatrix A; 42 | * //Fill the matrix ... 43 | * 44 | * ordering(A, perm); // Call AMD 45 | * \endcode 46 | * 47 | * \note Some of these methods (like AMD or METIS), need the sparsity pattern 48 | * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, 49 | * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. 50 | * If your matrix is already symmetric (at leat in structure), you can avoid that 51 | * by calling the method with a SelfAdjointView type. 52 | * 53 | * \code 54 | * // Call the ordering on the pattern of the lower triangular matrix A 55 | * ordering(A.selfadjointView(), perm); 56 | * \endcode 57 | */ 58 | 59 | #ifndef EIGEN_MPL2_ONLY 60 | #include "src/OrderingMethods/Amd.h" 61 | #endif 62 | 63 | #include "src/OrderingMethods/Ordering.h" 64 | #include "src/Core/util/ReenableStupidWarnings.h" 65 | 66 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H 67 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/SparseTranspose.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSETRANSPOSE_H 11 | #define EIGEN_SPARSETRANSPOSE_H 12 | 13 | namespace Eigen { 14 | 15 | template class TransposeImpl 16 | : public SparseMatrixBase > 17 | { 18 | typedef typename internal::remove_all::type _MatrixTypeNested; 19 | public: 20 | 21 | EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose ) 22 | 23 | class InnerIterator; 24 | class ReverseInnerIterator; 25 | 26 | inline Index nonZeros() const { return derived().nestedExpression().nonZeros(); } 27 | }; 28 | 29 | // NOTE: VC10 and VC11 trigger an ICE if don't put typename TransposeImpl:: in front of Index, 30 | // a typedef typename TransposeImpl::Index Index; 31 | // does not fix the issue. 32 | // An alternative is to define the nested class in the parent class itself. 33 | template class TransposeImpl::InnerIterator 34 | : public _MatrixTypeNested::InnerIterator 35 | { 36 | typedef typename _MatrixTypeNested::InnerIterator Base; 37 | typedef typename TransposeImpl::Index Index; 38 | public: 39 | 40 | EIGEN_STRONG_INLINE InnerIterator(const TransposeImpl& trans, typename TransposeImpl::Index outer) 41 | : Base(trans.derived().nestedExpression(), outer) 42 | {} 43 | typename TransposeImpl::Index row() const { return Base::col(); } 44 | typename TransposeImpl::Index col() const { return Base::row(); } 45 | }; 46 | 47 | template class TransposeImpl::ReverseInnerIterator 48 | : public _MatrixTypeNested::ReverseInnerIterator 49 | { 50 | typedef typename _MatrixTypeNested::ReverseInnerIterator Base; 51 | typedef typename TransposeImpl::Index Index; 52 | public: 53 | 54 | EIGEN_STRONG_INLINE ReverseInnerIterator(const TransposeImpl& xpr, typename TransposeImpl::Index outer) 55 | : Base(xpr.derived().nestedExpression(), outer) 56 | {} 57 | typename TransposeImpl::Index row() const { return Base::col(); } 58 | typename TransposeImpl::Index col() const { return Base::row(); } 59 | }; 60 | 61 | } // end namespace Eigen 62 | 63 | #endif // EIGEN_SPARSETRANSPOSE_H 64 | -------------------------------------------------------------------------------- /src/Denoising/Algorithms/GuidedMeshNormalFiltering.h: -------------------------------------------------------------------------------- 1 | #ifndef GUIDEDMESHNORMALFILTERING_H 2 | #define GUIDEDMESHNORMALFILTERING_H 3 | 4 | /* 5 | @brief: "Guided Mesh Normal Filtering" class 6 | @reference: Guided Mesh Normal Filtering, PG2015 7 | */ 8 | 9 | #include "MeshDenoisingBase.h" 10 | #include "Eigen/Dense" 11 | #include "Eigen/Sparse" 12 | #include 13 | #include 14 | 15 | class GuidedMeshNormalFiltering : public MeshDenoisingBase 16 | { 17 | public: 18 | GuidedMeshNormalFiltering(DataManager *_data_manager, ParameterSet *_parameter_set); 19 | ~GuidedMeshNormalFiltering() {} 20 | 21 | private: 22 | void denoise(); 23 | void initParameters(); 24 | 25 | void getVertexBasedFaceNeighbor(TriMesh &mesh, TriMesh::FaceHandle fh, std::vector &face_neighbor); 26 | void getRadiusBasedFaceNeighbor(TriMesh &mesh, TriMesh::FaceHandle fh, double radius, std::vector &face_neighbor); 27 | void getAllFaceNeighborGMNF(TriMesh &mesh, FaceNeighborType face_neighbor_type, double radius, bool include_central_face, std::vector< std::vector > &all_face_neighbor); 28 | void getAllGuidedNeighborGMNF(TriMesh &mesh, std::vector< std::vector > &all_guided_neighbor); 29 | 30 | double GaussianWeight(double distance, double sigma); 31 | double NormalDistance(const TriMesh::Normal &n1, const TriMesh::Normal &n2); 32 | 33 | void getFaceNeighborInnerEdge(TriMesh &mesh, std::vector &face_neighbor, std::vector &inner_edge); 34 | void getRangeAndMeanNormal(TriMesh &mesh, std::vector > &all_guided_neighbor, 35 | std::vector &face_area, std::vector &normals, 36 | std::vector > &range_and_mean_normal); 37 | void getGuidedNormals(TriMesh &mesh, std::vector > &all_guided_neighbor, 38 | std::vector &face_area, std::vector &normals, 39 | std::vector > range_and_mean_normal, 40 | std::vector &guided_normals); 41 | 42 | double getRadius(double multiple, TriMesh &mesh); 43 | double getSigmaS(double multiple, std::vector ¢roid, TriMesh &mesh); 44 | 45 | void updateFilteredNormals(TriMesh &mesh, std::vector &filtered_normals); 46 | void updateFilteredNormalsLocalScheme(TriMesh &mesh, std::vector &filtered_normals); 47 | void updateFilteredNormalsGlobalScheme(TriMesh &mesh, std::vector &filtered_normals); 48 | }; 49 | 50 | #endif // GUIDEDMESHNORMALFILTERING_H 51 | -------------------------------------------------------------------------------- /src/Eigen/src/misc/Solve.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MISC_SOLVE_H 11 | #define EIGEN_MISC_SOLVE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \class solve_retval_base 18 | * 19 | */ 20 | template 21 | struct traits > 22 | { 23 | typedef typename DecompositionType::MatrixType MatrixType; 24 | typedef Matrix ReturnType; 30 | }; 31 | 32 | template struct solve_retval_base 33 | : public ReturnByValue > 34 | { 35 | typedef typename remove_all::type RhsNestedCleaned; 36 | typedef _DecompositionType DecompositionType; 37 | typedef ReturnByValue Base; 38 | typedef typename Base::Index Index; 39 | 40 | solve_retval_base(const DecompositionType& dec, const Rhs& rhs) 41 | : m_dec(dec), m_rhs(rhs) 42 | {} 43 | 44 | inline Index rows() const { return m_dec.cols(); } 45 | inline Index cols() const { return m_rhs.cols(); } 46 | inline const DecompositionType& dec() const { return m_dec; } 47 | inline const RhsNestedCleaned& rhs() const { return m_rhs; } 48 | 49 | template inline void evalTo(Dest& dst) const 50 | { 51 | static_cast*>(this)->evalTo(dst); 52 | } 53 | 54 | protected: 55 | const DecompositionType& m_dec; 56 | typename Rhs::Nested m_rhs; 57 | }; 58 | 59 | } // end namespace internal 60 | 61 | #define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \ 62 | typedef typename DecompositionType::MatrixType MatrixType; \ 63 | typedef typename MatrixType::Scalar Scalar; \ 64 | typedef typename MatrixType::RealScalar RealScalar; \ 65 | typedef typename MatrixType::Index Index; \ 66 | typedef Eigen::internal::solve_retval_base Base; \ 67 | using Base::dec; \ 68 | using Base::rhs; \ 69 | using Base::rows; \ 70 | using Base::cols; \ 71 | solve_retval(const DecompositionType& dec, const Rhs& rhs) \ 72 | : Base(dec, rhs) {} 73 | 74 | } // end namespace Eigen 75 | 76 | #endif // EIGEN_MISC_SOLVE_H 77 | -------------------------------------------------------------------------------- /src/Eigen/src/plugins/MatrixCwiseUnaryOps.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | // This file is a base class plugin containing matrix specifics coefficient wise functions. 12 | 13 | /** \returns an expression of the coefficient-wise absolute value of \c *this 14 | * 15 | * Example: \include MatrixBase_cwiseAbs.cpp 16 | * Output: \verbinclude MatrixBase_cwiseAbs.out 17 | * 18 | * \sa cwiseAbs2() 19 | */ 20 | EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> 21 | cwiseAbs() const { return derived(); } 22 | 23 | /** \returns an expression of the coefficient-wise squared absolute value of \c *this 24 | * 25 | * Example: \include MatrixBase_cwiseAbs2.cpp 26 | * Output: \verbinclude MatrixBase_cwiseAbs2.out 27 | * 28 | * \sa cwiseAbs() 29 | */ 30 | EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> 31 | cwiseAbs2() const { return derived(); } 32 | 33 | /** \returns an expression of the coefficient-wise square root of *this. 34 | * 35 | * Example: \include MatrixBase_cwiseSqrt.cpp 36 | * Output: \verbinclude MatrixBase_cwiseSqrt.out 37 | * 38 | * \sa cwisePow(), cwiseSquare() 39 | */ 40 | inline const CwiseUnaryOp, const Derived> 41 | cwiseSqrt() const { return derived(); } 42 | 43 | /** \returns an expression of the coefficient-wise inverse of *this. 44 | * 45 | * Example: \include MatrixBase_cwiseInverse.cpp 46 | * Output: \verbinclude MatrixBase_cwiseInverse.out 47 | * 48 | * \sa cwiseProduct() 49 | */ 50 | inline const CwiseUnaryOp, const Derived> 51 | cwiseInverse() const { return derived(); } 52 | 53 | /** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s 54 | * 55 | * \warning this performs an exact comparison, which is generally a bad idea with floating-point types. 56 | * In order to check for equality between two vectors or matrices with floating-point coefficients, it is 57 | * generally a far better idea to use a fuzzy comparison as provided by isApprox() and 58 | * isMuchSmallerThan(). 59 | * 60 | * \sa cwiseEqual(const MatrixBase &) const 61 | */ 62 | inline const CwiseUnaryOp >, const Derived> 63 | cwiseEqual(const Scalar& s) const 64 | { 65 | return CwiseUnaryOp >,const Derived> 66 | (derived(), std::bind1st(std::equal_to(), s)); 67 | } 68 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector > 3 | { 4 | 5 | typedef std::vector< bool > value_type; 6 | typedef value_type::value_type elem_type; 7 | 8 | static const bool is_streamable = true; 9 | 10 | static size_t size_of(void) { return UnknownSize; } 11 | static size_t size_of(const value_type& _v) 12 | { 13 | return _v.size() / 8 + ((_v.size() % 8)!=0); 14 | } 15 | 16 | static 17 | size_t store( std::ostream& _ostr, const value_type& _v, bool ) 18 | { 19 | size_t bytes = 0; 20 | 21 | size_t N = _v.size() / 8; 22 | size_t R = _v.size() % 8; 23 | 24 | size_t idx; // element index 25 | unsigned char bits; // bitset 26 | 27 | for (idx=0; idx < N; ++idx) 28 | { 29 | bits = 0; 30 | bits = bits | (_v[idx+0] ? 1 : 0); 31 | bits = bits | ((_v[idx+1] ? 1 : 0) << 1); 32 | bits = bits | ((_v[idx+2] ? 1 : 0) << 2); 33 | bits = bits | ((_v[idx+3] ? 1 : 0) << 3); 34 | bits = bits | ((_v[idx+4] ? 1 : 0) << 4); 35 | bits = bits | ((_v[idx+5] ? 1 : 0) << 5); 36 | bits = bits | ((_v[idx+6] ? 1 : 0) << 6); 37 | bits = bits | ((_v[idx+7] ? 1 : 0) << 7); 38 | _ostr << bits; 39 | } 40 | bytes = N; 41 | 42 | if (R) 43 | { 44 | bits = 0; 45 | switch(R) 46 | { 47 | case 7: bits = bits | ((_v[idx+6] ? 1 : 0) << 6); 48 | case 6: bits = bits | ((_v[idx+5] ? 1 : 0) << 5); 49 | case 5: bits = bits | ((_v[idx+4] ? 1 : 0) << 4); 50 | case 4: bits = bits | ((_v[idx+3] ? 1 : 0) << 3); 51 | case 3: bits = bits | ((_v[idx+2] ? 1 : 0) << 2); 52 | case 2: bits = bits | ((_v[idx+1] ? 1 : 0) << 1); 53 | case 1: bits = bits | (_v[idx+0] ? 1 : 0); 54 | } 55 | _ostr << bits; 56 | ++bytes; 57 | } 58 | 59 | assert( bytes == size_of(_v) ); 60 | 61 | return bytes; 62 | } 63 | 64 | static 65 | size_t restore( std::istream& _istr, value_type& _v, bool ) 66 | { 67 | size_t bytes = 0; 68 | 69 | size_t N = _v.size() / 8; 70 | size_t R = _v.size() % 8; 71 | 72 | size_t idx; // element index 73 | unsigned char bits; // bitset 74 | 75 | for (idx=0; idx < N; ++idx) 76 | { 77 | _istr >> bits; 78 | _v[idx+0] = ((bits & 0x01)!=0); 79 | _v[idx+1] = ((bits & 0x02)!=0); 80 | _v[idx+2] = ((bits & 0x04)!=0); 81 | _v[idx+3] = ((bits & 0x08)!=0); 82 | _v[idx+4] = ((bits & 0x10)!=0); 83 | _v[idx+5] = ((bits & 0x20)!=0); 84 | _v[idx+6] = ((bits & 0x40)!=0); 85 | _v[idx+7] = ((bits & 0x80)!=0); 86 | } 87 | bytes = N; 88 | 89 | if (R) 90 | { 91 | _istr >> bits; 92 | for(; idx < _v.size(); ++idx) 93 | _v[idx] = (bits & (1 << (idx%8)))!=0; 94 | ++bytes; 95 | } 96 | 97 | return bytes; 98 | } 99 | }; 100 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MATH_FUNCTIONS_H 11 | #define EIGEN2_MATH_FUNCTIONS_H 12 | 13 | namespace Eigen { 14 | 15 | template inline typename NumTraits::Real ei_real(const T& x) { return numext::real(x); } 16 | template inline typename NumTraits::Real ei_imag(const T& x) { return numext::imag(x); } 17 | template inline T ei_conj(const T& x) { return numext::conj(x); } 18 | template inline typename NumTraits::Real ei_abs (const T& x) { using std::abs; return abs(x); } 19 | template inline typename NumTraits::Real ei_abs2(const T& x) { return numext::abs2(x); } 20 | template inline T ei_sqrt(const T& x) { using std::sqrt; return sqrt(x); } 21 | template inline T ei_exp (const T& x) { using std::exp; return exp(x); } 22 | template inline T ei_log (const T& x) { using std::log; return log(x); } 23 | template inline T ei_sin (const T& x) { using std::sin; return sin(x); } 24 | template inline T ei_cos (const T& x) { using std::cos; return cos(x); } 25 | template inline T ei_atan2(const T& x,const T& y) { using std::atan2; return atan2(x,y); } 26 | template inline T ei_pow (const T& x,const T& y) { return numext::pow(x,y); } 27 | template inline T ei_random () { return internal::random(); } 28 | template inline T ei_random (const T& x, const T& y) { return internal::random(x, y); } 29 | 30 | template inline T precision () { return NumTraits::dummy_precision(); } 31 | template inline T machine_epsilon () { return NumTraits::epsilon(); } 32 | 33 | 34 | template 35 | inline bool ei_isMuchSmallerThan(const Scalar& x, const OtherScalar& y, 36 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 37 | { 38 | return internal::isMuchSmallerThan(x, y, precision); 39 | } 40 | 41 | template 42 | inline bool ei_isApprox(const Scalar& x, const Scalar& y, 43 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 44 | { 45 | return internal::isApprox(x, y, precision); 46 | } 47 | 48 | template 49 | inline bool ei_isApproxOrLessThan(const Scalar& x, const Scalar& y, 50 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 51 | { 52 | return internal::isApproxOrLessThan(x, y, precision); 53 | } 54 | 55 | } // end namespace Eigen 56 | 57 | #endif // EIGEN2_MATH_FUNCTIONS_H 58 | -------------------------------------------------------------------------------- /src/Eigen/src/Householder/BlockHouseholder.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Vincent Lejeune 5 | // Copyright (C) 2010 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_BLOCK_HOUSEHOLDER_H 12 | #define EIGEN_BLOCK_HOUSEHOLDER_H 13 | 14 | // This file contains some helper function to deal with block householder reflectors 15 | 16 | namespace Eigen { 17 | 18 | namespace internal { 19 | 20 | /** \internal */ 21 | template 22 | void make_block_householder_triangular_factor(TriangularFactorType& triFactor, const VectorsType& vectors, const CoeffsType& hCoeffs) 23 | { 24 | typedef typename TriangularFactorType::Index Index; 25 | typedef typename VectorsType::Scalar Scalar; 26 | const Index nbVecs = vectors.cols(); 27 | eigen_assert(triFactor.rows() == nbVecs && triFactor.cols() == nbVecs && vectors.rows()>=nbVecs); 28 | 29 | for(Index i = 0; i < nbVecs; i++) 30 | { 31 | Index rs = vectors.rows() - i; 32 | Scalar Vii = vectors(i,i); 33 | vectors.const_cast_derived().coeffRef(i,i) = Scalar(1); 34 | triFactor.col(i).head(i).noalias() = -hCoeffs(i) * vectors.block(i, 0, rs, i).adjoint() 35 | * vectors.col(i).tail(rs); 36 | vectors.const_cast_derived().coeffRef(i, i) = Vii; 37 | // FIXME add .noalias() once the triangular product can work inplace 38 | triFactor.col(i).head(i) = triFactor.block(0,0,i,i).template triangularView() 39 | * triFactor.col(i).head(i); 40 | triFactor(i,i) = hCoeffs(i); 41 | } 42 | } 43 | 44 | /** \internal */ 45 | template 46 | void apply_block_householder_on_the_left(MatrixType& mat, const VectorsType& vectors, const CoeffsType& hCoeffs) 47 | { 48 | typedef typename MatrixType::Index Index; 49 | enum { TFactorSize = MatrixType::ColsAtCompileTime }; 50 | Index nbVecs = vectors.cols(); 51 | Matrix T(nbVecs,nbVecs); 52 | make_block_householder_triangular_factor(T, vectors, hCoeffs); 53 | 54 | const TriangularView& V(vectors); 55 | 56 | // A -= V T V^* A 57 | Matrix tmp = V.adjoint() * mat; 59 | // FIXME add .noalias() once the triangular product can work inplace 60 | tmp = T.template triangularView().adjoint() * tmp; 61 | mat.noalias() -= V * tmp; 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | 68 | #endif // EIGEN_BLOCK_HOUSEHOLDER_H 69 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl: -------------------------------------------------------------------------------- 1 | 2 | #define BINARY_VECTOR( T ) \ 3 | template <> struct binary< std::vector< T > > { \ 4 | typedef std::vector< T > value_type; \ 5 | typedef value_type::value_type elem_type; \ 6 | \ 7 | static const bool is_streamable = true; \ 8 | \ 9 | static size_t size_of(void) \ 10 | { return IO::UnknownSize; } \ 11 | \ 12 | static size_t size_of(const value_type& _v) \ 13 | { return sizeof(elem_type)*_v.size(); } \ 14 | \ 15 | static \ 16 | size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) { \ 17 | size_t bytes=0; \ 18 | \ 19 | if (_swap) \ 20 | bytes = std::accumulate( _v.begin(), _v.end(), bytes, \ 21 | FunctorStore(_os,_swap) ); \ 22 | else { \ 23 | bytes = size_of(_v); \ 24 | _os.write( reinterpret_cast(&_v[0]), bytes ); \ 25 | } \ 26 | return _os.good() ? bytes : 0; \ 27 | } \ 28 | \ 29 | static size_t restore(std::istream& _is, value_type& _v, bool _swap=false) { \ 30 | size_t bytes=0; \ 31 | \ 32 | if ( _swap) \ 33 | bytes = std::accumulate( _v.begin(), _v.end(), size_t(0), \ 34 | FunctorRestore(_is, _swap) ); \ 35 | else \ 36 | { \ 37 | bytes = size_of(_v); \ 38 | _is.read( reinterpret_cast(&_v[0]), bytes ); \ 39 | } \ 40 | return _is.good() ? bytes : 0; \ 41 | } \ 42 | } 43 | 44 | BINARY_VECTOR( short ); 45 | BINARY_VECTOR( unsigned short ); 46 | BINARY_VECTOR( int ); 47 | BINARY_VECTOR( unsigned int ); 48 | BINARY_VECTOR( long ); 49 | BINARY_VECTOR( unsigned long ); 50 | BINARY_VECTOR( float ); 51 | BINARY_VECTOR( double ); 52 | 53 | #undef BINARY_VECTOR 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Guided Denoising 2 | 3 | This code implements the denoising algorithm in the following paper: 4 | 5 | * Wangyu Zhang, Bailin Deng, Juyong Zhang, Sofien Bouaziz, Ligang Liu. Guided mesh normal filtering. Pacific Graphics 2015. 6 | 7 | It also implements the denoising methods from the following papers for comparison: 8 | 9 | * Shachar Fleishman, Iddo Drori, and Daniel Cohen-Or. 2003. Bilateral mesh denoising. ACM Trans. Graph. 22, 3 (July 2003), 950-953. 10 | * Thouis R. Jones, Frédo Durand, and Mathieu Desbrun. 2003. Non-iterative, feature-preserving mesh smoothing. ACM Trans. Graph. 22, 3 (July 2003), 943-949. 11 | * Xianfang Sun, P. L. Rosin, R. R. Martin, and F. C. Langbein. 2007. Fast and Effective Feature-Preserving Mesh Denoising. IEEE Transactions on Visualization and Computer Graphics 13, 5 (September 2007), 925-938. 12 | * Youyi Zheng, Hongbo Fu, Oscar Kin-Chung Au, and Chiew-Lan Tai. 2011. Bilateral Normal Filtering for Mesh Denoising. IEEE Transactions on Visualization and Computer Graphics 17, 10 (October 2011), 1521-1530. 13 | * Lei He and Scott Schaefer. 2013. Mesh denoising via L0 minimization. ACM Trans. Graph. 32, 4, Article 64 (July 2013). 14 | 15 | The code has been tested on the following platforms: 16 | 17 | * Windows 10 with Qt 5.11.2, Qt Creator 4.7.1, and MSVC 2017 Community Edition (older versions of MSVC may not work); 18 | * Debian Buster with Qt 5.11.1, Qt Creator 4.6.2, and GCC 8.2.0. 19 | 20 | ### Compiling the source code: 21 | 22 | Make sure you have Qt (https://www.qt.io) installed . Then open the file `src/MeshDenoising.pro` with Qt Creator, and build the source code. 23 | 24 | 25 | ### Usage 26 | 27 | The following table explains the functionality for the GUI icons. 28 | 29 | |icon | functionality | 30 | |---------- | ---------- | 31 | |![open](./src/Denoising/Icons/open.ico) | read a mesh from file (supports obj, ply and off files) | 32 | |![save](./src/Denoising/Icons/save.ico) | save the mesh to file | 33 | |![point](./src/Denoising/Icons/points.ico) | render vertices of the mesh | 34 | |![edge](./src/Denoising/Icons/edges.ico) | render edges of the mesh | 35 | |![face](./src/Denoising/Icons/faces.ico) | render faces of the mesh | 36 | |![background](./src/Denoising/Icons/background.ico)| change the background color of the OpenGL area | 37 | |![about](./src/Denoising/Icons/about.ico) | information about this software| 38 | |`Original Mesh` |show the original mesh| 39 | |`Noisy Mesh`|show the noisy mesh| 40 | |`Denoised Mesh`|show the denoised mesh| 41 | |`Clear`|clear the mesh| 42 | 43 | 44 | ### Parameters 45 | 46 | Please see the [supplementary material](http://staff.ustc.edu.cn/~juyong/Papers/GuidedFilterSupp.pdf) for details about the parameters in each mesh denoising algorithm or see the code of each algorithm (function initParameters() in .cpp). 47 | 48 | 49 | ### License 50 | 51 | This software is released under GNU LGPL V3. 52 | 53 | 54 | ### Contact 55 | 56 | If you have any question, please contact Wangyu Zhang <zhwangyu@mail.ustc.edu.cn> or Bailin Deng <bldeng@gmail.com>. -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/VectorBlock.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN2_VECTORBLOCK_H 12 | #define EIGEN2_VECTORBLOCK_H 13 | 14 | namespace Eigen { 15 | 16 | /** \deprecated use DenseMase::head(Index) */ 17 | template 18 | inline VectorBlock 19 | MatrixBase::start(Index size) 20 | { 21 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 22 | return VectorBlock(derived(), 0, size); 23 | } 24 | 25 | /** \deprecated use DenseMase::head(Index) */ 26 | template 27 | inline const VectorBlock 28 | MatrixBase::start(Index size) const 29 | { 30 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 31 | return VectorBlock(derived(), 0, size); 32 | } 33 | 34 | /** \deprecated use DenseMase::tail(Index) */ 35 | template 36 | inline VectorBlock 37 | MatrixBase::end(Index size) 38 | { 39 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 40 | return VectorBlock(derived(), this->size() - size, size); 41 | } 42 | 43 | /** \deprecated use DenseMase::tail(Index) */ 44 | template 45 | inline const VectorBlock 46 | MatrixBase::end(Index size) const 47 | { 48 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 49 | return VectorBlock(derived(), this->size() - size, size); 50 | } 51 | 52 | /** \deprecated use DenseMase::head() */ 53 | template 54 | template 55 | inline VectorBlock 56 | MatrixBase::start() 57 | { 58 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 59 | return VectorBlock(derived(), 0); 60 | } 61 | 62 | /** \deprecated use DenseMase::head() */ 63 | template 64 | template 65 | inline const VectorBlock 66 | MatrixBase::start() const 67 | { 68 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 69 | return VectorBlock(derived(), 0); 70 | } 71 | 72 | /** \deprecated use DenseMase::tail() */ 73 | template 74 | template 75 | inline VectorBlock 76 | MatrixBase::end() 77 | { 78 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 79 | return VectorBlock(derived(), size() - Size); 80 | } 81 | 82 | /** \deprecated use DenseMase::tail() */ 83 | template 84 | template 85 | inline const VectorBlock 86 | MatrixBase::end() const 87 | { 88 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 89 | return VectorBlock(derived(), size() - Size); 90 | } 91 | 92 | } // end namespace Eigen 93 | 94 | #endif // EIGEN2_VECTORBLOCK_H 95 | -------------------------------------------------------------------------------- /src/Eigen/src/StlSupport/details.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STL_DETAILS_H 12 | #define EIGEN_STL_DETAILS_H 13 | 14 | #ifndef EIGEN_ALIGNED_ALLOCATOR 15 | #define EIGEN_ALIGNED_ALLOCATOR Eigen::aligned_allocator 16 | #endif 17 | 18 | namespace Eigen { 19 | 20 | // This one is needed to prevent reimplementing the whole std::vector. 21 | template 22 | class aligned_allocator_indirection : public EIGEN_ALIGNED_ALLOCATOR 23 | { 24 | public: 25 | typedef size_t size_type; 26 | typedef ptrdiff_t difference_type; 27 | typedef T* pointer; 28 | typedef const T* const_pointer; 29 | typedef T& reference; 30 | typedef const T& const_reference; 31 | typedef T value_type; 32 | 33 | template 34 | struct rebind 35 | { 36 | typedef aligned_allocator_indirection other; 37 | }; 38 | 39 | aligned_allocator_indirection() {} 40 | aligned_allocator_indirection(const aligned_allocator_indirection& ) : EIGEN_ALIGNED_ALLOCATOR() {} 41 | aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR& ) {} 42 | template 43 | aligned_allocator_indirection(const aligned_allocator_indirection& ) {} 44 | template 45 | aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR& ) {} 46 | ~aligned_allocator_indirection() {} 47 | }; 48 | 49 | #ifdef _MSC_VER 50 | 51 | // sometimes, MSVC detects, at compile time, that the argument x 52 | // in std::vector::resize(size_t s,T x) won't be aligned and generate an error 53 | // even if this function is never called. Whence this little wrapper. 54 | #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) \ 55 | typename Eigen::internal::conditional< \ 56 | Eigen::internal::is_arithmetic::value, \ 57 | T, \ 58 | Eigen::internal::workaround_msvc_stl_support \ 59 | >::type 60 | 61 | namespace internal { 62 | template struct workaround_msvc_stl_support : public T 63 | { 64 | inline workaround_msvc_stl_support() : T() {} 65 | inline workaround_msvc_stl_support(const T& other) : T(other) {} 66 | inline operator T& () { return *static_cast(this); } 67 | inline operator const T& () const { return *static_cast(this); } 68 | template 69 | inline T& operator=(const OtherT& other) 70 | { T::operator=(other); return *this; } 71 | inline workaround_msvc_stl_support& operator=(const workaround_msvc_stl_support& other) 72 | { T::operator=(other); return *this; } 73 | }; 74 | } 75 | 76 | #else 77 | 78 | #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) T 79 | 80 | #endif 81 | 82 | } 83 | 84 | #endif // EIGEN_STL_DETAILS_H 85 | -------------------------------------------------------------------------------- /src/Eigen/src/misc/Kernel.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MISC_KERNEL_H 11 | #define EIGEN_MISC_KERNEL_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \class kernel_retval_base 18 | * 19 | */ 20 | template 21 | struct traits > 22 | { 23 | typedef typename DecompositionType::MatrixType MatrixType; 24 | typedef Matrix< 25 | typename MatrixType::Scalar, 26 | MatrixType::ColsAtCompileTime, // the number of rows in the "kernel matrix" 27 | // is the number of cols of the original matrix 28 | // so that the product "matrix * kernel = zero" makes sense 29 | Dynamic, // we don't know at compile-time the dimension of the kernel 30 | MatrixType::Options, 31 | MatrixType::MaxColsAtCompileTime, // see explanation for 2nd template parameter 32 | MatrixType::MaxColsAtCompileTime // the kernel is a subspace of the domain space, 33 | // whose dimension is the number of columns of the original matrix 34 | > ReturnType; 35 | }; 36 | 37 | template struct kernel_retval_base 38 | : public ReturnByValue > 39 | { 40 | typedef _DecompositionType DecompositionType; 41 | typedef ReturnByValue Base; 42 | typedef typename Base::Index Index; 43 | 44 | kernel_retval_base(const DecompositionType& dec) 45 | : m_dec(dec), 46 | m_rank(dec.rank()), 47 | m_cols(m_rank==dec.cols() ? 1 : dec.cols() - m_rank) 48 | {} 49 | 50 | inline Index rows() const { return m_dec.cols(); } 51 | inline Index cols() const { return m_cols; } 52 | inline Index rank() const { return m_rank; } 53 | inline const DecompositionType& dec() const { return m_dec; } 54 | 55 | template inline void evalTo(Dest& dst) const 56 | { 57 | static_cast*>(this)->evalTo(dst); 58 | } 59 | 60 | protected: 61 | const DecompositionType& m_dec; 62 | Index m_rank, m_cols; 63 | }; 64 | 65 | } // end namespace internal 66 | 67 | #define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \ 68 | typedef typename DecompositionType::MatrixType MatrixType; \ 69 | typedef typename MatrixType::Scalar Scalar; \ 70 | typedef typename MatrixType::RealScalar RealScalar; \ 71 | typedef typename MatrixType::Index Index; \ 72 | typedef Eigen::internal::kernel_retval_base Base; \ 73 | using Base::dec; \ 74 | using Base::rank; \ 75 | using Base::rows; \ 76 | using Base::cols; \ 77 | kernel_retval(const DecompositionType& dec) : Base(dec) {} 78 | 79 | } // end namespace Eigen 80 | 81 | #endif // EIGEN_MISC_KERNEL_H 82 | -------------------------------------------------------------------------------- /src/Eigen/src/QR/HouseholderQR_MKL.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of Intel Corporation nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************** 28 | * Content : Eigen bindings to Intel(R) MKL 29 | * Householder QR decomposition of a matrix w/o pivoting based on 30 | * LAPACKE_?geqrf function. 31 | ******************************************************************************** 32 | */ 33 | 34 | #ifndef EIGEN_QR_MKL_H 35 | #define EIGEN_QR_MKL_H 36 | 37 | #include "Eigen/src/Core/util/MKL_support.h" 38 | 39 | namespace Eigen { 40 | 41 | namespace internal { 42 | 43 | /** \internal Specialization for the data types supported by MKL */ 44 | 45 | #define EIGEN_MKL_QR_NOPIV(EIGTYPE, MKLTYPE, MKLPREFIX) \ 46 | template \ 47 | void householder_qr_inplace_blocked(MatrixQR& mat, HCoeffs& hCoeffs, \ 48 | typename MatrixQR::Index maxBlockSize=32, \ 49 | EIGTYPE* tempData = 0) \ 50 | { \ 51 | lapack_int m = mat.rows(); \ 52 | lapack_int n = mat.cols(); \ 53 | lapack_int lda = mat.outerStride(); \ 54 | lapack_int matrix_order = (MatrixQR::IsRowMajor) ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ 55 | LAPACKE_##MKLPREFIX##geqrf( matrix_order, m, n, (MKLTYPE*)mat.data(), lda, (MKLTYPE*)hCoeffs.data()); \ 56 | hCoeffs.adjointInPlace(); \ 57 | \ 58 | } 59 | 60 | EIGEN_MKL_QR_NOPIV(double, double, d) 61 | EIGEN_MKL_QR_NOPIV(float, float, s) 62 | EIGEN_MKL_QR_NOPIV(dcomplex, MKL_Complex16, z) 63 | EIGEN_MKL_QR_NOPIV(scomplex, MKL_Complex8, c) 64 | 65 | } // end namespace internal 66 | 67 | } // end namespace Eigen 68 | 69 | #endif // EIGEN_QR_MKL_H 70 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseLU/SparseLU_relax_snode.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | /* This file is a modified version of heap_relax_snode.c file in SuperLU 11 | * -- SuperLU routine (version 3.0) -- 12 | * Univ. of California Berkeley, Xerox Palo Alto Research Center, 13 | * and Lawrence Berkeley National Lab. 14 | * October 15, 2003 15 | * 16 | * Copyright (c) 1994 by Xerox Corporation. All rights reserved. 17 | * 18 | * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY 19 | * EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. 20 | * 21 | * Permission is hereby granted to use or copy this program for any 22 | * purpose, provided the above notices are retained on all copies. 23 | * Permission to modify the code and to distribute modified code is 24 | * granted, provided the above notices are retained, and a notice that 25 | * the code was modified is included with the above copyright notice. 26 | */ 27 | 28 | #ifndef SPARSELU_RELAX_SNODE_H 29 | #define SPARSELU_RELAX_SNODE_H 30 | 31 | namespace Eigen { 32 | 33 | namespace internal { 34 | 35 | /** 36 | * \brief Identify the initial relaxed supernodes 37 | * 38 | * This routine is applied to a column elimination tree. 39 | * It assumes that the matrix has been reordered according to the postorder of the etree 40 | * \param n the number of columns 41 | * \param et elimination tree 42 | * \param relax_columns Maximum number of columns allowed in a relaxed snode 43 | * \param descendants Number of descendants of each node in the etree 44 | * \param relax_end last column in a supernode 45 | */ 46 | template 47 | void SparseLUImpl::relax_snode (const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants, IndexVector& relax_end) 48 | { 49 | 50 | // compute the number of descendants of each node in the etree 51 | Index j, parent; 52 | relax_end.setConstant(emptyIdxLU); 53 | descendants.setZero(); 54 | for (j = 0; j < n; j++) 55 | { 56 | parent = et(j); 57 | if (parent != n) // not the dummy root 58 | descendants(parent) += descendants(j) + 1; 59 | } 60 | // Identify the relaxed supernodes by postorder traversal of the etree 61 | Index snode_start; // beginning of a snode 62 | for (j = 0; j < n; ) 63 | { 64 | parent = et(j); 65 | snode_start = j; 66 | while ( parent != n && descendants(parent) < relax_columns ) 67 | { 68 | j = parent; 69 | parent = et(j); 70 | } 71 | // Found a supernode in postordered etree, j is the last column 72 | relax_end(snode_start) = j; // Record last column 73 | j++; 74 | // Search for a new leaf 75 | while (descendants(j) != 0 && j < n) j++; 76 | } // End postorder traversal of the etree 77 | 78 | } 79 | 80 | } // end namespace internal 81 | 82 | } // end namespace Eigen 83 | #endif 84 | -------------------------------------------------------------------------------- /src/Denoising/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | 7 | class GLViewer; 8 | class DataManager; 9 | class ParameterSet; 10 | class ParameterSetWidget; 11 | class CalculationThread; 12 | class ioThread; 13 | 14 | namespace Ui { 15 | class MainWindow; 16 | } 17 | 18 | class MainWindow : public QMainWindow 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit MainWindow(QWidget *parent = 0); 24 | ~MainWindow(); 25 | 26 | private: 27 | void init(); 28 | void CreateActions(); 29 | void CreateMenus(); 30 | void CreateToolBars(); 31 | void CreateStatusBar(); 32 | 33 | void CloseWidget(); 34 | void ShowWidget(); 35 | void SetActionStatus(bool value); 36 | 37 | private slots: 38 | void ImportMesh(); 39 | void ExportMesh(); 40 | void TransToNoisyMesh(); 41 | void TransToOriginalMesh(); 42 | void TransToDenoisedMesh(); 43 | void ClearMesh(); 44 | void ApplyAlgorithms(QString algorithm_name); 45 | 46 | void ShowNoiseWidget(); 47 | void ShowBilateralMeshDenoisingWidget(); 48 | void ShowNonIterativeFeaturePreservingMeshFilteringWidget(); 49 | void ShowFastAndEffectiveFeaturePreservingMeshDenoisingWidget(); 50 | void ShowBilateralNormalFilteringForMeshDenoisingWidget(); 51 | void ShowMeshDenoisingViaL0MinimizationWidget(); 52 | void ShowGuidedMeshNormalFilteringWidget(); 53 | 54 | void setActionAndWidget(bool value1, bool value2); 55 | void needToUpdateGL(bool value); 56 | 57 | void About(); 58 | 59 | private: 60 | Ui::MainWindow *ui; 61 | 62 | private: 63 | QMenu *menu_file_; 64 | QMenu *menu_algorithms_; 65 | QMenu *menu_help_; 66 | 67 | QAction *action_import_mesh_; 68 | QAction *action_export_mesh_; 69 | QAction *action_exit_; 70 | 71 | QAction *action_noise_; 72 | QAction *action_bilateral_mesh_denoising_; 73 | QAction *action_non_iterative_feature_preserving_mesh_filtering_; 74 | QAction *action_fast_and_effective_feature_preserving_mesh_denoising_; 75 | QAction *action_bilateral_normal_filtering_for_mesh_denoising_; 76 | QAction *action_mesh_denoising_via_l0_minimization_; 77 | QAction *action_guided_mesh_normal_filtering_; 78 | 79 | QAction *action_about_; 80 | 81 | QAction *action_render_points_; 82 | QAction *action_render_edges_; 83 | QAction *action_render_faces_; 84 | QAction *action_set_background_color_; 85 | 86 | QAction *action_to_noisy_mesh_; 87 | QAction *action_to_original_mesh_; 88 | QAction *action_to_denoised_mesh_; 89 | QAction *action_clear_mesh_; 90 | 91 | QToolBar *toolbar_file_; 92 | QToolBar *toolbar_opengl_info_; 93 | QToolBar *toolbar_mesh_status_; 94 | 95 | QLabel *label_operation_info_; 96 | 97 | private: 98 | // glviewer 99 | GLViewer *opengl_viewer_; 100 | // datamanager 101 | DataManager *data_manager_; 102 | // parameter set 103 | ParameterSet *parameter_set_; 104 | // parameter set widget 105 | ParameterSetWidget *parameter_set_widget_; 106 | 107 | ioThread *io_thread_; 108 | CalculationThread *calculation_thread_; 109 | }; 110 | 111 | #endif // MAINWINDOW_H 112 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/System/config.hh: -------------------------------------------------------------------------------- 1 | /*===========================================================================*\ 2 | * * 3 | * OpenMesh * 4 | * Copyright (C) 2001-2015 by Computer Graphics Group, RWTH Aachen * 5 | * www.openmesh.org * 6 | * * 7 | *---------------------------------------------------------------------------* 8 | * This file is part of OpenMesh. * 9 | * * 10 | * OpenMesh is free software: you can redistribute it and/or modify * 11 | * it under the terms of the GNU Lesser General Public License as * 12 | * published by the Free Software Foundation, either version 3 of * 13 | * the License, or (at your option) any later version with the * 14 | * following exceptions: * 15 | * * 16 | * If other files instantiate templates or use macros * 17 | * or inline functions from this file, or you compile this file and * 18 | * link it with other files to produce an executable, this file does * 19 | * not by itself cause the resulting executable to be covered by the * 20 | * GNU Lesser General Public License. This exception does not however * 21 | * invalidate any other reasons why the executable file might be * 22 | * covered by the GNU Lesser General Public License. * 23 | * * 24 | * OpenMesh is distributed in the hope that it will be useful, * 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 27 | * GNU Lesser General Public License for more details. * 28 | * * 29 | * You should have received a copy of the GNU LesserGeneral Public * 30 | * License along with OpenMesh. If not, * 31 | * see . * 32 | * * 33 | \*===========================================================================*/ 34 | 35 | /*===========================================================================*\ 36 | * * 37 | * $Revision: 1188 $ * 38 | * $Date: 2015-01-05 16:34:10 +0100 (Mo, 05 Jan 2015) $ * 39 | * * 40 | \*===========================================================================*/ 41 | 42 | #include 43 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Meta.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_META_H 11 | #define EIGEN2_META_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | struct ei_traits : internal::traits 17 | {}; 18 | 19 | struct ei_meta_true { enum { ret = 1 }; }; 20 | struct ei_meta_false { enum { ret = 0 }; }; 21 | 22 | template 23 | struct ei_meta_if { typedef Then ret; }; 24 | 25 | template 26 | struct ei_meta_if { typedef Else ret; }; 27 | 28 | template struct ei_is_same_type { enum { ret = 0 }; }; 29 | template struct ei_is_same_type { enum { ret = 1 }; }; 30 | 31 | template struct ei_unref { typedef T type; }; 32 | template struct ei_unref { typedef T type; }; 33 | 34 | template struct ei_unpointer { typedef T type; }; 35 | template struct ei_unpointer { typedef T type; }; 36 | template struct ei_unpointer { typedef T type; }; 37 | 38 | template struct ei_unconst { typedef T type; }; 39 | template struct ei_unconst { typedef T type; }; 40 | template struct ei_unconst { typedef T & type; }; 41 | template struct ei_unconst { typedef T * type; }; 42 | 43 | template struct ei_cleantype { typedef T type; }; 44 | template struct ei_cleantype { typedef typename ei_cleantype::type type; }; 45 | template struct ei_cleantype { typedef typename ei_cleantype::type type; }; 46 | template struct ei_cleantype { typedef typename ei_cleantype::type type; }; 47 | template struct ei_cleantype { typedef typename ei_cleantype::type type; }; 48 | template struct ei_cleantype { typedef typename ei_cleantype::type type; }; 49 | 50 | /** \internal In short, it computes int(sqrt(\a Y)) with \a Y an integer. 51 | * Usage example: \code ei_meta_sqrt<1023>::ret \endcode 52 | */ 53 | template Y))) > 57 | // use ?: instead of || just to shut up a stupid gcc 4.3 warning 58 | class ei_meta_sqrt 59 | { 60 | enum { 61 | MidX = (InfX+SupX)/2, 62 | TakeInf = MidX*MidX > Y ? 1 : 0, 63 | NewInf = int(TakeInf) ? InfX : int(MidX), 64 | NewSup = int(TakeInf) ? int(MidX) : SupX 65 | }; 66 | public: 67 | enum { ret = ei_meta_sqrt::ret }; 68 | }; 69 | 70 | template 71 | class ei_meta_sqrt { public: enum { ret = (SupX*SupX <= Y) ? SupX : InfX }; }; 72 | 73 | } // end namespace Eigen 74 | 75 | #endif // EIGEN2_META_H 76 | -------------------------------------------------------------------------------- /src/Eigen/src/Eigen2Support/Geometry/All.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN2_GEOMETRY_MODULE_H 2 | #define EIGEN2_GEOMETRY_MODULE_H 3 | 4 | #include 5 | 6 | #ifndef M_PI 7 | #define M_PI 3.14159265358979323846 8 | #endif 9 | 10 | #if EIGEN2_SUPPORT_STAGE < STAGE20_RESOLVE_API_CONFLICTS 11 | #include "RotationBase.h" 12 | #include "Rotation2D.h" 13 | #include "Quaternion.h" 14 | #include "AngleAxis.h" 15 | #include "Transform.h" 16 | #include "Translation.h" 17 | #include "Scaling.h" 18 | #include "AlignedBox.h" 19 | #include "Hyperplane.h" 20 | #include "ParametrizedLine.h" 21 | #endif 22 | 23 | 24 | #define RotationBase eigen2_RotationBase 25 | #define Rotation2D eigen2_Rotation2D 26 | #define Rotation2Df eigen2_Rotation2Df 27 | #define Rotation2Dd eigen2_Rotation2Dd 28 | 29 | #define Quaternion eigen2_Quaternion 30 | #define Quaternionf eigen2_Quaternionf 31 | #define Quaterniond eigen2_Quaterniond 32 | 33 | #define AngleAxis eigen2_AngleAxis 34 | #define AngleAxisf eigen2_AngleAxisf 35 | #define AngleAxisd eigen2_AngleAxisd 36 | 37 | #define Transform eigen2_Transform 38 | #define Transform2f eigen2_Transform2f 39 | #define Transform2d eigen2_Transform2d 40 | #define Transform3f eigen2_Transform3f 41 | #define Transform3d eigen2_Transform3d 42 | 43 | #define Translation eigen2_Translation 44 | #define Translation2f eigen2_Translation2f 45 | #define Translation2d eigen2_Translation2d 46 | #define Translation3f eigen2_Translation3f 47 | #define Translation3d eigen2_Translation3d 48 | 49 | #define Scaling eigen2_Scaling 50 | #define Scaling2f eigen2_Scaling2f 51 | #define Scaling2d eigen2_Scaling2d 52 | #define Scaling3f eigen2_Scaling3f 53 | #define Scaling3d eigen2_Scaling3d 54 | 55 | #define AlignedBox eigen2_AlignedBox 56 | 57 | #define Hyperplane eigen2_Hyperplane 58 | #define ParametrizedLine eigen2_ParametrizedLine 59 | 60 | #define ei_toRotationMatrix eigen2_ei_toRotationMatrix 61 | #define ei_quaternion_assign_impl eigen2_ei_quaternion_assign_impl 62 | #define ei_transform_product_impl eigen2_ei_transform_product_impl 63 | 64 | #include "RotationBase.h" 65 | #include "Rotation2D.h" 66 | #include "Quaternion.h" 67 | #include "AngleAxis.h" 68 | #include "Transform.h" 69 | #include "Translation.h" 70 | #include "Scaling.h" 71 | #include "AlignedBox.h" 72 | #include "Hyperplane.h" 73 | #include "ParametrizedLine.h" 74 | 75 | #undef ei_toRotationMatrix 76 | #undef ei_quaternion_assign_impl 77 | #undef ei_transform_product_impl 78 | 79 | #undef RotationBase 80 | #undef Rotation2D 81 | #undef Rotation2Df 82 | #undef Rotation2Dd 83 | 84 | #undef Quaternion 85 | #undef Quaternionf 86 | #undef Quaterniond 87 | 88 | #undef AngleAxis 89 | #undef AngleAxisf 90 | #undef AngleAxisd 91 | 92 | #undef Transform 93 | #undef Transform2f 94 | #undef Transform2d 95 | #undef Transform3f 96 | #undef Transform3d 97 | 98 | #undef Translation 99 | #undef Translation2f 100 | #undef Translation2d 101 | #undef Translation3f 102 | #undef Translation3d 103 | 104 | #undef Scaling 105 | #undef Scaling2f 106 | #undef Scaling2d 107 | #undef Scaling3f 108 | #undef Scaling3d 109 | 110 | #undef AlignedBox 111 | 112 | #undef Hyperplane 113 | #undef ParametrizedLine 114 | 115 | #endif // EIGEN2_GEOMETRY_MODULE_H 116 | -------------------------------------------------------------------------------- /src/Eigen/src/misc/Image.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MISC_IMAGE_H 11 | #define EIGEN_MISC_IMAGE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \class image_retval_base 18 | * 19 | */ 20 | template 21 | struct traits > 22 | { 23 | typedef typename DecompositionType::MatrixType MatrixType; 24 | typedef Matrix< 25 | typename MatrixType::Scalar, 26 | MatrixType::RowsAtCompileTime, // the image is a subspace of the destination space, whose 27 | // dimension is the number of rows of the original matrix 28 | Dynamic, // we don't know at compile time the dimension of the image (the rank) 29 | MatrixType::Options, 30 | MatrixType::MaxRowsAtCompileTime, // the image matrix will consist of columns from the original matrix, 31 | MatrixType::MaxColsAtCompileTime // so it has the same number of rows and at most as many columns. 32 | > ReturnType; 33 | }; 34 | 35 | template struct image_retval_base 36 | : public ReturnByValue > 37 | { 38 | typedef _DecompositionType DecompositionType; 39 | typedef typename DecompositionType::MatrixType MatrixType; 40 | typedef ReturnByValue Base; 41 | typedef typename Base::Index Index; 42 | 43 | image_retval_base(const DecompositionType& dec, const MatrixType& originalMatrix) 44 | : m_dec(dec), m_rank(dec.rank()), 45 | m_cols(m_rank == 0 ? 1 : m_rank), 46 | m_originalMatrix(originalMatrix) 47 | {} 48 | 49 | inline Index rows() const { return m_dec.rows(); } 50 | inline Index cols() const { return m_cols; } 51 | inline Index rank() const { return m_rank; } 52 | inline const DecompositionType& dec() const { return m_dec; } 53 | inline const MatrixType& originalMatrix() const { return m_originalMatrix; } 54 | 55 | template inline void evalTo(Dest& dst) const 56 | { 57 | static_cast*>(this)->evalTo(dst); 58 | } 59 | 60 | protected: 61 | const DecompositionType& m_dec; 62 | Index m_rank, m_cols; 63 | const MatrixType& m_originalMatrix; 64 | }; 65 | 66 | } // end namespace internal 67 | 68 | #define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \ 69 | typedef typename DecompositionType::MatrixType MatrixType; \ 70 | typedef typename MatrixType::Scalar Scalar; \ 71 | typedef typename MatrixType::RealScalar RealScalar; \ 72 | typedef typename MatrixType::Index Index; \ 73 | typedef Eigen::internal::image_retval_base Base; \ 74 | using Base::dec; \ 75 | using Base::originalMatrix; \ 76 | using Base::rank; \ 77 | using Base::rows; \ 78 | using Base::cols; \ 79 | image_retval(const DecompositionType& dec, const MatrixType& originalMatrix) \ 80 | : Base(dec, originalMatrix) {} 81 | 82 | } // end namespace Eigen 83 | 84 | #endif // EIGEN_MISC_IMAGE_H 85 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/SparseView.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2010 Daniel Lowengrub 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSEVIEW_H 12 | #define EIGEN_SPARSEVIEW_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | struct traits > : traits 20 | { 21 | typedef typename MatrixType::Index Index; 22 | typedef Sparse StorageKind; 23 | enum { 24 | Flags = int(traits::Flags) & (RowMajorBit) 25 | }; 26 | }; 27 | 28 | } // end namespace internal 29 | 30 | template 31 | class SparseView : public SparseMatrixBase > 32 | { 33 | typedef typename MatrixType::Nested MatrixTypeNested; 34 | typedef typename internal::remove_all::type _MatrixTypeNested; 35 | public: 36 | EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) 37 | 38 | SparseView(const MatrixType& mat, const Scalar& m_reference = Scalar(0), 39 | typename NumTraits::Real m_epsilon = NumTraits::dummy_precision()) : 40 | m_matrix(mat), m_reference(m_reference), m_epsilon(m_epsilon) {} 41 | 42 | class InnerIterator; 43 | 44 | inline Index rows() const { return m_matrix.rows(); } 45 | inline Index cols() const { return m_matrix.cols(); } 46 | 47 | inline Index innerSize() const { return m_matrix.innerSize(); } 48 | inline Index outerSize() const { return m_matrix.outerSize(); } 49 | 50 | protected: 51 | MatrixTypeNested m_matrix; 52 | Scalar m_reference; 53 | typename NumTraits::Real m_epsilon; 54 | }; 55 | 56 | template 57 | class SparseView::InnerIterator : public _MatrixTypeNested::InnerIterator 58 | { 59 | typedef typename SparseView::Index Index; 60 | public: 61 | typedef typename _MatrixTypeNested::InnerIterator IterBase; 62 | InnerIterator(const SparseView& view, Index outer) : 63 | IterBase(view.m_matrix, outer), m_view(view) 64 | { 65 | incrementToNonZero(); 66 | } 67 | 68 | EIGEN_STRONG_INLINE InnerIterator& operator++() 69 | { 70 | IterBase::operator++(); 71 | incrementToNonZero(); 72 | return *this; 73 | } 74 | 75 | using IterBase::value; 76 | 77 | protected: 78 | const SparseView& m_view; 79 | 80 | private: 81 | void incrementToNonZero() 82 | { 83 | while((bool(*this)) && internal::isMuchSmallerThan(value(), m_view.m_reference, m_view.m_epsilon)) 84 | { 85 | IterBase::operator++(); 86 | } 87 | } 88 | }; 89 | 90 | template 91 | const SparseView MatrixBase::sparseView(const Scalar& m_reference, 92 | const typename NumTraits::Real& m_epsilon) const 93 | { 94 | return SparseView(derived(), m_reference, m_epsilon); 95 | } 96 | 97 | } // end namespace Eigen 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Utils/BaseProperty.cc: -------------------------------------------------------------------------------- 1 | /*===========================================================================*\ 2 | * * 3 | * OpenMesh * 4 | * Copyright (C) 2001-2015 by Computer Graphics Group, RWTH Aachen * 5 | * www.openmesh.org * 6 | * * 7 | *---------------------------------------------------------------------------* 8 | * This file is part of OpenMesh. * 9 | * * 10 | * OpenMesh is free software: you can redistribute it and/or modify * 11 | * it under the terms of the GNU Lesser General Public License as * 12 | * published by the Free Software Foundation, either version 3 of * 13 | * the License, or (at your option) any later version with the * 14 | * following exceptions: * 15 | * * 16 | * If other files instantiate templates or use macros * 17 | * or inline functions from this file, or you compile this file and * 18 | * link it with other files to produce an executable, this file does * 19 | * not by itself cause the resulting executable to be covered by the * 20 | * GNU Lesser General Public License. This exception does not however * 21 | * invalidate any other reasons why the executable file might be * 22 | * covered by the GNU Lesser General Public License. * 23 | * * 24 | * OpenMesh is distributed in the hope that it will be useful, * 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 27 | * GNU Lesser General Public License for more details. * 28 | * * 29 | * You should have received a copy of the GNU LesserGeneral Public * 30 | * License along with OpenMesh. If not, * 31 | * see . * 32 | * * 33 | \*===========================================================================*/ 34 | 35 | /*===========================================================================*\ 36 | * * 37 | * $Revision: 1188 $ * 38 | * $Date: 2015-01-05 16:34:10 +0100 (Mo, 05 Jan 2015) $ * 39 | * * 40 | \*===========================================================================*/ 41 | 42 | #include 43 | #include 44 | 45 | namespace OpenMesh 46 | { 47 | 48 | void BaseProperty::stats(std::ostream& _ostr) const 49 | { 50 | _ostr << " " << name() << (persistent() ? ", persistent " : "") << "\n"; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/ReturnByValue.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // Copyright (C) 2009-2010 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_RETURNBYVALUE_H 12 | #define EIGEN_RETURNBYVALUE_H 13 | 14 | namespace Eigen { 15 | 16 | /** \class ReturnByValue 17 | * \ingroup Core_Module 18 | * 19 | */ 20 | 21 | namespace internal { 22 | 23 | template 24 | struct traits > 25 | : public traits::ReturnType> 26 | { 27 | enum { 28 | // We're disabling the DirectAccess because e.g. the constructor of 29 | // the Block-with-DirectAccess expression requires to have a coeffRef method. 30 | // Also, we don't want to have to implement the stride stuff. 31 | Flags = (traits::ReturnType>::Flags 32 | | EvalBeforeNestingBit) & ~DirectAccessBit 33 | }; 34 | }; 35 | 36 | /* The ReturnByValue object doesn't even have a coeff() method. 37 | * So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix. 38 | * So internal::nested always gives the plain return matrix type. 39 | * 40 | * FIXME: I don't understand why we need this specialization: isn't this taken care of by the EvalBeforeNestingBit ?? 41 | */ 42 | template 43 | struct nested, n, PlainObject> 44 | { 45 | typedef typename traits::ReturnType type; 46 | }; 47 | 48 | } // end namespace internal 49 | 50 | template class ReturnByValue 51 | : internal::no_assignment_operator, public internal::dense_xpr_base< ReturnByValue >::type 52 | { 53 | public: 54 | typedef typename internal::traits::ReturnType ReturnType; 55 | 56 | typedef typename internal::dense_xpr_base::type Base; 57 | EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue) 58 | 59 | template 60 | inline void evalTo(Dest& dst) const 61 | { static_cast(this)->evalTo(dst); } 62 | inline Index rows() const { return static_cast(this)->rows(); } 63 | inline Index cols() const { return static_cast(this)->cols(); } 64 | 65 | #ifndef EIGEN_PARSED_BY_DOXYGEN 66 | #define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT 67 | class Unusable{ 68 | Unusable(const Unusable&) {} 69 | Unusable& operator=(const Unusable&) {return *this;} 70 | }; 71 | const Unusable& coeff(Index) const { return *reinterpret_cast(this); } 72 | const Unusable& coeff(Index,Index) const { return *reinterpret_cast(this); } 73 | Unusable& coeffRef(Index) { return *reinterpret_cast(this); } 74 | Unusable& coeffRef(Index,Index) { return *reinterpret_cast(this); } 75 | #endif 76 | }; 77 | 78 | template 79 | template 80 | Derived& DenseBase::operator=(const ReturnByValue& other) 81 | { 82 | other.evalTo(derived()); 83 | return derived(); 84 | } 85 | 86 | } // end namespace Eigen 87 | 88 | #endif // EIGEN_RETURNBYVALUE_H 89 | -------------------------------------------------------------------------------- /src/Eigen/src/LU/Determinant.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_DETERMINANT_H 11 | #define EIGEN_DETERMINANT_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template 18 | inline const typename Derived::Scalar bruteforce_det3_helper 19 | (const MatrixBase& matrix, int a, int b, int c) 20 | { 21 | return matrix.coeff(0,a) 22 | * (matrix.coeff(1,b) * matrix.coeff(2,c) - matrix.coeff(1,c) * matrix.coeff(2,b)); 23 | } 24 | 25 | template 26 | const typename Derived::Scalar bruteforce_det4_helper 27 | (const MatrixBase& matrix, int j, int k, int m, int n) 28 | { 29 | return (matrix.coeff(j,0) * matrix.coeff(k,1) - matrix.coeff(k,0) * matrix.coeff(j,1)) 30 | * (matrix.coeff(m,2) * matrix.coeff(n,3) - matrix.coeff(n,2) * matrix.coeff(m,3)); 31 | } 32 | 33 | template struct determinant_impl 36 | { 37 | static inline typename traits::Scalar run(const Derived& m) 38 | { 39 | if(Derived::ColsAtCompileTime==Dynamic && m.rows()==0) 40 | return typename traits::Scalar(1); 41 | return m.partialPivLu().determinant(); 42 | } 43 | }; 44 | 45 | template struct determinant_impl 46 | { 47 | static inline typename traits::Scalar run(const Derived& m) 48 | { 49 | return m.coeff(0,0); 50 | } 51 | }; 52 | 53 | template struct determinant_impl 54 | { 55 | static inline typename traits::Scalar run(const Derived& m) 56 | { 57 | return m.coeff(0,0) * m.coeff(1,1) - m.coeff(1,0) * m.coeff(0,1); 58 | } 59 | }; 60 | 61 | template struct determinant_impl 62 | { 63 | static inline typename traits::Scalar run(const Derived& m) 64 | { 65 | return bruteforce_det3_helper(m,0,1,2) 66 | - bruteforce_det3_helper(m,1,0,2) 67 | + bruteforce_det3_helper(m,2,0,1); 68 | } 69 | }; 70 | 71 | template struct determinant_impl 72 | { 73 | static typename traits::Scalar run(const Derived& m) 74 | { 75 | // trick by Martin Costabel to compute 4x4 det with only 30 muls 76 | return bruteforce_det4_helper(m,0,1,2,3) 77 | - bruteforce_det4_helper(m,0,2,1,3) 78 | + bruteforce_det4_helper(m,0,3,1,2) 79 | + bruteforce_det4_helper(m,1,2,0,3) 80 | - bruteforce_det4_helper(m,1,3,0,2) 81 | + bruteforce_det4_helper(m,2,3,0,1); 82 | } 83 | }; 84 | 85 | } // end namespace internal 86 | 87 | /** \lu_module 88 | * 89 | * \returns the determinant of this matrix 90 | */ 91 | template 92 | inline typename internal::traits::Scalar MatrixBase::determinant() const 93 | { 94 | eigen_assert(rows() == cols()); 95 | typedef typename internal::nested::type Nested; 96 | return internal::determinant_impl::type>::run(derived()); 97 | } 98 | 99 | } // end namespace Eigen 100 | 101 | #endif // EIGEN_DETERMINANT_H 102 | -------------------------------------------------------------------------------- /src/Eigen/Eigen2Support: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2SUPPORT_H 11 | #define EIGEN2SUPPORT_H 12 | 13 | #if (!defined(EIGEN2_SUPPORT)) || (!defined(EIGEN_CORE_H)) 14 | #error Eigen2 support must be enabled by defining EIGEN2_SUPPORT before including any Eigen header 15 | #endif 16 | 17 | #ifndef EIGEN_NO_EIGEN2_DEPRECATED_WARNING 18 | 19 | #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__) 20 | #warning "Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)" 21 | #else 22 | #pragma message ("Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)") 23 | #endif 24 | 25 | #endif // EIGEN_NO_EIGEN2_DEPRECATED_WARNING 26 | 27 | #include "src/Core/util/DisableStupidWarnings.h" 28 | 29 | /** \ingroup Support_modules 30 | * \defgroup Eigen2Support_Module Eigen2 support module 31 | * 32 | * \warning Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. 33 | * 34 | * This module provides a couple of deprecated functions improving the compatibility with Eigen2. 35 | * 36 | * To use it, define EIGEN2_SUPPORT before including any Eigen header 37 | * \code 38 | * #define EIGEN2_SUPPORT 39 | * \endcode 40 | * 41 | */ 42 | 43 | #include "src/Eigen2Support/Macros.h" 44 | #include "src/Eigen2Support/Memory.h" 45 | #include "src/Eigen2Support/Meta.h" 46 | #include "src/Eigen2Support/Lazy.h" 47 | #include "src/Eigen2Support/Cwise.h" 48 | #include "src/Eigen2Support/CwiseOperators.h" 49 | #include "src/Eigen2Support/TriangularSolver.h" 50 | #include "src/Eigen2Support/Block.h" 51 | #include "src/Eigen2Support/VectorBlock.h" 52 | #include "src/Eigen2Support/Minor.h" 53 | #include "src/Eigen2Support/MathFunctions.h" 54 | 55 | 56 | #include "src/Core/util/ReenableStupidWarnings.h" 57 | 58 | // Eigen2 used to include iostream 59 | #include 60 | 61 | #define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \ 62 | using Eigen::Matrix##SizeSuffix##TypeSuffix; \ 63 | using Eigen::Vector##SizeSuffix##TypeSuffix; \ 64 | using Eigen::RowVector##SizeSuffix##TypeSuffix; 65 | 66 | #define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(TypeSuffix) \ 67 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ 68 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ 69 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ 70 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ 71 | 72 | #define EIGEN_USING_MATRIX_TYPEDEFS \ 73 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(i) \ 74 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(f) \ 75 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(d) \ 76 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cf) \ 77 | EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cd) 78 | 79 | #define USING_PART_OF_NAMESPACE_EIGEN \ 80 | EIGEN_USING_MATRIX_TYPEDEFS \ 81 | using Eigen::Matrix; \ 82 | using Eigen::MatrixBase; \ 83 | using Eigen::ei_random; \ 84 | using Eigen::ei_real; \ 85 | using Eigen::ei_imag; \ 86 | using Eigen::ei_conj; \ 87 | using Eigen::ei_abs; \ 88 | using Eigen::ei_abs2; \ 89 | using Eigen::ei_sqrt; \ 90 | using Eigen::ei_exp; \ 91 | using Eigen::ei_log; \ 92 | using Eigen::ei_sin; \ 93 | using Eigen::ei_cos; 94 | 95 | #endif // EIGEN2SUPPORT_H 96 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/writer/VTKWriter.cc: -------------------------------------------------------------------------------- 1 | //== INCLUDES ================================================================= 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | //=== NAMESPACES ============================================================== 14 | 15 | namespace OpenMesh { 16 | namespace IO { 17 | 18 | //=== INSTANTIATE ============================================================= 19 | 20 | _VTKWriter_ __VTKWriterinstance; 21 | _VTKWriter_& VTKWriter() { return __VTKWriterinstance; } 22 | 23 | //=== IMPLEMENTATION ========================================================== 24 | 25 | _VTKWriter_::_VTKWriter_() { IOManager().register_module(this); } 26 | 27 | //----------------------------------------------------------------------------- 28 | 29 | bool _VTKWriter_::write(const std::string& _filename, BaseExporter& _be, Options _opt, std::streamsize _precision) const 30 | { 31 | std::ofstream out(_filename.c_str()); 32 | 33 | if (!out) { 34 | omerr() << "[VTKWriter] : cannot open file " << _filename << std::endl; 35 | return false; 36 | } 37 | 38 | return write(out, _be, _opt, _precision); 39 | } 40 | 41 | //----------------------------------------------------------------------------- 42 | 43 | bool _VTKWriter_::write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const 44 | { 45 | Vec3f v, n; 46 | Vec2f t; 47 | VertexHandle vh; 48 | OpenMesh::Vec3f c; 49 | OpenMesh::Vec4f cA; 50 | 51 | // check exporter features 52 | if (!check(_be, _opt)) { 53 | return false; 54 | } 55 | 56 | // check writer features 57 | if (!_opt.is_empty()) { 58 | omlog() << "[VTKWriter] : writer does not support any options\n"; 59 | return false; 60 | } 61 | 62 | omlog() << "[VTKWriter] : write file\n"; 63 | _out.precision(_precision); 64 | 65 | std::vector vhandles; 66 | size_t polygon_table_size = 0; 67 | size_t nf = _be.n_faces(); 68 | for (size_t i = 0; i < nf; ++i) { 69 | polygon_table_size += _be.get_vhandles(FaceHandle(int(i)), vhandles); 70 | } 71 | polygon_table_size += nf; 72 | 73 | // header 74 | _out << "# vtk DataFile Version 3.0\n"; 75 | _out << "Generated by OpenMesh\n"; 76 | _out << "ASCII\n"; 77 | _out << "DATASET POLYDATA\n"; 78 | 79 | // points 80 | _out << "POINTS " << _be.n_vertices() << " float\n"; 81 | size_t nv = _be.n_vertices(); 82 | for (size_t i = 0; i < nv; ++i) { 83 | Vec3f v = _be.point(VertexHandle(int(i))); 84 | _out << v[0] << ' ' << v[1] << ' ' << v[2] << std::endl; 85 | } 86 | 87 | // faces 88 | _out << "POLYGONS " << nf << ' ' << polygon_table_size << std::endl; 89 | for (size_t i = 0; i < nf; ++i) { 90 | _be.get_vhandles(FaceHandle(int(i)), vhandles); 91 | 92 | _out << vhandles.size() << ' '; 93 | for (size_t j = 0; j < vhandles.size(); ++j) { 94 | _out << " " << vhandles[j].idx(); 95 | } 96 | _out << std::endl; 97 | } 98 | 99 | return true; 100 | } 101 | 102 | //============================================================================= 103 | } // namespace IO 104 | } // namespace OpenMesh 105 | //============================================================================= 106 | -------------------------------------------------------------------------------- /src/Eigen/src/SparseCore/SparseDot.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_DOT_H 11 | #define EIGEN_SPARSE_DOT_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | typename internal::traits::Scalar 18 | SparseMatrixBase::dot(const MatrixBase& other) const 19 | { 20 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 21 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) 22 | EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) 23 | EIGEN_STATIC_ASSERT((internal::is_same::value), 24 | YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 25 | 26 | eigen_assert(size() == other.size()); 27 | eigen_assert(other.size()>0 && "you are using a non initialized vector"); 28 | 29 | typename Derived::InnerIterator i(derived(),0); 30 | Scalar res(0); 31 | while (i) 32 | { 33 | res += numext::conj(i.value()) * other.coeff(i.index()); 34 | ++i; 35 | } 36 | return res; 37 | } 38 | 39 | template 40 | template 41 | typename internal::traits::Scalar 42 | SparseMatrixBase::dot(const SparseMatrixBase& other) const 43 | { 44 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) 45 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) 46 | EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) 47 | EIGEN_STATIC_ASSERT((internal::is_same::value), 48 | YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 49 | 50 | eigen_assert(size() == other.size()); 51 | 52 | typedef typename Derived::Nested Nested; 53 | typedef typename OtherDerived::Nested OtherNested; 54 | typedef typename internal::remove_all::type NestedCleaned; 55 | typedef typename internal::remove_all::type OtherNestedCleaned; 56 | 57 | Nested nthis(derived()); 58 | OtherNested nother(other.derived()); 59 | 60 | typename NestedCleaned::InnerIterator i(nthis,0); 61 | typename OtherNestedCleaned::InnerIterator j(nother,0); 62 | Scalar res(0); 63 | while (i && j) 64 | { 65 | if (i.index()==j.index()) 66 | { 67 | res += numext::conj(i.value()) * j.value(); 68 | ++i; ++j; 69 | } 70 | else if (i.index() 79 | inline typename NumTraits::Scalar>::Real 80 | SparseMatrixBase::squaredNorm() const 81 | { 82 | return numext::real((*this).cwiseAbs2().sum()); 83 | } 84 | 85 | template 86 | inline typename NumTraits::Scalar>::Real 87 | SparseMatrixBase::norm() const 88 | { 89 | using std::sqrt; 90 | return sqrt(squaredNorm()); 91 | } 92 | 93 | template 94 | inline typename NumTraits::Scalar>::Real 95 | SparseMatrixBase::blueNorm() const 96 | { 97 | return internal::blueNorm_impl(*this); 98 | } 99 | } // end namespace Eigen 100 | 101 | #endif // EIGEN_SPARSE_DOT_H 102 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/NestByValue.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_NESTBYVALUE_H 12 | #define EIGEN_NESTBYVALUE_H 13 | 14 | namespace Eigen { 15 | 16 | /** \class NestByValue 17 | * \ingroup Core_Module 18 | * 19 | * \brief Expression which must be nested by value 20 | * 21 | * \param ExpressionType the type of the object of which we are requiring nesting-by-value 22 | * 23 | * This class is the return type of MatrixBase::nestByValue() 24 | * and most of the time this is the only way it is used. 25 | * 26 | * \sa MatrixBase::nestByValue() 27 | */ 28 | 29 | namespace internal { 30 | template 31 | struct traits > : public traits 32 | {}; 33 | } 34 | 35 | template class NestByValue 36 | : public internal::dense_xpr_base< NestByValue >::type 37 | { 38 | public: 39 | 40 | typedef typename internal::dense_xpr_base::type Base; 41 | EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue) 42 | 43 | inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} 44 | 45 | inline Index rows() const { return m_expression.rows(); } 46 | inline Index cols() const { return m_expression.cols(); } 47 | inline Index outerStride() const { return m_expression.outerStride(); } 48 | inline Index innerStride() const { return m_expression.innerStride(); } 49 | 50 | inline const CoeffReturnType coeff(Index row, Index col) const 51 | { 52 | return m_expression.coeff(row, col); 53 | } 54 | 55 | inline Scalar& coeffRef(Index row, Index col) 56 | { 57 | return m_expression.const_cast_derived().coeffRef(row, col); 58 | } 59 | 60 | inline const CoeffReturnType coeff(Index index) const 61 | { 62 | return m_expression.coeff(index); 63 | } 64 | 65 | inline Scalar& coeffRef(Index index) 66 | { 67 | return m_expression.const_cast_derived().coeffRef(index); 68 | } 69 | 70 | template 71 | inline const PacketScalar packet(Index row, Index col) const 72 | { 73 | return m_expression.template packet(row, col); 74 | } 75 | 76 | template 77 | inline void writePacket(Index row, Index col, const PacketScalar& x) 78 | { 79 | m_expression.const_cast_derived().template writePacket(row, col, x); 80 | } 81 | 82 | template 83 | inline const PacketScalar packet(Index index) const 84 | { 85 | return m_expression.template packet(index); 86 | } 87 | 88 | template 89 | inline void writePacket(Index index, const PacketScalar& x) 90 | { 91 | m_expression.const_cast_derived().template writePacket(index, x); 92 | } 93 | 94 | operator const ExpressionType&() const { return m_expression; } 95 | 96 | protected: 97 | const ExpressionType m_expression; 98 | }; 99 | 100 | /** \returns an expression of the temporary version of *this. 101 | */ 102 | template 103 | inline const NestByValue 104 | DenseBase::nestByValue() const 105 | { 106 | return NestByValue(derived()); 107 | } 108 | 109 | } // end namespace Eigen 110 | 111 | #endif // EIGEN_NESTBYVALUE_H 112 | -------------------------------------------------------------------------------- /src/Eigen/src/Core/VectorBlock.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_VECTORBLOCK_H 12 | #define EIGEN_VECTORBLOCK_H 13 | 14 | namespace Eigen { 15 | 16 | /** \class VectorBlock 17 | * \ingroup Core_Module 18 | * 19 | * \brief Expression of a fixed-size or dynamic-size sub-vector 20 | * 21 | * \param VectorType the type of the object in which we are taking a sub-vector 22 | * \param Size size of the sub-vector we are taking at compile time (optional) 23 | * 24 | * This class represents an expression of either a fixed-size or dynamic-size sub-vector. 25 | * It is the return type of DenseBase::segment(Index,Index) and DenseBase::segment(Index) and 26 | * most of the time this is the only way it is used. 27 | * 28 | * However, if you want to directly maniputate sub-vector expressions, 29 | * for instance if you want to write a function returning such an expression, you 30 | * will need to use this class. 31 | * 32 | * Here is an example illustrating the dynamic case: 33 | * \include class_VectorBlock.cpp 34 | * Output: \verbinclude class_VectorBlock.out 35 | * 36 | * \note Even though this expression has dynamic size, in the case where \a VectorType 37 | * has fixed size, this expression inherits a fixed maximal size which means that evaluating 38 | * it does not cause a dynamic memory allocation. 39 | * 40 | * Here is an example illustrating the fixed-size case: 41 | * \include class_FixedVectorBlock.cpp 42 | * Output: \verbinclude class_FixedVectorBlock.out 43 | * 44 | * \sa class Block, DenseBase::segment(Index,Index,Index,Index), DenseBase::segment(Index,Index) 45 | */ 46 | 47 | namespace internal { 48 | template 49 | struct traits > 50 | : public traits::Flags & RowMajorBit ? 1 : Size, 52 | traits::Flags & RowMajorBit ? Size : 1> > 53 | { 54 | }; 55 | } 56 | 57 | template class VectorBlock 58 | : public Block::Flags & RowMajorBit ? 1 : Size, 60 | internal::traits::Flags & RowMajorBit ? Size : 1> 61 | { 62 | typedef Block::Flags & RowMajorBit ? 1 : Size, 64 | internal::traits::Flags & RowMajorBit ? Size : 1> Base; 65 | enum { 66 | IsColVector = !(internal::traits::Flags & RowMajorBit) 67 | }; 68 | public: 69 | EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock) 70 | 71 | using Base::operator=; 72 | 73 | /** Dynamic-size constructor 74 | */ 75 | inline VectorBlock(VectorType& vector, Index start, Index size) 76 | : Base(vector, 77 | IsColVector ? start : 0, IsColVector ? 0 : start, 78 | IsColVector ? size : 1, IsColVector ? 1 : size) 79 | { 80 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock); 81 | } 82 | 83 | /** Fixed-size constructor 84 | */ 85 | inline VectorBlock(VectorType& vector, Index start) 86 | : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start) 87 | { 88 | EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock); 89 | } 90 | }; 91 | 92 | 93 | } // end namespace Eigen 94 | 95 | #endif // EIGEN_VECTORBLOCK_H 96 | -------------------------------------------------------------------------------- /src/Eigen/src/LU/PartialPivLU_MKL.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of Intel Corporation nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ******************************************************************************** 28 | * Content : Eigen bindings to Intel(R) MKL 29 | * LU decomposition with partial pivoting based on LAPACKE_?getrf function. 30 | ******************************************************************************** 31 | */ 32 | 33 | #ifndef EIGEN_PARTIALLU_LAPACK_H 34 | #define EIGEN_PARTIALLU_LAPACK_H 35 | 36 | #include "Eigen/src/Core/util/MKL_support.h" 37 | 38 | namespace Eigen { 39 | 40 | namespace internal { 41 | 42 | /** \internal Specialization for the data types supported by MKL */ 43 | 44 | #define EIGEN_MKL_LU_PARTPIV(EIGTYPE, MKLTYPE, MKLPREFIX) \ 45 | template \ 46 | struct partial_lu_impl \ 47 | { \ 48 | /* \internal performs the LU decomposition in-place of the matrix represented */ \ 49 | static lapack_int blocked_lu(lapack_int rows, lapack_int cols, EIGTYPE* lu_data, lapack_int luStride, lapack_int* row_transpositions, lapack_int& nb_transpositions, lapack_int maxBlockSize=256) \ 50 | { \ 51 | EIGEN_UNUSED_VARIABLE(maxBlockSize);\ 52 | lapack_int matrix_order, first_zero_pivot; \ 53 | lapack_int m, n, lda, *ipiv, info; \ 54 | EIGTYPE* a; \ 55 | /* Set up parameters for ?getrf */ \ 56 | matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ 57 | lda = luStride; \ 58 | a = lu_data; \ 59 | ipiv = row_transpositions; \ 60 | m = rows; \ 61 | n = cols; \ 62 | nb_transpositions = 0; \ 63 | \ 64 | info = LAPACKE_##MKLPREFIX##getrf( matrix_order, m, n, (MKLTYPE*)a, lda, ipiv ); \ 65 | \ 66 | for(int i=0;i= 0); \ 69 | /* something should be done with nb_transpositions */ \ 70 | \ 71 | first_zero_pivot = info; \ 72 | return first_zero_pivot; \ 73 | } \ 74 | }; 75 | 76 | EIGEN_MKL_LU_PARTPIV(double, double, d) 77 | EIGEN_MKL_LU_PARTPIV(float, float, s) 78 | EIGEN_MKL_LU_PARTPIV(dcomplex, MKL_Complex16, z) 79 | EIGEN_MKL_LU_PARTPIV(scomplex, MKL_Complex8, c) 80 | 81 | } // end namespace internal 82 | 83 | } // end namespace Eigen 84 | 85 | #endif // EIGEN_PARTIALLU_LAPACK_H 86 | --------------------------------------------------------------------------------