├── .gitignore ├── CMakeLists.txt ├── CMakeSettings.json ├── LICENSE ├── ModelDraw.cpp ├── ModelDraw.h ├── NurbsSDK ├── AutoGeoCreate.cpp ├── AutoGeoCreate.h ├── Basis.cpp ├── Basis.h ├── Curve.cpp ├── Curve.h ├── FileUtil.cpp ├── FileUtil.h ├── Geo.h ├── Model │ ├── H1.xml │ ├── circle(1).xml │ ├── circle(2).xml │ ├── curve (2).xml │ ├── egg1.xml │ ├── g_plus_s_surf1.xml │ ├── hand1.xml │ ├── konglong1.xml │ ├── surface.xml │ ├── surface1.xml │ ├── teapot1.xml │ └── terrific1.xml ├── MultiGeo.cpp ├── MultiGeo.h ├── Surface.cpp ├── Surface.h ├── Volume.cpp ├── Volume.h └── tinyXML │ ├── tinystr.cpp │ ├── tinystr.h │ ├── tinyxml.cpp │ ├── tinyxml.h │ ├── tinyxmlerror.cpp │ └── tinyxmlparser.cpp ├── PrintInfo.cpp ├── PrintInfo.h ├── README.md ├── Resources ├── 3Dmesh.png ├── 6610 - View.png ├── Configuration.png ├── Delete.png ├── Document.png ├── File.png ├── Move.png ├── Setting.png ├── View-disable.png ├── _Manage.png ├── arrow_click_cursor_pointer_icon (1).png ├── arrow_click_cursor_pointer_icon .png ├── arrow_click_cursor_pointer_icon.png ├── begin.jpg ├── clear.png ├── colorPoint.png ├── coord-disable.png ├── facefill.png ├── file_export_icon.png ├── file_import_icon.png ├── iGameLab.png ├── iGameLogo.png ├── icon (1).ico ├── icon (1).png ├── icon (10).png ├── icon (11).png ├── icon (12).png ├── icon (2).png ├── icon (3).png ├── icon (4).png ├── icon (5).png ├── icon (6).png ├── icon (7).png ├── icon (8).png ├── icon (9).png ├── import1.png ├── import2.png ├── knife_cutter_cut_cutlery_cutting_icon.png ├── mesh.png ├── point.png ├── 三维曲面图.png ├── 填充颜色.png ├── 清空.png ├── 点.png ├── 离散.png ├── 线性-导入 (1).png ├── 线性-导入.png ├── 网格-disable.png └── 网格.png ├── TinyVector.h ├── Turbine_Blade.qrc ├── Turbine_Blade.ui ├── ViewOpenGL.cpp ├── ViewOpenGL.h ├── color.frag ├── color.vert ├── extern ├── Eigen │ ├── CMakeLists.txt │ ├── Cholesky │ ├── CholmodSupport │ ├── Core │ ├── Dense │ ├── Eigen │ ├── Eigenvalues │ ├── Geometry │ ├── Householder │ ├── IterativeLinearSolvers │ ├── Jacobi │ ├── LU │ ├── MetisSupport │ ├── OrderingMethods │ ├── PaStiXSupport │ ├── PardisoSupport │ ├── QR │ ├── QtAlignedMalloc │ ├── SPQRSupport │ ├── SVD │ ├── Sparse │ ├── SparseCholesky │ ├── SparseCore │ ├── SparseLU │ ├── SparseQR │ ├── StdDeque │ ├── StdList │ ├── StdVector │ ├── SuperLUSupport │ ├── UmfPackSupport │ └── src │ │ ├── Cholesky │ │ ├── LDLT.h │ │ ├── LLT.h │ │ └── LLT_LAPACKE.h │ │ ├── CholmodSupport │ │ └── CholmodSupport.h │ │ ├── Core │ │ ├── Array.h │ │ ├── ArrayBase.h │ │ ├── ArrayWrapper.h │ │ ├── Assign.h │ │ ├── AssignEvaluator.h │ │ ├── Assign_MKL.h │ │ ├── BandMatrix.h │ │ ├── Block.h │ │ ├── BooleanRedux.h │ │ ├── CommaInitializer.h │ │ ├── ConditionEstimator.h │ │ ├── CoreEvaluators.h │ │ ├── CoreIterators.h │ │ ├── CwiseBinaryOp.h │ │ ├── CwiseNullaryOp.h │ │ ├── CwiseTernaryOp.h │ │ ├── CwiseUnaryOp.h │ │ ├── CwiseUnaryView.h │ │ ├── DenseBase.h │ │ ├── DenseCoeffsBase.h │ │ ├── DenseStorage.h │ │ ├── Diagonal.h │ │ ├── DiagonalMatrix.h │ │ ├── DiagonalProduct.h │ │ ├── Dot.h │ │ ├── EigenBase.h │ │ ├── ForceAlignedAccess.h │ │ ├── Fuzzy.h │ │ ├── GeneralProduct.h │ │ ├── GenericPacketMath.h │ │ ├── GlobalFunctions.h │ │ ├── IO.h │ │ ├── Inverse.h │ │ ├── Map.h │ │ ├── MapBase.h │ │ ├── MathFunctions.h │ │ ├── MathFunctionsImpl.h │ │ ├── Matrix.h │ │ ├── MatrixBase.h │ │ ├── NestByValue.h │ │ ├── NoAlias.h │ │ ├── NumTraits.h │ │ ├── PermutationMatrix.h │ │ ├── PlainObjectBase.h │ │ ├── Product.h │ │ ├── ProductEvaluators.h │ │ ├── Random.h │ │ ├── Redux.h │ │ ├── Ref.h │ │ ├── Replicate.h │ │ ├── ReturnByValue.h │ │ ├── Reverse.h │ │ ├── Select.h │ │ ├── SelfAdjointView.h │ │ ├── SelfCwiseBinaryOp.h │ │ ├── Solve.h │ │ ├── SolveTriangular.h │ │ ├── SolverBase.h │ │ ├── StableNorm.h │ │ ├── Stride.h │ │ ├── Swap.h │ │ ├── Transpose.h │ │ ├── Transpositions.h │ │ ├── TriangularMatrix.h │ │ ├── VectorBlock.h │ │ ├── VectorwiseOp.h │ │ ├── Visitor.h │ │ ├── arch │ │ │ ├── AVX │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ └── TypeCasting.h │ │ │ ├── AVX512 │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── AltiVec │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── CUDA │ │ │ │ ├── Complex.h │ │ │ │ ├── Half.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ ├── PacketMathHalf.h │ │ │ │ └── TypeCasting.h │ │ │ ├── Default │ │ │ │ └── Settings.h │ │ │ ├── NEON │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── SSE │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ └── TypeCasting.h │ │ │ └── ZVector │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ ├── functors │ │ │ ├── AssignmentFunctors.h │ │ │ ├── BinaryFunctors.h │ │ │ ├── NullaryFunctors.h │ │ │ ├── StlFunctors.h │ │ │ ├── TernaryFunctors.h │ │ │ └── UnaryFunctors.h │ │ ├── products │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ ├── GeneralMatrixMatrix.h │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ ├── GeneralMatrixVector.h │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ ├── Parallelizer.h │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ ├── SelfadjointMatrixVector.h │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ ├── SelfadjointProduct.h │ │ │ ├── SelfadjointRank2Update.h │ │ │ ├── TriangularMatrixMatrix.h │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ ├── TriangularMatrixVector.h │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ ├── TriangularSolverMatrix.h │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ └── TriangularSolverVector.h │ │ └── util │ │ │ ├── BlasUtil.h │ │ │ ├── Constants.h │ │ │ ├── DisableStupidWarnings.h │ │ │ ├── ForwardDeclarations.h │ │ │ ├── MKL_support.h │ │ │ ├── Macros.h │ │ │ ├── Memory.h │ │ │ ├── Meta.h │ │ │ ├── NonMPL2.h │ │ │ ├── ReenableStupidWarnings.h │ │ │ ├── StaticAssert.h │ │ │ └── XprHelper.h │ │ ├── Eigenvalues │ │ ├── ComplexEigenSolver.h │ │ ├── ComplexSchur.h │ │ ├── ComplexSchur_LAPACKE.h │ │ ├── EigenSolver.h │ │ ├── GeneralizedEigenSolver.h │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ ├── HessenbergDecomposition.h │ │ ├── MatrixBaseEigenvalues.h │ │ ├── RealQZ.h │ │ ├── RealSchur.h │ │ ├── RealSchur_LAPACKE.h │ │ ├── SelfAdjointEigenSolver.h │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ └── Tridiagonalization.h │ │ ├── Geometry │ │ ├── AlignedBox.h │ │ ├── AngleAxis.h │ │ ├── EulerAngles.h │ │ ├── Homogeneous.h │ │ ├── Hyperplane.h │ │ ├── OrthoMethods.h │ │ ├── ParametrizedLine.h │ │ ├── Quaternion.h │ │ ├── Rotation2D.h │ │ ├── RotationBase.h │ │ ├── Scaling.h │ │ ├── Transform.h │ │ ├── Translation.h │ │ ├── Umeyama.h │ │ └── arch │ │ │ └── Geometry_SSE.h │ │ ├── Householder │ │ ├── BlockHouseholder.h │ │ ├── Householder.h │ │ └── HouseholderSequence.h │ │ ├── IterativeLinearSolvers │ │ ├── BasicPreconditioners.h │ │ ├── BiCGSTAB.h │ │ ├── ConjugateGradient.h │ │ ├── IncompleteCholesky.h │ │ ├── IncompleteLUT.h │ │ ├── IterativeSolverBase.h │ │ ├── LeastSquareConjugateGradient.h │ │ └── SolveWithGuess.h │ │ ├── Jacobi │ │ └── Jacobi.h │ │ ├── LU │ │ ├── Determinant.h │ │ ├── FullPivLU.h │ │ ├── InverseImpl.h │ │ ├── PartialPivLU.h │ │ ├── PartialPivLU_LAPACKE.h │ │ └── arch │ │ │ └── Inverse_SSE.h │ │ ├── MetisSupport │ │ └── MetisSupport.h │ │ ├── OrderingMethods │ │ ├── Amd.h │ │ ├── Eigen_Colamd.h │ │ └── Ordering.h │ │ ├── PaStiXSupport │ │ └── PaStiXSupport.h │ │ ├── PardisoSupport │ │ └── PardisoSupport.h │ │ ├── QR │ │ ├── ColPivHouseholderQR.h │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ ├── CompleteOrthogonalDecomposition.h │ │ ├── FullPivHouseholderQR.h │ │ ├── HouseholderQR.h │ │ └── HouseholderQR_LAPACKE.h │ │ ├── SPQRSupport │ │ └── SuiteSparseQRSupport.h │ │ ├── SVD │ │ ├── BDCSVD.h │ │ ├── JacobiSVD.h │ │ ├── JacobiSVD_LAPACKE.h │ │ ├── SVDBase.h │ │ └── UpperBidiagonalization.h │ │ ├── SparseCholesky │ │ ├── SimplicialCholesky.h │ │ └── SimplicialCholesky_impl.h │ │ ├── SparseCore │ │ ├── AmbiVector.h │ │ ├── CompressedStorage.h │ │ ├── ConservativeSparseSparseProduct.h │ │ ├── MappedSparseMatrix.h │ │ ├── SparseAssign.h │ │ ├── SparseBlock.h │ │ ├── SparseColEtree.h │ │ ├── SparseCompressedBase.h │ │ ├── SparseCwiseBinaryOp.h │ │ ├── SparseCwiseUnaryOp.h │ │ ├── SparseDenseProduct.h │ │ ├── SparseDiagonalProduct.h │ │ ├── SparseDot.h │ │ ├── SparseFuzzy.h │ │ ├── SparseMap.h │ │ ├── SparseMatrix.h │ │ ├── SparseMatrixBase.h │ │ ├── SparsePermutation.h │ │ ├── SparseProduct.h │ │ ├── SparseRedux.h │ │ ├── SparseRef.h │ │ ├── SparseSelfAdjointView.h │ │ ├── SparseSolverBase.h │ │ ├── SparseSparseProductWithPruning.h │ │ ├── SparseTranspose.h │ │ ├── SparseTriangularView.h │ │ ├── SparseUtil.h │ │ ├── SparseVector.h │ │ ├── SparseView.h │ │ └── TriangularSolver.h │ │ ├── SparseLU │ │ ├── SparseLU.h │ │ ├── SparseLUImpl.h │ │ ├── SparseLU_Memory.h │ │ ├── SparseLU_Structs.h │ │ ├── SparseLU_SupernodalMatrix.h │ │ ├── SparseLU_Utils.h │ │ ├── SparseLU_column_bmod.h │ │ ├── SparseLU_column_dfs.h │ │ ├── SparseLU_copy_to_ucol.h │ │ ├── SparseLU_gemm_kernel.h │ │ ├── SparseLU_heap_relax_snode.h │ │ ├── SparseLU_kernel_bmod.h │ │ ├── SparseLU_panel_bmod.h │ │ ├── SparseLU_panel_dfs.h │ │ ├── SparseLU_pivotL.h │ │ ├── SparseLU_pruneL.h │ │ └── SparseLU_relax_snode.h │ │ ├── SparseQR │ │ └── SparseQR.h │ │ ├── StlSupport │ │ ├── StdDeque.h │ │ ├── StdList.h │ │ ├── StdVector.h │ │ └── details.h │ │ ├── SuperLUSupport │ │ └── SuperLUSupport.h │ │ ├── UmfPackSupport │ │ └── UmfPackSupport.h │ │ ├── misc │ │ ├── Image.h │ │ ├── Kernel.h │ │ ├── RealSvd2x2.h │ │ ├── blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ └── lapacke_mangling.h │ │ └── plugins │ │ ├── ArrayCwiseBinaryOps.h │ │ ├── ArrayCwiseUnaryOps.h │ │ ├── BlockMethods.h │ │ ├── CommonCwiseBinaryOps.h │ │ ├── CommonCwiseUnaryOps.h │ │ ├── MatrixCwiseBinaryOps.h │ │ └── MatrixCwiseUnaryOps.h ├── GLUT │ ├── include │ │ └── glut.h │ └── lib │ │ ├── glut.lib │ │ └── glut32.lib ├── include │ ├── DSU.cpp │ ├── DSU.h │ ├── GeometrySmallLib.h │ ├── stl_parser.h │ └── stl_write.hpp ├── lib │ ├── OpenMesh.lib │ └── lp_solve.lib ├── openmesh │ ├── OpenMeshCore.dll │ ├── OpenMeshCored.dll │ ├── OpenMeshTools.dll │ ├── OpenMeshToolsd.dll │ ├── include │ │ └── OpenMesh │ │ │ ├── Core │ │ │ ├── Geometry │ │ │ │ ├── Config.hh │ │ │ │ ├── EigenVectorT.hh │ │ │ │ ├── LoopSchemeMaskT.hh │ │ │ │ ├── MathDefs.hh │ │ │ │ ├── NormalConeT.hh │ │ │ │ ├── NormalConeT_impl.hh │ │ │ │ ├── Plane3d.hh │ │ │ │ ├── QuadricT.hh │ │ │ │ ├── Vector11T.hh │ │ │ │ ├── VectorT.hh │ │ │ │ └── VectorT_inc.hh │ │ │ ├── IO │ │ │ │ ├── BinaryHelper.hh │ │ │ │ ├── IOInstances.hh │ │ │ │ ├── IOManager.hh │ │ │ │ ├── MeshIO.hh │ │ │ │ ├── OFFFormat.hh │ │ │ │ ├── OMFormat.hh │ │ │ │ ├── OMFormatT_impl.hh │ │ │ │ ├── Options.hh │ │ │ │ ├── SR_binary.hh │ │ │ │ ├── SR_binary_spec.hh │ │ │ │ ├── SR_binary_vector_of_bool.inl │ │ │ │ ├── SR_binary_vector_of_fundamentals.inl │ │ │ │ ├── SR_binary_vector_of_string.inl │ │ │ │ ├── SR_rbo.hh │ │ │ │ ├── SR_store.hh │ │ │ │ ├── SR_types.hh │ │ │ │ ├── StoreRestore.hh │ │ │ │ ├── exporter │ │ │ │ │ ├── BaseExporter.hh │ │ │ │ │ └── ExporterT.hh │ │ │ │ ├── importer │ │ │ │ │ ├── BaseImporter.hh │ │ │ │ │ └── ImporterT.hh │ │ │ │ ├── reader │ │ │ │ │ ├── BaseReader.hh │ │ │ │ │ ├── OBJReader.hh │ │ │ │ │ ├── OFFReader.hh │ │ │ │ │ ├── OMReader.hh │ │ │ │ │ ├── PLYReader.hh │ │ │ │ │ └── STLReader.hh │ │ │ │ └── writer │ │ │ │ │ ├── BaseWriter.hh │ │ │ │ │ ├── OBJWriter.hh │ │ │ │ │ ├── OFFWriter.hh │ │ │ │ │ ├── OMWriter.hh │ │ │ │ │ ├── PLYWriter.hh │ │ │ │ │ ├── STLWriter.hh │ │ │ │ │ └── VTKWriter.hh │ │ │ ├── Mesh │ │ │ │ ├── ArrayItems.hh │ │ │ │ ├── ArrayKernel.hh │ │ │ │ ├── ArrayKernelT_impl.hh │ │ │ │ ├── AttribKernelT.hh │ │ │ │ ├── Attributes.hh │ │ │ │ ├── BaseKernel.hh │ │ │ │ ├── BaseMesh.hh │ │ │ │ ├── Casts.hh │ │ │ │ ├── CirculatorsT.hh │ │ │ │ ├── FinalMeshItemsT.hh │ │ │ │ ├── Handles.hh │ │ │ │ ├── IteratorsT.hh │ │ │ │ ├── PolyConnectivity.hh │ │ │ │ ├── PolyMeshT.hh │ │ │ │ ├── PolyMeshT_impl.hh │ │ │ │ ├── PolyMesh_ArrayKernelT.hh │ │ │ │ ├── Status.hh │ │ │ │ ├── Tags.hh │ │ │ │ ├── Traits.hh │ │ │ │ ├── TriConnectivity.hh │ │ │ │ ├── TriMeshT.hh │ │ │ │ ├── TriMeshT_impl.hh │ │ │ │ ├── TriMesh_ArrayKernelT.hh │ │ │ │ └── gen │ │ │ │ │ ├── circulators_header.hh │ │ │ │ │ ├── circulators_template.hh │ │ │ │ │ ├── footer.hh │ │ │ │ │ ├── iterators_header.hh │ │ │ │ │ └── iterators_template.hh │ │ │ ├── System │ │ │ │ ├── OpenMeshDLLMacros.hh │ │ │ │ ├── compiler.hh │ │ │ │ ├── config.h │ │ │ │ ├── config.hh │ │ │ │ ├── mostream.hh │ │ │ │ └── omstream.hh │ │ │ └── Utils │ │ │ │ ├── AutoPropertyHandleT.hh │ │ │ │ ├── BaseProperty.hh │ │ │ │ ├── Endian.hh │ │ │ │ ├── GenProg.hh │ │ │ │ ├── HandleToPropHandle.hh │ │ │ │ ├── Noncopyable.hh │ │ │ │ ├── Property.hh │ │ │ │ ├── PropertyContainer.hh │ │ │ │ ├── PropertyManager.hh │ │ │ │ ├── RandomNumberGenerator.hh │ │ │ │ ├── SingletonT.hh │ │ │ │ ├── SingletonT_impl.hh │ │ │ │ ├── color_cast.hh │ │ │ │ ├── vector_cast.hh │ │ │ │ └── vector_traits.hh │ │ │ └── Tools │ │ │ ├── Decimater │ │ │ ├── BaseDecimaterT.hh │ │ │ ├── BaseDecimaterT_impl.hh │ │ │ ├── CollapseInfoT.hh │ │ │ ├── DecimaterT.hh │ │ │ ├── DecimaterT_impl.hh │ │ │ ├── McDecimaterT.hh │ │ │ ├── McDecimaterT_impl.hh │ │ │ ├── MixedDecimaterT.hh │ │ │ ├── MixedDecimaterT_impl.hh │ │ │ ├── ModAspectRatioT.hh │ │ │ ├── ModAspectRatioT_impl.hh │ │ │ ├── ModBaseT.hh │ │ │ ├── ModEdgeLengthT.hh │ │ │ ├── ModEdgeLengthT_impl.hh │ │ │ ├── ModHausdorffT.hh │ │ │ ├── ModHausdorffT_impl.hh │ │ │ ├── ModIndependentSetsT.hh │ │ │ ├── ModNormalDeviationT.hh │ │ │ ├── ModNormalFlippingT.hh │ │ │ ├── ModProgMeshT.hh │ │ │ ├── ModProgMeshT_impl.hh │ │ │ ├── ModQuadricT.hh │ │ │ ├── ModQuadricT_impl.hh │ │ │ ├── ModRoundnessT.hh │ │ │ └── Observer.hh │ │ │ ├── Dualizer │ │ │ └── meshDualT.hh │ │ │ ├── Kernel_OSG │ │ │ ├── ArrayKernelT.hh │ │ │ ├── AttribKernelT.hh │ │ │ ├── PropertyKernel.hh │ │ │ ├── PropertyT.hh │ │ │ ├── Traits.hh │ │ │ ├── TriMesh_OSGArrayKernelT.hh │ │ │ ├── VectorAdapter.hh │ │ │ ├── bindT.hh │ │ │ └── color_cast.hh │ │ │ ├── SmartTagger │ │ │ ├── SmartTaggerT.hh │ │ │ └── SmartTaggerT_impl.hh │ │ │ ├── Smoother │ │ │ ├── JacobiLaplaceSmootherT.hh │ │ │ ├── JacobiLaplaceSmootherT_impl.hh │ │ │ ├── LaplaceSmootherT.hh │ │ │ ├── LaplaceSmootherT_impl.hh │ │ │ ├── SmootherT.hh │ │ │ ├── SmootherT_impl.hh │ │ │ └── smooth_mesh.hh │ │ │ ├── Subdivider │ │ │ ├── Adaptive │ │ │ │ └── Composite │ │ │ │ │ ├── CompositeT.hh │ │ │ │ │ ├── CompositeT_impl.hh │ │ │ │ │ ├── CompositeTraits.hh │ │ │ │ │ ├── RuleInterfaceT.hh │ │ │ │ │ ├── RulesT.hh │ │ │ │ │ ├── RulesT_impl.hh │ │ │ │ │ └── Traits.hh │ │ │ └── Uniform │ │ │ │ ├── CatmullClarkT.hh │ │ │ │ ├── CatmullClarkT_impl.hh │ │ │ │ ├── Composite │ │ │ │ ├── CompositeT.hh │ │ │ │ ├── CompositeT_impl.hh │ │ │ │ └── CompositeTraits.hh │ │ │ │ ├── CompositeLoopT.hh │ │ │ │ ├── CompositeSqrt3T.hh │ │ │ │ ├── LongestEdgeT.hh │ │ │ │ ├── LoopT.hh │ │ │ │ ├── MidpointT.hh │ │ │ │ ├── ModifiedButterFlyT.hh │ │ │ │ ├── Sqrt3InterpolatingSubdividerLabsikGreinerT.hh │ │ │ │ ├── Sqrt3T.hh │ │ │ │ └── SubdividerT.hh │ │ │ ├── Utils │ │ │ ├── Config.hh │ │ │ ├── GLConstAsString.hh │ │ │ ├── Gnuplot.hh │ │ │ ├── HeapT.hh │ │ │ ├── MeshCheckerT.hh │ │ │ ├── MeshCheckerT_impl.hh │ │ │ ├── NumLimitsT.hh │ │ │ ├── StripifierT.hh │ │ │ ├── StripifierT_impl.hh │ │ │ ├── TestingFramework.hh │ │ │ ├── Timer.hh │ │ │ ├── conio.hh │ │ │ └── getopt.h │ │ │ └── VDPM │ │ │ ├── MeshTraits.hh │ │ │ ├── StreamingDef.hh │ │ │ ├── VFront.hh │ │ │ ├── VHierarchy.hh │ │ │ ├── VHierarchyNode.hh │ │ │ ├── VHierarchyNodeIndex.hh │ │ │ ├── VHierarchyWindow.hh │ │ │ └── ViewingParameters.hh │ └── lib │ │ ├── OpenMeshCore.lib │ │ ├── OpenMeshCored.lib │ │ ├── OpenMeshTools.lib │ │ └── OpenMeshToolsd.lib └── pmp │ ├── BoundingBox.h │ ├── Exceptions.h │ ├── MatVec.h │ ├── MemoryUsage.h │ ├── Properties.h │ ├── SurfaceMesh.cpp │ ├── SurfaceMesh.h │ ├── SurfaceMeshIO.cpp │ ├── SurfaceMeshIO.h │ ├── Timer.h │ ├── Types.h │ ├── algorithms │ ├── BarycentricCoordinates.h │ ├── CMakeLists.txt │ ├── DifferentialGeometry.cpp │ ├── DifferentialGeometry.h │ ├── DistancePointTriangle.cpp │ ├── DistancePointTriangle.h │ ├── Heap.h │ ├── NormalCone.h │ ├── Quadric.h │ ├── SurfaceCurvature.cpp │ ├── SurfaceCurvature.h │ ├── SurfaceFactory.cpp │ ├── SurfaceFactory.h │ ├── SurfaceFairing.cpp │ ├── SurfaceFairing.h │ ├── SurfaceFeatures.cpp │ ├── SurfaceFeatures.h │ ├── SurfaceGeodesic.cpp │ ├── SurfaceGeodesic.h │ ├── SurfaceHoleFilling.cpp │ ├── SurfaceHoleFilling.h │ ├── SurfaceNormals.cpp │ ├── SurfaceNormals.h │ ├── SurfaceParameterization.cpp │ ├── SurfaceParameterization.h │ ├── SurfaceRemeshing.cpp │ ├── SurfaceRemeshing.h │ ├── SurfaceSimplification.cpp │ ├── SurfaceSimplification.h │ ├── SurfaceSmoothing.cpp │ ├── SurfaceSmoothing.h │ ├── SurfaceSubdivision.cpp │ ├── SurfaceSubdivision.h │ ├── SurfaceTriangulation.cpp │ ├── SurfaceTriangulation.h │ ├── TriangleKdTree.cpp │ └── TriangleKdTree.h │ └── rply │ ├── CMakeLists.txt │ ├── LICENSE │ ├── etc │ ├── convert.c │ ├── dump.c │ ├── input.ply │ └── sconvert.c │ ├── manual │ ├── manual.html │ ├── reference.css │ └── rply.png │ ├── rply.c │ ├── rply.h │ └── rplyfile.h ├── iGame for Games302 安装使用指南.pdf ├── iGameMeshView.cpp ├── iGameMeshView.h ├── main.cpp └── psblack ├── add_bottom.png ├── add_left.png ├── add_right.png ├── add_top.png ├── branch_close.png ├── branch_open.png ├── calendar_nextmonth.png ├── calendar_prevmonth.png ├── checkbox_checked.png ├── checkbox_checked_disable.png ├── checkbox_parcial.png ├── checkbox_parcial_disable.png ├── checkbox_unchecked.png ├── checkbox_unchecked_disable.png ├── radiobutton_checked.png ├── radiobutton_checked_disable.png ├── radiobutton_unchecked.png └── radiobutton_unchecked_disable.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /cmake-build-debug-visual-studio/ 3 | /cmake-build-release-visual-studio/ 4 | /.idea/ 5 | /.vs/ 6 | /out/ 7 | /build/ -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "" 13 | }, 14 | { 15 | "name": "x64-Release", 16 | "generator": "Ninja", 17 | "configurationType": "Release", 18 | "buildRoot": "${projectDir}\\out\\build\\${name}", 19 | "installRoot": "${projectDir}\\out\\install\\${name}", 20 | "cmakeCommandArgs": "", 21 | "buildCommandArgs": "", 22 | "ctestCommandArgs": "", 23 | "inheritEnvironments": [ "msvc_x64_x64" ], 24 | "variables": [] 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 iGame-Lab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NurbsSDK/AutoGeoCreate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/AutoGeoCreate.h -------------------------------------------------------------------------------- /NurbsSDK/Basis.cpp: -------------------------------------------------------------------------------- 1 | #include "Basis.h" 2 | 3 | 4 | Basis::Basis(int degree, const std::vector& knots) 5 | { 6 | m_Degree = degree; 7 | m_Knots = knots; 8 | } 9 | 10 | 11 | int Basis::findSpan(double u) const 12 | { 13 | int n = m_Knots.size() - 1 - m_Degree - 1; 14 | int low = m_Degree, high = n + 1; 15 | int middle = (low + high) / 2; 16 | 17 | if (u >= m_Knots[n + 1]) return n; 18 | if (u < m_Knots[m_Degree]) return m_Degree; 19 | 20 | while (u < m_Knots[middle] || u >= m_Knots[middle + 1]) 21 | { 22 | if (u < m_Knots[middle]) 23 | high = middle; 24 | else 25 | low = middle; 26 | middle = (low + high) / 2; 27 | } 28 | return middle; 29 | } 30 | 31 | void Basis::getAllNurbsBasisFuns(int i, double u, std::vector& N) const 32 | { 33 | int j, r; // N_{j,r} 34 | double saved, temp; 35 | std::vector left(m_Degree + 1), right(m_Degree + 1); 36 | 37 | N[0] = 1.0; 38 | for (j = 1; j <= m_Degree; j++) 39 | { 40 | left[j] = u - m_Knots[i + 1 - j]; 41 | right[j] = m_Knots[i + j] - u; 42 | saved = 0.0; 43 | for (r = 0; r < j; r++) 44 | { 45 | temp = N[r] / (right[r + 1] + left[j - r]); 46 | N[r] = saved + right[r + 1] * temp; 47 | saved = left[j - r] * temp; 48 | } 49 | N[j] = saved; 50 | } 51 | } 52 | 53 | void Basis::getAllNurbsBasisFunsDers(int i, double u,int nd, std::vector>& ders) const 54 | { 55 | int j, r, k, s1, s2, rk, pk, j1, j2; 56 | double saved, temp, d; 57 | std::vector left(m_Degree + 1), right(m_Degree + 1); 58 | std::vector> ndu(m_Degree + 1, std::vector(m_Degree + 1)); 59 | std::vector> a(m_Degree + 1, std::vector(m_Degree + 1)); 60 | 61 | ndu[0][0] = 1.0; 62 | for (j = 1; j <= m_Degree; j++) 63 | { 64 | left[j] = u - m_Knots[i + 1 - j]; 65 | right[j] = m_Knots[i + j] - u; 66 | saved = 0.0; 67 | for (r = 0; r < j; r++) 68 | { 69 | ndu[j][r] = right[r + 1] + left[j - r]; 70 | temp = ndu[r][j - 1] / ndu[j][r]; 71 | ndu[r][j] = saved + right[r + 1] * temp; 72 | saved = left[j - r] * temp; 73 | } 74 | ndu[j][j] = saved; 75 | } 76 | 77 | for (j = 0; j <= m_Degree; j++) 78 | ders[0][j] = ndu[j][m_Degree]; 79 | 80 | for (r = 0; r <= m_Degree; r++) 81 | { 82 | s1 = 0; s2 = 1; 83 | a[0][0] = 1.0; 84 | 85 | for (k = 1; k <= nd; k++) 86 | { 87 | d = 0.0; 88 | rk = r - k; 89 | pk = m_Degree - k; 90 | if (r >= k) 91 | { 92 | a[s2][0] = a[s1][0] / ndu[pk + 1][rk]; 93 | d = a[s2][0] * ndu[rk][pk]; 94 | } 95 | if (rk >= -1) j1 = 1; 96 | else j1 = -rk; 97 | if (r - 1 <= pk) j2 = k - 1; 98 | else j2 = m_Degree - r; 99 | 100 | for (j = j1; j <= j2; j++) 101 | { 102 | a[s2][j] = (a[s1][j] - a[s1][j - 1]) / ndu[pk + 1][rk + j]; 103 | d += a[s2][j] * ndu[rk + j][pk]; 104 | } 105 | 106 | if (r <= pk) 107 | { 108 | a[s2][k] = -a[s1][k - 1] / ndu[pk + 1][r]; 109 | d += a[s2][k] * ndu[r][pk]; 110 | } 111 | ders[k][r] = d; 112 | j = s1; s1 = s2; s2 = j; 113 | } 114 | } 115 | 116 | r = m_Degree; 117 | for (k = 1; k <= nd; k++) 118 | { 119 | for (j = 0; j <= m_Degree; j++) 120 | ders[k][j] *= r; 121 | r *= (m_Degree - k); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /NurbsSDK/Basis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/Basis.h -------------------------------------------------------------------------------- /NurbsSDK/Curve.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/Curve.h -------------------------------------------------------------------------------- /NurbsSDK/FileUtil.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/FileUtil.cpp -------------------------------------------------------------------------------- /NurbsSDK/FileUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include"MultiGeo.h" 3 | #include"tinyXMl/tinyxml.h" 4 | #include 5 | #include 6 | class FileUtil { 7 | public: 8 | FileUtil(){} 9 | 10 | FileUtil(const std::string filename, MultiGeo& geometry); 11 | 12 | static void readFileXml(const std::string filename, MultiGeo& geometry); 13 | 14 | static void saveFileXml(const std::string filename, MultiGeo& Geo); 15 | 16 | 17 | }; -------------------------------------------------------------------------------- /NurbsSDK/Geo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/Geo.h -------------------------------------------------------------------------------- /NurbsSDK/Model/circle(1).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2 4 | 9 5 | 0 0 0 0.25 0.25 0.5 0.5 0.75 0.75 1 1 1 6 | 1 0.707 1 0.707 1 0.707 1 0.707 1 7 | 8 | 1 0 0 9 | 1 1 0 10 | 0 1 0 11 | -1 1 0 12 | -1 0 0 13 | -1 -1 0 14 | 0 -1 0 15 | 1 -1 0 16 | 1 0 0 17 | 18 | 19 | 20 | 0 0 21 | 0 1 22 | 23 | 24 | -------------------------------------------------------------------------------- /NurbsSDK/Model/circle(2).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2 4 | 9 5 | 0 0 0 0.25 0.25 0.5 0.5 0.75 0.75 1 1 1 6 | 1 0.707 1 0.707 1 0.707 1 0.707 1 7 | 8 | 1 0 0 9 | 1 1 0 10 | 0 1 0 11 | -1 1 0 12 | -1 0 0 13 | -1 -1 0 14 | 0 -1 0 15 | 1 -1 0 16 | 1 0 0 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /NurbsSDK/Model/curve (2).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | 4 5 | 0 0 0 0 1 1 1 1 6 | 1 1 1 1 7 | 8 | 0 0 0 9 | 1 1 0 10 | 2 1 0 11 | 3 0 0 12 | 13 | 14 | 15 | 0 0 16 | 0 1 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /NurbsSDK/Model/surface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 3 4 | 4 4 5 | 0 0 0 0 1 1 1 1 6 | 0 0 0 0 1 1 1 1 7 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 | 9 | -1.1118 0.00215876 0 10 | -1.07912 0.168856 0 11 | -1.04643 0.335553 0 12 | -1.01375 0.50225 0 13 | -1.30403 -0.00106082 0 14 | -1.24785 0.200459 0 15 | -1.19168 0.40198 0 16 | -1.1355 0.6035 0 17 | -1.49627 -0.00428041 0 18 | -1.41484 0.22048 0 19 | -1.33342 0.44524 0 20 | -1.252 0.67 0 21 | -1.6885 -0.0075 0 22 | -1.687 0.1295 0 23 | -1.681 0.267 0 24 | -1.464 0.485 0 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NurbsSDK/Model/surface1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 3 4 | 4 4 5 | 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 6 | 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 7 | 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 8 | 9 | -1.111800 0.002159 0.000000 10 | -1.079120 0.168856 0.000000 11 | -1.046430 0.335553 0.000000 12 | -1.013750 0.502250 0.000000 13 | -1.304030 -0.001061 0.000000 14 | -1.247850 0.200459 0.000000 15 | -1.191680 0.401980 0.000000 16 | -1.135500 0.603500 0.000000 17 | -1.496270 -0.004280 0.000000 18 | -1.414840 0.220480 0.000000 19 | -1.333420 0.445240 0.000000 20 | -1.252000 0.670000 0.000000 21 | -1.688500 -0.007500 0.000000 22 | -1.687000 0.129500 0.000000 23 | -1.681000 0.267000 0.000000 24 | -1.464000 0.485000 0.000000 25 | 26 | 27 | 28 | 0 0 29 | 0 1 30 | 0 2 31 | 0 3 32 | 33 | 34 | -------------------------------------------------------------------------------- /NurbsSDK/MultiGeo.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiGeo.h" 2 | #include"tinyXMl/tinyxml.h" 3 | #include 4 | #include 5 | 6 | MultiGeo::~MultiGeo() 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /NurbsSDK/MultiGeo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/MultiGeo.h -------------------------------------------------------------------------------- /NurbsSDK/Surface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/Surface.h -------------------------------------------------------------------------------- /NurbsSDK/Volume.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/NurbsSDK/Volume.h -------------------------------------------------------------------------------- /NurbsSDK/tinyXML/tinystr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | www.sourceforge.net/projects/tinyxml 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any 6 | damages arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any 9 | purpose, including commercial applications, and to alter it and 10 | redistribute it freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must 13 | not claim that you wrote the original software. If you use this 14 | software in a product, an acknowledgment in the product documentation 15 | would be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and 18 | must not be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | */ 23 | 24 | 25 | #ifndef TIXML_USE_STL 26 | 27 | #include "tinystr.h" 28 | 29 | // Error value for find primitive 30 | const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); 31 | 32 | 33 | // Null rep. 34 | TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; 35 | 36 | 37 | void TiXmlString::reserve (size_type cap) 38 | { 39 | if (cap > capacity()) 40 | { 41 | TiXmlString tmp; 42 | tmp.init(length(), cap); 43 | memcpy(tmp.start(), data(), length()); 44 | swap(tmp); 45 | } 46 | } 47 | 48 | 49 | TiXmlString& TiXmlString::assign(const char* str, size_type len) 50 | { 51 | size_type cap = capacity(); 52 | if (len > cap || cap > 3*(len + 8)) 53 | { 54 | TiXmlString tmp; 55 | tmp.init(len); 56 | memcpy(tmp.start(), str, len); 57 | swap(tmp); 58 | } 59 | else 60 | { 61 | memmove(start(), str, len); 62 | set_size(len); 63 | } 64 | return *this; 65 | } 66 | 67 | 68 | TiXmlString& TiXmlString::append(const char* str, size_type len) 69 | { 70 | size_type newsize = length() + len; 71 | if (newsize > capacity()) 72 | { 73 | reserve (newsize + capacity()); 74 | } 75 | memmove(finish(), str, len); 76 | set_size(newsize); 77 | return *this; 78 | } 79 | 80 | 81 | TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) 82 | { 83 | TiXmlString tmp; 84 | tmp.reserve(a.length() + b.length()); 85 | tmp += a; 86 | tmp += b; 87 | return tmp; 88 | } 89 | 90 | TiXmlString operator + (const TiXmlString & a, const char* b) 91 | { 92 | TiXmlString tmp; 93 | TiXmlString::size_type b_len = static_cast( strlen(b) ); 94 | tmp.reserve(a.length() + b_len); 95 | tmp += a; 96 | tmp.append(b, b_len); 97 | return tmp; 98 | } 99 | 100 | TiXmlString operator + (const char* a, const TiXmlString & b) 101 | { 102 | TiXmlString tmp; 103 | TiXmlString::size_type a_len = static_cast( strlen(a) ); 104 | tmp.reserve(a_len + b.length()); 105 | tmp.append(a, a_len); 106 | tmp += b; 107 | return tmp; 108 | } 109 | 110 | 111 | #endif // TIXML_USE_STL 112 | -------------------------------------------------------------------------------- /NurbsSDK/tinyXML/tinyxmlerror.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | www.sourceforge.net/projects/tinyxml 3 | Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any 7 | damages arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any 10 | purpose, including commercial applications, and to alter it and 11 | redistribute it freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must 14 | not claim that you wrote the original software. If you use this 15 | software in a product, an acknowledgment in the product documentation 16 | would be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and 19 | must not be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include "tinyxml.h" 26 | 27 | // The goal of the seperate error file is to make the first 28 | // step towards localization. tinyxml (currently) only supports 29 | // english error messages, but the could now be translated. 30 | // 31 | // It also cleans up the code a bit. 32 | // 33 | 34 | const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] = 35 | { 36 | "No error", 37 | "Error", 38 | "Failed to open file", 39 | "Error parsing Element.", 40 | "Failed to read Element name", 41 | "Error reading Element value.", 42 | "Error reading Attributes.", 43 | "Error: empty tag.", 44 | "Error reading end tag.", 45 | "Error parsing Unknown.", 46 | "Error parsing Comment.", 47 | "Error parsing Declaration.", 48 | "Error document empty.", 49 | "Error null (0) or unexpected EOF found in input stream.", 50 | "Error parsing CDATA.", 51 | "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", 52 | }; 53 | -------------------------------------------------------------------------------- /PrintInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 输出操作提示信息与模型数据信息 */ 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | class PrintInfo : 8 | public QTextBrowser{ 9 | Q_OBJECT 10 | public: 11 | PrintInfo (QWidget *parent = Q_NULLPTR); 12 | virtual ~PrintInfo (void); 13 | public: 14 | void infoClear (); 15 | void inputMeshInfo(QString &filename, int vcnt, int fcnt, QString &str); 16 | void outputMeshInfo(QString &filename, int vcnt, int fcnt); 17 | void printString(QString); 18 | 19 | void inputFileInfo (QString &pathinfo,QString &filetype);//读取的文件信息 20 | void outputFileInfo (QString &pathinfo);//保存文件信息 21 | void curveModelInfo (vector objtype,vector ControlNum,vector degree); 22 | void surfaceModelInfo (vector objtype,vector uControlNum,vector vControlNum,vector udegree,vector vdegree);//打印模型信息 23 | private: 24 | QTextCodec *codec = QTextCodec::codecForName ("GBK");//文本转换对象 25 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iGame 2 | iGame for Games302 3 | --- 4 | 5 | 1. 软件的安装及其基本操作请参考 《iGame for Games302 安装使用指南》; 6 | 2. Nurbs相关源码参见 NurbsSDK; 7 | 3. 可视化相关源码参见ModelDraw.h 和 ModelDraw.cpp; 8 | 4. 时间有限,仅供参考。欢迎大家批评指正,有问题随时可以提issue和PR, 该项目将会持续更新。 -------------------------------------------------------------------------------- /Resources/3Dmesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/3Dmesh.png -------------------------------------------------------------------------------- /Resources/6610 - View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/6610 - View.png -------------------------------------------------------------------------------- /Resources/Configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/Configuration.png -------------------------------------------------------------------------------- /Resources/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/Delete.png -------------------------------------------------------------------------------- /Resources/Document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/Document.png -------------------------------------------------------------------------------- /Resources/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/File.png -------------------------------------------------------------------------------- /Resources/Move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/Move.png -------------------------------------------------------------------------------- /Resources/Setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/Setting.png -------------------------------------------------------------------------------- /Resources/View-disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/View-disable.png -------------------------------------------------------------------------------- /Resources/_Manage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/_Manage.png -------------------------------------------------------------------------------- /Resources/arrow_click_cursor_pointer_icon (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/arrow_click_cursor_pointer_icon (1).png -------------------------------------------------------------------------------- /Resources/arrow_click_cursor_pointer_icon .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/arrow_click_cursor_pointer_icon .png -------------------------------------------------------------------------------- /Resources/arrow_click_cursor_pointer_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/arrow_click_cursor_pointer_icon.png -------------------------------------------------------------------------------- /Resources/begin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/begin.jpg -------------------------------------------------------------------------------- /Resources/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/clear.png -------------------------------------------------------------------------------- /Resources/colorPoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/colorPoint.png -------------------------------------------------------------------------------- /Resources/coord-disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/coord-disable.png -------------------------------------------------------------------------------- /Resources/facefill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/facefill.png -------------------------------------------------------------------------------- /Resources/file_export_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/file_export_icon.png -------------------------------------------------------------------------------- /Resources/file_import_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/file_import_icon.png -------------------------------------------------------------------------------- /Resources/iGameLab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/iGameLab.png -------------------------------------------------------------------------------- /Resources/iGameLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/iGameLogo.png -------------------------------------------------------------------------------- /Resources/icon (1).ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (1).ico -------------------------------------------------------------------------------- /Resources/icon (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (1).png -------------------------------------------------------------------------------- /Resources/icon (10).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (10).png -------------------------------------------------------------------------------- /Resources/icon (11).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (11).png -------------------------------------------------------------------------------- /Resources/icon (12).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (12).png -------------------------------------------------------------------------------- /Resources/icon (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (2).png -------------------------------------------------------------------------------- /Resources/icon (3).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (3).png -------------------------------------------------------------------------------- /Resources/icon (4).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (4).png -------------------------------------------------------------------------------- /Resources/icon (5).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (5).png -------------------------------------------------------------------------------- /Resources/icon (6).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (6).png -------------------------------------------------------------------------------- /Resources/icon (7).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (7).png -------------------------------------------------------------------------------- /Resources/icon (8).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (8).png -------------------------------------------------------------------------------- /Resources/icon (9).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/icon (9).png -------------------------------------------------------------------------------- /Resources/import1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/import1.png -------------------------------------------------------------------------------- /Resources/import2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/import2.png -------------------------------------------------------------------------------- /Resources/knife_cutter_cut_cutlery_cutting_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/knife_cutter_cut_cutlery_cutting_icon.png -------------------------------------------------------------------------------- /Resources/mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/mesh.png -------------------------------------------------------------------------------- /Resources/point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/point.png -------------------------------------------------------------------------------- /Resources/三维曲面图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/三维曲面图.png -------------------------------------------------------------------------------- /Resources/填充颜色.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/填充颜色.png -------------------------------------------------------------------------------- /Resources/清空.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/清空.png -------------------------------------------------------------------------------- /Resources/点.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/点.png -------------------------------------------------------------------------------- /Resources/离散.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/离散.png -------------------------------------------------------------------------------- /Resources/线性-导入 (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/线性-导入 (1).png -------------------------------------------------------------------------------- /Resources/线性-导入.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/线性-导入.png -------------------------------------------------------------------------------- /Resources/网格-disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/网格-disable.png -------------------------------------------------------------------------------- /Resources/网格.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/Resources/网格.png -------------------------------------------------------------------------------- /Turbine_Blade.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Resources/_Manage.png 4 | Resources/6610 - View.png 5 | Resources/Configuration.png 6 | Resources/Delete.png 7 | Resources/Document.png 8 | Resources/File.png 9 | Resources/begin.jpg 10 | Resources/icon (1).ico 11 | Resources/icon (1).png 12 | Resources/icon (2).png 13 | Resources/icon (3).png 14 | Resources/icon (4).png 15 | Resources/icon (5).png 16 | Resources/icon (6).png 17 | Resources/icon (7).png 18 | Resources/icon (8).png 19 | Resources/icon (9).png 20 | Resources/icon (10).png 21 | Resources/icon (11).png 22 | Resources/icon (12).png 23 | Resources/Move.png 24 | Resources/Setting.png 25 | Resources/iGameLogo.png 26 | Resources/point.png 27 | Resources/colorPoint.png 28 | Resources/clear.png 29 | Resources/3Dmesh.png 30 | Resources/facefill.png 31 | Resources/mesh.png 32 | Resources/import1.png 33 | Resources/import2.png 34 | Resources/file_export_icon.png 35 | Resources/file_import_icon.png 36 | psblack/add_bottom.png 37 | psblack/add_left.png 38 | psblack/add_right.png 39 | psblack/add_top.png 40 | psblack/branch_close.png 41 | psblack/branch_open.png 42 | psblack/calendar_nextmonth.png 43 | psblack/calendar_prevmonth.png 44 | psblack/checkbox_checked.png 45 | psblack/checkbox_checked_disable.png 46 | psblack/checkbox_parcial.png 47 | psblack/checkbox_parcial_disable.png 48 | psblack/checkbox_unchecked.png 49 | psblack/checkbox_unchecked_disable.png 50 | psblack/radiobutton_checked.png 51 | psblack/radiobutton_checked_disable.png 52 | psblack/radiobutton_unchecked.png 53 | psblack/radiobutton_unchecked_disable.png 54 | Resources/arrow_click_cursor_pointer_icon (1).png 55 | Resources/arrow_click_cursor_pointer_icon .png 56 | Resources/arrow_click_cursor_pointer_icon.png 57 | Resources/knife_cutter_cut_cutlery_cutting_icon.png 58 | 59 | 60 | color.frag 61 | color.vert 62 | 63 | 64 | -------------------------------------------------------------------------------- /color.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | out vec4 FragColor; 3 | in vec3 pos; 4 | in vec3 pos_fixed; 5 | in vec3 normal; 6 | in vec3 normal_fixed; 7 | struct Light { 8 | vec3 position; 9 | vec3 ambient; 10 | vec3 diffuse; 11 | vec3 specular; 12 | }; 13 | uniform Light light; 14 | uniform float shininess; 15 | uniform vec3 viewpos; 16 | uniform int rendermode = 3; // 渲染模式,1:点,2:线,3:光滑面,4:平面 17 | uniform int colormode = 1; // 颜色模式,1:光照方式,2:根据法向方式,3:自定颜色模式,4:使用传入VBO时使用的值作为颜色(默认传入的是顶点的向量) 18 | uniform vec4 color = vec4(1.0, 0, 0, 1.0); // 自定颜色 19 | void main() { 20 | vec3 n; 21 | if(colormode == 1){ // 光照模式下,物体法向会随着物体旋转而改变 22 | if(rendermode == 4) 23 | n = normalize(cross(dFdx(pos),dFdy(pos))); // 离散 24 | else 25 | n = normalize(normal); // 连续 26 | } 27 | else if(colormode == 2){ // 法向模式下,物体法向不会改变 28 | if(rendermode == 4){ 29 | n = normalize(cross(dFdx(pos_fixed),dFdy(pos_fixed))); 30 | } 31 | else{ 32 | n = normalize(normal_fixed); 33 | } 34 | } 35 | 36 | // ambient 37 | vec3 ambient = light.ambient; 38 | 39 | // diffuse 40 | vec3 lightDir = normalize(light.position - pos); 41 | float diff = max(dot(n, lightDir), 0.0); 42 | vec3 diffuse = light.diffuse *diff; 43 | 44 | // specular 45 | vec3 viewDir = normalize(viewpos - pos); 46 | vec3 reflectDir = reflect(-lightDir, n); 47 | float spec = pow(max(dot(viewDir, reflectDir), 0.0), shininess); 48 | vec3 specular = light.specular * spec; 49 | 50 | vec3 result = ambient + diffuse + specular; 51 | 52 | if(colormode == 1){ 53 | switch(rendermode){ 54 | case 1: 55 | case 2: 56 | FragColor = vec4(ambient*1.8,1.0); 57 | break; 58 | case 3: 59 | case 4: 60 | FragColor = vec4(result,1.0); 61 | break; 62 | } 63 | } 64 | else if(colormode == 2){ 65 | FragColor = vec4((n+vec3(1.0,1.0,1.0))/2,1.0); 66 | } 67 | else if(colormode == 3){ 68 | FragColor = color; 69 | } 70 | else if(colormode == 4){ 71 | FragColor = vec4(normal_fixed, 1.0); 72 | } 73 | } -------------------------------------------------------------------------------- /color.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | layout(location=0) in vec3 p; 4 | layout(location=1) in vec3 n; 5 | 6 | uniform mat4 model=mat4(1.0); 7 | uniform mat4 view=mat4(1.0); 8 | uniform mat4 projection=mat4(1.0); 9 | uniform mat4 rotate=mat4(1.0); 10 | out vec3 pos; 11 | out vec3 pos_fixed; 12 | out vec3 normal; 13 | out vec3 normal_fixed; 14 | void main(){ 15 | 16 | pos=vec3(view*model*vec4(p,1.0)); 17 | pos_fixed = vec3(view*vec4(p,1.0)); 18 | normal = vec3(rotate*vec4(n,1.0)); 19 | normal_fixed = n; 20 | gl_Position=projection*view*model*vec4(p,1.0); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /extern/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 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /extern/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Cholesky_Module Cholesky module 16 | * 17 | * 18 | * 19 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 20 | * Those decompositions are also accessible via the following methods: 21 | * - MatrixBase::llt() 22 | * - MatrixBase::ldlt() 23 | * - SelfAdjointView::llt() 24 | * - SelfAdjointView::ldlt() 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/Cholesky/LLT.h" 32 | #include "src/Cholesky/LDLT.h" 33 | #ifdef EIGEN_USE_LAPACKE 34 | #include "src/misc/lapacke.h" 35 | #include "src/Cholesky/LLT_LAPACKE.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_CHOLESKY_MODULE_H 41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 42 | -------------------------------------------------------------------------------- /extern/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup CholmodSupport_Module CholmodSupport module 21 | * 22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 23 | * It provides the two following main factorization classes: 24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * 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. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /extern/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /extern/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /extern/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | #include "LU" 19 | #include "Geometry" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #include "src/misc/lapacke.h" 49 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 50 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 51 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 52 | #endif 53 | 54 | #include "src/Core/util/ReenableStupidWarnings.h" 55 | 56 | #endif // EIGEN_EIGENVALUES_MODULE_H 57 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 58 | -------------------------------------------------------------------------------- /extern/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_GEOMETRY_MODULE_H 9 | #define EIGEN_GEOMETRY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SVD" 16 | #include "LU" 17 | #include 18 | 19 | /** \defgroup Geometry_Module Geometry module 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - \link Quaternion quaternions \endlink 25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) 26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) 27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink 28 | * - \link AlignedBox axis aligned bounding boxes \endlink 29 | * - \link umeyama least-square transformation fitting \endlink 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/Geometry/OrthoMethods.h" 37 | #include "src/Geometry/EulerAngles.h" 38 | 39 | #include "src/Geometry/Homogeneous.h" 40 | #include "src/Geometry/RotationBase.h" 41 | #include "src/Geometry/Rotation2D.h" 42 | #include "src/Geometry/Quaternion.h" 43 | #include "src/Geometry/AngleAxis.h" 44 | #include "src/Geometry/Transform.h" 45 | #include "src/Geometry/Translation.h" 46 | #include "src/Geometry/Scaling.h" 47 | #include "src/Geometry/Hyperplane.h" 48 | #include "src/Geometry/ParametrizedLine.h" 49 | #include "src/Geometry/AlignedBox.h" 50 | #include "src/Geometry/Umeyama.h" 51 | 52 | // Use the SSE optimized version whenever possible. At the moment the 53 | // SSE version doesn't compile when AVX is enabled 54 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 55 | #include "src/Geometry/arch/Geometry_SSE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_GEOMETRY_MODULE_H 61 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 62 | 63 | -------------------------------------------------------------------------------- /extern/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 31 | -------------------------------------------------------------------------------- /extern/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 9 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** 17 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 18 | * 19 | * 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. 20 | * Those solvers are accessible via the following classes: 21 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 22 | * - LeastSquaresConjugateGradient for rectangular least-square problems, 23 | * - BiCGSTAB for general square matrices. 24 | * 25 | * These iterative solvers are associated with some preconditioners: 26 | * - IdentityPreconditioner - not really useful 27 | * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices. 28 | * - IncompleteLUT - incomplete LU factorization with dual thresholding 29 | * 30 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. 31 | * 32 | \code 33 | #include 34 | \endcode 35 | */ 36 | 37 | #include "src/IterativeLinearSolvers/SolveWithGuess.h" 38 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 39 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 40 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 41 | #include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" 42 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 43 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 44 | #include "src/IterativeLinearSolvers/IncompleteCholesky.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 49 | -------------------------------------------------------------------------------- /extern/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | 34 | -------------------------------------------------------------------------------- /extern/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #include "src/misc/lapacke.h" 32 | #include "src/LU/PartialPivLU_LAPACKE.h" 33 | #endif 34 | #include "src/LU/Determinant.h" 35 | #include "src/LU/InverseImpl.h" 36 | 37 | // Use the SSE optimized version whenever possible. At the moment the 38 | // SSE version doesn't compile when AVX is enabled 39 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 40 | #include "src/LU/arch/Inverse_SSE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_LU_MODULE_H 46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 47 | -------------------------------------------------------------------------------- /extern/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/Eigen/OrderingMethods: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H 9 | #define EIGEN_ORDERINGMETHODS_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** 16 | * \defgroup OrderingMethods_Module OrderingMethods module 17 | * 18 | * This module is currently for internal use only 19 | * 20 | * It defines various built-in and external ordering methods for sparse matrices. 21 | * They are typically used to reduce the number of elements during 22 | * the sparse matrix decomposition (LLT, LU, QR). 23 | * Precisely, in a preprocessing step, a permutation matrix P is computed using 24 | * those ordering methods and applied to the columns of the matrix. 25 | * Using for instance the sparse Cholesky decomposition, it is expected that 26 | * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). 27 | * 28 | * 29 | * Usage : 30 | * \code 31 | * #include 32 | * \endcode 33 | * 34 | * A simple usage is as a template parameter in the sparse decomposition classes : 35 | * 36 | * \code 37 | * SparseLU > solver; 38 | * \endcode 39 | * 40 | * \code 41 | * SparseQR > solver; 42 | * \endcode 43 | * 44 | * It is possible as well to call directly a particular ordering method for your own purpose, 45 | * \code 46 | * AMDOrdering ordering; 47 | * PermutationMatrix perm; 48 | * SparseMatrix A; 49 | * //Fill the matrix ... 50 | * 51 | * ordering(A, perm); // Call AMD 52 | * \endcode 53 | * 54 | * \note Some of these methods (like AMD or METIS), need the sparsity pattern 55 | * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, 56 | * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. 57 | * If your matrix is already symmetric (at leat in structure), you can avoid that 58 | * by calling the method with a SelfAdjointView type. 59 | * 60 | * \code 61 | * // Call the ordering on the pattern of the lower triangular matrix A 62 | * ordering(A.selfadjointView(), perm); 63 | * \endcode 64 | */ 65 | 66 | #ifndef EIGEN_MPL2_ONLY 67 | #include "src/OrderingMethods/Amd.h" 68 | #endif 69 | 70 | #include "src/OrderingMethods/Ordering.h" 71 | #include "src/Core/util/ReenableStupidWarnings.h" 72 | 73 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H 74 | -------------------------------------------------------------------------------- /extern/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * 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. 39 | * The dependencies depend on how PaSTiX has been compiled. 40 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 41 | * 42 | */ 43 | 44 | #include "src/PaStiXSupport/PaStiXSupport.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 49 | -------------------------------------------------------------------------------- /extern/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * 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. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #include "src/misc/lapacke.h" 40 | #include "src/QR/HouseholderQR_LAPACKE.h" 41 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_QR_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /extern/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 41 | -------------------------------------------------------------------------------- /extern/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * 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,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /extern/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #include "src/misc/lapacke.h" 41 | #include "src/SVD/JacobiSVD_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_SVD_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /extern/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #ifndef EIGEN_MPL2_ONLY 29 | #include "SparseCholesky" 30 | #endif 31 | #include "SparseLU" 32 | #include "SparseQR" 33 | #include "IterativeLinearSolvers" 34 | 35 | #endif // EIGEN_SPARSE_MODULE_H 36 | 37 | -------------------------------------------------------------------------------- /extern/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/SparseCholesky/SimplicialCholesky.h" 38 | 39 | #ifndef EIGEN_MPL2_ONLY 40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /extern/Eigen/SparseCore: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSECORE_MODULE_H 9 | #define EIGEN_SPARSECORE_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | /** 22 | * \defgroup SparseCore_Module SparseCore module 23 | * 24 | * This module provides a sparse matrix representation, and basic associated matrix manipulations 25 | * and operations. 26 | * 27 | * See the \ref TutorialSparse "Sparse tutorial" 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | * 33 | * This module depends on: Core. 34 | */ 35 | 36 | #include "src/SparseCore/SparseUtil.h" 37 | #include "src/SparseCore/SparseMatrixBase.h" 38 | #include "src/SparseCore/SparseAssign.h" 39 | #include "src/SparseCore/CompressedStorage.h" 40 | #include "src/SparseCore/AmbiVector.h" 41 | #include "src/SparseCore/SparseCompressedBase.h" 42 | #include "src/SparseCore/SparseMatrix.h" 43 | #include "src/SparseCore/SparseMap.h" 44 | #include "src/SparseCore/MappedSparseMatrix.h" 45 | #include "src/SparseCore/SparseVector.h" 46 | #include "src/SparseCore/SparseRef.h" 47 | #include "src/SparseCore/SparseCwiseUnaryOp.h" 48 | #include "src/SparseCore/SparseCwiseBinaryOp.h" 49 | #include "src/SparseCore/SparseTranspose.h" 50 | #include "src/SparseCore/SparseBlock.h" 51 | #include "src/SparseCore/SparseDot.h" 52 | #include "src/SparseCore/SparseRedux.h" 53 | #include "src/SparseCore/SparseView.h" 54 | #include "src/SparseCore/SparseDiagonalProduct.h" 55 | #include "src/SparseCore/ConservativeSparseSparseProduct.h" 56 | #include "src/SparseCore/SparseSparseProductWithPruning.h" 57 | #include "src/SparseCore/SparseProduct.h" 58 | #include "src/SparseCore/SparseDenseProduct.h" 59 | #include "src/SparseCore/SparseSelfAdjointView.h" 60 | #include "src/SparseCore/SparseTriangularView.h" 61 | #include "src/SparseCore/TriangularSolver.h" 62 | #include "src/SparseCore/SparsePermutation.h" 63 | #include "src/SparseCore/SparseFuzzy.h" 64 | #include "src/SparseCore/SparseSolverBase.h" 65 | 66 | #include "src/Core/util/ReenableStupidWarnings.h" 67 | 68 | #endif // EIGEN_SPARSECORE_MODULE_H 69 | 70 | -------------------------------------------------------------------------------- /extern/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 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 27 | 28 | #include "src/SparseLU/SparseLU_Structs.h" 29 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 30 | #include "src/SparseLU/SparseLUImpl.h" 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseLU/SparseLU_Memory.h" 33 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 34 | #include "src/SparseLU/SparseLU_relax_snode.h" 35 | #include "src/SparseLU/SparseLU_pivotL.h" 36 | #include "src/SparseLU/SparseLU_panel_dfs.h" 37 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 38 | #include "src/SparseLU/SparseLU_panel_bmod.h" 39 | #include "src/SparseLU/SparseLU_column_dfs.h" 40 | #include "src/SparseLU/SparseLU_column_bmod.h" 41 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 42 | #include "src/SparseLU/SparseLU_pruneL.h" 43 | #include "src/SparseLU/SparseLU_Utils.h" 44 | #include "src/SparseLU/SparseLU.h" 45 | 46 | #endif // EIGEN_SPARSELU_MODULE_H 47 | -------------------------------------------------------------------------------- /extern/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "OrderingMethods" 32 | #include "src/SparseCore/SparseColEtree.h" 33 | #include "src/SparseQR/SparseQR.h" 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /extern/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 EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /extern/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 EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /extern/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 EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /extern/Eigen/SuperLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 9 | #define EIGEN_SUPERLUSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #ifdef EMPTY 16 | #define EIGEN_EMPTY_WAS_ALREADY_DEFINED 17 | #endif 18 | 19 | typedef int int_t; 20 | #include 21 | #include 22 | #include 23 | 24 | // slu_util.h defines a preprocessor token named EMPTY which is really polluting, 25 | // so we remove it in favor of a SUPERLU_EMPTY token. 26 | // If EMPTY was already defined then we don't undef it. 27 | 28 | #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) 29 | # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED 30 | #elif defined(EMPTY) 31 | # undef EMPTY 32 | #endif 33 | 34 | #define SUPERLU_EMPTY (-1) 35 | 36 | namespace Eigen { struct SluMatrix; } 37 | 38 | /** \ingroup Support_modules 39 | * \defgroup SuperLUSupport_Module SuperLUSupport module 40 | * 41 | * This module provides an interface to the SuperLU library. 42 | * It provides the following factorization class: 43 | * - class SuperLU: a supernodal sequential LU factorization. 44 | * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). 45 | * 46 | * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. 47 | * 48 | * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. 49 | * 50 | * \code 51 | * #include 52 | * \endcode 53 | * 54 | * 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. 55 | * The dependencies depend on how superlu has been compiled. 56 | * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. 57 | * 58 | */ 59 | 60 | #include "src/SuperLUSupport/SuperLUSupport.h" 61 | 62 | #include "src/Core/util/ReenableStupidWarnings.h" 63 | 64 | #endif // EIGEN_SUPERLUSUPPORT_MODULE_H 65 | -------------------------------------------------------------------------------- /extern/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * 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. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/Assign.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2007 Michael Olbrich 5 | // Copyright (C) 2006-2010 Benoit Jacob 6 | // Copyright (C) 2008 Gael Guennebaud 7 | // 8 | // This Source Code Form is subject to the terms of the Mozilla 9 | // Public License v. 2.0. If a copy of the MPL was not distributed 10 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | 12 | #ifndef EIGEN_ASSIGN_H 13 | #define EIGEN_ASSIGN_H 14 | 15 | namespace Eigen { 16 | 17 | template 18 | template 19 | EIGEN_STRONG_INLINE Derived& DenseBase 20 | ::lazyAssign(const DenseBase& other) 21 | { 22 | enum{ 23 | SameType = internal::is_same::value 24 | }; 25 | 26 | EIGEN_STATIC_ASSERT_LVALUE(Derived) 27 | EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) 28 | EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 29 | 30 | eigen_assert(rows() == other.rows() && cols() == other.cols()); 31 | internal::call_assignment_no_alias(derived(),other.derived()); 32 | 33 | return derived(); 34 | } 35 | 36 | template 37 | template 38 | EIGEN_DEVICE_FUNC 39 | EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) 40 | { 41 | internal::call_assignment(derived(), other.derived()); 42 | return derived(); 43 | } 44 | 45 | template 46 | EIGEN_DEVICE_FUNC 47 | EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) 48 | { 49 | internal::call_assignment(derived(), other.derived()); 50 | return derived(); 51 | } 52 | 53 | template 54 | EIGEN_DEVICE_FUNC 55 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const MatrixBase& other) 56 | { 57 | internal::call_assignment(derived(), other.derived()); 58 | return derived(); 59 | } 60 | 61 | template 62 | template 63 | EIGEN_DEVICE_FUNC 64 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const DenseBase& other) 65 | { 66 | internal::call_assignment(derived(), other.derived()); 67 | return derived(); 68 | } 69 | 70 | template 71 | template 72 | EIGEN_DEVICE_FUNC 73 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const EigenBase& other) 74 | { 75 | internal::call_assignment(derived(), other.derived()); 76 | return derived(); 77 | } 78 | 79 | template 80 | template 81 | EIGEN_DEVICE_FUNC 82 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const ReturnByValue& other) 83 | { 84 | other.derived().evalTo(derived()); 85 | return derived(); 86 | } 87 | 88 | } // end namespace Eigen 89 | 90 | #endif // EIGEN_ASSIGN_H 91 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/DiagonalProduct.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) 2007-2009 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_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/MathFunctionsImpl.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) 5 | // Copyright (C) 2016 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_MATHFUNCTIONSIMPL_H 12 | #define EIGEN_MATHFUNCTIONSIMPL_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | /** \internal \returns the hyperbolic tan of \a a (coeff-wise) 19 | Doesn't do anything fancy, just a 13/6-degree rational interpolant which 20 | is accurate up to a couple of ulp in the range [-9, 9], outside of which 21 | the tanh(x) = +/-1. 22 | 23 | This implementation works on both scalars and packets. 24 | */ 25 | template 26 | T generic_fast_tanh_float(const T& a_x) 27 | { 28 | // Clamp the inputs to the range [-9, 9] since anything outside 29 | // this range is +/-1.0f in single-precision. 30 | const T plus_9 = pset1(9.f); 31 | const T minus_9 = pset1(-9.f); 32 | // NOTE GCC prior to 6.3 might improperly optimize this max/min 33 | // step such that if a_x is nan, x will be either 9 or -9, 34 | // and tanh will return 1 or -1 instead of nan. 35 | // This is supposed to be fixed in gcc6.3, 36 | // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72867 37 | const T x = pmax(minus_9,pmin(plus_9,a_x)); 38 | // The monomial coefficients of the numerator polynomial (odd). 39 | const T alpha_1 = pset1(4.89352455891786e-03f); 40 | const T alpha_3 = pset1(6.37261928875436e-04f); 41 | const T alpha_5 = pset1(1.48572235717979e-05f); 42 | const T alpha_7 = pset1(5.12229709037114e-08f); 43 | const T alpha_9 = pset1(-8.60467152213735e-11f); 44 | const T alpha_11 = pset1(2.00018790482477e-13f); 45 | const T alpha_13 = pset1(-2.76076847742355e-16f); 46 | 47 | // The monomial coefficients of the denominator polynomial (even). 48 | const T beta_0 = pset1(4.89352518554385e-03f); 49 | const T beta_2 = pset1(2.26843463243900e-03f); 50 | const T beta_4 = pset1(1.18534705686654e-04f); 51 | const T beta_6 = pset1(1.19825839466702e-06f); 52 | 53 | // Since the polynomials are odd/even, we need x^2. 54 | const T x2 = pmul(x, x); 55 | 56 | // Evaluate the numerator polynomial p. 57 | T p = pmadd(x2, alpha_13, alpha_11); 58 | p = pmadd(x2, p, alpha_9); 59 | p = pmadd(x2, p, alpha_7); 60 | p = pmadd(x2, p, alpha_5); 61 | p = pmadd(x2, p, alpha_3); 62 | p = pmadd(x2, p, alpha_1); 63 | p = pmul(x, p); 64 | 65 | // Evaluate the denominator polynomial p. 66 | T q = pmadd(x2, beta_6, beta_4); 67 | q = pmadd(x2, q, beta_2); 68 | q = pmadd(x2, q, beta_0); 69 | 70 | // Divide the numerator by the denominator. 71 | return pdiv(p, q); 72 | } 73 | 74 | } // end namespace internal 75 | 76 | } // end namespace Eigen 77 | 78 | #endif // EIGEN_MATHFUNCTIONSIMPL_H 79 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/SelfCwiseBinaryOp.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 | // 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_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | typedef typename Derived::PlainObject PlainObject; 21 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 22 | return derived(); 23 | } 24 | 25 | template 26 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 27 | { 28 | typedef typename Derived::PlainObject PlainObject; 29 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 30 | return derived(); 31 | } 32 | 33 | template 34 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 35 | { 36 | typedef typename Derived::PlainObject PlainObject; 37 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 38 | return derived(); 39 | } 40 | 41 | template 42 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 43 | { 44 | typedef typename Derived::PlainObject PlainObject; 45 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 46 | return derived(); 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_SELFCWISEBINARYOP_H 52 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/Swap.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2006-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_SWAP_H 11 | #define EIGEN_SWAP_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // Overload default assignPacket behavior for swapping them 18 | template 19 | class generic_dense_assignment_kernel, Specialized> 20 | : public generic_dense_assignment_kernel, BuiltIn> 21 | { 22 | protected: 23 | typedef generic_dense_assignment_kernel, BuiltIn> Base; 24 | using Base::m_dst; 25 | using Base::m_src; 26 | using Base::m_functor; 27 | 28 | public: 29 | typedef typename Base::Scalar Scalar; 30 | typedef typename Base::DstXprType DstXprType; 31 | typedef swap_assign_op Functor; 32 | 33 | EIGEN_DEVICE_FUNC generic_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType& dstExpr) 34 | : Base(dst, src, func, dstExpr) 35 | {} 36 | 37 | template 38 | void assignPacket(Index row, Index col) 39 | { 40 | PacketType tmp = m_src.template packet(row,col); 41 | const_cast(m_src).template writePacket(row,col, m_dst.template packet(row,col)); 42 | m_dst.template writePacket(row,col,tmp); 43 | } 44 | 45 | template 46 | void assignPacket(Index index) 47 | { 48 | PacketType tmp = m_src.template packet(index); 49 | const_cast(m_src).template writePacket(index, m_dst.template packet(index)); 50 | m_dst.template writePacket(index,tmp); 51 | } 52 | 53 | // TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I mean no CRTP (Gael) 54 | template 55 | void assignPacketByOuterInner(Index outer, Index inner) 56 | { 57 | Index row = Base::rowIndexByOuterInner(outer, inner); 58 | Index col = Base::colIndexByOuterInner(outer, inner); 59 | assignPacket(row, col); 60 | } 61 | }; 62 | 63 | } // namespace internal 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN_SWAP_H 68 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/arch/AVX/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 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_TYPE_CASTING_AVX_H 11 | #define EIGEN_TYPE_CASTING_AVX_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast 18 | // from int to float 19 | template <> 20 | struct type_casting_traits { 21 | enum { 22 | VectorizedCast = 0, 23 | SrcCoeffRatio = 1, 24 | TgtCoeffRatio = 1 25 | }; 26 | }; 27 | 28 | template <> 29 | struct type_casting_traits { 30 | enum { 31 | VectorizedCast = 0, 32 | SrcCoeffRatio = 1, 33 | TgtCoeffRatio = 1 34 | }; 35 | }; 36 | 37 | 38 | 39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) { 40 | return _mm256_cvtps_epi32(a); 41 | } 42 | 43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) { 44 | return _mm256_cvtepi32_ps(a); 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_TYPE_CASTING_AVX_H 52 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/arch/CUDA/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 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_MATH_FUNCTIONS_CUDA_H 11 | #define EIGEN_MATH_FUNCTIONS_CUDA_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // Make sure this is only available when targeting a GPU: we don't want to 18 | // introduce conflicts between these packet_traits definitions and the ones 19 | // we'll use on the host side (SSE, AVX, ...) 20 | #if defined(__CUDACC__) && defined(EIGEN_USE_GPU) 21 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 22 | float4 plog(const float4& a) 23 | { 24 | return make_float4(logf(a.x), logf(a.y), logf(a.z), logf(a.w)); 25 | } 26 | 27 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 28 | double2 plog(const double2& a) 29 | { 30 | using ::log; 31 | return make_double2(log(a.x), log(a.y)); 32 | } 33 | 34 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 35 | float4 plog1p(const float4& a) 36 | { 37 | return make_float4(log1pf(a.x), log1pf(a.y), log1pf(a.z), log1pf(a.w)); 38 | } 39 | 40 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 41 | double2 plog1p(const double2& a) 42 | { 43 | return make_double2(log1p(a.x), log1p(a.y)); 44 | } 45 | 46 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 47 | float4 pexp(const float4& a) 48 | { 49 | return make_float4(expf(a.x), expf(a.y), expf(a.z), expf(a.w)); 50 | } 51 | 52 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 53 | double2 pexp(const double2& a) 54 | { 55 | using ::exp; 56 | return make_double2(exp(a.x), exp(a.y)); 57 | } 58 | 59 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 60 | float4 psqrt(const float4& a) 61 | { 62 | return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w)); 63 | } 64 | 65 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 66 | double2 psqrt(const double2& a) 67 | { 68 | using ::sqrt; 69 | return make_double2(sqrt(a.x), sqrt(a.y)); 70 | } 71 | 72 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 73 | float4 prsqrt(const float4& a) 74 | { 75 | return make_float4(rsqrtf(a.x), rsqrtf(a.y), rsqrtf(a.z), rsqrtf(a.w)); 76 | } 77 | 78 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 79 | double2 prsqrt(const double2& a) 80 | { 81 | return make_double2(rsqrt(a.x), rsqrt(a.y)); 82 | } 83 | 84 | 85 | #endif 86 | 87 | } // end namespace internal 88 | 89 | } // end namespace Eigen 90 | 91 | #endif // EIGEN_MATH_FUNCTIONS_CUDA_H 92 | -------------------------------------------------------------------------------- /extern/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 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/arch/NEON/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | /* The sin, cos, exp, and log functions of this file come from 9 | * Julien Pommier's sse math library: http://gruntthepeon.free.fr/ssemath/ 10 | */ 11 | 12 | #ifndef EIGEN_MATH_FUNCTIONS_NEON_H 13 | #define EIGEN_MATH_FUNCTIONS_NEON_H 14 | 15 | namespace Eigen { 16 | 17 | namespace internal { 18 | 19 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 20 | Packet4f pexp(const Packet4f& _x) 21 | { 22 | Packet4f x = _x; 23 | Packet4f tmp, fx; 24 | 25 | _EIGEN_DECLARE_CONST_Packet4f(1 , 1.0f); 26 | _EIGEN_DECLARE_CONST_Packet4f(half, 0.5f); 27 | _EIGEN_DECLARE_CONST_Packet4i(0x7f, 0x7f); 28 | _EIGEN_DECLARE_CONST_Packet4f(exp_hi, 88.3762626647950f); 29 | _EIGEN_DECLARE_CONST_Packet4f(exp_lo, -88.3762626647949f); 30 | _EIGEN_DECLARE_CONST_Packet4f(cephes_LOG2EF, 1.44269504088896341f); 31 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_C1, 0.693359375f); 32 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_C2, -2.12194440e-4f); 33 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p0, 1.9875691500E-4f); 34 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p1, 1.3981999507E-3f); 35 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p2, 8.3334519073E-3f); 36 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p3, 4.1665795894E-2f); 37 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p4, 1.6666665459E-1f); 38 | _EIGEN_DECLARE_CONST_Packet4f(cephes_exp_p5, 5.0000001201E-1f); 39 | 40 | x = vminq_f32(x, p4f_exp_hi); 41 | x = vmaxq_f32(x, p4f_exp_lo); 42 | 43 | /* express exp(x) as exp(g + n*log(2)) */ 44 | fx = vmlaq_f32(p4f_half, x, p4f_cephes_LOG2EF); 45 | 46 | /* perform a floorf */ 47 | tmp = vcvtq_f32_s32(vcvtq_s32_f32(fx)); 48 | 49 | /* if greater, substract 1 */ 50 | Packet4ui mask = vcgtq_f32(tmp, fx); 51 | mask = vandq_u32(mask, vreinterpretq_u32_f32(p4f_1)); 52 | 53 | fx = vsubq_f32(tmp, vreinterpretq_f32_u32(mask)); 54 | 55 | tmp = vmulq_f32(fx, p4f_cephes_exp_C1); 56 | Packet4f z = vmulq_f32(fx, p4f_cephes_exp_C2); 57 | x = vsubq_f32(x, tmp); 58 | x = vsubq_f32(x, z); 59 | 60 | Packet4f y = vmulq_f32(p4f_cephes_exp_p0, x); 61 | z = vmulq_f32(x, x); 62 | y = vaddq_f32(y, p4f_cephes_exp_p1); 63 | y = vmulq_f32(y, x); 64 | y = vaddq_f32(y, p4f_cephes_exp_p2); 65 | y = vmulq_f32(y, x); 66 | y = vaddq_f32(y, p4f_cephes_exp_p3); 67 | y = vmulq_f32(y, x); 68 | y = vaddq_f32(y, p4f_cephes_exp_p4); 69 | y = vmulq_f32(y, x); 70 | y = vaddq_f32(y, p4f_cephes_exp_p5); 71 | 72 | y = vmulq_f32(y, z); 73 | y = vaddq_f32(y, x); 74 | y = vaddq_f32(y, p4f_1); 75 | 76 | /* build 2^n */ 77 | int32x4_t mm; 78 | mm = vcvtq_s32_f32(fx); 79 | mm = vaddq_s32(mm, p4i_0x7f); 80 | mm = vshlq_n_s32(mm, 23); 81 | Packet4f pow2n = vreinterpretq_f32_s32(mm); 82 | 83 | y = vmulq_f32(y, pow2n); 84 | return y; 85 | } 86 | 87 | } // end namespace internal 88 | 89 | } // end namespace Eigen 90 | 91 | #endif // EIGEN_MATH_FUNCTIONS_NEON_H 92 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/arch/SSE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 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_TYPE_CASTING_SSE_H 11 | #define EIGEN_TYPE_CASTING_SSE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template <> 18 | struct type_casting_traits { 19 | enum { 20 | VectorizedCast = 1, 21 | SrcCoeffRatio = 1, 22 | TgtCoeffRatio = 1 23 | }; 24 | }; 25 | 26 | template<> EIGEN_STRONG_INLINE Packet4i pcast(const Packet4f& a) { 27 | return _mm_cvttps_epi32(a); 28 | } 29 | 30 | 31 | template <> 32 | struct type_casting_traits { 33 | enum { 34 | VectorizedCast = 1, 35 | SrcCoeffRatio = 1, 36 | TgtCoeffRatio = 1 37 | }; 38 | }; 39 | 40 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet4i& a) { 41 | return _mm_cvtepi32_ps(a); 42 | } 43 | 44 | 45 | template <> 46 | struct type_casting_traits { 47 | enum { 48 | VectorizedCast = 1, 49 | SrcCoeffRatio = 2, 50 | TgtCoeffRatio = 1 51 | }; 52 | }; 53 | 54 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet2d& a, const Packet2d& b) { 55 | return _mm_shuffle_ps(_mm_cvtpd_ps(a), _mm_cvtpd_ps(b), (1 << 2) | (1 << 6)); 56 | } 57 | 58 | template <> 59 | struct type_casting_traits { 60 | enum { 61 | VectorizedCast = 1, 62 | SrcCoeffRatio = 1, 63 | TgtCoeffRatio = 2 64 | }; 65 | }; 66 | 67 | template<> EIGEN_STRONG_INLINE Packet2d pcast(const Packet4f& a) { 68 | // Simply discard the second half of the input 69 | return _mm_cvtps_pd(a); 70 | } 71 | 72 | 73 | } // end namespace internal 74 | 75 | } // end namespace Eigen 76 | 77 | #endif // EIGEN_TYPE_CASTING_SSE_H 78 | -------------------------------------------------------------------------------- /extern/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 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_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /extern/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 | -------------------------------------------------------------------------------- /extern/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 | #elif defined __GNUC__ && __GNUC__>=6 12 | #pragma GCC diagnostic pop 13 | #endif 14 | 15 | #if defined __NVCC__ 16 | // Don't reenable the diagnostic messages, as it turns out these messages need 17 | // to be disabled at the point of the template instantiation (i.e the user code) 18 | // otherwise they'll be triggered by nvcc. 19 | // #pragma diag_default code_is_unreachable 20 | // #pragma diag_default initialization_not_reachable 21 | // #pragma diag_default 2651 22 | // #pragma diag_default 2653 23 | #endif 24 | 25 | #endif 26 | 27 | #endif // EIGEN_WARNINGS_DISABLED 28 | -------------------------------------------------------------------------------- /extern/Eigen/src/QR/HouseholderQR_LAPACKE.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 LAPACKe 29 | * Householder QR decomposition of a matrix w/o pivoting based on 30 | * LAPACKE_?geqrf function. 31 | ******************************************************************************** 32 | */ 33 | 34 | #ifndef EIGEN_QR_LAPACKE_H 35 | #define EIGEN_QR_LAPACKE_H 36 | 37 | namespace Eigen { 38 | 39 | namespace internal { 40 | 41 | /** \internal Specialization for the data types supported by LAPACKe */ 42 | 43 | #define EIGEN_LAPACKE_QR_NOPIV(EIGTYPE, LAPACKE_TYPE, LAPACKE_PREFIX) \ 44 | template \ 45 | struct householder_qr_inplace_blocked \ 46 | { \ 47 | static void run(MatrixQR& mat, HCoeffs& hCoeffs, Index = 32, \ 48 | typename MatrixQR::Scalar* = 0) \ 49 | { \ 50 | lapack_int m = (lapack_int) mat.rows(); \ 51 | lapack_int n = (lapack_int) mat.cols(); \ 52 | lapack_int lda = (lapack_int) mat.outerStride(); \ 53 | lapack_int matrix_order = (MatrixQR::IsRowMajor) ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ 54 | LAPACKE_##LAPACKE_PREFIX##geqrf( matrix_order, m, n, (LAPACKE_TYPE*)mat.data(), lda, (LAPACKE_TYPE*)hCoeffs.data()); \ 55 | hCoeffs.adjointInPlace(); \ 56 | } \ 57 | }; 58 | 59 | EIGEN_LAPACKE_QR_NOPIV(double, double, d) 60 | EIGEN_LAPACKE_QR_NOPIV(float, float, s) 61 | EIGEN_LAPACKE_QR_NOPIV(dcomplex, lapack_complex_double, z) 62 | EIGEN_LAPACKE_QR_NOPIV(scomplex, lapack_complex_float, c) 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | 68 | #endif // EIGEN_QR_LAPACKE_H 69 | -------------------------------------------------------------------------------- /extern/Eigen/src/SparseCore/MappedSparseMatrix.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 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_MAPPED_SPARSEMATRIX_H 11 | #define EIGEN_MAPPED_SPARSEMATRIX_H 12 | 13 | namespace Eigen { 14 | 15 | /** \deprecated Use Map > 16 | * \class MappedSparseMatrix 17 | * 18 | * \brief Sparse matrix 19 | * 20 | * \param _Scalar the scalar type, i.e. the type of the coefficients 21 | * 22 | * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme. 23 | * 24 | */ 25 | namespace internal { 26 | template 27 | struct traits > : traits > 28 | {}; 29 | } // end namespace internal 30 | 31 | template 32 | class MappedSparseMatrix 33 | : public Map > 34 | { 35 | typedef Map > Base; 36 | 37 | public: 38 | 39 | typedef typename Base::StorageIndex StorageIndex; 40 | typedef typename Base::Scalar Scalar; 41 | 42 | inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0) 43 | : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr) 44 | {} 45 | 46 | /** Empty destructor */ 47 | inline ~MappedSparseMatrix() {} 48 | }; 49 | 50 | namespace internal { 51 | 52 | template 53 | struct evaluator > 54 | : evaluator > > 55 | { 56 | typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType; 57 | typedef evaluator > Base; 58 | 59 | evaluator() : Base() {} 60 | explicit evaluator(const XprType &mat) : Base(mat) {} 61 | }; 62 | 63 | } 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN_MAPPED_SPARSEMATRIX_H 68 | -------------------------------------------------------------------------------- /extern/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-2014 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 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /extern/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-2014 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 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /extern/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 | StorageIndex 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 | -------------------------------------------------------------------------------- /extern/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 parent; 52 | relax_end.setConstant(emptyIdxLU); 53 | descendants.setZero(); 54 | for (Index 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 (Index 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) = StorageIndex(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 | -------------------------------------------------------------------------------- /extern/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 std::size_t size_type; 26 | typedef std::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 | #if EIGEN_COMP_MSVC 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 | -------------------------------------------------------------------------------- /extern/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 | 42 | image_retval_base(const DecompositionType& dec, const MatrixType& originalMatrix) 43 | : m_dec(dec), m_rank(dec.rank()), 44 | m_cols(m_rank == 0 ? 1 : m_rank), 45 | m_originalMatrix(originalMatrix) 46 | {} 47 | 48 | inline Index rows() const { return m_dec.rows(); } 49 | inline Index cols() const { return m_cols; } 50 | inline Index rank() const { return m_rank; } 51 | inline const DecompositionType& dec() const { return m_dec; } 52 | inline const MatrixType& originalMatrix() const { return m_originalMatrix; } 53 | 54 | template inline void evalTo(Dest& dst) const 55 | { 56 | static_cast*>(this)->evalTo(dst); 57 | } 58 | 59 | protected: 60 | const DecompositionType& m_dec; 61 | Index m_rank, m_cols; 62 | const MatrixType& m_originalMatrix; 63 | }; 64 | 65 | } // end namespace internal 66 | 67 | #define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \ 68 | typedef typename DecompositionType::MatrixType MatrixType; \ 69 | typedef typename MatrixType::Scalar Scalar; \ 70 | typedef typename MatrixType::RealScalar RealScalar; \ 71 | typedef Eigen::internal::image_retval_base Base; \ 72 | using Base::dec; \ 73 | using Base::originalMatrix; \ 74 | using Base::rank; \ 75 | using Base::rows; \ 76 | using Base::cols; \ 77 | image_retval(const DecompositionType& dec, const MatrixType& originalMatrix) \ 78 | : Base(dec, originalMatrix) {} 79 | 80 | } // end namespace Eigen 81 | 82 | #endif // EIGEN_MISC_IMAGE_H 83 | -------------------------------------------------------------------------------- /extern/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 | 43 | explicit kernel_retval_base(const DecompositionType& dec) 44 | : m_dec(dec), 45 | m_rank(dec.rank()), 46 | m_cols(m_rank==dec.cols() ? 1 : dec.cols() - m_rank) 47 | {} 48 | 49 | inline Index rows() const { return m_dec.cols(); } 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 | 54 | template inline void evalTo(Dest& dst) const 55 | { 56 | static_cast*>(this)->evalTo(dst); 57 | } 58 | 59 | protected: 60 | const DecompositionType& m_dec; 61 | Index m_rank, m_cols; 62 | }; 63 | 64 | } // end namespace internal 65 | 66 | #define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \ 67 | typedef typename DecompositionType::MatrixType MatrixType; \ 68 | typedef typename MatrixType::Scalar Scalar; \ 69 | typedef typename MatrixType::RealScalar RealScalar; \ 70 | typedef Eigen::internal::kernel_retval_base Base; \ 71 | using Base::dec; \ 72 | using Base::rank; \ 73 | using Base::rows; \ 74 | using Base::cols; \ 75 | kernel_retval(const DecompositionType& dec) : Base(dec) {} 76 | 77 | } // end namespace Eigen 78 | 79 | #endif // EIGEN_MISC_KERNEL_H 80 | -------------------------------------------------------------------------------- /extern/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 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_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /extern/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /extern/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 included into the body of the base classes supporting matrix specific coefficient-wise functions. 12 | // This include MatrixBase and SparseMatrixBase. 13 | 14 | 15 | typedef CwiseUnaryOp, const Derived> CwiseAbsReturnType; 16 | typedef CwiseUnaryOp, const Derived> CwiseAbs2ReturnType; 17 | typedef CwiseUnaryOp, const Derived> CwiseSqrtReturnType; 18 | typedef CwiseUnaryOp, const Derived> CwiseSignReturnType; 19 | typedef CwiseUnaryOp, const Derived> CwiseInverseReturnType; 20 | 21 | /// \returns an expression of the coefficient-wise absolute value of \c *this 22 | /// 23 | /// Example: \include MatrixBase_cwiseAbs.cpp 24 | /// Output: \verbinclude MatrixBase_cwiseAbs.out 25 | /// 26 | EIGEN_DOC_UNARY_ADDONS(cwiseAbs,absolute value) 27 | /// 28 | /// \sa cwiseAbs2() 29 | /// 30 | EIGEN_DEVICE_FUNC 31 | EIGEN_STRONG_INLINE const CwiseAbsReturnType 32 | cwiseAbs() const { return CwiseAbsReturnType(derived()); } 33 | 34 | /// \returns an expression of the coefficient-wise squared absolute value of \c *this 35 | /// 36 | /// Example: \include MatrixBase_cwiseAbs2.cpp 37 | /// Output: \verbinclude MatrixBase_cwiseAbs2.out 38 | /// 39 | EIGEN_DOC_UNARY_ADDONS(cwiseAbs2,squared absolute value) 40 | /// 41 | /// \sa cwiseAbs() 42 | /// 43 | EIGEN_DEVICE_FUNC 44 | EIGEN_STRONG_INLINE const CwiseAbs2ReturnType 45 | cwiseAbs2() const { return CwiseAbs2ReturnType(derived()); } 46 | 47 | /// \returns an expression of the coefficient-wise square root of *this. 48 | /// 49 | /// Example: \include MatrixBase_cwiseSqrt.cpp 50 | /// Output: \verbinclude MatrixBase_cwiseSqrt.out 51 | /// 52 | EIGEN_DOC_UNARY_ADDONS(cwiseSqrt,square-root) 53 | /// 54 | /// \sa cwisePow(), cwiseSquare() 55 | /// 56 | EIGEN_DEVICE_FUNC 57 | inline const CwiseSqrtReturnType 58 | cwiseSqrt() const { return CwiseSqrtReturnType(derived()); } 59 | 60 | /// \returns an expression of the coefficient-wise signum of *this. 61 | /// 62 | /// Example: \include MatrixBase_cwiseSign.cpp 63 | /// Output: \verbinclude MatrixBase_cwiseSign.out 64 | /// 65 | EIGEN_DOC_UNARY_ADDONS(cwiseSign,sign function) 66 | /// 67 | EIGEN_DEVICE_FUNC 68 | inline const CwiseSignReturnType 69 | cwiseSign() const { return CwiseSignReturnType(derived()); } 70 | 71 | 72 | /// \returns an expression of the coefficient-wise inverse of *this. 73 | /// 74 | /// Example: \include MatrixBase_cwiseInverse.cpp 75 | /// Output: \verbinclude MatrixBase_cwiseInverse.out 76 | /// 77 | EIGEN_DOC_UNARY_ADDONS(cwiseInverse,inverse) 78 | /// 79 | /// \sa cwiseProduct() 80 | /// 81 | EIGEN_DEVICE_FUNC 82 | inline const CwiseInverseReturnType 83 | cwiseInverse() const { return CwiseInverseReturnType(derived()); } 84 | 85 | 86 | -------------------------------------------------------------------------------- /extern/GLUT/lib/glut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/GLUT/lib/glut.lib -------------------------------------------------------------------------------- /extern/GLUT/lib/glut32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/GLUT/lib/glut32.lib -------------------------------------------------------------------------------- /extern/include/DSU.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by teitoku on 2022-03-20. 3 | // 4 | #include 5 | #include "DSU.h" 6 | 7 | DSU::DSU() { 8 | pre.resize(1000); 9 | for (int i = 0; i < pre.size(); i++) 10 | pre[i] = i; 11 | } 12 | 13 | DSU::DSU(int x) { 14 | pre.resize(x); 15 | for (int i = 0; i < pre.size(); i++) 16 | pre[i] = i; 17 | } 18 | 19 | int DSU::find_root(int id) { 20 | int r = id; 21 | while (pre[r] != r) { 22 | r = pre[r]; 23 | } 24 | while (pre[id] != r) { 25 | int y = pre[id]; 26 | pre[id] = r; 27 | id = y; 28 | } 29 | return r; 30 | } 31 | 32 | void DSU::join(int x, int y) { 33 | if (find_root(x) != find_root(y)) { 34 | pre[find_root(x)] = find_root(y); 35 | } 36 | return; 37 | } -------------------------------------------------------------------------------- /extern/include/DSU.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by teitoku on 2022-03-20. 3 | // 4 | 5 | #ifndef IGAMEVIEW_DSU_H 6 | #define IGAMEVIEW_DSU_H 7 | #include 8 | 9 | class DSU { 10 | private: 11 | std::vectorpre; 12 | public: 13 | DSU(); 14 | DSU(int x); 15 | void join(int x,int y); 16 | int find_root(int x); 17 | }; 18 | 19 | 20 | #endif //IGAMEVIEW_DSU_H 21 | -------------------------------------------------------------------------------- /extern/include/stl_write.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class STLWrite { 9 | class Buffer{ 10 | public: 11 | char* p; 12 | int count; 13 | char* buffer ; 14 | 15 | Buffer(){ 16 | buffer = new char[5192000]; 17 | p = buffer; 18 | } 19 | ~Buffer(){ 20 | delete[] buffer; 21 | } 22 | void writehead(char h[]){ 23 | int a = 0; 24 | for(int i = 0; h[i] != '\0'; i++){ 25 | a++; 26 | *p = h[i]; 27 | p++; 28 | } 29 | for(; a < 80; a++ ){ 30 | buffer[a] = 0; 31 | } 32 | p = buffer + 80; 33 | count = 80; 34 | } 35 | void writeNum(uint32_t num){ 36 | *p++ = num & 0xff; 37 | *p++ = (num >> 8) & 0xff; 38 | *p++ = (num >> 16) & 0xff; 39 | *p++ = (num >> 24) & 0xff; 40 | count += sizeof(uint32_t); 41 | } 42 | void writePoint(float x, float y, float z){ 43 | float* p1 = (float*) p; 44 | *p1 = x; p1++; 45 | *p1 = y; p1++; 46 | *p1 = z; p1++; 47 | p += 3*sizeof(float); 48 | count += 3*sizeof(float); 49 | } 50 | void writeart(){ 51 | *p++ = 0; 52 | *p++ = 0; 53 | count += sizeof(uint16_t); 54 | } 55 | int size(){ 56 | return count; 57 | } 58 | }; 59 | 60 | class Shape{ 61 | public: 62 | float x, y, z; 63 | Shape(float x, float y, float z):x(x), y(y), z(z){} 64 | vector getpoint() { 65 | return vector{x,y,z}; 66 | } 67 | }; 68 | 69 | private: 70 | vector shapes; 71 | public: 72 | STLWrite(){} 73 | ~STLWrite(){ 74 | for(int i = 0; i < shapes.size(); i++) 75 | delete shapes[i]; 76 | } 77 | void add(float x,float y,float z){ 78 | shapes.push_back(new Shape(x,y,z)); 79 | } 80 | void write(string filename){ 81 | ofstream stl; 82 | stl.open(filename, std::ofstream::binary); 83 | Buffer a; 84 | char head[8] = "Shape3D"; 85 | a.writehead(head); 86 | a.writeNum(shapes.size()/3); 87 | for(int i=0;ix, shapes[i]->y, shapes[i]->z); 90 | a.writePoint(shapes[i+1]->x, shapes[i+1]->y, shapes[i+1]->z); 91 | a.writePoint(shapes[i+2]->x, shapes[i+2]->y, shapes[i+2]->z); 92 | a.writeart(); 93 | } 94 | stl.write(a.buffer, a.size()); 95 | stl.close(); 96 | } 97 | }; -------------------------------------------------------------------------------- /extern/lib/OpenMesh.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/lib/OpenMesh.lib -------------------------------------------------------------------------------- /extern/lib/lp_solve.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/lib/lp_solve.lib -------------------------------------------------------------------------------- /extern/openmesh/OpenMeshCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/OpenMeshCore.dll -------------------------------------------------------------------------------- /extern/openmesh/OpenMeshCored.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/OpenMeshCored.dll -------------------------------------------------------------------------------- /extern/openmesh/OpenMeshTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/OpenMeshTools.dll -------------------------------------------------------------------------------- /extern/openmesh/OpenMeshToolsd.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/OpenMeshToolsd.dll -------------------------------------------------------------------------------- /extern/openmesh/include/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 = static_cast(_v[idx]) 30 | | (static_cast(_v[idx+1]) << 1) 31 | | (static_cast(_v[idx+2]) << 2) 32 | | (static_cast(_v[idx+3]) << 3) 33 | | (static_cast(_v[idx+4]) << 4) 34 | | (static_cast(_v[idx+5]) << 5) 35 | | (static_cast(_v[idx+6]) << 6) 36 | | (static_cast(_v[idx+7]) << 7); 37 | _ostr << bits; 38 | } 39 | bytes = N; 40 | 41 | if (R) 42 | { 43 | bits = 0; 44 | switch(R) 45 | { 46 | case 7: bits |= (static_cast(_v[idx+6]) << 6); 47 | case 6: bits |= (static_cast(_v[idx+5]) << 5); 48 | case 5: bits |= (static_cast(_v[idx+4]) << 4); 49 | case 4: bits |= (static_cast(_v[idx+3]) << 3); 50 | case 3: bits |= (static_cast(_v[idx+2]) << 2); 51 | case 2: bits |= (static_cast(_v[idx+1]) << 1); 52 | case 1: bits |= static_cast(_v[idx+0]); 53 | } 54 | _ostr << bits; 55 | ++bytes; 56 | } 57 | 58 | assert( bytes == size_of(_v) ); 59 | 60 | return bytes; 61 | } 62 | 63 | static 64 | size_t restore( std::istream& _istr, value_type& _v, bool ) 65 | { 66 | size_t bytes = 0; 67 | 68 | size_t N = _v.size() / 8; 69 | size_t R = _v.size() % 8; 70 | 71 | size_t idx; // element index 72 | unsigned char bits; // bitset 73 | 74 | for (idx=0; idx < N; ++idx) 75 | { 76 | _istr >> bits; 77 | _v[idx+0] = ((bits & 0x01)!=0); 78 | _v[idx+1] = ((bits & 0x02)!=0); 79 | _v[idx+2] = ((bits & 0x04)!=0); 80 | _v[idx+3] = ((bits & 0x08)!=0); 81 | _v[idx+4] = ((bits & 0x10)!=0); 82 | _v[idx+5] = ((bits & 0x20)!=0); 83 | _v[idx+6] = ((bits & 0x40)!=0); 84 | _v[idx+7] = ((bits & 0x80)!=0); 85 | } 86 | bytes = N; 87 | 88 | if (R) 89 | { 90 | _istr >> bits; 91 | for(; idx < _v.size(); ++idx) 92 | _v[idx] = (bits & (1 << (idx%8)))!=0; 93 | ++bytes; 94 | } 95 | 96 | return bytes; 97 | } 98 | }; 99 | -------------------------------------------------------------------------------- /extern/openmesh/include/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 | -------------------------------------------------------------------------------- /extern/openmesh/include/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 | -------------------------------------------------------------------------------- /extern/openmesh/include/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 | -------------------------------------------------------------------------------- /extern/openmesh/include/OpenMesh/Core/Mesh/gen/footer.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | } // namespace Iterators 3 | } // namespace OpenMesh 4 | //============================================================================= 5 | #endif 6 | //============================================================================= 7 | -------------------------------------------------------------------------------- /extern/openmesh/include/OpenMesh/Core/System/config.hh: -------------------------------------------------------------------------------- 1 | /* ========================================================================= * 2 | * * 3 | * OpenMesh * 4 | * Copyright (c) 2001-2015, RWTH-Aachen University * 5 | * Department of Computer Graphics and Multimedia * 6 | * All rights reserved. * 7 | * www.openmesh.org * 8 | * * 9 | *---------------------------------------------------------------------------* 10 | * This file is part of OpenMesh. * 11 | *---------------------------------------------------------------------------* 12 | * * 13 | * Redistribution and use in source and binary forms, with or without * 14 | * modification, are permitted provided that the following conditions * 15 | * are met: * 16 | * * 17 | * 1. Redistributions of source code must retain the above copyright notice, * 18 | * this list of conditions and the following disclaimer. * 19 | * * 20 | * 2. Redistributions in binary form must reproduce the above copyright * 21 | * notice, this list of conditions and the following disclaimer in the * 22 | * documentation and/or other materials provided with the distribution. * 23 | * * 24 | * 3. Neither the name of the copyright holder nor the names of its * 25 | * contributors may be used to endorse or promote products derived from * 26 | * this software without specific prior written permission. * 27 | * * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * 30 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 31 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * 32 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * 33 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * 34 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 39 | * * 40 | * ========================================================================= */ 41 | 42 | 43 | 44 | #include 45 | -------------------------------------------------------------------------------- /extern/openmesh/include/OpenMesh/Core/Utils/HandleToPropHandle.hh: -------------------------------------------------------------------------------- 1 | #ifndef HANDLETOPROPHANDLE_HH_ 2 | #define HANDLETOPROPHANDLE_HH_ 3 | 4 | #include 5 | #include 6 | 7 | namespace OpenMesh { 8 | 9 | template 10 | struct HandleToPropHandle { 11 | }; 12 | 13 | template 14 | struct HandleToPropHandle { 15 | using type = OpenMesh::VPropHandleT; 16 | }; 17 | 18 | template 19 | struct HandleToPropHandle { 20 | using type = OpenMesh::HPropHandleT; 21 | }; 22 | 23 | template 24 | struct HandleToPropHandle { 25 | using type = OpenMesh::EPropHandleT; 26 | }; 27 | 28 | template 29 | struct HandleToPropHandle { 30 | using type = OpenMesh::FPropHandleT; 31 | }; 32 | 33 | template 34 | struct HandleToPropHandle { 35 | using type = OpenMesh::MPropHandleT; 36 | }; 37 | 38 | } // namespace OpenMesh 39 | 40 | #endif // HANDLETOPROPHANDLE_HH_ -------------------------------------------------------------------------------- /extern/openmesh/include/OpenMesh/Tools/Utils/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef _GETOPT_H_ 2 | #define _GETOPT_H_ 3 | 4 | #include 5 | #include 6 | 7 | #if defined(_MSC_VER) 8 | #if defined(__cplusplus) 9 | 10 | extern "C" { 11 | 12 | extern OPENMESHDLLEXPORT int opterr; 13 | extern OPENMESHDLLEXPORT int optind; 14 | extern OPENMESHDLLEXPORT int optopt; 15 | extern OPENMESHDLLEXPORT int optreset; 16 | extern OPENMESHDLLEXPORT char *optarg; 17 | 18 | OPENMESHDLLEXPORT extern int getopt(int nargc, char * const *nargv, const char *ostr); 19 | 20 | } 21 | 22 | #endif 23 | 24 | #elif defined __APPLE__ 25 | #include 26 | #else 27 | #include 28 | #endif 29 | 30 | #endif /* _GETOPT_H_ */ 31 | -------------------------------------------------------------------------------- /extern/openmesh/lib/OpenMeshCore.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/lib/OpenMeshCore.lib -------------------------------------------------------------------------------- /extern/openmesh/lib/OpenMeshCored.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/lib/OpenMeshCored.lib -------------------------------------------------------------------------------- /extern/openmesh/lib/OpenMeshTools.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/lib/OpenMeshTools.lib -------------------------------------------------------------------------------- /extern/openmesh/lib/OpenMeshToolsd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/openmesh/lib/OpenMeshToolsd.lib -------------------------------------------------------------------------------- /extern/pmp/BoundingBox.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2021 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/Types.h" 7 | 8 | namespace pmp { 9 | 10 | //! Simple class for representing a bounding box. 11 | //! \ingroup core 12 | class BoundingBox 13 | { 14 | public: 15 | //! Construct infinite/invalid bounding box. 16 | BoundingBox() 17 | : min_(std::numeric_limits::max()), 18 | max_(-std::numeric_limits::max()) 19 | { 20 | } 21 | 22 | //! Construct from min and max points. 23 | BoundingBox(const Point& min, const Point& max) : min_(min), max_(max) {} 24 | 25 | //! Add point to the bounding box. 26 | BoundingBox& operator+=(const Point& p) 27 | { 28 | for (int i = 0; i < 3; ++i) 29 | { 30 | if (p[i] < min_[i]) 31 | min_[i] = p[i]; 32 | if (p[i] > max_[i]) 33 | max_[i] = p[i]; 34 | } 35 | return *this; 36 | } 37 | 38 | //! Add two bounding boxes. 39 | BoundingBox& operator+=(const BoundingBox& bb) 40 | { 41 | for (int i = 0; i < 3; ++i) 42 | { 43 | if (bb.min_[i] < min_[i]) 44 | min_[i] = bb.min_[i]; 45 | if (bb.max_[i] > max_[i]) 46 | max_[i] = bb.max_[i]; 47 | } 48 | return *this; 49 | } 50 | 51 | //! Get min point. 52 | Point& min() { return min_; } 53 | 54 | //! Get max point. 55 | Point& max() { return max_; } 56 | 57 | //! Get center point. 58 | Point center() const { return 0.5f * (min_ + max_); } 59 | 60 | //! Indicate if the bounding box is empty. 61 | bool is_empty() const 62 | { 63 | return (max_[0] < min_[0] || max_[1] < min_[1] || max_[2] < min_[2]); 64 | } 65 | 66 | //! Get the size of the bounding box. 67 | Scalar size() const { return is_empty() ? 0.0 : distance(max_, min_); } 68 | 69 | private: 70 | Point min_, max_; 71 | }; 72 | 73 | } // namespace pmp 74 | -------------------------------------------------------------------------------- /extern/pmp/Exceptions.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace pmp { 9 | 10 | //! \addtogroup core 11 | //! @{ 12 | 13 | //! \brief Exception indicating invalid input passed to a function. 14 | //! \details This exception should be used to signal violation of a 15 | //! precondition, e.g., if an algorithm expects a pure triangle mesh but a 16 | //! general polygon mesh is passed instead. 17 | class InvalidInputException : public std::invalid_argument 18 | { 19 | public: 20 | InvalidInputException(const std::string& what) : std::invalid_argument(what) 21 | { 22 | } 23 | }; 24 | 25 | //! \brief Exception indicating failure so solve an equation system. 26 | class SolverException : public std::runtime_error 27 | { 28 | public: 29 | SolverException(const std::string& what) : std::runtime_error(what) {} 30 | }; 31 | 32 | //! \brief Exception indicating failure to allocate a new resource. 33 | //! \details This exception signals an error resulting from an attempt to exceed 34 | //! implementation-defined allocation limits. 35 | class AllocationException : public std::length_error 36 | { 37 | public: 38 | AllocationException(const std::string& what) : std::length_error(what) {} 39 | }; 40 | 41 | //! \brief Exception indicating a topological error has occurred. 42 | class TopologyException : public std::logic_error 43 | { 44 | public: 45 | TopologyException(const std::string& what) : std::logic_error(what) {} 46 | }; 47 | 48 | //! \brief Exception indicating an error occurred while performing IO. 49 | class IOException : public std::runtime_error 50 | { 51 | public: 52 | IOException(const std::string& what) : std::runtime_error(what) {} 53 | }; 54 | 55 | //! @} 56 | 57 | } // namespace pmp 58 | -------------------------------------------------------------------------------- /extern/pmp/MemoryUsage.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #if defined _WIN32 7 | #include 8 | #include 9 | #elif defined __linux__ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #elif defined __APPLE__ 15 | #include 16 | #endif 17 | 18 | namespace pmp { 19 | 20 | //! A simple class to retrieve memory usage information. 21 | //! \ingroup core 22 | class MemoryUsage 23 | { 24 | public: 25 | //! \brief Get the maximum memory size the application has used so far. 26 | //! \return the max. resident set size (RSS) in bytes 27 | static size_t max_size(); 28 | 29 | //! \brief Get the currently used memory. 30 | //! \return the current resident set size (RSS) in bytes 31 | static size_t current_size(); 32 | }; 33 | 34 | size_t MemoryUsage::max_size() 35 | { 36 | #if defined(_WIN32) 37 | 38 | PROCESS_MEMORY_COUNTERS info; 39 | GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info)); 40 | return (size_t)info.PeakWorkingSetSize; 41 | 42 | #elif defined(__linux__) || defined(__APPLE__) 43 | 44 | struct rusage rusage; 45 | getrusage(RUSAGE_SELF, &rusage); 46 | 47 | #if defined(__APPLE__) 48 | return (size_t)rusage.ru_maxrss; 49 | #else 50 | return (size_t)(rusage.ru_maxrss * 1024); 51 | #endif 52 | 53 | #endif 54 | return 0; 55 | } 56 | 57 | size_t MemoryUsage::current_size() 58 | { 59 | #if defined(_WIN32) 60 | 61 | PROCESS_MEMORY_COUNTERS info; 62 | GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info)); 63 | return (size_t)info.WorkingSetSize; 64 | 65 | #elif defined(__linux__) 66 | 67 | long rss = 0; 68 | FILE* fp = nullptr; 69 | 70 | if ((fp = fopen("/proc/self/statm", "r")) == nullptr) 71 | { 72 | std::cerr << "Failed to read process information file" << std::endl; 73 | return 0; 74 | } 75 | 76 | if (fscanf(fp, "%*s%ld", &rss) != 1) 77 | { 78 | std::cerr << "Failed to retrieve RSS information" << std::endl; 79 | fclose(fp); 80 | return 0; 81 | } 82 | 83 | fclose(fp); 84 | return (size_t)rss * (size_t)sysconf(_SC_PAGESIZE); 85 | 86 | #elif defined(__APPLE__) 87 | 88 | struct mach_task_basic_info info; 89 | mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT; 90 | auto ret = task_info(mach_task_self(), MACH_TASK_BASIC_INFO, 91 | (task_info_t)&info, &infoCount); 92 | if (ret != KERN_SUCCESS) 93 | { 94 | std::cerr << "Failed to retrieve task information" << std::endl; 95 | return 0; 96 | } 97 | return (size_t)info.resident_size; 98 | 99 | #else 100 | return 0; 101 | #endif 102 | } 103 | 104 | } // namespace pmp 105 | -------------------------------------------------------------------------------- /extern/pmp/SurfaceMeshIO.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2021 the Polygon Mesh Processing Library developers. 2 | // Copyright 2001-2005 by Computer Graphics Group, RWTH Aachen 3 | // Distributed under a MIT-style license, see LICENSE.txt for details. 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include "pmp/Types.h" 11 | #include "pmp/SurfaceMesh.h" 12 | 13 | namespace pmp { 14 | 15 | class SurfaceMeshIO 16 | { 17 | public: 18 | SurfaceMeshIO(std::string filename, IOFlags flags) 19 | : filename_(std::move(filename)), flags_(std::move(flags)) 20 | { 21 | } 22 | 23 | void read(SurfaceMesh& mesh); 24 | 25 | void write(const SurfaceMesh& mesh); 26 | 27 | private: 28 | void read_off(SurfaceMesh& mesh); 29 | void read_obj(SurfaceMesh& mesh); 30 | void read_stl(SurfaceMesh& mesh); 31 | void read_ply(SurfaceMesh& mesh); 32 | void read_pmp(SurfaceMesh& mesh); 33 | void read_xyz(SurfaceMesh& mesh); 34 | void read_agi(SurfaceMesh& mesh); 35 | 36 | void write_off(const SurfaceMesh& mesh); 37 | void write_off_binary(const SurfaceMesh& mesh); 38 | void write_obj(const SurfaceMesh& mesh); 39 | void write_stl(const SurfaceMesh& mesh); 40 | void write_ply(const SurfaceMesh& mesh); 41 | void write_pmp(const SurfaceMesh& mesh); 42 | void write_xyz(const SurfaceMesh& mesh); 43 | 44 | private: 45 | std::string filename_; 46 | IOFlags flags_; 47 | }; 48 | 49 | } // namespace pmp 50 | -------------------------------------------------------------------------------- /extern/pmp/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace pmp { 10 | 11 | //! A simple timer class. 12 | //! \ingroup core 13 | class Timer 14 | { 15 | public: 16 | //! Constructor 17 | Timer() = default; 18 | 19 | //! Start time measurement 20 | void start() 21 | { 22 | elapsed_ = 0.0; 23 | cont(); 24 | } 25 | 26 | //! Continue measurement, accumulates elapased times 27 | void cont() 28 | { 29 | start_time_ = hclock::now(); 30 | is_running_ = true; 31 | } 32 | 33 | //! Stop time measurement, return elapsed time in ms 34 | Timer& stop() 35 | { 36 | using std::chrono::duration_cast; 37 | end_time_ = hclock::now(); 38 | duration time_span = duration_cast(end_time_ - start_time_); 39 | elapsed_ += time_span.count(); 40 | is_running_ = false; 41 | return *this; 42 | } 43 | 44 | //! Return elapsed time in ms (watch has to be stopped). 45 | double elapsed() const 46 | { 47 | if (is_running_) 48 | { 49 | std::cerr << "Timer: stop timer before calling elapsed()\n"; 50 | } 51 | return 1000.0 * elapsed_; 52 | } 53 | 54 | private: 55 | using hclock = std::chrono::high_resolution_clock; 56 | using time_point = std::chrono::time_point; 57 | using duration = std::chrono::duration; 58 | 59 | time_point start_time_, end_time_; 60 | double elapsed_{0.0}; 61 | bool is_running_{false}; 62 | }; 63 | 64 | //! output a timer to a stream 65 | inline std::ostream& operator<<(std::ostream& os, const Timer& timer) 66 | { 67 | os << timer.elapsed() << " ms"; 68 | return os; 69 | } 70 | 71 | } // namespace pmp 72 | -------------------------------------------------------------------------------- /extern/pmp/Types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2021 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include "pmp/MatVec.h" 9 | 10 | //! \def PMP_ASSERT(x) 11 | //! Custom assert macro that allows to silence unused variable warnings with no 12 | //! overhead. Generates no code in release mode since if the argument to 13 | //! sizeof() is an expression it is not evaluated. In debug mode we just fall 14 | //! back to the default assert(). 15 | #ifdef NDEBUG 16 | #define PMP_ASSERT(x) \ 17 | do \ 18 | { \ 19 | (void)sizeof(x); \ 20 | } while (0) 21 | #else 22 | #define PMP_ASSERT(x) assert(x) 23 | #endif 24 | 25 | //! The pmp-library namespace 26 | namespace pmp { 27 | 28 | //! \addtogroup core 29 | //! @{ 30 | 31 | //! Scalar type 32 | #ifdef PMP_SCALAR_TYPE_64 33 | using Scalar = double; 34 | #else 35 | using Scalar = float; 36 | #endif 37 | 38 | //! Point type 39 | using Point = Vector; 40 | 41 | //! Normal type 42 | using Normal = Vector; 43 | 44 | //! Color type 45 | using Color = Vector; 46 | 47 | //! Texture coordinate type 48 | using TexCoord = Vector; 49 | 50 | // define index type to be used 51 | #ifdef PMP_INDEX_TYPE_64 52 | using IndexType = std::uint_least64_t; 53 | #define PMP_MAX_INDEX UINT_LEAST64_MAX 54 | #else 55 | using IndexType = std::uint_least32_t; 56 | #define PMP_MAX_INDEX UINT_LEAST32_MAX 57 | #endif 58 | 59 | //! Common IO flags for reading and writing 60 | struct IOFlags 61 | { 62 | bool use_binary = false; //!< read / write binary format 63 | bool use_vertex_normals = false; //!< read / write vertex normals 64 | bool use_vertex_colors = false; //!< read / write vertex colors 65 | bool use_vertex_texcoords = false; //!< read / write vertex texcoords 66 | bool use_face_normals = false; //!< read / write face normals 67 | bool use_face_colors = false; //!< read / write face colors 68 | bool use_halfedge_texcoords = false; //!< read / write halfedge texcoords 69 | }; 70 | 71 | //! @} 72 | 73 | //! \defgroup core core 74 | //! \brief Core data structure and utilities. 75 | 76 | //! \defgroup algorithms algorithms 77 | //! \brief Geometry processing algorithms. 78 | 79 | //! \defgroup visualization visualization 80 | //! \brief Visualization tools using OpenGL. 81 | 82 | } // namespace pmp 83 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/BarycentricCoordinates.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/MatVec.h" 7 | 8 | namespace pmp { 9 | 10 | template 11 | const Vector barycentric_coordinates(const Vector& p, 12 | const Vector& u, 13 | const Vector& v, 14 | const Vector& w) 15 | { 16 | Vector result(1.0 / 3.0); // default: barycenter 17 | 18 | Vector vu = v - u, wu = w - u, pu = p - u; 19 | 20 | // find largest absolute coodinate of normal 21 | Scalar nx = vu[1] * wu[2] - vu[2] * wu[1], 22 | ny = vu[2] * wu[0] - vu[0] * wu[2], 23 | nz = vu[0] * wu[1] - vu[1] * wu[0], ax = fabs(nx), ay = fabs(ny), 24 | az = fabs(nz); 25 | 26 | unsigned char maxCoord; 27 | 28 | if (ax > ay) 29 | { 30 | if (ax > az) 31 | { 32 | maxCoord = 0; 33 | } 34 | else 35 | { 36 | maxCoord = 2; 37 | } 38 | } 39 | else 40 | { 41 | if (ay > az) 42 | { 43 | maxCoord = 1; 44 | } 45 | else 46 | { 47 | maxCoord = 2; 48 | } 49 | } 50 | 51 | // solve 2D problem 52 | switch (maxCoord) 53 | { 54 | case 0: 55 | { 56 | if (1.0 + ax != 1.0) 57 | { 58 | result[1] = 1.0 + (pu[1] * wu[2] - pu[2] * wu[1]) / nx - 1.0; 59 | result[2] = 1.0 + (vu[1] * pu[2] - vu[2] * pu[1]) / nx - 1.0; 60 | result[0] = 1.0 - result[1] - result[2]; 61 | } 62 | break; 63 | } 64 | 65 | case 1: 66 | { 67 | if (1.0 + ay != 1.0) 68 | { 69 | result[1] = 1.0 + (pu[2] * wu[0] - pu[0] * wu[2]) / ny - 1.0; 70 | result[2] = 1.0 + (vu[2] * pu[0] - vu[0] * pu[2]) / ny - 1.0; 71 | result[0] = 1.0 - result[1] - result[2]; 72 | } 73 | break; 74 | } 75 | 76 | case 2: 77 | { 78 | if (1.0 + az != 1.0) 79 | { 80 | result[1] = 1.0 + (pu[0] * wu[1] - pu[1] * wu[0]) / nz - 1.0; 81 | result[2] = 1.0 + (vu[0] * pu[1] - vu[1] * pu[0]) / nz - 1.0; 82 | result[0] = 1.0 - result[1] - result[2]; 83 | } 84 | break; 85 | } 86 | } 87 | 88 | return result; 89 | } 90 | 91 | } // namespace pmp 92 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # make sure to install headers, use relative path from top-level since we're 2 | # included from above 3 | file(GLOB HEADERS ./algorithms/*.h) 4 | file(GLOB SOURCES ./algorithms/*.cpp) 5 | 6 | if(PMP_INSTALL) 7 | install(FILES ${HEADERS} DESTINATION include/pmp/algorithms) 8 | endif() 9 | 10 | target_sources(pmp PRIVATE "${SOURCES}" "${HEADERS}") 11 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/DistancePointTriangle.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/Types.h" 7 | 8 | namespace pmp { 9 | 10 | //! \addtogroup algorithms 11 | //! @{ 12 | 13 | //! Compute the distance of a point p to a line segment given by points (v0,v1). 14 | Scalar dist_point_line_segment(const Point& p, const Point& v0, const Point& v1, 15 | Point& nearest_point); 16 | 17 | //! Compute the distance of a point p to the triangle given by points (v0, v1, v2). 18 | Scalar dist_point_triangle(const Point& p, const Point& v0, const Point& v1, 19 | const Point& v2, Point& nearest_point); 20 | 21 | //! @} 22 | 23 | } // namespace pmp 24 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/NormalCone.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2021 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/Types.h" 7 | 8 | #include 9 | 10 | namespace pmp { 11 | 12 | //! \brief A class implementing a normal cone. 13 | //! \ingroup algorithms 14 | class NormalCone 15 | { 16 | public: 17 | //! default constructor (not initialized) 18 | NormalCone() = default; 19 | 20 | //! Initialize cone with center (unit vector) and angle (radius in radians) 21 | NormalCone(const Normal& normal, Scalar angle = 0.0) 22 | : center_normal_(normal), angle_(angle) 23 | { 24 | } 25 | 26 | //! returns center normal 27 | const Normal& center_normal() const { return center_normal_; } 28 | 29 | //! returns size of cone (radius in radians) 30 | Scalar angle() const { return angle_; } 31 | 32 | //! merge *this with n. 33 | NormalCone& merge(const Normal& n) { return merge(NormalCone(n)); } 34 | 35 | //! merge *this with nc. *this will then enclose both cones. 36 | NormalCone& merge(const NormalCone& nc) 37 | { 38 | const Scalar dp = dot(center_normal_, nc.center_normal_); 39 | 40 | // axes point in same direction 41 | if (dp > 0.99999) 42 | { 43 | angle_ = std::max(angle_, nc.angle_); 44 | } 45 | 46 | // axes point in opposite directions 47 | else if (dp < -0.99999) 48 | { 49 | angle_ = 2 * M_PI; 50 | } 51 | 52 | else 53 | { 54 | // new angle 55 | Scalar center_angle = std::acos(dp); 56 | Scalar min_angle = std::min(-angle_, center_angle - nc.angle_); 57 | Scalar max_angle = std::max(angle_, center_angle + nc.angle_); 58 | angle_ = 0.5 * (max_angle - min_angle); 59 | 60 | // axis by SLERP 61 | Scalar axis_angle = 0.5 * (min_angle + max_angle); 62 | center_normal_ = 63 | ((center_normal_ * std::sin(center_angle - axis_angle) + 64 | nc.center_normal_ * std::sin(axis_angle)) / 65 | std::sin(center_angle)); 66 | } 67 | 68 | return *this; 69 | } 70 | 71 | private: 72 | Normal center_normal_; 73 | Scalar angle_; 74 | }; 75 | 76 | } // namespace pmp 77 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/Quadric.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/Types.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief This class stores a quadric as a symmetric 4x4 matrix. 11 | //! \details Used by the error quadric mesh decimation algorithms. 12 | //! \ingroup algorithms 13 | class Quadric 14 | { 15 | public: // clang-format off 16 | 17 | //! construct quadric from upper triangle of symmetrix 4x4 matrix 18 | Quadric(double a, double b, double c, double d, 19 | double e, double f, double g, 20 | double h, double i, 21 | double j) 22 | : a_(a), b_(b), c_(c), d_(d), 23 | e_(e), f_(f), g_(g), 24 | h_(h), i_(i), 25 | j_(j) 26 | {} 27 | 28 | //! constructor quadric from given plane equation: ax+by+cz+d=0 29 | Quadric(double a=0.0, double b=0.0, double c=0.0, double d=0.0) 30 | : a_(a*a), b_(a*b), c_(a*c), d_(a*d), 31 | e_(b*b), f_(b*c), g_(b*d), 32 | h_(c*c), i_(c*d), 33 | j_(d*d) 34 | {} 35 | 36 | //! construct from point and normal specifying a plane 37 | Quadric(const Normal& n, const Point& p) 38 | { 39 | *this = Quadric(n[0], n[1], n[2], -dot(n,p)); 40 | } 41 | 42 | //! set all matrix entries to zero 43 | void clear() { a_ = b_ = c_ = d_ = e_ = f_ = g_ = h_ = i_ = j_ = 0.0; } 44 | 45 | //! add given quadric to this quadric 46 | Quadric& operator+=(const Quadric& q) 47 | { 48 | a_ += q.a_; b_ += q.b_; c_ += q.c_; d_ += q.d_; 49 | e_ += q.e_; f_ += q.f_; g_ += q.g_; 50 | h_ += q.h_; i_ += q.i_; 51 | j_ += q.j_; 52 | return *this; 53 | } 54 | 55 | //! multiply quadric by a scalar 56 | Quadric& operator*=(double s) 57 | { 58 | a_ *= s; b_ *= s; c_ *= s; d_ *= s; 59 | e_ *= s; f_ *= s; g_ *= s; 60 | h_ *= s; i_ *= s; 61 | j_ *= s; 62 | return *this; 63 | } 64 | 65 | //! evaluate quadric Q at position p by computing (p^T * Q * p) 66 | double operator()(const Point& p) const 67 | { 68 | const double x(p[0]), y(p[1]), z(p[2]); 69 | return a_*x*x + 2.0*b_*x*y + 2.0*c_*x*z + 2.0*d_*x 70 | + e_*y*y + 2.0*f_*y*z + 2.0*g_*y 71 | + h_*z*z + 2.0*i_*z 72 | + j_; 73 | } 74 | 75 | private: 76 | 77 | double a_, b_, c_, d_, 78 | e_, f_, g_, 79 | h_, i_, 80 | j_; 81 | }; // clang-format on 82 | 83 | } // namespace pmp 84 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceCurvature.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief Compute per-vertex curvature (min,max,mean,Gaussian). 11 | //! \details Curvature values for boundary vertices are interpolated from their 12 | //! interior neighbors. Curvature values can be smoothed. See 13 | //! \cite meyer_2003_discrete and \cite cohen-steiner_2003_restricted for 14 | //! details. 15 | //! \ingroup algorithms 16 | class SurfaceCurvature 17 | { 18 | public: 19 | //! construct with mesh to be analyzed 20 | SurfaceCurvature(SurfaceMesh& mesh); 21 | 22 | //! destructor 23 | ~SurfaceCurvature(); 24 | 25 | //! compute curvature information for each vertex, optionally followed 26 | //! by some smoothing iterations of the curvature values 27 | void analyze(unsigned int post_smoothing_steps = 0); 28 | 29 | //! compute curvature information for each vertex, optionally followed 30 | //! by some smoothing iterations of the curvature values 31 | void analyze_tensor(unsigned int post_smoothing_steps = 0, 32 | bool two_ring_neighborhood = false); 33 | 34 | //! return mean curvature 35 | Scalar mean_curvature(Vertex v) const 36 | { 37 | return 0.5 * (min_curvature_[v] + max_curvature_[v]); 38 | } 39 | 40 | //! return Gaussian curvature 41 | Scalar gauss_curvature(Vertex v) const 42 | { 43 | return min_curvature_[v] * max_curvature_[v]; 44 | } 45 | 46 | //! return minimum (signed) curvature 47 | Scalar min_curvature(Vertex v) const { return min_curvature_[v]; } 48 | 49 | //! return maximum (signed) curvature 50 | Scalar max_curvature(Vertex v) const { return max_curvature_[v]; } 51 | 52 | //! return maximum absolute curvature 53 | Scalar max_abs_curvature(Vertex v) const 54 | { 55 | return std::max(fabs(min_curvature_[v]), fabs(max_curvature_[v])); 56 | } 57 | 58 | //! convert (precomputed) mean curvature to 1D texture coordinates 59 | void mean_curvature_to_texture_coordinates() const; 60 | 61 | //! convert (precomputed) Gauss curvature to 1D texture coordinates 62 | void gauss_curvature_to_texture_coordinates() const; 63 | 64 | //! convert (precomputed) max. abs. curvature to 1D texture coordinates 65 | void max_curvature_to_texture_coordinates() const; 66 | 67 | private: 68 | //! smooth curvature values 69 | void smooth_curvatures(unsigned int iterations); 70 | 71 | //! convert curvature values ("v:curv") to 1D texture coordinates 72 | void curvature_to_texture_coordinates() const; 73 | 74 | private: 75 | SurfaceMesh& mesh_; 76 | VertexProperty min_curvature_; 77 | VertexProperty max_curvature_; 78 | }; 79 | 80 | } // namespace pmp 81 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceFairing.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include "pmp/SurfaceMesh.h" 9 | 10 | namespace pmp { 11 | 12 | //! \brief A class for implicitly fairing a surface mesh. 13 | //! \details See also \cite desbrun_1999_implicit . 14 | //! \ingroup algorithms 15 | class SurfaceFairing 16 | { 17 | public: 18 | //! Construct with mesh to be processed. 19 | SurfaceFairing(SurfaceMesh& mesh); 20 | 21 | // destructor 22 | ~SurfaceFairing(); 23 | 24 | //! minimize surface area (class SurfaceFairing::fair(1)) 25 | void minimize_area() { fair(1); } 26 | 27 | //! minimize surface curvature (class SurfaceFairing::fair(2)) 28 | void minimize_curvature() { fair(2); } 29 | 30 | //! compute surface by solving k-harmonic equation 31 | //! \throw SolverException in case of failure to solve the linear system 32 | //! \throw InvalidInputException in case of missing boundary constraints 33 | void fair(unsigned int k = 2); 34 | 35 | private: 36 | void setup_matrix_row(const Vertex v, VertexProperty vweight, 37 | EdgeProperty eweight, 38 | unsigned int laplace_degree, 39 | std::map& row); 40 | 41 | private: 42 | SurfaceMesh& mesh_; //!< the mesh 43 | 44 | // property handles 45 | VertexProperty points_; 46 | VertexProperty vselected_; 47 | VertexProperty vlocked_; 48 | VertexProperty vweight_; 49 | EdgeProperty eweight_; 50 | VertexProperty idx_; 51 | }; 52 | 53 | } // namespace pmp 54 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceFeatures.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #include "pmp/algorithms/SurfaceFeatures.h" 5 | #include "pmp/algorithms/SurfaceNormals.h" 6 | 7 | namespace pmp { 8 | 9 | SurfaceFeatures::SurfaceFeatures(SurfaceMesh& mesh) : mesh_(mesh) 10 | { 11 | vfeature_ = mesh_.vertex_property("v:feature", false); 12 | efeature_ = mesh_.edge_property("e:feature", false); 13 | } 14 | 15 | void SurfaceFeatures::clear() 16 | { 17 | for (auto v : mesh_.vertices()) 18 | vfeature_[v] = false; 19 | 20 | for (auto e : mesh_.edges()) 21 | efeature_[e] = false; 22 | } 23 | 24 | size_t SurfaceFeatures::detect_boundary() 25 | { 26 | for (auto v : mesh_.vertices()) 27 | if (mesh_.is_boundary(v)) 28 | vfeature_[v] = true; 29 | 30 | size_t n_edges = 0; 31 | for (auto e : mesh_.edges()) 32 | if (mesh_.is_boundary(e)) 33 | { 34 | efeature_[e] = true; 35 | n_edges++; 36 | } 37 | return n_edges; 38 | } 39 | 40 | size_t SurfaceFeatures::detect_angle(Scalar angle) 41 | { 42 | const Scalar feature_cosine = cos(angle / 180.0 * M_PI); 43 | size_t n_edges = 0; 44 | for (auto e : mesh_.edges()) 45 | { 46 | if (!mesh_.is_boundary(e)) 47 | { 48 | const auto f0 = mesh_.face(mesh_.halfedge(e, 0)); 49 | const auto f1 = mesh_.face(mesh_.halfedge(e, 1)); 50 | 51 | const Normal n0 = SurfaceNormals::compute_face_normal(mesh_, f0); 52 | const Normal n1 = SurfaceNormals::compute_face_normal(mesh_, f1); 53 | 54 | if (dot(n0, n1) < feature_cosine) 55 | { 56 | efeature_[e] = true; 57 | vfeature_[mesh_.vertex(e, 0)] = true; 58 | vfeature_[mesh_.vertex(e, 1)] = true; 59 | n_edges++; 60 | } 61 | } 62 | } 63 | return n_edges; 64 | } 65 | 66 | } // namespace pmp 67 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceFeatures.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief Detect and mark feature edges based on boundary or dihedral angle. 11 | //! \ingroup algorithms 12 | class SurfaceFeatures 13 | { 14 | public: 15 | //! \brief Construct with mesh to be analyzed. 16 | //! \details Adds two \c bool properties to the mesh if they are not already 17 | //! existing: 18 | //! - \c "e:feature" to mark feature edges 19 | //! - \c "v:feature" to mark feature vertices. 20 | //! 21 | //! \note The class never removes the marker properties so that other 22 | //! algorithms can re-use this information. Cleaning up the properties when 23 | //! they are no longer needed is the responsibility of the caller. 24 | SurfaceFeatures(SurfaceMesh& mesh); 25 | 26 | //! \brief Clear feature and boundary edges. 27 | //! \details Sets all \c "e:feature" and \c "v:feature" properties to \c false. 28 | //! \note This does not remove the corresponding property arrays. 29 | void clear(); 30 | 31 | //! \brief Mark all boundary edges as features. 32 | //! \return The number of boudary edges detected. 33 | size_t detect_boundary(); 34 | 35 | //! \brief Mark edges with dihedral angle larger than \p angle as feature. 36 | //! \return The number of feature edges detected. 37 | size_t detect_angle(Scalar angle); 38 | 39 | private: 40 | SurfaceMesh& mesh_; 41 | 42 | VertexProperty vfeature_; 43 | EdgeProperty efeature_; 44 | }; 45 | 46 | } // namespace pmp 47 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceNormals.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief A class for computing surface normals. 11 | //! \details This class provides a set of static functions for computing surface 12 | //! normal information, either 13 | //! 14 | //! \li per vertex: compute_vertex_normal() 15 | //! \li per face: compute_face_normal() 16 | //! \li per corner: compute_corner_normal() 17 | //! 18 | //! The convenience functions compute_vertex_normals() and compute_face_normals() 19 | //! compute the normals for the whole mesh and add a corresponding vertex or 20 | //! face property. 21 | //! \ingroup algorithms 22 | class SurfaceNormals 23 | { 24 | public: 25 | // delete default and copy constructor 26 | SurfaceNormals() = delete; 27 | SurfaceNormals(const SurfaceNormals&) = delete; 28 | 29 | //! \brief Compute vertex normals for the whole \p mesh. 30 | //! \details Calls compute_vertex_normal() for each vertex and adds a new 31 | //! vertex property of type Normal named "v:normal". 32 | static void compute_vertex_normals(SurfaceMesh& mesh); 33 | 34 | //! \brief Compute face normals for the whole \p mesh. 35 | //! \details Calls compute_face_normal() for each face and adds a new face 36 | //! property of type Normal named "f:normal". 37 | static void compute_face_normals(SurfaceMesh& mesh); 38 | 39 | //! \brief Compute the normal vector of vertex \p v. 40 | static Normal compute_vertex_normal(const SurfaceMesh& mesh, Vertex v); 41 | 42 | //! \brief Compute the normal vector of face \p f. 43 | //! \details Normal is computed as (normalized) sum of per-corner 44 | //! cross products of the two incident edges. This corresponds to 45 | //! the normalized vector area in \cite alexa_2011_laplace 46 | static Normal compute_face_normal(const SurfaceMesh& mesh, Face f); 47 | 48 | //! \brief Compute the normal vector of the polygon corner specified by the 49 | //! target vertex of halfedge \p h. 50 | //! \details Averages incident corner normals if they are within crease_angle 51 | //! of the face normal. \p crease_angle is in radians, not degrees. 52 | static Normal compute_corner_normal(const SurfaceMesh& mesh, Halfedge h, 53 | Scalar crease_angle); 54 | }; 55 | 56 | } // namespace pmp 57 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceParameterization.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief A class for surface parameterization. 11 | //! \details See \cite levy_2002_least and \cite desbrun_2002_intrinsic 12 | //! for more details. 13 | //! \ingroup algorithms 14 | class SurfaceParameterization 15 | { 16 | public: 17 | //! \brief Construct with mesh to be parameterized. 18 | //! \pre The mesh has a boundary. 19 | //! \throw InvalidInputException if the input precondition is violated. 20 | SurfaceParameterization(SurfaceMesh& mesh); 21 | 22 | //! \brief Compute discrete harmonic parameterization. 23 | //! \throw SolverException in case of failure to solve the linear system. 24 | void harmonic(bool use_uniform_weights = false); 25 | 26 | //! \brief Compute parameterization based on least squares conformal mapping. 27 | //! \throw SolverException in case of failure to solve the linear system. 28 | void lscm(); 29 | 30 | private: 31 | //! setup boundary constraints: map surface boundary to unit circle 32 | void setup_boundary_constraints(); 33 | 34 | //! setup boundary: pin the two farthest boundary vertices 35 | void setup_lscm_boundary(); 36 | 37 | private: 38 | //! the mesh 39 | SurfaceMesh& mesh_; 40 | }; 41 | 42 | } // namespace pmp 43 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceSmoothing.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief A class for Laplacian smoothing 11 | //! \details See also \cite desbrun_1999_implicit and \cite kazhdan_2012 12 | //! \ingroup algorithms 13 | class SurfaceSmoothing 14 | { 15 | public: 16 | //! Construct with mesh to be smoothed. 17 | //! \pre \p mesh is not empty 18 | //! \throw InvalidInputException if \p mesh is empty 19 | SurfaceSmoothing(SurfaceMesh& mesh); 20 | 21 | // destructor 22 | ~SurfaceSmoothing(); 23 | 24 | //! Perform \p iters iterations of explicit Laplacian smoothing. 25 | //! Decide whether to use uniform Laplacian or cotan Laplacian (default: cotan). 26 | void explicit_smoothing(unsigned int iters = 10, 27 | bool use_uniform_laplace = false); 28 | 29 | //! \brief Perform implicit Laplacian smoothing. 30 | //! \param timestep The time step taken. 31 | //! \param use_uniform_laplace Decide whether to use uniform Laplacian or cotan Laplacian. Default: cotan. 32 | //! \param rescale Decide whether to re-center and re-scale model after smoothing. Default: true. 33 | //! \throw SolverException in case of a failure to solve the linear system. 34 | void implicit_smoothing(Scalar timestep = 0.001, 35 | bool use_uniform_laplace = false, 36 | bool rescale = true); 37 | 38 | //! Initialize edge and vertex weights. 39 | void initialize(bool use_uniform_laplace = false) 40 | { 41 | compute_edge_weights(use_uniform_laplace); 42 | compute_vertex_weights(use_uniform_laplace); 43 | } 44 | 45 | private: 46 | //! Initialize cotan/uniform Laplace weights. 47 | void compute_edge_weights(bool use_uniform_laplace); 48 | 49 | //! Initialize cotan/uniform Laplace weights. 50 | void compute_vertex_weights(bool use_uniform_laplace); 51 | 52 | private: 53 | //! the mesh 54 | SurfaceMesh& mesh_; 55 | 56 | // remember for how many vertices/edges we computed weights 57 | // recompute if numbers change (i.e. mesh has changed) 58 | unsigned int how_many_edge_weights_; 59 | unsigned int how_many_vertex_weights_; 60 | }; 61 | 62 | } // namespace pmp 63 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceSubdivision.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2022 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include "pmp/SurfaceMesh.h" 7 | 8 | namespace pmp { 9 | 10 | //! \brief A class providing surface subdivision algorithms. 11 | //! \ingroup algorithms 12 | class SurfaceSubdivision 13 | { 14 | public: 15 | //! Construct with mesh to be subdivided. 16 | SurfaceSubdivision(SurfaceMesh& mesh); 17 | 18 | //! \brief Perform one step of Catmull-Clark subdivision. 19 | //! \details See \cite catmull_1978_recursively for details. 20 | void catmull_clark(); 21 | 22 | //! \brief Perform one step of Loop subdivision. 23 | //! \details See \cite loop_1987_smooth for details. 24 | //! \pre Requires a pure triangle mesh as input. 25 | //! \throw InvalidInputException in case the input violates the precondition. 26 | void loop(); 27 | 28 | //! \brief Perform one step of quad-tri subdivision. 29 | //! \details See \cite stam_2003_subdiv for details. 30 | void quad_tri(); 31 | 32 | private: 33 | SurfaceMesh& mesh_; 34 | VertexProperty points_; 35 | VertexProperty vfeature_; 36 | EdgeProperty efeature_; 37 | }; 38 | 39 | } // namespace pmp 40 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/SurfaceTriangulation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2021 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include "pmp/SurfaceMesh.h" 9 | 10 | namespace pmp { 11 | 12 | //! \brief Triangulate polygons to get a pure triangle mesh. 13 | //! \details Triangulate n-gons into n-2 triangles. Finds the triangulation that 14 | //! minimizes the sum of squared triangle areas, or the one that maximizes the 15 | //! minimum angle. 16 | //! See \cite liepa_2003_filling for details. 17 | //! \ingroup algorithms 18 | class SurfaceTriangulation 19 | { 20 | public: 21 | //! Triangulation objective 22 | enum class Objective 23 | { 24 | MIN_AREA, //!< minimize the sum of squared areas 25 | MAX_ANGLE //!< maximize the minimum angle 26 | } objective_; 27 | 28 | //! Construct with mesh 29 | SurfaceTriangulation(SurfaceMesh& mesh); 30 | 31 | //! Triangulate all faces 32 | void triangulate(Objective o = Objective::MIN_AREA); 33 | 34 | //! Triangulate the Face \p f 35 | //! \pre The input face is manifold 36 | //! \throw InvalidInputException in case the input precondition is violated 37 | void triangulate(Face f, Objective o = Objective::MIN_AREA); 38 | 39 | private: 40 | // Compute the weight of the triangle (i,j,k). 41 | Scalar compute_weight(int i, int j, int k) const; 42 | 43 | // Does edge (a,b) exist? 44 | bool is_edge(Vertex a, Vertex b) const; 45 | 46 | // Add edge from vertex i to j. 47 | bool insert_edge(int i, int j); 48 | 49 | // mesh and properties 50 | SurfaceMesh& mesh_; 51 | VertexProperty points_; 52 | std::vector halfedges_; 53 | std::vector vertices_; 54 | 55 | // data for computing optimal triangulation 56 | std::vector> weight_; 57 | std::vector> index_; 58 | }; 59 | 60 | } // namespace pmp 61 | -------------------------------------------------------------------------------- /extern/pmp/algorithms/TriangleKdTree.h: -------------------------------------------------------------------------------- 1 | // Copyright 2011-2020 the Polygon Mesh Processing Library developers. 2 | // Distributed under a MIT-style license, see LICENSE.txt for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include "pmp/SurfaceMesh.h" 10 | 11 | namespace pmp { 12 | 13 | //! \brief A k-d tree for triangles 14 | //! \ingroup algorithms 15 | class TriangleKdTree 16 | { 17 | public: 18 | //! Construct with mesh. 19 | TriangleKdTree(std::shared_ptr mesh, 20 | unsigned int max_faces = 10, unsigned int max_depth = 30); 21 | 22 | //! destructor 23 | ~TriangleKdTree() { delete root_; } 24 | 25 | //! nearest neighbor information 26 | struct NearestNeighbor 27 | { 28 | Scalar dist; 29 | Face face; 30 | Point nearest; 31 | }; 32 | 33 | //! Return handle of the nearest neighbor 34 | NearestNeighbor nearest(const Point& p) const; 35 | 36 | private: 37 | // triangle stores corners and face handle 38 | struct Triangle 39 | { 40 | Triangle() = default; 41 | Triangle(const Point& x0, const Point& x1, const Point& x2, Face ff) 42 | { 43 | x[0] = x0; 44 | x[1] = x1; 45 | x[2] = x2; 46 | f = ff; 47 | } 48 | 49 | std::array x; 50 | Face f; 51 | }; 52 | 53 | // vector of Triangle 54 | using Triangles = std::vector; 55 | 56 | // Node of the tree: contains parent, children and splitting plane 57 | struct Node 58 | { 59 | Node() = default; 60 | 61 | ~Node() 62 | { 63 | delete faces; 64 | delete left_child; 65 | delete right_child; 66 | } 67 | 68 | unsigned char axis; 69 | Scalar split; 70 | Triangles* faces{nullptr}; 71 | Node* left_child{nullptr}; 72 | Node* right_child{nullptr}; 73 | }; 74 | 75 | // Recursive part of build() 76 | void build_recurse(Node* node, unsigned int max_handles, 77 | unsigned int depth); 78 | 79 | // Recursive part of nearest() 80 | void nearest_recurse(Node* node, const Point& point, 81 | NearestNeighbor& data) const; 82 | 83 | Node* root_; 84 | }; 85 | 86 | } // namespace pmp 87 | -------------------------------------------------------------------------------- /extern/pmp/rply/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SOURCES ./*.c) 2 | file(GLOB HEADERS ./*.h) 3 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 4 | if(WIN32) 5 | add_compile_definitions(_CRT_SECURE_NO_WARNINGS) 6 | endif() 7 | 8 | if(MSVC) 9 | add_compile_options(/wd4700) 10 | endif() 11 | add_library(rply OBJECT ${SOURCES} ${HEADERS}) -------------------------------------------------------------------------------- /extern/pmp/rply/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/pmp/rply/LICENSE -------------------------------------------------------------------------------- /extern/pmp/rply/etc/dump.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rply.h" 3 | 4 | static int vertex_cb(p_ply_argument argument) { 5 | long eol; 6 | ply_get_argument_user_data(argument, NULL, &eol); 7 | printf("%g", ply_get_argument_value(argument)); 8 | if (eol) printf("\n"); 9 | else printf(" "); 10 | return 1; 11 | } 12 | 13 | static int face_cb(p_ply_argument argument) { 14 | long length, value_index; 15 | ply_get_argument_property(argument, NULL, &length, &value_index); 16 | switch (value_index) { 17 | case 0: 18 | case 1: 19 | printf("%g ", ply_get_argument_value(argument)); 20 | break; 21 | case 2: 22 | printf("%g\n", ply_get_argument_value(argument)); 23 | break; 24 | default: 25 | break; 26 | } 27 | return 1; 28 | } 29 | 30 | int main(void) { 31 | long nvertices, ntriangles; 32 | p_ply ply = ply_open("input.ply", NULL, 0, NULL); 33 | if (!ply) return 1; 34 | if (!ply_read_header(ply)) return 1; 35 | nvertices = ply_set_read_cb(ply, "vertex", "x", vertex_cb, NULL, 0); 36 | ply_set_read_cb(ply, "vertex", "y", vertex_cb, NULL, 0); 37 | ply_set_read_cb(ply, "vertex", "z", vertex_cb, NULL, 1); 38 | ntriangles = ply_set_read_cb(ply, "face", "vertex_indices", face_cb, NULL, 0); 39 | printf("%ld\n%ld\n", nvertices, ntriangles); 40 | if (!ply_read(ply)) return 1; 41 | ply_close(ply); 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /extern/pmp/rply/etc/input.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment this is our first comment 4 | element vertex 3 5 | property float x 6 | property float y 7 | property float z 8 | element face 1 9 | property list uchar int vertex_indices 10 | comment this is our last comment 11 | end_header 12 | -1 0 0 13 | 000 1 0 14 | 1 0000 0 15 | 3 1 00000 2 16 | 3 1 0 2 17 | -------------------------------------------------------------------------------- /extern/pmp/rply/etc/sconvert.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rply.h" 3 | 4 | static int callback(p_ply_argument argument) { 5 | void *pdata; 6 | /* just pass the value from the input file to the output file */ 7 | ply_get_argument_user_data(argument, &pdata, NULL); 8 | ply_write((p_ply) pdata, ply_get_argument_value(argument)); 9 | return 1; 10 | } 11 | 12 | static int setup_callbacks(p_ply iply, p_ply oply) { 13 | p_ply_element element = NULL; 14 | /* iterate over all elements in input file */ 15 | while ((element = ply_get_next_element(iply, element))) { 16 | p_ply_property property = NULL; 17 | long ninstances = 0; 18 | const char *element_name; 19 | ply_get_element_info(element, &element_name, &ninstances); 20 | /* add this element to output file */ 21 | if (!ply_add_element(oply, element_name, ninstances)) return 0; 22 | /* iterate over all properties of current element */ 23 | while ((property = ply_get_next_property(element, property))) { 24 | const char *property_name; 25 | e_ply_type type, length_type, value_type; 26 | ply_get_property_info(property, &property_name, &type, 27 | &length_type, &value_type); 28 | /* setup input callback for this property */ 29 | ply_set_read_cb(iply, element_name, property_name, callback, 30 | oply, 0); 31 | /* add this property to output file */ 32 | if (!ply_add_property(oply, property_name, type, length_type, 33 | value_type)) return 0; 34 | } 35 | } 36 | return 1; 37 | } 38 | 39 | int main(int argc, char *argv[]) { 40 | const char *value; 41 | p_ply iply, oply; 42 | (void) argc; (void) argv; 43 | iply = ply_open("input.ply", NULL, 0, NULL); 44 | if (!iply) return 1; 45 | if (!ply_read_header(iply)) return 1; 46 | oply = ply_create("output.ply", PLY_LITTLE_ENDIAN, NULL, 0, NULL); 47 | if (!oply) return 1; 48 | if (!setup_callbacks(iply, oply)) return 1; 49 | /* pass comments and obj_infos from input to output */ 50 | value = NULL; 51 | while ((value = ply_get_next_comment(iply, value))) 52 | if (!ply_add_comment(oply, value)) return 1; 53 | value = NULL; 54 | while ((value = ply_get_next_obj_info(iply, value))) 55 | if (!ply_add_obj_info(oply, value)) return 1;; 56 | /* write output header */ 57 | if (!ply_write_header(oply)) return 1; 58 | /* read input file generating callbacks that pass data to output file */ 59 | if (!ply_read(iply)) return 1; 60 | /* close up, we are done */ 61 | if (!ply_close(iply)) return 1; 62 | if (!ply_close(oply)) return 1; 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /extern/pmp/rply/manual/reference.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 1em; 3 | margin-right: 1em; 4 | font-family: "Verdana", sans-serif; 5 | } 6 | 7 | tt { 8 | font-family: "Andale Mono", monospace; 9 | } 10 | 11 | h1, h2, h3, h4 { margin-left: 0em; } 12 | 13 | 14 | h3 { padding-top: 1em; } 15 | 16 | p { margin-left: 1em; } 17 | 18 | p.name { 19 | font-family: "Andale Mono", monospace; 20 | padding-top: 1em; 21 | margin-left: 0em; 22 | } 23 | 24 | a[href] { color: #7f0000; } 25 | 26 | blockquote { margin-left: 3em; } 27 | 28 | pre.example { 29 | background: #cbb; 30 | padding: 1em; 31 | margin-left: 1em; 32 | font-family: "Andale Mono", monospace; 33 | font-size: small; 34 | } 35 | 36 | hr { 37 | margin-left: 0em; 38 | background: #7f0000; 39 | border: 0px; 40 | height: 1px; 41 | } 42 | 43 | ul { list-style-type: disc; } 44 | 45 | table.index { border: 1px #7f0000; } 46 | table.index td { text-align: left; vertical-align: top; } 47 | table.index ul { padding-top: 0em; margin-top: 0em; } 48 | 49 | h1:first-letter, 50 | h2:first-letter, 51 | h2:first-letter, 52 | h3:first-letter { color: #7f0000; } 53 | 54 | div.header, div.footer { margin-left: 0em; } 55 | -------------------------------------------------------------------------------- /extern/pmp/rply/manual/rply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/extern/pmp/rply/manual/rply.png -------------------------------------------------------------------------------- /extern/pmp/rply/rplyfile.h: -------------------------------------------------------------------------------- 1 | #ifndef RPLY_FILE_H 2 | #define RPLY_FILE_H 3 | /* ---------------------------------------------------------------------- 4 | * RPly library, read/write PLY files 5 | * Diego Nehab, IMPA 6 | * http://www.impa.br/~diego/software/rply 7 | * 8 | * This library is distributed under the MIT License. See notice 9 | * at the end of this file. 10 | * ---------------------------------------------------------------------- */ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /* ---------------------------------------------------------------------- 17 | * Opens a PLY file for reading (fails if file is not a PLY file) 18 | * 19 | * file_pointer: FILE * to file open for reading 20 | * error_cb: error callback function 21 | * idata,pdata: contextual information available to users 22 | * 23 | * Returns 1 if successful, 0 otherwise 24 | * ---------------------------------------------------------------------- */ 25 | p_ply ply_open_from_file(FILE *file_pointer, p_ply_error_cb error_cb, 26 | long idata, void *pdata); 27 | 28 | /* ---------------------------------------------------------------------- 29 | * Creates new PLY file 30 | * 31 | * file_pointer: FILE * to a file open for writing 32 | * storage_mode: file format mode 33 | * error_cb: error callback function 34 | * idata,pdata: contextual information available to users 35 | * 36 | * Returns handle to PLY file if successfull, NULL otherwise 37 | * ---------------------------------------------------------------------- */ 38 | p_ply ply_create_to_file(FILE *file_pointer, e_ply_storage_mode storage_mode, 39 | p_ply_error_cb error_cb, long idata, void *pdata); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* RPLY_FILE_H */ 46 | 47 | /* ---------------------------------------------------------------------- 48 | * Copyright (C) 2003-2015 Diego Nehab. All rights reserved. 49 | * 50 | * Permission is hereby granted, free of charge, to any person obtaining 51 | * a copy of this software and associated documentation files (the 52 | * "Software"), to deal in the Software without restriction, including 53 | * without limitation the rights to use, copy, modify, merge, publish, 54 | * distribute, sublicense, and/or sell copies of the Software, and to 55 | * permit persons to whom the Software is furnished to do so, subject to 56 | * the following conditions: 57 | * 58 | * The above copyright notice and this permission notice shall be 59 | * included in all copies or substantial portions of the Software. 60 | * 61 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 62 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 63 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 64 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 65 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 66 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 67 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 68 | * ---------------------------------------------------------------------- */ 69 | -------------------------------------------------------------------------------- /iGame for Games302 安装使用指南.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/iGame for Games302 安装使用指南.pdf -------------------------------------------------------------------------------- /iGameMeshView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | 主窗口类,实现有关界面UI和信号&槽的连接 4 | */ 5 | #include "ui_Turbine_Blade.h" 6 | #if __linux__ 7 | #include 8 | #include 9 | #else 10 | #include 11 | #include 12 | #endif 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "ModelDraw.h" 19 | 20 | class ModelView; 21 | class iGameMeshView : public QMainWindow 22 | { 23 | Q_OBJECT 24 | private: 25 | Ui::MainWindow *ui; 26 | public: 27 | iGameMeshView( QWidget *parent = Q_NULLPTR ); 28 | ~iGameMeshView(void); 29 | public slots: 30 | // 表面网格 31 | bool OpenMesh(void); 32 | bool SaveMesh(void); 33 | bool LastMesh(void); 34 | bool NextMesh(void); 35 | bool CopyMesh(void); 36 | bool RecoverMesh(void); 37 | bool AddNoise(void); 38 | bool MotorcycleGraphs(void); 39 | bool MeshAlgorithm1(); 40 | bool MeshAlgorithm2(); 41 | bool MeshAlgorithm3(); 42 | 43 | 44 | 45 | // Nurbs 46 | bool OpenNurbs(void); 47 | bool CreateNurbsCurve(void); 48 | bool CreateNurbsSurface(void); 49 | bool CreateNurbsVolume(void); 50 | bool SaveNurbs(void); 51 | 52 | 53 | bool ViewStylePoints (); // 渲染样式点 54 | bool ViewStyleLines (); // 渲染样式线 55 | bool ViewStyleFill (); // 渲染样式片(平滑) 56 | bool ViewStyleFlatFill(); // 渲染片(非平滑) 57 | bool ViewClear(); // 清除模型 58 | bool ViewLight(); // 灯光渲染 59 | bool ViewNormal(); // 法线渲染 60 | bool ChangeSurfaceGrid(); 61 | bool ChangeFaceCull(); 62 | bool ChangeCoordCircle(); 63 | 64 | void PrintMeshInfo(); 65 | 66 | bool setModelView(); 67 | bool setPickItem(); 68 | bool setModelCut(); 69 | bool setPickPoint(); 70 | bool setPickEdge(); 71 | bool setPickFace(); 72 | bool setPickCell(); 73 | bool removeSelectedAll(); 74 | bool cutModel(); 75 | bool ChangeCutFlag(); 76 | bool UpdateCutXYZ(); 77 | 78 | bool removeLine(); 79 | 80 | signals: 81 | bool editOpen ();//开启编辑模式 82 | 83 | }; 84 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "iGameMeshView.h" 2 | #include 3 | #if __linux__ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #else 9 | #include 10 | #include 11 | #include 12 | #include 13 | #endif 14 | int main(int argc, char *argv[]) 15 | { 16 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // 窗口高分辨率支持 17 | QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);// 图标高分辨率支持 18 | //QCoreApplication::setAttribute (Qt::AA_UseDesktopOpenGL); 19 | QApplication a(argc, argv); 20 | a.processEvents (); 21 | QSurfaceFormat format; 22 | format.setRenderableType (QSurfaceFormat::OpenGL); 23 | format.setSamples (16); 24 | format.setDepthBufferSize (32); 25 | //format.setStencilBufferSize (16); 26 | format.setVersion (4,1); 27 | //format.setProfile (QSurfaceFormat::CompatibilityProfile); 28 | format.setProfile (QSurfaceFormat::CoreProfile); 29 | QSurfaceFormat::setDefaultFormat (format); 30 | QPixmap pixmap ("../Resources/iGameLogo.png"); 31 | QSplashScreen splash (pixmap); 32 | splash.show (); 33 | QTextCodec *codec = QTextCodec::codecForName ("GBK"); 34 | iGameMeshView w; 35 | w.setWindowTitle (codec->toUnicode ("iGame")); 36 | splash.finish (&w); 37 | w.show (); 38 | return a.exec(); 39 | } 40 | -------------------------------------------------------------------------------- /psblack/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/add_bottom.png -------------------------------------------------------------------------------- /psblack/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/add_left.png -------------------------------------------------------------------------------- /psblack/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/add_right.png -------------------------------------------------------------------------------- /psblack/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/add_top.png -------------------------------------------------------------------------------- /psblack/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/branch_close.png -------------------------------------------------------------------------------- /psblack/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/branch_open.png -------------------------------------------------------------------------------- /psblack/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/calendar_nextmonth.png -------------------------------------------------------------------------------- /psblack/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/calendar_prevmonth.png -------------------------------------------------------------------------------- /psblack/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_checked.png -------------------------------------------------------------------------------- /psblack/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_checked_disable.png -------------------------------------------------------------------------------- /psblack/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_parcial.png -------------------------------------------------------------------------------- /psblack/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /psblack/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_unchecked.png -------------------------------------------------------------------------------- /psblack/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /psblack/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/radiobutton_checked.png -------------------------------------------------------------------------------- /psblack/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /psblack/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/radiobutton_unchecked.png -------------------------------------------------------------------------------- /psblack/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iGame-Lab/iGameView/21e39c1e5a1b659c8d41ab1ebbaafaba92bc1627/psblack/radiobutton_unchecked_disable.png --------------------------------------------------------------------------------