├── .qmake.cache ├── ACGMakefile ├── CHANGELOG ├── CMakeLists.txt ├── Doc ├── ACGMakefile ├── CMakeLists.txt ├── Concepts │ ├── MeshItems.hh │ └── MeshKernel.hh ├── Examples │ ├── BaseExporter.hh │ ├── BaseImporter.hh │ ├── BaseReader.hh │ ├── adasub.cc │ ├── build-trimesh.cc │ ├── circulator_functions.cc │ ├── circulators.cc │ ├── decimater.cc │ ├── draw_normals.cc │ ├── iterators.cc │ ├── mesh_io.cc │ ├── mymesh.cc │ ├── nav_code1.cc │ ├── nav_code2.cc │ ├── nav_code3.cc │ ├── nav_code4.cc │ ├── nav_code4a.cc │ ├── traits0.cc │ ├── traits1.cc │ ├── traits2.cc │ ├── traits3.cc │ ├── traits4.cc │ └── traits5.cc ├── Tutorial │ ├── 01-build_cube │ │ ├── ACGMakefile │ │ └── build_cube.cc │ ├── 02-iterators │ │ ├── ACGMakefile │ │ └── smooth.cc │ ├── 03-properties │ │ ├── ACGMakefile │ │ └── smooth.cc │ ├── 04-stl_algorithms │ │ ├── ACGMakefile │ │ ├── smooth.cc │ │ └── smooth_algo.hh │ ├── 05-std_properties │ │ ├── ACGMakefile │ │ └── properties.cc │ ├── 06-attributes │ │ ├── ACGMakefile │ │ └── attributes.cc │ ├── 07-traits │ │ ├── ACGMakefile │ │ └── smooth.cc │ ├── 07b-delete_geometry │ │ └── delete_geometry.cc │ ├── 08-io_options │ │ ├── ACGMakefile │ │ └── io_options.cc │ ├── 09-persistence │ │ ├── ACGMakefile │ │ ├── fill_props.hh │ │ ├── generate_cube.hh │ │ ├── int2roman.cc │ │ ├── int2roman.hh │ │ ├── persistence.cc │ │ └── stats.hh │ ├── ACGMakefile │ └── CMakeLists.txt ├── changelog.docu ├── decimater.docu ├── doxy.config.in ├── html │ ├── acg_footer.html │ └── acg_icon.gif ├── images │ ├── class-hierarchy.png │ ├── class-hierarchy2.png │ ├── collapse_info.png │ ├── diagrams.sxi │ ├── halfedge_structure.gif │ ├── halfedge_structure2.png │ ├── halfedge_structure3.png │ ├── inheritance-simple.png │ ├── inheritance-simple.scaled.png │ ├── inheritance.fig │ ├── inheritance.gif │ ├── iomanager.gif │ ├── iomanager.png │ ├── mesh.collapse.png │ ├── mesh.flip.png │ ├── mesh.inner.png │ ├── mesh.inout.png │ ├── mesh.normal.png │ ├── mesh.opp.png │ ├── mesh.outer.png │ ├── om-format.png │ └── src │ │ ├── iomanager.tex │ │ ├── mesh.collapse.tex │ │ ├── mesh.flip.tex │ │ ├── mesh.inner.tex │ │ ├── mesh.io.tex │ │ ├── mesh.normal.tex │ │ ├── mesh.opp.tex │ │ └── mesh.outer.tex ├── mainpage.docu ├── mesh.docu ├── misc.docu ├── namespaces.docu ├── navigation.docu ├── operations.docu ├── subdivider.docu ├── tools.docu ├── tutorial_01.docu ├── tutorial_02.docu ├── tutorial_03.docu ├── tutorial_04.docu ├── tutorial_05.docu ├── tutorial_06.docu ├── tutorial_07.docu ├── tutorial_07b.docu ├── tutorial_08.docu ├── tutorial_09.docu ├── tutorial_build.docu ├── tutorial_main.docu └── vdpm.docu ├── LICENSE ├── COPYING ├── COPYING.EXCEPTIONS ├── COPYING.LESSER └── LICENSEHEADER ├── OpenMesh.pro ├── README ├── VERSION ├── VS2008OpenMesh.sln ├── cmake ├── ACGCommon.cmake ├── ACGCompiler.cmake ├── ACGDoxygen.cmake ├── ACGOutput.cmake ├── FindGLEW.cmake ├── FindGLUT.cmake ├── FindGoogleTest.cmake ├── FindOpenMP.cmake ├── OpenMeshPackage.cmake ├── fixbundle.cmake.in └── fixbundle.cmake.win.in ├── debian ├── changelog ├── compat ├── control ├── copyright └── rules ├── qmake ├── all.include ├── architecture.include ├── compiler.include ├── functions.include ├── packages │ ├── packages.Darwin │ ├── packages.Linux │ └── packages.Windows └── targets.include ├── release.howto ├── src ├── OpenMesh │ ├── ACGMakefile │ ├── ACGMakefile.proj │ ├── Apps │ │ ├── CMakeLists.txt │ │ ├── Decimating │ │ │ ├── CmdOption.hh │ │ │ ├── DecimaterGui │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── DecimaterGui.pro │ │ │ ├── DecimaterViewerWidget.cc │ │ │ ├── DecimaterViewerWidget.hh │ │ │ ├── commandlineDecimater │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── commandlineDecimater.pro │ │ │ ├── decimater.cc │ │ │ └── decimaterviewer.cc │ │ ├── Dualizer │ │ │ ├── CMakeLists.txt │ │ │ └── dualizer.cc │ │ ├── ProgViewer │ │ │ ├── ACGMakefile │ │ │ ├── CMakeLists.txt │ │ │ ├── OpenMesh_Apps_ProgViewer.vcproj │ │ │ ├── ProgViewerWidget.cc │ │ │ ├── ProgViewerWidget.hh │ │ │ └── progviewer.cc │ │ ├── QtViewer │ │ │ ├── CMakeLists.txt │ │ │ ├── MeshViewerWidget.hh │ │ │ ├── MeshViewerWidgetT.cc │ │ │ ├── MeshViewerWidgetT.hh │ │ │ ├── QGLViewerWidget.cc │ │ │ ├── QGLViewerWidget.hh │ │ │ ├── QtViewer.pro │ │ │ └── meshviewer.cc │ │ ├── Smoothing │ │ │ ├── CMakeLists.txt │ │ │ ├── Smoothing.pro │ │ │ └── smooth.cc │ │ ├── Subdivider │ │ │ ├── MeshViewerWidget.hh │ │ │ ├── SubdivideWidget.cc │ │ │ ├── SubdivideWidget.hh │ │ │ ├── SubdividerGui │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SubdividerGui.pro │ │ │ ├── adaptive_subdivider.cc │ │ │ ├── commandlineAdaptiveSubdivider │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── commandlineAdaptiveSubdivider.pro │ │ │ ├── commandlineSubdivider │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── commandlineSubdivider.pro │ │ │ ├── qtsubdivider.cc │ │ │ └── subdivider.cc │ │ ├── Unsupported │ │ │ ├── IvViewer │ │ │ │ ├── ACGMakefile │ │ │ │ ├── SoOpenMeshNodeT.cc │ │ │ │ ├── SoOpenMeshNodeT.hh │ │ │ │ ├── SoOpenMeshSupport.hh │ │ │ │ └── ivviewer.cc │ │ │ ├── OsgViewer │ │ │ │ ├── ACGMakefile │ │ │ │ ├── README │ │ │ │ ├── meshviewer.cc │ │ │ │ └── osgviewer.cc │ │ │ ├── Streaming-qt4 │ │ │ │ ├── ACGMakefile │ │ │ │ ├── Client │ │ │ │ │ ├── ACGMakefile │ │ │ │ │ ├── MeshViewerWidgetT.cc │ │ │ │ │ ├── MeshViewerWidgetT.hh │ │ │ │ │ ├── MyMesh.hh │ │ │ │ │ ├── QGLViewerWidget.cc │ │ │ │ │ ├── QGLViewerWidget.hh │ │ │ │ │ ├── VDPMClientViewerWidget.cc │ │ │ │ │ ├── VDPMClientViewerWidget.hh │ │ │ │ │ ├── VDPMStreamingClient.cc │ │ │ │ │ └── camera.cmr │ │ │ │ └── Server │ │ │ │ │ ├── ACGMakefile │ │ │ │ │ ├── ServerSideVDPM.cc │ │ │ │ │ ├── ServerSideVDPM.hh │ │ │ │ │ ├── VDPMServerSession.cc │ │ │ │ │ ├── VDPMServerSession.hh │ │ │ │ │ ├── VDPMServerSocket.hh │ │ │ │ │ ├── VDPMServerViewerWidget.cc │ │ │ │ │ ├── VDPMServerViewerWidget.hh │ │ │ │ │ ├── VDPMStreamingServer.cc │ │ │ │ │ ├── VDPMStreamingServer.hh │ │ │ │ │ ├── bunny.pm │ │ │ │ │ ├── bunny.spm │ │ │ │ │ └── rockerArm.pm │ │ │ └── Streaming │ │ │ │ ├── ACGMakefile │ │ │ │ ├── Client │ │ │ │ ├── ACGMakefile │ │ │ │ ├── MeshViewerWidgetT.cc │ │ │ │ ├── MeshViewerWidgetT.hh │ │ │ │ ├── MyMesh.hh │ │ │ │ ├── QGLViewerWidget.cc │ │ │ │ ├── QGLViewerWidget.hh │ │ │ │ ├── VDPMClientViewerWidget.cc │ │ │ │ ├── VDPMClientViewerWidget.hh │ │ │ │ └── VDPMStreamingClient.cc │ │ │ │ └── Server │ │ │ │ ├── ACGMakefile │ │ │ │ ├── ServerSideVDPM.cc │ │ │ │ ├── ServerSideVDPM.hh │ │ │ │ ├── VDPMServerSession.cc │ │ │ │ ├── VDPMServerSession.hh │ │ │ │ ├── VDPMServerSocket.hh │ │ │ │ ├── VDPMServerViewerWidget.cc │ │ │ │ ├── VDPMServerViewerWidget.hh │ │ │ │ ├── VDPMStreamingServer.cc │ │ │ │ └── VDPMStreamingServer.hh │ │ ├── VDProgMesh │ │ │ ├── Analyzer │ │ │ │ ├── Analyzer.pro │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── vdpmanalyzer.cc │ │ │ ├── Synthesizer │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Synthesizer.pro │ │ │ │ ├── VDPMSynthesizerViewerWidget.cc │ │ │ │ ├── VDPMSynthesizerViewerWidget.hh │ │ │ │ └── vdpmsynthesizer.cc │ │ │ └── mkbalancedpm │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── mkbalancedpm.cc │ │ │ │ └── mkbalancedpm.pro │ │ └── mconvert │ │ │ ├── CMakeLists.txt │ │ │ ├── VS2008mconvert.vcproj │ │ │ ├── mconvert.cc │ │ │ └── mconvert.pro │ ├── Core │ │ ├── ACGMakefile │ │ ├── CMakeLists.txt │ │ ├── Core.pro │ │ ├── Geometry │ │ │ ├── ACGMakefile │ │ │ ├── Config.hh │ │ │ ├── LoopSchemeMaskT.hh │ │ │ ├── MathDefs.hh │ │ │ ├── NormalConeT.cc │ │ │ ├── NormalConeT.hh │ │ │ ├── Plane3d.hh │ │ │ ├── QuadricT.hh │ │ │ ├── VectorT.hh │ │ │ └── VectorT_inc.hh │ │ ├── IO │ │ │ ├── ACGMakefile │ │ │ ├── BinaryHelper.cc │ │ │ ├── BinaryHelper.hh │ │ │ ├── IOInstances.hh │ │ │ ├── IOManager.cc │ │ │ ├── IOManager.hh │ │ │ ├── MeshIO.hh │ │ │ ├── OFFFormat.hh │ │ │ ├── OMFormat.cc │ │ │ ├── OMFormat.hh │ │ │ ├── OMFormatT.cc │ │ │ ├── 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 │ │ │ │ ├── ACGMakefile │ │ │ │ ├── BaseExporter.hh │ │ │ │ └── ExporterT.hh │ │ │ ├── importer │ │ │ │ ├── ACGMakefile │ │ │ │ ├── BaseImporter.hh │ │ │ │ └── ImporterT.hh │ │ │ ├── reader │ │ │ │ ├── ACGMakefile │ │ │ │ ├── BaseReader.cc │ │ │ │ ├── BaseReader.hh │ │ │ │ ├── OBJReader.cc │ │ │ │ ├── OBJReader.hh │ │ │ │ ├── OFFReader.cc │ │ │ │ ├── OFFReader.hh │ │ │ │ ├── OMReader.cc │ │ │ │ ├── OMReader.hh │ │ │ │ ├── PLYReader.cc │ │ │ │ ├── PLYReader.hh │ │ │ │ ├── STLReader.cc │ │ │ │ └── STLReader.hh │ │ │ └── writer │ │ │ │ ├── ACGMakefile │ │ │ │ ├── BaseWriter.cc │ │ │ │ ├── BaseWriter.hh │ │ │ │ ├── OBJWriter.cc │ │ │ │ ├── OBJWriter.hh │ │ │ │ ├── OFFWriter.cc │ │ │ │ ├── OFFWriter.hh │ │ │ │ ├── OMWriter.cc │ │ │ │ ├── OMWriter.hh │ │ │ │ ├── PLYWriter.cc │ │ │ │ ├── PLYWriter.hh │ │ │ │ ├── STLWriter.cc │ │ │ │ └── STLWriter.hh │ │ ├── Mesh │ │ │ ├── ACGMakefile │ │ │ ├── ArrayItems.hh │ │ │ ├── ArrayKernel.cc │ │ │ ├── ArrayKernel.hh │ │ │ ├── ArrayKernelT.cc │ │ │ ├── AttribKernelT.hh │ │ │ ├── Attributes.hh │ │ │ ├── BaseKernel.cc │ │ │ ├── BaseKernel.hh │ │ │ ├── BaseMesh.hh │ │ │ ├── Casts.hh │ │ │ ├── CirculatorsT.hh │ │ │ ├── FinalMeshItemsT.hh │ │ │ ├── Handles.hh │ │ │ ├── IteratorsT.hh │ │ │ ├── PolyConnectivity.cc │ │ │ ├── PolyConnectivity.hh │ │ │ ├── PolyMeshT.cc │ │ │ ├── PolyMeshT.hh │ │ │ ├── PolyMesh_ArrayKernelT.hh │ │ │ ├── Status.hh │ │ │ ├── Traits.hh │ │ │ ├── TriConnectivity.cc │ │ │ ├── TriConnectivity.hh │ │ │ ├── TriMeshT.cc │ │ │ ├── TriMeshT.hh │ │ │ ├── TriMesh_ArrayKernelT.hh │ │ │ └── gen │ │ │ │ ├── circulators_header.hh │ │ │ │ ├── circulators_template.hh │ │ │ │ ├── footer.hh │ │ │ │ ├── generate.sh │ │ │ │ ├── iterators_header.hh │ │ │ │ └── iterators_template.hh │ │ ├── System │ │ │ ├── ACGMakefile │ │ │ ├── OpenMeshDLLMacros.hh │ │ │ ├── compiler.hh │ │ │ ├── config.h │ │ │ ├── config.hh │ │ │ ├── mostream.hh │ │ │ ├── omstream.cc │ │ │ └── omstream.hh │ │ ├── Templates │ │ │ ├── newClass.cc │ │ │ ├── newClass.hh │ │ │ ├── newClass.sh │ │ │ ├── newClassT.cc │ │ │ ├── newClassT.hh │ │ │ └── newClassT.sh │ │ ├── Utils │ │ │ ├── ACGMakefile │ │ │ ├── AutoPropertyHandleT.hh │ │ │ ├── BaseProperty.cc │ │ │ ├── BaseProperty.hh │ │ │ ├── Endian.cc │ │ │ ├── Endian.hh │ │ │ ├── GenProg.hh │ │ │ ├── Noncopyable.hh │ │ │ ├── Property.hh │ │ │ ├── PropertyContainer.hh │ │ │ ├── PropertyManager.hh │ │ │ ├── RandomNumberGenerator.cc │ │ │ ├── RandomNumberGenerator.hh │ │ │ ├── SingletonT.cc │ │ │ ├── SingletonT.hh │ │ │ ├── color_cast.hh │ │ │ ├── vector_cast.hh │ │ │ └── vector_traits.hh │ │ └── VS2008Core.vcproj │ ├── Examples │ │ ├── Examples.pro │ │ ├── Tutorial01 │ │ │ ├── Tutorial01.pro │ │ │ └── cube.cc │ │ ├── Tutorial02 │ │ │ ├── Tutorial02.pro │ │ │ └── smooth.cc │ │ ├── Tutorial03 │ │ │ ├── Tutorial03.pro │ │ │ └── smooth.cc │ │ ├── Tutorial04 │ │ │ ├── Tutorial04.pro │ │ │ ├── smooth.cc │ │ │ └── smooth_algo.hh │ │ ├── Tutorial05 │ │ │ ├── Tutorial05.pro │ │ │ └── properties.cc │ │ ├── Tutorial06 │ │ │ ├── Tutorial06.pro │ │ │ └── attributes.cc │ │ ├── Tutorial07 │ │ │ ├── Tutorial07.pro │ │ │ └── smooth.cc │ │ ├── Tutorial08 │ │ │ ├── Tutorial08.pro │ │ │ └── delete_geometry.cc │ │ ├── Tutorial09 │ │ │ ├── Tutorial09.pro │ │ │ └── io_options.cc │ │ └── Tutorial10 │ │ │ ├── Tutorial10.pro │ │ │ ├── fill_props.hh │ │ │ ├── generate_cube.hh │ │ │ ├── int2roman.cc │ │ │ ├── int2roman.hh │ │ │ ├── persistence.cc │ │ │ └── stats.hh │ └── Tools │ │ ├── ACGMakefile │ │ ├── CMakeLists.txt │ │ ├── Decimater │ │ ├── ACGMakefile │ │ ├── BaseDecimaterT.cc │ │ ├── BaseDecimaterT.hh │ │ ├── CollapseInfoT.hh │ │ ├── DecimaterT.cc │ │ ├── DecimaterT.hh │ │ ├── McDecimaterT.cc │ │ ├── McDecimaterT.hh │ │ ├── MixedDecimaterT.cc │ │ ├── MixedDecimaterT.hh │ │ ├── ModAspectRatioT.cc │ │ ├── ModAspectRatioT.hh │ │ ├── ModBaseT.hh │ │ ├── ModEdgeLengthT.cc │ │ ├── ModEdgeLengthT.hh │ │ ├── ModHausdorffT.cc │ │ ├── ModHausdorffT.hh │ │ ├── ModIndependentSetsT.hh │ │ ├── ModNormalDeviationT.hh │ │ ├── ModNormalFlippingT.hh │ │ ├── ModProgMeshT.cc │ │ ├── ModProgMeshT.hh │ │ ├── ModQuadricT.cc │ │ ├── ModQuadricT.hh │ │ └── ModRoundnessT.hh │ │ ├── Dualizer │ │ └── meshDualT.hh │ │ ├── Kernel_OSG │ │ ├── ACGMakefile │ │ ├── ArrayKernelT.hh │ │ ├── AttribKernelT.hh │ │ ├── PropertyKernel.hh │ │ ├── PropertyT.hh │ │ ├── Traits.hh │ │ ├── TriMesh_OSGArrayKernelT.hh │ │ ├── VectorAdapter.hh │ │ ├── bindT.hh │ │ └── color_cast.hh │ │ ├── Smoother │ │ ├── JacobiLaplaceSmootherT.cc │ │ ├── JacobiLaplaceSmootherT.hh │ │ ├── LaplaceSmootherT.cc │ │ ├── LaplaceSmootherT.hh │ │ ├── SmootherT.cc │ │ ├── SmootherT.hh │ │ └── smooth_mesh.hh │ │ ├── Subdivider │ │ ├── ACGMakefile │ │ ├── Adaptive │ │ │ ├── ACGMakefile │ │ │ └── Composite │ │ │ │ ├── ACGMakefile │ │ │ │ ├── CompositeT.cc │ │ │ │ ├── CompositeT.hh │ │ │ │ ├── CompositeTraits.hh │ │ │ │ ├── RuleInterfaceT.hh │ │ │ │ ├── RulesT.cc │ │ │ │ ├── RulesT.hh │ │ │ │ └── Traits.hh │ │ └── Uniform │ │ │ ├── ACGMakefile │ │ │ ├── CatmullClarkT.cc │ │ │ ├── CatmullClarkT.hh │ │ │ ├── Composite │ │ │ ├── ACGMakefile │ │ │ ├── CompositeT.cc │ │ │ ├── CompositeT.hh │ │ │ └── CompositeTraits.hh │ │ │ ├── CompositeLoopT.hh │ │ │ ├── CompositeSqrt3T.hh │ │ │ ├── LongestEdgeT.hh │ │ │ ├── LoopT.hh │ │ │ ├── ModifiedButterFlyT.hh │ │ │ ├── Sqrt3InterpolatingSubdividerLabsikGreinerT.hh │ │ │ ├── Sqrt3T.hh │ │ │ └── SubdividerT.hh │ │ ├── Tools.pro │ │ ├── Utils │ │ ├── ACGMakefile │ │ ├── Config.hh │ │ ├── GLConstAsString.hh │ │ ├── Gnuplot.cc │ │ ├── Gnuplot.hh │ │ ├── HeapT.hh │ │ ├── MeshCheckerT.cc │ │ ├── MeshCheckerT.hh │ │ ├── NumLimitsT.hh │ │ ├── StripifierT.cc │ │ ├── StripifierT.hh │ │ ├── TestingFramework.hh │ │ ├── Timer.cc │ │ ├── Timer.hh │ │ ├── conio.cc │ │ ├── conio.hh │ │ ├── getopt.c │ │ └── getopt.h │ │ ├── VDPM │ │ ├── ACGMakefile │ │ ├── MeshTraits.hh │ │ ├── StreamingDef.hh │ │ ├── VFront.cc │ │ ├── VFront.hh │ │ ├── VHierarchy.cc │ │ ├── VHierarchy.hh │ │ ├── VHierarchyNode.hh │ │ ├── VHierarchyNodeIndex.cc │ │ ├── VHierarchyNodeIndex.hh │ │ ├── VHierarchyWindow.cc │ │ ├── VHierarchyWindow.hh │ │ ├── ViewingParameters.cc │ │ ├── ViewingParameters.hh │ │ └── xpm │ │ │ ├── fileopen.xpm │ │ │ ├── fileprint.xpm │ │ │ └── filesave.xpm │ │ └── VS2008Tools.vcproj └── Unittests │ ├── CMakeLists.txt │ ├── TestFiles │ ├── cube-minimal-normals.ply │ ├── cube-minimal-texCoords.obj │ ├── cube-minimal-texCoords.om │ ├── cube-minimal-texCoords.ply │ ├── cube-minimal-vertex-colors-after-vertex-definition.obj │ ├── cube-minimal-vertex-colors-as-vc-lines.obj │ ├── cube-minimal-vertexColors.om │ ├── cube-minimal-vertexColors.ply │ ├── cube-minimal.obj │ ├── cube-minimal.om │ ├── cube-minimal.ply │ ├── cube1.off │ ├── cube1.stl │ ├── cube1Binary.stl │ ├── cube1_customProps.om │ ├── meshlab.ply │ ├── pointCloudBadEncoding.ply │ ├── pointCloudGoodEncoding.ply │ ├── square_material.mtl │ └── square_material.obj │ ├── fill_props.hh │ ├── generate_cube.hh │ ├── int2roman.hh │ ├── unittests.cc │ ├── unittests_add_face.cc │ ├── unittests_boundary.cc │ ├── unittests_common.hh │ ├── unittests_decimater.cc │ ├── unittests_delete_face.cc │ ├── unittests_faceless_mesh.cc │ ├── unittests_mc_decimater.cc │ ├── unittests_mesh_cast.cc │ ├── unittests_mesh_dual.cc │ ├── unittests_mixed_decimater.cc │ ├── unittests_property.cc │ ├── unittests_randomNumberGenerator.cc │ ├── unittests_read_write_OBJ.cc │ ├── unittests_read_write_OFF.cc │ ├── unittests_read_write_OM.cc │ ├── unittests_read_write_PLY.cc │ ├── unittests_read_write_STL.cc │ ├── unittests_split_copy.cc │ ├── unittests_stripifier.cc │ ├── unittests_subdivider_adaptive.cc │ ├── unittests_subdivider_uniform.cc │ ├── unittests_trimesh_circulator_current_halfedge_handle_replacement.cc │ ├── unittests_trimesh_circulator_face_edge.cc │ ├── unittests_trimesh_circulator_face_face.cc │ ├── unittests_trimesh_circulator_face_halfedge.cc │ ├── unittests_trimesh_circulator_face_vertex.cc │ ├── unittests_trimesh_circulator_vertex_edge.cc │ ├── unittests_trimesh_circulator_vertex_face.cc │ ├── unittests_trimesh_circulator_vertex_ihalfedge.cc │ ├── unittests_trimesh_circulator_vertex_ohalfedge.cc │ ├── unittests_trimesh_circulator_vertex_vertex.cc │ ├── unittests_trimesh_collapse.cc │ ├── unittests_trimesh_garbage_collection.cc │ ├── unittests_trimesh_iterators.cc │ ├── unittests_trimesh_normal_calculations.cc │ ├── unittests_trimesh_others.cc │ ├── unittests_tutorials.cc │ └── unittests_vector_type.cc └── templates ├── cc ├── cpp ├── h └── hh /.qmake.cache: -------------------------------------------------------------------------------- 1 | unix { 2 | TOPDIR = $$system( pwd )/ 3 | } 4 | 5 | win32 { 6 | TOPDIR = $$system( cd )/ 7 | } 8 | 9 | #use next qmake.cache if it exists 10 | exists(../.qmake.cache) { 11 | include( ../.qmake.cache ) 12 | } 13 | 14 | include( qmake/all.include ) 15 | 16 | -------------------------------------------------------------------------------- /ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = src/OpenMesh Doc 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | Please look into the doxygen configuration (Generated from Doc/history.docu) 2 | -------------------------------------------------------------------------------- /Doc/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | MODULES := doxygen 7 | 8 | DOXY_PROJECT_NAME = OpenMesh 9 | 10 | DOXY_FILE_PATTERNS = *.cc *.hh *.docu 11 | DOXY_EXCLUDE_DIRS = $(cur-dir)/Examples $(proj-dir)/Tools/Test $(proj-dir)/Apps 12 | DOXY_EXCLUDE_PATTERNS = CVS $(build-dir) *.moc.cc footer.hh 13 | DOXY_EXAMPLE_PATH = $(cur-dir)/Examples $(cur-dir)/Tutorial 14 | DOXY_EXAMPLE_PATTERNS = *.cc *.hh 15 | DOXY_MACROS = OM_Attribute=class 16 | 17 | DOXY_GENERATE_HTML = YES 18 | DOXY_GENERATE_LATEX = NO 19 | DOXY_GENERATE_RTF = NO 20 | DOXY_GENERATE_MAN = NO 21 | DOXY_USE_PDFLATEX = YES 22 | DOXY_ACG_STYLE = YES 23 | DOXY_HAVE_DOT = NO 24 | DOXY_COLLABORATION_GRAPH = NO 25 | 26 | #== SYSTEM PART -- DON'T TOUCH ============================================== 27 | include $(ACGMAKE)/Rules 28 | #============================================================================== 29 | -------------------------------------------------------------------------------- /Doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGDoxygen) 2 | 3 | IF (DOXYGEN_FOUND) 4 | 5 | if (TARGET doc) 6 | acg_copy_after_build (doc "${CMAKE_CURRENT_SOURCE_DIR}/html" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html") 7 | endif () 8 | 9 | # Add a documentation install target 10 | add_custom_target(doc-install COMMENT "Installing Documentation" VERBATIM ) 11 | 12 | # Build Documentation before installing it 13 | add_dependencies(doc-install doc) 14 | 15 | if (TARGET doc-install) 16 | acg_copy_after_build (doc-install "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html" "${CMAKE_INSTALL_PREFIX}/${ACG_PROJECT_DATADIR}/doc/html") 17 | endif() 18 | 19 | ENDIF(DOXYGEN_FOUND) -------------------------------------------------------------------------------- /Doc/Examples/BaseExporter.hh: -------------------------------------------------------------------------------- 1 | class BaseExporter 2 | { 3 | public: 4 | 5 | virtual void update() = 0; 6 | 7 | virtual PVertexIter const_vertices_begin() = 0; 8 | virtual PVertexIter const_vertices_end() = 0; 9 | 10 | virtual PTexCoordIter const_texcoords_begin() = 0; 11 | virtual PTexCoordIter const_texcoords_end() = 0; 12 | 13 | virtual PIdxFaceIter const_idx_faces_begin() = 0; 14 | virtual PIdxFaceIter const_idx_faces_end() = 0; 15 | 16 | virtual PFaceIter const_set_faces_begin() = 0; 17 | virtual PFaceIter const_set_faces_end() = 0; 18 | 19 | virtual unsigned int n_faces() = 0; 20 | virtual unsigned int n_vertices() = 0; 21 | virtual unsigned int n_texcoords() = 0; 22 | }; 23 | -------------------------------------------------------------------------------- /Doc/Examples/BaseImporter.hh: -------------------------------------------------------------------------------- 1 | class BaseImporter 2 | { 3 | public: 4 | 5 | virtual void add_vertex (const OpenMesh::Vec3f&) {}; 6 | virtual void add_normal (const OpenMesh::Vec3f&) {}; 7 | virtual void add_texture (const OpenMesh::Vec2f&) {}; 8 | virtual void add_face (const FaceType&) {}; 9 | }; 10 | -------------------------------------------------------------------------------- /Doc/Examples/BaseReader.hh: -------------------------------------------------------------------------------- 1 | class BaseReader 2 | { 3 | public: 4 | 5 | virtual std::string get_description() const = 0; 6 | virtual std::string get_extensions() const = 0; 7 | virtual std::string get_magic() const { return std::string(""); } 8 | 9 | virtual bool read(std::istream& _is, BaseImporter& _bi) const = 0; 10 | virtual bool read(const std::string& _filename, BaseImporter& _bi) const = 0; 11 | 12 | ... 13 | }; 14 | -------------------------------------------------------------------------------- /Doc/Examples/adasub.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // ---------------------------------------- 9 | 10 | using OpenMesh::Subdivider::Adaptive; 11 | 12 | // ---------------------------------------- necessary types 13 | 14 | OpenMesh::TriMesh_ArrayKernelT< CompositeTraits > MyMesh; 15 | CompositeT< MyMesh > Subdivider; 16 | 17 | // ---------------------------------------- setup a subdivider 18 | 19 | int main(int argc, char **argv) 20 | { 21 | MyMesh mesh; // create mesh and fill it 22 | 23 | if (!OpenMesh::IO::read_mesh(mesh, argv[1])) 24 | return 1; // error reading mesh 25 | 26 | Subdivider subdivider(mesh); // bind subdivider to mesh 27 | 28 | // -------------------- add some rules 29 | 30 | // anonymous registration 31 | subdivider.add< Tvv3::Handle >(); 32 | subdivider.add< VF::Handle >(); 33 | subdivider.add< FF::Handle >(); 34 | 35 | // 'named' registration 36 | FVc::Handle hFVc; 37 | subdivider.add( hFVc ); 38 | 39 | // print pre-computed coefficients to std::cout... 40 | std::copy(subdivider.rule( hFVc ).coeffs().begin(), 41 | subdivider.rule( hFVc ).coeffs().end(), 42 | std::ostream_iterator(std::cout, ", ")); 43 | 44 | // prepare subdivider and the traits 45 | if (!subdivider.initialize()) 46 | return 1; // error initializing subdivider 47 | 48 | MyMesh::FaceHandle fh; // select a face 49 | subdivider.refine(fh); 50 | } 51 | -------------------------------------------------------------------------------- /Doc/Examples/build-trimesh.cc: -------------------------------------------------------------------------------- 1 | template 2 | struct TriMesh_ArrayKernel_GeneratorT 3 | { 4 | typedef FinalMeshItemsT MeshItems; 5 | typedef AttribKernelT AttribKernel; 6 | typedef ArrayKernelT MeshKernel; 7 | typedef TriMeshT Mesh; 8 | }; 9 | -------------------------------------------------------------------------------- /Doc/Examples/circulator_functions.cc: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * Vertex circulators 3 | **************************************************/ 4 | 5 | // Get the vertex-vertex circulator (1-ring) of vertex _vh 6 | VertexVertexIter OpenMesh::PolyConnectivity::vv_iter (VertexHandle _vh); 7 | 8 | // Get the vertex-incoming halfedges circulator of vertex _vh 9 | VertexIHalfedgeIter OpenMesh::PolyConnectivity::vih_iter (VertexHandle _vh); 10 | 11 | // Get the vertex-outgoing halfedges circulator of vertex _vh 12 | VertexOHalfedgeIter OpenMesh::PolyConnectivity::voh_iter (VertexHandle _vh); 13 | 14 | // Get the vertex-edge circulator of vertex _vh 15 | VertexEdgeIter OpenMesh::PolyConnectivity::ve_iter (VertexHandle _vh); 16 | 17 | // Get the vertex-face circulator of vertex _vh 18 | VertexFaceIter OpenMesh::PolyConnectivity::vf_iter (VertexHandle _vh); 19 | 20 | /************************************************** 21 | * Face circulators 22 | **************************************************/ 23 | 24 | // Get the face-vertex circulator of face _fh 25 | FaceVertexIter OpenMesh::PolyConnectivity::fv_iter (FaceHandle _fh); 26 | 27 | // Get the face-halfedge circulator of face _fh 28 | FaceHalfedgeIter OpenMesh::PolyConnectivity::fh_iter (FaceHandle _fh); 29 | 30 | // Get the face-edge circulator of face _fh 31 | FaceEdgeIter OpenMesh::PolyConnectivity::fe_iter (FaceHandle _fh); 32 | 33 | // Get the face-face circulator of face _fh 34 | FaceFaceIter OpenMesh::PolyConnectivity::ff_iter (FaceHandle _fh); 35 | -------------------------------------------------------------------------------- /Doc/Examples/circulators.cc: -------------------------------------------------------------------------------- 1 | MyMesh mesh; 2 | 3 | // (linearly) iterate over all vertices 4 | for (MyMesh::VertexIter v_it=mesh.vertices_sbegin(); v_it!=mesh.vertices_end(); ++v_it) 5 | { 6 | // circulate around the current vertex 7 | for (MyMesh::VertexVertexIter vv_it=mesh.vv_iter(*v_it); vv_it.is_valid(); ++vv_it) 8 | { 9 | // do something with e.g. mesh.point(*vv_it) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Doc/Examples/decimater.cc: -------------------------------------------------------------------------------- 1 | // 2 | using namespace OpenMesh 3 | 4 | // ---------------------------------------- necessary types 5 | 6 | // Mesh type 7 | typedef TriMesh_ArrayKernelT<> Mesh; 8 | 9 | // Decimater type 10 | typedef Decimater::DecimaterT< Mesh > Decimater; 11 | 12 | // Decimation Module Handle type 13 | typedef Decimater::ModQuadricT< Mesh >::Handle HModQuadric; 14 | 15 | // ---------------------------------------- decimater setup 16 | 17 | Mesh mesh; // a mesh object 18 | Decimater decimater(mesh); // a decimater object, connected to a mesh 19 | HModQuadric hModQuadric; // use a quadric module 20 | 21 | decimater.add( hModQuadric ); // register module at the decimater 22 | 23 | std::cout << decimater.module( hModQuadric ).name() << std::endl; 24 | // the way to access the module 25 | 26 | /* 27 | * since we need exactly one priority module (non-binary) 28 | * we have to call set_binary(false) for our priority module 29 | * in the case of HModQuadric, unset_max_err() calls set_binary(false) internally 30 | */ 31 | decimater.module( hModQuadric ).unset_max_err(); 32 | 33 | decimater.initialize(); // let the decimater initialize the mesh and the 34 | // modules 35 | 36 | decimater.decimate(); // do decimation 37 | 38 | -------------------------------------------------------------------------------- /Doc/Examples/draw_normals.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // draw a face normal if we have one 4 | void drawFaceNormal(const MyMesh::Face& _f) { 5 | drawFaceNormal(_f, GenProg::Bool2Type()); 6 | } 7 | 8 | // normal exists -> use it 9 | void drawFaceNormal(const MyMesh::Face& _f, GenProg::Bool2Type) { 10 | glNormal3fv(_f.normal()); 11 | } 12 | 13 | // empty dummy (no normals) 14 | void drawFaceNormal(const MyMesh::Face& _f, GenProg::Bool2Type){} 15 | -------------------------------------------------------------------------------- /Doc/Examples/iterators.cc: -------------------------------------------------------------------------------- 1 | MyMesh mesh; 2 | 3 | // iterate over all vertices 4 | for (MyMesh::VertexIter v_it=mesh.vertices_begin(); v_it!=mesh.vertices_end(); ++v_it) 5 | ...; // do something with *v_it, v_it->, or *v_it 6 | 7 | // iterate over all halfedges 8 | for (MyMesh::HalfedgeIter h_it=mesh.halfedges_begin(); h_it!=mesh.halfedges_end(); ++h_it) 9 | ...; // do something with *h_it, h_it->, or *h_it 10 | 11 | // iterate over all edges 12 | for (MyMesh::EdgeIter e_it=mesh.edges_begin(); e_it!=mesh.edges_end(); ++e_it) 13 | ...; // do something with *e_it, e_it->, or *e_it 14 | 15 | // iterator over all faces 16 | for (MyMesh::FaceIter f_it=mesh.faces_begin(); f_it!=mesh.faces_end(); ++f_it) 17 | ...; // do something with *f_it, f_it->, or *f_it 18 | 19 | -------------------------------------------------------------------------------- /Doc/Examples/mesh_io.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | MyMesh mesh; 4 | 5 | if (!OpenMesh::IO::read_mesh(mesh, "some input file")) 6 | { 7 | std::cerr << "read error\n"; 8 | exit(1); 9 | } 10 | 11 | // do something with your mesh ... 12 | 13 | if (!OpenMesh::IO::write_mesh(mesh, "some output file")) 14 | { 15 | std::cerr << "write error\n"; 16 | exit(1); 17 | } 18 | -------------------------------------------------------------------------------- /Doc/Examples/mymesh.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | // define traits 5 | struct MyTraits : public OpenMesh::DefaultTraits 6 | { 7 | // use double valued coordinates 8 | typedef OpenMesh::Vec3d Point; 9 | 10 | // use vertex normals and vertex colors 11 | VertexAttributes( OpenMesh::DefaultAttributer::Normal | 12 | OpenMesh::DefaultAttributer::Color ); 13 | 14 | // store the previous halfedge 15 | HalfedgeAttributes( OpenMesh::DefaultAttributer::PrevHalfedge ); 16 | 17 | // use face normals 18 | FaceAttributes( OpenMesh::DefaultAttributer::Normal ); 19 | 20 | // store a face handle for each vertex 21 | VertexTraits 22 | { 23 | typename Base::Refs::FaceHandle my_face_handle; 24 | }; 25 | 26 | }; 27 | 28 | 29 | // Select mesh type (TriMesh) and kernel (ArrayKernel) 30 | // and define my personal mesh type (MyMesh) 31 | typedef OpenMesh::TriMesh_ArrayKernelT MyMesh; 32 | 33 | int main(int argc, char **argv) 34 | { 35 | MyMesh mesh; 36 | 37 | // -------------------- Add dynamic data 38 | 39 | // for each vertex an extra double value 40 | OpenMesh::VPropHandleT< double > vprop_double; 41 | mesh.add_property( vprop_double ); 42 | 43 | // for the mesh an extra string 44 | OpenMesh::MPropHandleT< string > mprop_string; 45 | mesh.add_property( mprop_string ); 46 | 47 | // -------------------- do something 48 | 49 | ...; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Doc/Examples/nav_code1.cc: -------------------------------------------------------------------------------- 1 | [...] 2 | 3 | TriMesh::HalfedgeHandle heh, heh_init; 4 | 5 | // Get the halfedge handle assigned to vertex[0] 6 | heh = heh_init = mesh.halfedge_handle(vertex[0].handle()); 7 | 8 | // heh now holds the handle to the initial halfedge. 9 | // We now get further on the boundary by requesting 10 | // the next halfedge adjacent to the vertex heh 11 | // points to... 12 | heh = mesh.next_halfedge_handle(heh); 13 | 14 | // We can do this as often as we want: 15 | while(heh != heh_init) { 16 | heh = mesh.next_halfedge_handle(heh); 17 | } 18 | 19 | [...] 20 | -------------------------------------------------------------------------------- /Doc/Examples/nav_code2.cc: -------------------------------------------------------------------------------- 1 | // Test if a halfedge lies at a boundary (is not adjacent to a face) 2 | bool is_boundary (HalfedgeHandle _heh) const 3 | 4 | // Test if an edge lies at a boundary 5 | bool is_boundary (EdgeHandle _eh) const 6 | 7 | // Test if a vertex is adjacent to a boundary edge 8 | bool is_boundary (VertexHandle _vh) const 9 | 10 | // Test if a face has at least one adjacent boundary edge. 11 | // If _check_vertex=true, this function also tests if at least one 12 | // of the adjacent vertices is a boundary vertex 13 | bool is_boundary (FaceHandle _fh, bool _check_vertex=false) const 14 | -------------------------------------------------------------------------------- /Doc/Examples/nav_code3.cc: -------------------------------------------------------------------------------- 1 | [...] 2 | 3 | // Get some vertex handle 4 | PolyMesh::VertexHandle v = ...; 5 | 6 | for(PolyMesh::VertexIHalfedgeIter vih_it = mesh.vih_iter(v); vih_it; ++vih_it) { 7 | // Iterate over all incoming halfedges... 8 | } 9 | 10 | for(PolyMesh::VertexOHalfedgeIter voh_it = mesh.voh_iter(v); voh_it; ++voh_it) { 11 | // Iterate over all outgoing halfedges... 12 | } 13 | 14 | [...] 15 | -------------------------------------------------------------------------------- /Doc/Examples/nav_code4.cc: -------------------------------------------------------------------------------- 1 | // Get the face adjacent to the opposite halfedge 2 | OpenMesh::PolyConnectivity::opposite_face_handle(); 3 | 4 | // Get the handle to the opposite halfedge 5 | OpenMesh::Concepts::KernelT::opposite_halfedge_handle(); 6 | 7 | // Get the opposite vertex to the opposite halfedge 8 | OpenMesh::TriConnectivity::opposite_he_opposite_vh(); 9 | 10 | // Get the vertex assigned to the opposite halfedge 11 | OpenMesh::TriConnectivity::opposite_vh(); 12 | -------------------------------------------------------------------------------- /Doc/Examples/nav_code4a.cc: -------------------------------------------------------------------------------- 1 | // Get the halfedge handle of i.e. the halfedge 2 | // that is associated to the first vertex 3 | // of our set of vertices 4 | PolyMesh::HalfedgeHandle heh = mesh.halfedge_handle(*(mesh.vertices_begin())); 5 | 6 | // Now get the handle of its opposing halfedge 7 | PolyMesh::HalfedgeHandle opposite_heh = mesh.opposite_halfedge_handle(heh); 8 | -------------------------------------------------------------------------------- /Doc/Examples/traits0.cc: -------------------------------------------------------------------------------- 1 | struct DefaultTraits 2 | { 3 | typedef Vec3f Point; 4 | typedef Vec3f Normal; 5 | typedef Vec2f TexCoord; 6 | typedef Vec3uc Color; 7 | 8 | VertexTraits {}; 9 | HalfedgeTraits {}; 10 | EdgeTraits {}; 11 | FaceTraits {}; 12 | 13 | VertexAttributes(0); 14 | HalfedgeAttributes(Attributes::PrevHalfedge); 15 | EdgeAttributes(0); 16 | FaceAttributes(0); 17 | }; 18 | -------------------------------------------------------------------------------- /Doc/Examples/traits1.cc: -------------------------------------------------------------------------------- 1 | struct MyTraits : public OpenMesh::DefaultTraits 2 | { 3 | typedef OpenMesh::Vec3d Point; // use double-values points 4 | }; 5 | -------------------------------------------------------------------------------- /Doc/Examples/traits2.cc: -------------------------------------------------------------------------------- 1 | struct MyTraits : public OpenMesh::DefaultTraits 2 | { 3 | VertexTraits 4 | { 5 | int some_additional_index; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /Doc/Examples/traits3.cc: -------------------------------------------------------------------------------- 1 | struct MyTraits : public OpenMesh::DefaultTraits 2 | { 3 | template struct VertexT : public Base 4 | { 5 | int some_additional_index; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /Doc/Examples/traits4.cc: -------------------------------------------------------------------------------- 1 | struct MyTraits : public OpenMesh::DefaultTraits 2 | { 3 | VertexTraits 4 | { 5 | int some_additional_index; 6 | typename Base::Refs::FaceHandle my_face_handle; 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /Doc/Examples/traits5.cc: -------------------------------------------------------------------------------- 1 | struct MyTraits : public OpenMesh::DefaultTraits 2 | { 3 | VertexAttributes( OpenMesh::Attributes::Normal | 4 | OpenMesh::Attributes::Color ); 5 | 6 | FaceAttributes( OpenMesh::Attributes::Normal ); 7 | }; 8 | -------------------------------------------------------------------------------- /Doc/Tutorial/01-build_cube/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/02-iterators/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/02-iterators/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- OpenMesh 4 | #include 5 | #include 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | 15 | // check command line options 16 | if (argc != 4) 17 | { 18 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 19 | return 1; 20 | } 21 | 22 | 23 | // read mesh from stdin 24 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 25 | { 26 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 27 | return 1; 28 | } 29 | 30 | 31 | // this vector stores the computed centers of gravity 32 | std::vector cogs; 33 | std::vector::iterator cog_it; 34 | cogs.reserve(mesh.n_vertices()); 35 | 36 | 37 | // smoothing mesh argv[1] times 38 | MyMesh::VertexIter v_it, v_end(mesh.vertices_end()); 39 | MyMesh::VertexVertexIter vv_it; 40 | MyMesh::Point cog; 41 | MyMesh::Scalar valence; 42 | unsigned int i, N(atoi(argv[1])); 43 | 44 | 45 | for (i=0; i < N; ++i) 46 | { 47 | cogs.clear(); 48 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 49 | { 50 | cog[0] = cog[1] = cog[2] = valence = 0.0; 51 | 52 | for (vv_it=mesh.vv_iter( *v_it ); vv_it.is_valid(); ++vv_it) 53 | { 54 | cog += mesh.point( *vv_it ); 55 | ++valence; 56 | } 57 | 58 | cogs.push_back(cog / valence); 59 | } 60 | 61 | for (v_it=mesh.vertices_begin(), cog_it=cogs.begin(); 62 | v_it!=v_end; ++v_it, ++cog_it) 63 | if ( !mesh.is_boundary( *v_it ) ) 64 | mesh.set_point( *v_it, *cog_it ); 65 | } 66 | 67 | 68 | // write mesh to stdout 69 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 70 | { 71 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 72 | return 1; 73 | } 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /Doc/Tutorial/03-properties/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/03-properties/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- 4 | #include 5 | #include 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | 15 | // check command line options 16 | if (argc != 4) 17 | { 18 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 19 | return 1; 20 | } 21 | 22 | 23 | 24 | // read mesh from stdin 25 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 26 | { 27 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 28 | return 1; 29 | } 30 | 31 | 32 | 33 | // this vertex property stores the computed centers of gravity 34 | OpenMesh::VPropHandleT cogs; 35 | mesh.add_property(cogs); 36 | 37 | // smoothing mesh argv[1] times 38 | MyMesh::VertexIter v_it, v_end(mesh.vertices_end()); 39 | MyMesh::VertexVertexIter vv_it; 40 | MyMesh::Point cog; 41 | MyMesh::Scalar valence; 42 | unsigned int i, N(atoi(argv[1])); 43 | 44 | 45 | for (i=0; i < N; ++i) 46 | { 47 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 48 | { 49 | mesh.property(cogs,*v_it).vectorize(0.0f); 50 | valence = 0.0; 51 | 52 | for (vv_it=mesh.vv_iter( *v_it ); vv_it; ++vv_it) 53 | { 54 | mesh.property(cogs,*v_it) += mesh.point( *vv_it ); 55 | ++valence; 56 | } 57 | mesh.property(cogs,*v_it) /= valence; 58 | } 59 | 60 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 61 | if ( !mesh.is_boundary( *v_it ) ) 62 | mesh.set_point( *v_it, mesh.property(cogs,*v_it) ); 63 | } 64 | 65 | 66 | // write mesh to stdout 67 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 68 | { 69 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 70 | return 1; 71 | } 72 | 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /Doc/Tutorial/04-stl_algorithms/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/04-stl_algorithms/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- OpenMesh 4 | #include 5 | #include 6 | // -------------------- 7 | #include "smooth_algo.hh" 8 | 9 | 10 | // ---------------------------------------------------------------------------- 11 | 12 | #ifndef DOXY_IGNORE_THIS 13 | 14 | struct MyTraits : public OpenMesh::DefaultTraits 15 | { 16 | HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge); 17 | }; 18 | 19 | #endif 20 | 21 | typedef OpenMesh::TriMesh_ArrayKernelT MyMesh; 22 | 23 | 24 | // ---------------------------------------------------------------------------- 25 | 26 | int main(int argc, char **argv) 27 | { 28 | MyMesh mesh; 29 | 30 | 31 | // check command line options 32 | if (argc != 4) 33 | { 34 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 35 | return 1; 36 | } 37 | 38 | 39 | // read mesh from stdin 40 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 41 | { 42 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 43 | return 1; 44 | } 45 | 46 | 47 | // smoothing mesh argv[1] times 48 | SmootherT smoother(mesh); 49 | smoother.smooth(atoi(argv[1])); 50 | 51 | 52 | // write mesh to stdout 53 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 54 | { 55 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 56 | return 1; 57 | } 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /Doc/Tutorial/04-stl_algorithms/smooth_algo.hh: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef DOXY_IGNORE_THIS 5 | 6 | template class SmootherT 7 | { 8 | public: 9 | 10 | typedef typename Mesh::Point cog_t; 11 | typedef OpenMesh::VPropHandleT< cog_t > Property_cog; 12 | 13 | public: 14 | 15 | // construct with a given mesh 16 | SmootherT(Mesh& _mesh) 17 | : mesh_(_mesh) 18 | { 19 | mesh_.add_property( cog_ ); 20 | } 21 | 22 | ~SmootherT() 23 | { 24 | mesh_.remove_property( cog_ ); 25 | } 26 | 27 | // smooth mesh _iterations times 28 | void smooth(unsigned int _iterations) 29 | { 30 | for (unsigned int i=0; i < _iterations; ++i) 31 | { 32 | std::for_each(mesh_.vertices_begin(), 33 | mesh_.vertices_end(), 34 | ComputeCOG(mesh_, cog_)); 35 | 36 | std::for_each(mesh_.vertices_begin(), 37 | mesh_.vertices_end(), 38 | SetCOG(mesh_, cog_)); 39 | } 40 | } 41 | 42 | 43 | private: 44 | 45 | 46 | //--- private classes --- 47 | 48 | class ComputeCOG 49 | { 50 | public: 51 | ComputeCOG(Mesh& _mesh, Property_cog& _cog) 52 | : mesh_(_mesh), cog_(_cog) 53 | {} 54 | 55 | void operator()(const typename Mesh::VertexHandle& _vh) 56 | { 57 | typename Mesh::VertexVertexIter vv_it; 58 | typename Mesh::Scalar valence(0.0); 59 | 60 | mesh_.property(cog_, _vh) = typename Mesh::Point(0.0, 0.0, 0.0); 61 | 62 | for (vv_it=mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it) 63 | { 64 | mesh_.property(cog_, _vh) += mesh_.point( *vv_it ); 65 | ++valence; 66 | } 67 | 68 | mesh_.property(cog_, _vh ) /= valence; 69 | } 70 | 71 | private: 72 | Mesh& mesh_; 73 | Property_cog& cog_; 74 | }; 75 | 76 | 77 | class SetCOG 78 | { 79 | public: 80 | SetCOG(Mesh& _mesh, Property_cog& _cog) 81 | : mesh_(_mesh), cog_(_cog) 82 | {} 83 | 84 | void operator()(const typename Mesh::VertexHandle& _vh) 85 | { 86 | 87 | if (!mesh_.is_boundary(_vh)) 88 | mesh_.set_point( _vh, mesh_.property(cog_, _vh) ); 89 | } 90 | 91 | private: 92 | 93 | Mesh& mesh_; 94 | Property_cog& cog_; 95 | }; 96 | 97 | 98 | //--- private elements --- 99 | 100 | Mesh& mesh_; 101 | Property_cog cog_; 102 | }; 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /Doc/Tutorial/05-std_properties/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/05-std_properties/properties.cc: -------------------------------------------------------------------------------- 1 | #include 2 | // -------------------- 3 | #include 4 | #include 5 | 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | if (argc!=2) 15 | { 16 | std::cerr << "Usage: " << argv[0] << " \n"; 17 | return 1; 18 | } 19 | 20 | // request vertex normals, so the mesh reader can use normal information 21 | // if available 22 | mesh.request_vertex_normals(); 23 | 24 | // assure we have vertex normals 25 | if (!mesh.has_vertex_normals()) 26 | { 27 | std::cerr << "ERROR: Standard vertex property 'Normals' not available!\n"; 28 | return 1; 29 | } 30 | 31 | OpenMesh::IO::Options opt; 32 | if ( ! OpenMesh::IO::read_mesh(mesh,argv[1], opt)) 33 | { 34 | std::cerr << "Error loading mesh from file " << argv[1] << std::endl; 35 | return 1; 36 | } 37 | 38 | // If the file did not provide vertex normals, then calculate them 39 | if ( !opt.check( OpenMesh::IO::Options::VertexNormal ) ) 40 | { 41 | // we need face normals to update the vertex normals 42 | mesh.request_face_normals(); 43 | 44 | // let the mesh update the normals 45 | mesh.update_normals(); 46 | 47 | // dispose the face normals, as we don't need them anymore 48 | mesh.release_face_normals(); 49 | } 50 | 51 | // move all vertices one unit length along it's normal direction 52 | for (MyMesh::VertexIter v_it = mesh.vertices_begin(); 53 | v_it != mesh.vertices_end(); ++v_it) 54 | { 55 | std::cout << "Vertex #" << *v_it << ": " << mesh.point( *v_it ); 56 | mesh.set_point( *v_it, mesh.point(*v_it)+mesh.normal(*v_it) ); 57 | std::cout << " moved to " << mesh.point( *v_it ) << std::endl; 58 | } 59 | 60 | // don't need the normals anymore? Remove them! 61 | mesh.release_vertex_normals(); 62 | 63 | // just check if it really works 64 | if (mesh.has_vertex_normals()) 65 | { 66 | std::cerr << "Ouch! ERROR! Shouldn't have any vertex normals anymore!\n"; 67 | return 1; 68 | } 69 | 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /Doc/Tutorial/06-attributes/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/07-traits/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/08-io_options/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/09-persistence/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | # subdirs to process 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | # programms (files containing main(), w/o suffix) 10 | EXECS = $(call cxx-find-execs) 11 | 12 | # packages (qt, opengl, ...) 13 | PACKAGES := 14 | 15 | # project DSOs 16 | PROJ_LIBS := OpenMesh/Core 17 | 18 | # modules to use (cxx, c, moc, uic, yacc) ! order-dependent ! 19 | MODULES := cxx 20 | 21 | 22 | #== SYSTEM PART -- DON'T TOUCH ============================================== 23 | include $(ACGMAKE)/Rules 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /Doc/Tutorial/09-persistence/generate_cube.hh: -------------------------------------------------------------------------------- 1 | #ifndef GENERATE_CUBE_HH 2 | #define GENERATE_CUBE_HH 3 | 4 | template 5 | size_t generate_cube( MeshType& mesh ) 6 | { 7 | typedef typename MeshType::VertexHandle VertexHandle; 8 | typedef typename MeshType::Point Point; 9 | 10 | typename MeshType::VertexHandle vhandle[8]; 11 | 12 | vhandle[0] = mesh.add_vertex(Point(-1, -1, 1)); 13 | vhandle[1] = mesh.add_vertex(Point( 1, -1, 1)); 14 | vhandle[2] = mesh.add_vertex(Point( 1, 1, 1)); 15 | vhandle[3] = mesh.add_vertex(Point(-1, 1, 1)); 16 | vhandle[4] = mesh.add_vertex(Point(-1, -1, -1)); 17 | vhandle[5] = mesh.add_vertex(Point( 1, -1, -1)); 18 | vhandle[6] = mesh.add_vertex(Point( 1, 1, -1)); 19 | vhandle[7] = mesh.add_vertex(Point(-1, 1, -1)); 20 | 21 | // generate (quadrilateral) faces 22 | 23 | std::vector< VertexHandle > face_vhandles; 24 | 25 | face_vhandles.clear(); 26 | face_vhandles.push_back(vhandle[0]); 27 | face_vhandles.push_back(vhandle[1]); 28 | face_vhandles.push_back(vhandle[2]); 29 | face_vhandles.push_back(vhandle[3]); 30 | mesh.add_face(face_vhandles); 31 | 32 | face_vhandles.clear(); 33 | face_vhandles.push_back(vhandle[7]); 34 | face_vhandles.push_back(vhandle[6]); 35 | face_vhandles.push_back(vhandle[5]); 36 | face_vhandles.push_back(vhandle[4]); 37 | mesh.add_face(face_vhandles); 38 | 39 | face_vhandles.clear(); 40 | face_vhandles.push_back(vhandle[1]); 41 | face_vhandles.push_back(vhandle[0]); 42 | face_vhandles.push_back(vhandle[4]); 43 | face_vhandles.push_back(vhandle[5]); 44 | mesh.add_face(face_vhandles); 45 | 46 | face_vhandles.clear(); 47 | face_vhandles.push_back(vhandle[2]); 48 | face_vhandles.push_back(vhandle[1]); 49 | face_vhandles.push_back(vhandle[5]); 50 | face_vhandles.push_back(vhandle[6]); 51 | mesh.add_face(face_vhandles); 52 | 53 | face_vhandles.clear(); 54 | face_vhandles.push_back(vhandle[3]); 55 | face_vhandles.push_back(vhandle[2]); 56 | face_vhandles.push_back(vhandle[6]); 57 | face_vhandles.push_back(vhandle[7]); 58 | mesh.add_face(face_vhandles); 59 | 60 | face_vhandles.clear(); 61 | face_vhandles.push_back(vhandle[0]); 62 | face_vhandles.push_back(vhandle[3]); 63 | face_vhandles.push_back(vhandle[7]); 64 | face_vhandles.push_back(vhandle[4]); 65 | mesh.add_face(face_vhandles); 66 | 67 | return mesh.n_vertices(); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Doc/Tutorial/09-persistence/int2roman.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #if defined(OM_CC_MIPS) 3 | # include 4 | #else 5 | # include 6 | #endif 7 | #include "int2roman.hh" 8 | 9 | 10 | std::string int2roman( size_t decimal, size_t length ) 11 | { 12 | assert( decimal > 0 && decimal < 1000 ); 13 | 14 | const size_t nrows = 4; 15 | const size_t ncols = 4; 16 | 17 | static size_t table_arabs[ nrows ][ ncols ] = { { 1000, 1000, 1000, 1000 }, 18 | { 900, 500, 400, 100 }, 19 | { 90, 50, 40, 10 }, 20 | { 9, 5, 4, 1 } }; 21 | 22 | static char *table_romans[ nrows ][ ncols ] = { { "M", "M", "M", "M" }, 23 | { "CM", "D", "CD", "C" }, 24 | { "XC", "L", "XL", "X" }, 25 | { "IX", "V", "IV", "I" } }; 26 | 27 | size_t power; // power of ten 28 | size_t index; // Indexes thru values to subtract 29 | 30 | std::string roman = ""; 31 | roman.reserve(length); 32 | 33 | for ( power = 0; power < nrows; power++ ) 34 | for ( index = 0; index < ncols; index++ ) 35 | while ( decimal >= table_arabs[ power ][ index ] ) 36 | { 37 | roman += table_romans[ power ][ index ]; 38 | decimal -= table_arabs[ power ][ index ]; 39 | } 40 | 41 | return roman; 42 | } 43 | -------------------------------------------------------------------------------- /Doc/Tutorial/09-persistence/int2roman.hh: -------------------------------------------------------------------------------- 1 | #ifndef INT2ROMAN_HH 2 | #define INT2ROMAN_HH 3 | 4 | #include 5 | 6 | std::string int2roman( size_t decimal, size_t length=30 ); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Doc/Tutorial/09-persistence/stats.hh: -------------------------------------------------------------------------------- 1 | #ifndef STATS_HH 2 | #define STATS_HH 3 | 4 | template 5 | void mesh_stats( Mesh& _m, const std::string& prefix = "" ) 6 | { 7 | std::cout << prefix 8 | << _m.n_vertices() << " vertices, " 9 | << _m.n_edges() << " edges, " 10 | << _m.n_faces() << " faces\n"; 11 | } 12 | 13 | template 14 | void mesh_property_stats(Mesh& _m) 15 | { 16 | std::cout << "Current set of properties:\n"; 17 | _m.property_stats(std::cout); 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Doc/Tutorial/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxx 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /Doc/Tutorial/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName MyOwnProject) 9 | 10 | # collect all header and source files 11 | acg_append_files (headers "*.hh" .) 12 | acg_append_files (sources "*.cc" .) 13 | 14 | acg_add_executable (${targetName} ${headers} ${sources}) 15 | 16 | target_link_libraries (${targetName} 17 | OpenMeshCore 18 | OpenMeshTools 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /Doc/html/acg_footer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | acg pic 6 | 7 | Project $projectname, 8 | ©  Computer Graphics Group, RWTH Aachen. 9 | Documentation generated using 10 | 11 | doxygen 12 | . 13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /Doc/html/acg_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/html/acg_icon.gif -------------------------------------------------------------------------------- /Doc/images/class-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/class-hierarchy.png -------------------------------------------------------------------------------- /Doc/images/class-hierarchy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/class-hierarchy2.png -------------------------------------------------------------------------------- /Doc/images/collapse_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/collapse_info.png -------------------------------------------------------------------------------- /Doc/images/diagrams.sxi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/diagrams.sxi -------------------------------------------------------------------------------- /Doc/images/halfedge_structure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/halfedge_structure.gif -------------------------------------------------------------------------------- /Doc/images/halfedge_structure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/halfedge_structure2.png -------------------------------------------------------------------------------- /Doc/images/halfedge_structure3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/halfedge_structure3.png -------------------------------------------------------------------------------- /Doc/images/inheritance-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/inheritance-simple.png -------------------------------------------------------------------------------- /Doc/images/inheritance-simple.scaled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/inheritance-simple.scaled.png -------------------------------------------------------------------------------- /Doc/images/inheritance.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 11 | 1 1 2.00 120.00 240.00 12 | 2550 3900 2550 3300 13 | 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 14 | 1 1 2.00 120.00 240.00 15 | 2550 2700 2550 2100 16 | 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 17 | 1500 1500 3600 1500 3600 2100 1500 2100 1500 1500 18 | 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 19 | 1500 2700 3600 2700 3600 3300 1500 3300 1500 2700 20 | 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 21 | 1500 3900 3600 3900 3600 4500 1500 4500 1500 3900 22 | 4 1 0 50 0 0 25 0.0000 4 255 990 2475 1950 Kernel\001 23 | 4 1 0 50 0 0 25 0.0000 4 345 1500 2550 3150 PolyMesh\001 24 | 4 1 0 50 0 0 25 0.0000 4 255 1290 2550 4350 TriMesh\001 25 | -------------------------------------------------------------------------------- /Doc/images/inheritance.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/inheritance.gif -------------------------------------------------------------------------------- /Doc/images/iomanager.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/iomanager.gif -------------------------------------------------------------------------------- /Doc/images/iomanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/iomanager.png -------------------------------------------------------------------------------- /Doc/images/mesh.collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.collapse.png -------------------------------------------------------------------------------- /Doc/images/mesh.flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.flip.png -------------------------------------------------------------------------------- /Doc/images/mesh.inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.inner.png -------------------------------------------------------------------------------- /Doc/images/mesh.inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.inout.png -------------------------------------------------------------------------------- /Doc/images/mesh.normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.normal.png -------------------------------------------------------------------------------- /Doc/images/mesh.opp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.opp.png -------------------------------------------------------------------------------- /Doc/images/mesh.outer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/mesh.outer.png -------------------------------------------------------------------------------- /Doc/images/om-format.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/Doc/images/om-format.png -------------------------------------------------------------------------------- /Doc/images/src/iomanager.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,% 8 | decorations.pathreplacing,decorations.pathmorphing,shapes,% 9 | matrix,shapes.symbols,positioning} 10 | 11 | \tikzset{ 12 | kiste/.style={ 13 | rectangle, 14 | rounded corners, 15 | % fill=black!10, 16 | draw=black, very thick, 17 | text width=10em, 18 | minimum height=3em, 19 | text centered}, 20 | kkiste/.style={ 21 | rectangle, 22 | rounded corners, 23 | % fill=black!10, 24 | draw=black, very thick, 25 | text width=7em, 26 | minimum height=2em, 27 | text centered}, 28 | } 29 | 30 | \begin{document} 31 | \begin{center} 32 | \begin{tikzpicture} 33 | 34 | \node[kiste](IOM) at (0,0) {IOManager}; 35 | \node[kiste,rotate=90](PD) at (-5,-4) {Persistent Data}; 36 | \node[kiste,rotate=-90](DS) at (5,-4) {Data Structures}; 37 | 38 | \path[fill=yellow!20,rounded corners,draw=black!50, dashed] 39 | (-3.5,-2) rectangle (-0.5,-6); 40 | \path[fill=yellow!20,rounded corners,draw=black!50, dashed] 41 | (.5,-2) rectangle (3.5,-6); 42 | 43 | \node[] at (-2,-2.5) {Reader/Writer}; 44 | \node[kkiste] at (-2,-3.5) {OBJ}; 45 | \node[] at (-2,-4.25) {$\vdots$}; 46 | \node[kkiste] at (-2,-5.25) {Custom file format}; 47 | 48 | \node[] at (2,-2.5) {Importer/Exporter}; 49 | \node[kkiste] at (2,-3.5) {OpenMesh}; 50 | \node[] at (2,-4.25) {$\vdots$}; 51 | \node[kkiste] at (2,-5.25) {Custom data structure}; 52 | 53 | \path [draw,thick,>=latex,<->] (-0.1,-0.6) -- (-2,-1.9) {}; 54 | \path [draw,thick,>=latex,<->] (0.1,-0.6) -- (2,-1.9) {}; 55 | 56 | \path [draw,thick,>=latex,->] (-4.4,-3.8) -- (-3.6,-3.8) {}; 57 | \path [draw,thick,>=latex,<-] (-4.4,-4.2) -- (-3.6,-4.2) {}; 58 | 59 | \path [draw,thick,>=latex,->] (4.4,-3.8) -- (3.6,-3.8) {}; 60 | \path [draw,thick,>=latex,<-] (4.4,-4.2) -- (3.6,-4.2) {}; 61 | 62 | \end{tikzpicture} 63 | \end{center} 64 | 65 | \end{document} 66 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.flip.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | \usepackage{color} 7 | 8 | \definecolor{ACG}{RGB}{55,91,64} 9 | 10 | \begin{document} 11 | 12 | \begin{center} 13 | 14 | %\colorbox{ACG}{ 15 | 16 | \begin{tikzpicture} 17 | [ 18 | vertex/.style={draw=none,circle,fill=white,minimum size=2pt}, 19 | edge/.style={draw,white,thick}, 20 | redge/.style={line width=3pt,color=red!50!white} 21 | ] 22 | 23 | \begin{scope}[xshift=-5cm] 24 | 25 | \coordinate (V1) at (-3,3); 26 | \coordinate (V2) at (0,0); 27 | \coordinate (V3) at (0,6); 28 | \coordinate (V4) at (3,3); 29 | 30 | \draw[edge] (V1) to (V2) {}; 31 | 32 | \draw[edge] (V1) -- (V3) {}; 33 | 34 | \draw[redge] (V1) -- (V4) {}; 35 | 36 | \draw[edge] (V2) -- (V4) {}; 37 | 38 | \draw[edge] (V3) -- (V4) {}; 39 | 40 | \node[vertex] at (V1) {}; 41 | \node[vertex] at (V2) {}; 42 | \node[vertex] at (V3) {}; 43 | \node[vertex] at (V4) {}; 44 | 45 | \end{scope} 46 | 47 | \draw[->,>=latex,thick,white] (-1.5, 4) arc (105:75:6); 48 | \node[above] at (0, 4.2) {\textcolor{white}{\textbf{Flip edge}}}; 49 | 50 | \begin{scope}[xshift=5cm] 51 | 52 | \coordinate (V1) at (-3,3); 53 | \coordinate (V2) at (0,0); 54 | \coordinate (V3) at (0,6); 55 | \coordinate (V4) at (3,3); 56 | 57 | \draw[edge] (V1) to (V2) {}; 58 | 59 | \draw[edge] (V1) -- (V3) {}; 60 | 61 | \draw[redge] (V2) -- (V3) {}; 62 | 63 | \draw[edge] (V2) -- (V4) {}; 64 | 65 | \draw[edge] (V3) -- (V4) {}; 66 | 67 | \node[vertex] at (V1) {}; 68 | \node[vertex] at (V2) {}; 69 | \node[vertex] at (V3) {}; 70 | \node[vertex] at (V4) {}; 71 | 72 | \end{scope} 73 | \end{tikzpicture} 74 | 75 | %} 76 | 77 | \end{center} 78 | 79 | \end{document} 80 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.inner.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \begin{document} 8 | 9 | \begin{center} 10 | \begin{tikzpicture} 11 | [ 12 | vertex/.style={draw=none,circle,fill=black,minimum size=2pt}, 13 | oedge/.style={->,>=latex,shorten >=6pt,draw,black,thick}, 14 | roedge/.style={->,>=latex,shorten >=6pt,draw,black,thick,color=red} 15 | ] 16 | 17 | \coordinate (V1) at (-3,3); 18 | \coordinate (V2) at (0,0); 19 | \coordinate (V3) at (0,6); 20 | \coordinate (V4) at (3,3); 21 | 22 | \path[roedge] ([yshift=3pt]V1) to ([yshift=3pt]V2) {}; 23 | \path[oedge] ([yshift=-3pt]V2) to ([yshift=-3pt]V1) {}; 24 | 25 | \path[oedge] ([yshift=3pt]V1) -- ([yshift=3pt]V3) {}; 26 | \path[roedge] ([yshift=-3pt]V3) -- ([yshift=-3pt]V1) {}; 27 | 28 | \path[oedge] ([xshift=2pt]V3) -- ([xshift=2pt]V2) {}; 29 | \path[roedge] ([xshift=-2pt]V2) -- ([xshift=-2pt]V3) {}; 30 | 31 | \path[oedge] ([yshift=3pt]V2) -- ([yshift=3pt]V4) {}; 32 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V2) {}; 33 | 34 | \path[oedge] ([yshift=3pt]V3) -- ([yshift=3pt]V4) {}; 35 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V3) {}; 36 | 37 | \node[vertex] at (V1) {}; 38 | \node[vertex] at (V2) {}; 39 | \node[vertex] at (V3) {}; 40 | \node[vertex] at (V4) {}; 41 | 42 | \draw[->,>= latex,thick] (-0.4,3) arc (0:320:20pt); 43 | 44 | 45 | \end{tikzpicture} 46 | \end{center} 47 | 48 | \end{document} 49 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.io.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \begin{document} 8 | 9 | \begin{center} 10 | \begin{tikzpicture} 11 | [ 12 | vertex/.style={draw=none,circle,fill=white,minimum size=2pt}, 13 | vertex/.style={draw=none,circle,fill=white,minimum size=2pt}, 14 | oedge/.style={->,>=latex,shorten >=6pt,draw,white,thick}, 15 | roedge/.style={->,>=latex,shorten >=6pt,draw,thick,color=red!60!white}, 16 | boedge/.style={->,>=latex,shorten >=6pt,draw,thick,color=blue!60!white} 17 | ] 18 | 19 | \coordinate (V1) at (-3,3); 20 | \coordinate (V2) at (0,0); 21 | \coordinate (V3) at (0,6); 22 | \coordinate (V4) at (3,3); 23 | 24 | \path[boedge] ([yshift=3pt]V1) to ([yshift=3pt]V2) {}; 25 | \path[roedge] ([yshift=-3pt]V2) to ([yshift=-3pt]V1) {}; 26 | 27 | \path[oedge] ([yshift=3pt]V1) -- ([yshift=3pt]V3) {}; 28 | \path[oedge] ([yshift=-3pt]V3) -- ([yshift=-3pt]V1) {}; 29 | 30 | \path[boedge] ([xshift=2pt]V3) -- ([xshift=2pt]V2) {}; 31 | \path[roedge] ([xshift=-2pt]V2) -- ([xshift=-2pt]V3) {}; 32 | 33 | \path[roedge] ([yshift=3pt]V2) -- ([yshift=3pt]V4) {}; 34 | \path[boedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V2) {}; 35 | 36 | \path[oedge] ([yshift=3pt]V3) -- ([yshift=3pt]V4) {}; 37 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V3) {}; 38 | 39 | \node[vertex] at (V1) {}; 40 | \node[vertex] at (V2) {}; 41 | \node[vertex] at (V3) {}; 42 | \node[vertex] at (V4) {}; 43 | 44 | %\draw[->, thick] (-0.4,3) arc (0:320:20pt); 45 | 46 | 47 | \end{tikzpicture} 48 | \end{center} 49 | 50 | \end{document} 51 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.normal.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \begin{document} 8 | 9 | \begin{center} 10 | \begin{tikzpicture} 11 | [ 12 | vertex/.style={draw=none,circle,fill=black,minimum size=2pt}, 13 | oedge/.style={->,>=latex,shorten >=6pt,draw,black,thick}, 14 | roedge/.style={->,>=latex,shorten >=6pt,draw,black,thick,color=red} 15 | ] 16 | 17 | \coordinate (V1) at (-3,3); 18 | \coordinate (V2) at (0,0); 19 | \coordinate (V3) at (0,6); 20 | \coordinate (V4) at (3,3); 21 | 22 | \path[oedge] ([yshift=3pt]V1) to ([yshift=3pt]V2) {}; 23 | \path[oedge] ([yshift=-3pt]V2) to ([yshift=-3pt]V1) {}; 24 | 25 | \path[oedge] ([yshift=3pt]V1) -- ([yshift=3pt]V3) {}; 26 | \path[oedge] ([yshift=-3pt]V3) -- ([yshift=-3pt]V1) {}; 27 | 28 | \path[oedge] ([xshift=2pt]V3) -- ([xshift=2pt]V2) {}; 29 | \path[oedge] ([xshift=-2pt]V2) -- ([xshift=-2pt]V3) {}; 30 | 31 | \path[oedge] ([yshift=3pt]V2) -- ([yshift=3pt]V4) {}; 32 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V2) {}; 33 | 34 | \path[oedge] ([yshift=3pt]V3) -- ([yshift=3pt]V4) {}; 35 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V3) {}; 36 | 37 | \node[vertex] at (V1) {}; 38 | \node[vertex] at (V2) {}; 39 | \node[vertex] at (V3) {}; 40 | \node[vertex] at (V4) {}; 41 | 42 | %\draw[->, thick] (-0.4,3) arc (0:320:20pt); 43 | 44 | 45 | \end{tikzpicture} 46 | \end{center} 47 | 48 | \end{document} 49 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.opp.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \begin{document} 8 | 9 | \begin{center} 10 | \begin{tikzpicture} 11 | [ 12 | vertex/.style={draw=none,circle,fill=white,minimum size=2pt}, 13 | vertex/.style={draw=none,circle,fill=white,minimum size=2pt}, 14 | oedge/.style={->,>=latex,shorten >=6pt,draw,white,thick}, 15 | roedge/.style={->,>=latex,shorten >=6pt,draw,thick,color=red!60!white}, 16 | boedge/.style={->,>=latex,shorten >=6pt,draw,thick,color=blue!60!white} 17 | ] 18 | 19 | \coordinate (V1) at (-3,3); 20 | \coordinate (V2) at (0,0); 21 | \coordinate (V3) at (0,6); 22 | \coordinate (V4) at (3,3); 23 | 24 | \path[oedge] ([yshift=3pt]V1) to ([yshift=3pt]V2) {}; 25 | \path[oedge] ([yshift=-3pt]V2) to ([yshift=-3pt]V1) {}; 26 | 27 | \path[boedge] ([yshift=3pt]V1) -- ([yshift=3pt]V3) {}; 28 | \path[roedge] ([yshift=-3pt]V3) -- ([yshift=-3pt]V1) {}; 29 | 30 | \path[oedge] ([xshift=2pt]V3) -- ([xshift=2pt]V2) {}; 31 | \path[oedge] ([xshift=-2pt]V2) -- ([xshift=-2pt]V3) {}; 32 | 33 | \path[oedge] ([yshift=3pt]V2) -- ([yshift=3pt]V4) {}; 34 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V2) {}; 35 | 36 | \path[oedge] ([yshift=3pt]V3) -- ([yshift=3pt]V4) {}; 37 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V3) {}; 38 | 39 | \node[vertex] at (V1) {}; 40 | \node[vertex] at (V2) {}; 41 | \node[vertex] at (V3) {}; 42 | \node[vertex] at (V4) {}; 43 | 44 | %\draw[->, thick] (-0.4,3) arc (0:320:20pt); 45 | 46 | 47 | \end{tikzpicture} 48 | \end{center} 49 | 50 | \end{document} 51 | -------------------------------------------------------------------------------- /Doc/images/src/mesh.outer.tex: -------------------------------------------------------------------------------- 1 | \documentclass{minimal} 2 | 3 | % Tikz 4 | \usepackage{pgf} 5 | \usepackage{tikz} 6 | 7 | \begin{document} 8 | 9 | \begin{center} 10 | \begin{tikzpicture} 11 | [ 12 | vertex/.style={draw=none,circle,fill=black,minimum size=2pt}, 13 | oedge/.style={->,>=latex,shorten >=6pt,draw,black,thick}, 14 | roedge/.style={->,>=latex,shorten >=6pt,draw,black,thick,color=red} 15 | ] 16 | 17 | \coordinate (V1) at (-3,3); 18 | \coordinate (V2) at (0,0); 19 | \coordinate (V3) at (0,6); 20 | \coordinate (V4) at (3,3); 21 | 22 | \path[oedge] ([yshift=3pt]V1) to ([yshift=3pt]V2) {}; 23 | \path[roedge] ([yshift=-3pt]V2) to ([yshift=-3pt]V1) {}; 24 | 25 | \path[roedge] ([yshift=3pt]V1) -- ([yshift=3pt]V3) {}; 26 | \path[oedge] ([yshift=-3pt]V3) -- ([yshift=-3pt]V1) {}; 27 | 28 | \path[oedge] ([xshift=2pt]V3) -- ([xshift=2pt]V2) {}; 29 | \path[oedge] ([xshift=-2pt]V2) -- ([xshift=-2pt]V3) {}; 30 | 31 | \path[oedge] ([yshift=3pt]V2) -- ([yshift=3pt]V4) {}; 32 | \path[roedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V2) {}; 33 | 34 | \path[roedge] ([yshift=3pt]V3) -- ([yshift=3pt]V4) {}; 35 | \path[oedge] ([yshift=-3pt]V4) -- ([yshift=-3pt]V3) {}; 36 | 37 | \node[vertex] at (V1) {}; 38 | \node[vertex] at (V2) {}; 39 | \node[vertex] at (V3) {}; 40 | \node[vertex] at (V4) {}; 41 | 42 | \draw[<-,>= latex,thick] (3.3,3) arc (0:320:94pt); 43 | 44 | 45 | \end{tikzpicture} 46 | \end{center} 47 | 48 | \end{document} 49 | -------------------------------------------------------------------------------- /Doc/namespaces.docu: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // 3 | // Documents all used namespaces for doxygen 4 | // 5 | //============================================================================= 6 | 7 | 8 | /** \namespace OpenMesh::Concepts 9 | Descriptions of the concepts used in OpenMesh. 10 | */ 11 | 12 | 13 | /** \namespace OpenMesh 14 | Contains all the mesh ingredients like the polygonal mesh, 15 | the triangle mesh, different mesh kernels and mesh traits. 16 | **/ 17 | 18 | 19 | /** \namespace OpenMesh::Iterators 20 | Contains all mesh iterators and circulators. The two classes 21 | OpenMesh::Concepts::IteratorT and OpenMesh::Concepts::CirculatorT describe 22 | the interfaces provided by all iterators and circulators, respectively. 23 | 24 | All iterators/circulators defined in this namespace are template classes 25 | that require a mesh a template parameter. Therefore you should use 26 | the iterators/circulators that are defined by the mesh itself. See 27 | OpenMesh::Mesh::PolyMeshT for a complete list of them. 28 | 29 | \see The mesh docu section \ref mesh_iterators for a more detailed 30 | description. 31 | \see OpenMesh::Concepts::IteratorT 32 | \see OpenMesh::Concepts::CirculatorT 33 | */ 34 | 35 | 36 | /** \namespace OpenMesh::IO 37 | This namespace contains functions for reading and writing polygonal 38 | meshes and a list of supported file formats. 39 | */ 40 | 41 | 42 | /** \namespace OpenMesh::GenProg 43 | Utilities for generative programming. 44 | */ 45 | 46 | 47 | /** \namespace OpenMesh::Attributes 48 | This namespace holds per item attributes like normal/color. 49 | There are some macros provided for convenience, see Attributes.hh. 50 | \see Attributes.hh 51 | */ 52 | 53 | 54 | /** \namespace OpenMesh::Kernel_OSG 55 | In this namespace resides the OpenSG integration of OpenMesh. 56 | Here you find the class 57 | OpenMesh::OSG_Kernel::TriMesh_OSGArrayKernelT<> and the 58 | template function OpenMesh::OSG_Kernel::bindT<> to link such a 59 | mesh with a OpenSG Geometry. */ 60 | 61 | 62 | /** \namespace OpenMesh::Decimater 63 | Software related to mesh decimation. 64 | \see DecimaterT.hh 65 | */ 66 | 67 | 68 | /** \namespace OpenMesh::Subdivider::Adaptive 69 | * Software related to adaptive subdivision of meshes. 70 | */ 71 | 72 | /** \namespace OpenMesh::Subdivider::Uniform 73 | * Software related to uniform subdivision of meshes. 74 | */ 75 | 76 | /** \namespace OpenMesh::VDPM 77 | * Software related to view dependent progressive meshes. 78 | */ 79 | 80 | /** \namespace OpenMesh::Utils 81 | * Collection of little utility classes and helpers. 82 | */ -------------------------------------------------------------------------------- /Doc/subdivider.docu: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | 3 | /** \page subdivider_docu Sudivision Tools 4 | 5 | \section Overview 6 | 7 | The %OpenMesh library provides a few tools for uniform and adaptive 8 | subdivision: 9 | 10 | -# Uniform subdivision 11 | -# OpenMesh::Subdivider::Uniform::LoopT 12 | -# OpenMesh::Subdivider::Uniform::Sqrt3T 13 | -# OpenMesh::Subdivider::Uniform::ModifiedButterflyT 14 | -# OpenMesh::Subdivider::Uniform::InterpolatingSqrt3LGT 15 | -# OpenMesh::Subdivider::Uniform::CompositeT 16 | -# OpenMesh::Subdivider::Uniform::CatmullClarkT 17 | -# Adaptive subdivision 18 | -# OpenMesh::Subdivider::Adaptive::CompositeT 19 | -# Simple subdivision 20 | -# OpenMesh::Subdivider::Uniform::LongestEdgeT 21 | 22 | \section Usage 23 | The subdividers directly work on an OpenMesh. The following example shows how to use them: 24 | 25 | \code 26 | #include 27 | 28 | // Initialize subdivider 29 | OpenMesh::Subdivider::Uniform::CatmullClarkT catmull; 30 | 31 | // Execute 3 subdivision steps 32 | catmull.attach(mesh_); 33 | catmull( 3 ); 34 | catmull.detach(); 35 | \endcode 36 | 37 | */ 38 | 39 | //----------------------------------------------------------------------------- 40 | -------------------------------------------------------------------------------- /Doc/tools.docu: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | 3 | /** \page tools_docu OpenMesh Tools Documentation 4 | 5 | \li \subpage decimater_docu 6 | \li \subpage subdivider_docu 7 | \li \subpage vdpm_docu 8 | \li Miscellaneous 9 | OpenMesh::StripifierT 10 | 11 | */ 12 | 13 | // ---------------------------------------------------------------------------- 14 | -------------------------------------------------------------------------------- /Doc/tutorial_01.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_01 First Steps - Building a cube 2 | 3 | This small example shows: 4 | \li How to declare your type \c MyMesh, 5 | \li How to add vertices and faces to a mesh, 6 | \li How to write a mesh using the IO functions. 7 | 8 | For each program the first step is to define your type \c 9 | MyMesh. %OpenMesh supports general polygonal meshes (faces are polygons 10 | with varying number of vertices) as well as specialized triangle 11 | meshes (all faces are triangles). In this example we want to build a 12 | cube from six quadrangles, therefore we choose the polygonal mesh. 13 | 14 | %OpenMesh also supports different mesh kernels, specifying how all the 15 | vertices, edges, and faces are stored internally (see also \ref 16 | mesh_kernels_group). However, the storage must provide an array like interface. 17 | For the tutorial we use the supplied ArrayKernel. The predefined 18 | combinations of TriMesh/PolyMesh and the kernel are 19 | contained in \c %OpenMesh/src/OpenMesh/Core/Mesh, we use the 20 | PolyMesh_ArrayKernelT. 21 | 22 | \dontinclude build_cube.cc 23 | \skipline PolyMesh_ArrayKernel 24 | \skipline MyMesh 25 | 26 | Now since we have declared our type \c MyMesh, we only have to add 8 27 | vertices and 6 quadrangles to build a cube. Adding a vertex is done 28 | using the add_vertex method. It gets a coordinate and returns 29 | a handle to the inserted vertex. We store all handles in an array, 30 | since we need them for specifying the faces. 31 | 32 | \skipline vhandle[0] 33 | \until vhandle[3] 34 | 35 |
In order to add a face to the mesh, we have to build a vector holding 36 | the handles to the face's vertices. This vector is passed to the 37 | \c add_face method. The following block will create a face from the first 38 | four vertices: 39 | 40 | \skipline face_vhandles 41 | \until add_face 42 | 43 |
The orientation of the face is defined by the order in which the 44 | vertices are given: If you look at the frontfacing side of the 45 | polygon, then the vertices are in counter-clockwise order. 46 | 47 | After creating all of the six faces, we want to write the resulting 48 | mesh to standard output. %OpenMesh provides some basic input/output 49 | methods in the namespace OpenMesh::IO: 50 | 51 | \skipline write_ 52 | 53 |
To use the IO facility of %OpenMesh make sure that the include MeshIO.hh is 54 | included first. 55 | 56 | \dontinclude build_cube.cc 57 | \skipline MeshIO 58 | \until PolyMesh_ArrayKernel 59 | 60 |
The complete source looks like this: 61 | 62 | \include build_cube.cc 63 | 64 | **/ 65 | -------------------------------------------------------------------------------- /Doc/tutorial_02.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_02 Using iterators and circulators 2 | 3 | This examples shows: 4 | 5 | - How to use iterators, 6 | - How to use circulators. 7 | 8 | This example is the first version of the simple mesh smoother. Here we 9 | will introduce \em iterators and \em circulators. These two concepts 10 | provide functionality to linearly enumerate e.g. all vertices of a 11 | mesh, and to circulate around a vertex, i.e. to enumerate all its 12 | one-ring neighbors. For a more detailed description, see \ref 13 | mesh_iterators. 14 | 15 | First we have to define the mesh type we want to use. This time we use 16 | a triangle mesh instead of a polygonal mesh: 17 | 18 | \dontinclude 02-iterators/smooth.cc 19 | \skipline TriMesh_ArrayKernel 20 | \skipline MyMesh 21 | 22 |
We read the mesh to be smoothed from a file: 23 | 24 | \skipline read_mesh 25 | 26 |
One smoothing iteration is done in two steps: 27 |
    28 |
  1. For each vertex: calculate the barycenter of its one-ring neighbors.
  2. 29 |
  3. For each vertex: move the vertex to the computed barycenter.
  4. 30 |
31 | 32 | This can easily be implemented using vertex iterators. The mesh 33 | provides begin and end iterators by vertices_begin() and 34 | vertices_end(). 35 | 36 | \skipline VertexIter 37 | \skipline v_it!=v_end 38 | 39 |
For calculating the barycenter, we have to iterate through the 40 | one-ring neighborhood of the current vertex. This functionality 41 | is provided by the VertexVertexIter: 42 | 43 | \dontinclude 02-iterators/smooth.cc 44 | \skipline VertexVertexIter 45 | \skipline vv_it= 46 | 47 |
Now we can calculate the barycenters for each vertex and store them in 48 | the array cogs: 49 | 50 | \dontinclude 02-iterators/smooth.cc 51 | \skipline std::vector 52 | \skipline v_it= 53 | \until cogs.push_back 54 | \until } 55 | 56 |
After we have calculated the barycenters all that is left to do is to 57 | move the vertices to the corresponding barycenters. The complete source 58 | code is listed below. 59 | 60 | \include 02-iterators/smooth.cc 61 | 62 | **/ -------------------------------------------------------------------------------- /Doc/tutorial_03.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_03 Using (custom) properties 2 | 3 | This examples shows: 4 | - How to add and remove custom properties, 5 | - How to get and set the value of a custom property 6 | 7 | In the last example we computed the barycenter of each vertex' 8 | neighborhood and stored it in an array. It would be more convenient 9 | and less error-prone if we could store this data in the mesh and 10 | let %OpenMesh manage the data. 11 | It would be even more helpful if we could attach such properties 12 | dynamically to the mesh. 13 | 14 | %OpenMesh provides dynamic properties, which can be attached to each 15 | mesh entity (vertex, face, edge, halfedge, and the mesh itself). We 16 | distinguish between custom and standard properties. A custom property 17 | is any user-defined property and is accessed via the member function 18 | \c property(..) via a handle and an entity handle 19 | (e.g. VertexHandle). Whereas the standard properties are accessed via 20 | special member functions, e.g. the vertex position is accessed with \c 21 | point(..) and a vertex handle. 22 | 23 | In this example we will store the \c cog-value (see previous example) 24 | in an additional vertex property instead of keeping it in a separate 25 | array. To do so we define first a so-called property handle with the desired 26 | type (\c MyMesh::Point) and register the handle at the mesh: 27 | 28 | \dontinclude 03-properties/smooth.cc 29 | \skipline vertex property stores 30 | \until mesh.add 31 | 32 |
The \c mesh allocates enough memory to hold as many elements of type 33 | \c MyMesh::Point as number of vertices exist, and of course the mesh 34 | synchronizes all insert and delete operations on the vertices with the 35 | vertex properties. 36 | 37 | Once the wanted property is registered we can use the property to 38 | calculate the barycenter of the neighborhood of each vertex \c v_it 39 | 40 | \dontinclude 03-properties/smooth.cc 41 | \skipline vv_it= 42 | \until } 43 | \until mesh.prop 44 | 45 |
and finally set the new position for each vertex \c v_it 46 | 47 | \dontinclude 03-properties/smooth.cc 48 | \skipline mesh.set_point 49 | 50 |
Below is the complete source code: 51 | 52 | \include 03-properties/smooth.cc 53 | 54 | */ -------------------------------------------------------------------------------- /Doc/tutorial_04.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_04 Using STL algorithms 2 | 3 | Since the %OpenMesh iterators are (almost) conformant to STL iterators, 4 | one can apply the STL algorithms on meshes. The following example 5 | shows how to use the STL \c for_each construct, since it is 6 | easier to read and may be more efficient than hand-written loops. 7 | 8 | We will define a class which provides the smoothing algorithm, hence 9 | define a reusable component. The class must be template class because there 10 | is no such thing as a class %OpenMesh, but many different types of %OpenMesh: 11 | 12 | \dontinclude 04-stl_algorithms/smooth_algo.hh 13 | \skipline template 14 | 15 | The class SmootherT has two functors, one that computes the barycenter 16 | for a given vertex, and a second that sets the vertex position to the 17 | corresponding barycenter. A functor is simply a class with a function 18 | operator()(...). The first functor \c ComputeCOG 19 | computes the barycenter and stores it in a custom vertex property \c 20 | cog_: 21 | 22 | \skipline operator 23 | \until } 24 | \until } 25 | 26 | Note, that \c ComputeCOG needs to have access to the mesh object and 27 | the property handle. Here, both are references to member variables of 28 | the smoother object. 29 | 30 | The second functor \c class \c SetCOG, which sets the vertex position, 31 | is constructed analogical. 32 | 33 | Using these functors and std::for_each from the STL 34 | the smoothing algorithm can be realized in a member function of 35 | \c SmootherT: 36 | 37 | \dontinclude 04-stl_algorithms/smooth_algo.hh 38 | \skipline void smooth 39 | \until } 40 | \until } 41 | 42 |
The complete example looks like this: 43 | 44 | \include 04-stl_algorithms/smooth_algo.hh 45 | 46 |
and 47 | 48 | \include 04-stl_algorithms/smooth.cc 49 | 50 | */ -------------------------------------------------------------------------------- /Doc/tutorial_07.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_07 Extending the mesh using traits 2 | 3 | This examples shows: 4 | 5 | - How to extend the behaviour of entities using traits. 6 | 7 | In the previous tutorial we used attributes and changed the type of 8 | the data types \c Point, \c Normal, \c TexCoord, and \c Color. But we 9 | can do even more with traits. We can change the behaviour of the mesh 10 | entities \c Vertex, \c Face, \c Edge, and \c Halfedge. 11 | 12 | One goal in the design was a highly customizable data structure. Using 13 | the traits technique makes it possible. We pick up the smoother again 14 | and show an alternative way to implement it. Now we place the necessary 15 | data and the functions in the vertex itself 16 | 17 | \dontinclude 07-traits/smooth.cc 18 | \skipline MyTraits 19 | \until }; 20 | \until }; 21 | 22 | Note the definition of the vertex entity. We use the supplied define 23 | \c VertexTraits (which resolves in a rather inconvenient template 24 | definition). Similary we can use the defines \c FaceTraits, \c 25 | EdgeTraits, and \c HalfedgeTraits to extend these entities. Now we 26 | enhanced the vertex, with the additional member variable \c cog_, and 27 | the get/set-method pair to access the new member. 28 | 29 | As before we compute in a first loop the barycenters for all vertices 30 | and store the information at the vertices 31 | 32 | \skipline mesh.data(v_it).set_cog 33 | 34 | In the second pass we set the new position of each vertex 35 | 36 | \skipline mesh.data(v_it).cog 37 | 38 | It looks neat, but on the other hand we can't remove the data anymore 39 | as we could do with properties! By using traits one creates a 'static' 40 | configuration, which can't be changed during runtime. 41 | 42 | The complete source looks like this: 43 | 44 | \include 07-traits/smooth.cc 45 | 46 | */ -------------------------------------------------------------------------------- /Doc/tutorial_07b.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_07b Deleting geometry elements 2 | 3 | This small example shows how to remove faces and vertices from a mesh. 4 | 5 | We basically use the geometry created in \ref tutorial_01. 6 | 7 | If we want our mesh class to be able to remove vertices, faces or edges 8 | we have to extend the default traits for our mesh class. 9 | Vertices, faces and (half-)edges need the OpenMesh::Attributes::Status attribute 10 | which is used to hold the flag "deleted" if an element is deleted. 11 | 12 | The struct which defines the mesh traits then looks like this: 13 | 14 | \dontinclude delete_geometry.cc 15 | \skipline struct 16 | \until }; 17 | 18 | After having created the geometry of the cube one can delete faces and vertices 19 | by simply calling delete_vertices() (delete_faces() or delete_edges() respectively). 20 | 21 | Note that there is actually no way to directly delete halfedges since they are automatically 22 | affected when the parent edge is marked as deleted! 23 | 24 | The status whether an element is marked as deleted can be requested by 25 | 26 | \code 27 | mesh.status(handle).deleted(); // true if element handle is marked as deleted 28 | // false otherwise 29 | \endcode 30 | 31 | where handle is either a vertex-, edge- or face-handle. 32 | 33 | In this example we delete all faces except one and the corresponding vertices. 34 | The code looks like this 35 | 36 | \dontinclude delete_geometry.cc 37 | \skipline // Delete face 0 38 | \until mesh.delete_vertex(vhandle[3], false); 39 | 40 | Now the deleted faces and vertices are marked as "deleted" internally. 41 | Call garbage_collection() to definitely remove them from memory. 42 | 43 | \dontinclude delete_geometry.cc 44 | \skipline // Delete all 45 | \until mesh.garbage_collection(); 46 | 47 | The full source code of the example: 48 | 49 | \include delete_geometry.cc 50 | 51 | **/ 52 | -------------------------------------------------------------------------------- /Doc/tutorial_build.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial_build How to create your own project using OpenMesh 2 | 3 | In this tutorial we will explain, how to create a new project using 4 | %OpenMesh and build it with the CMake build system. We assume, that you have already 5 | downloaded the %OpenMesh source files as well as installed the CMake build tools. 6 | 7 | There are quite few steps to follow to successfully add your own application to the build tree: 8 | 9 | \li Go to OpenMeshRoot/src/OpenMesh/Apps and create a new directory, say "MyOwnProject" 10 | \li Now create a new file called "CMakeLists.txt" containing the following lines: 11 | 12 | \include CMakeLists.txt 13 | 14 | (Remember to replace "MyProjectName" with whatever you have chosen as your project's name. 15 | Note: If you don't want to use *.hh and *.cc as your C++ source file suffices, you'll 16 | have to change this, too, because CMake won't build your sources otherwise. 17 | 18 | \li Create your source files as for example explained in the previous tutorial (\ref tutorial_01) 19 | and save them in the same directory. 20 | 21 | \li Add \code add_subdirectory (MyOwnProject) \endcode to OpenMeshRoot/src/OpenMesh/Apps/CMakeLists.txt (note: You can either 22 | add this line right after the other projects or at the end of the file). 23 | 24 | \li Create a directory called "build" in OpenMesh's root directory. Change to the newly created directory and call 25 | \code cmake .. \endcode and \code make \endcode 26 | 27 | That's all. Your project will now be built. 28 | 29 | **/ 30 | -------------------------------------------------------------------------------- /Doc/tutorial_main.docu: -------------------------------------------------------------------------------- 1 | /** \page tutorial Tutorials (code examples) 2 | 3 | The %OpenMesh mesh library is a powerful tool for handling polygonal 4 | meshes. Due to its inherent generative structure it allows the user to 5 | create mesh types which are custom tailored to the specific needs of 6 | the application. The user can either supply his own data structures 7 | for representing vertices, edges and faces or he can conveniently use 8 | the predefined structures of %OpenMesh. 9 | Additionally %OpenMesh offers dynamic properties allowing the user to attach 10 | and detach data to the mesh during runtime. 11 | 12 | This document is supposed to introduce the basic concepts of 13 | %OpenMesh. 15 | 16 | In this tutorial we will introduce the %OpenMesh library by means of 17 | simple examples. The first one just builds a polygonal mesh 18 | representing a cube and writes the result to standard output. The 19 | following examples develop a simple mesh smoother: Recall that the 20 | immediate neighbors of a vertex are called the 1-ring of this 21 | vertex. It is well known that a polygonal mesh can be smoothed by 22 | repeatedly replacing each vertex' position by the center of gravity 23 | (cog) of its 1-ring. The basic smoother will 24 | 25 | \li read a polygonal mesh from standard input, 26 | \li compute the cog of the 1-ring of each vertex, 27 | \li replace each vertex' position by its cog and finally, 28 | \li write the mesh to standard output. 29 | 30 |
    31 |
  1. \subpage tutorial_build 32 |
  2. \subpage tutorial_01 33 |
  3. \subpage tutorial_02 34 |
  4. \subpage tutorial_03 35 |
  5. \subpage tutorial_04 36 |
  6. \subpage tutorial_05 37 |
  7. \subpage tutorial_06 38 |
  8. \subpage tutorial_07 39 |
  9. \subpage tutorial_07b 40 |
  10. \subpage tutorial_08 41 |
  11. \subpage tutorial_09 42 |
43 | 44 | */ 45 | -------------------------------------------------------------------------------- /Doc/vdpm.docu: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | 3 | /** \page vdpm_docu View Dependent Progressive Meshes 4 | 5 | The VDPM software is based on "Truly Selective 7 | Refinement of Progressive Meshes", J. Kim and S. Lee, In 8 | Proc. Graphics Interface 2001. 9 | 10 | The library is located in \c %OpenMesh/Tools/VDPM/ and in 11 | \c %OpenMesh/Apps/VDProgMesh/ are demo applications: 12 | -# \c mkbalancedpm creates balanced progressive meshes 13 | -# \c vdpmanalyzer takes a progressive mesh and generates a view dependent 14 | progressive mesh. 15 | -# \c vdpmsynthezier is viewer for vdpm meshes. 16 | 17 | \todo Complete VDPM documentation. 18 | */ -------------------------------------------------------------------------------- /LICENSE/COPYING.EXCEPTIONS: -------------------------------------------------------------------------------- 1 | OpenMesh makes use of the LGPL v3 with the following exception: 2 | 3 | As a special exception to the GNU Lesser General Public License, 4 | you may use any file of this software library without restriction. 5 | Specifically, if other files instantiate templates or use macros 6 | or inline functions from this file, or you compile this file and 7 | link it with other files to produce an executable, this file does 8 | not by itself cause the resulting executable to be covered by the 9 | GNU Lesser General Public License. This exception does not however 10 | invalidate any other reasons why the executable file might be 11 | covered by the GNU Lesser General Public License. 12 | -------------------------------------------------------------------------------- /OpenMesh.pro: -------------------------------------------------------------------------------- 1 | contains( OPENFLIPPER , OpenFlipper ){ 2 | include( $$TOPDIR/qmake/all.include ) 3 | } else { 4 | include( $$TOPDIR/OpenMesh/qmake/all.include ) 5 | } 6 | 7 | Subdirs() 8 | 9 | addSubdirs( src/OpenMesh/Core ) 10 | addSubdirs( src/OpenMesh/Tools , src/OpenMesh/Core ) 11 | addSubdirs( src/OpenMesh/Apps/commandlineDecimater , src/OpenMesh/Core src/OpenMesh/Tools) 12 | addSubdirs( src/OpenMesh/Apps/Decimating/DecimaterGui , src/OpenMesh/Core src/OpenMesh/Tools) 13 | addSubdirs( src/OpenMesh/Apps/mconvert , src/OpenMesh/Core src/OpenMesh/Tools) 14 | addSubdirs( src/OpenMesh/Apps/QtViewer , src/OpenMesh/Core src/OpenMesh/Tools) 15 | addSubdirs( src/OpenMesh/Apps/Smoothing , src/OpenMesh/Core src/OpenMesh/Tools) 16 | addSubdirs( src/OpenMesh/Apps/Subdivider/commandlineSubdivider , src/OpenMesh/Core src/OpenMesh/Tools) 17 | addSubdirs( src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider , src/OpenMesh/Core src/OpenMesh/Tools) 18 | addSubdirs( src/OpenMesh/Apps/Subdivider/SubdividerGui , src/OpenMesh/Core src/OpenMesh/Tools) 19 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | OpenMesh, 3.0 2 | ~~~~~~~~~~~~~~~ 3 | 4 | 0. Licence 5 | ~~~~~~~~~~~~~~~ 6 | see LICENSE 7 | 8 | 9 | 1. Installing 10 | ~~~~~~~~~~~~~~ 11 | Unpack the tar-ball to a suitable place. 12 | 13 | A detailed build manual for Mac/Windows/Linux is in the Documentation 14 | located at Doc/html/index.html 15 | 16 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | VERSION=3.0 2 | MAJOR=3 3 | MINOR=0 4 | PATCH=0 5 | ID=OPENMESH 6 | 7 | -------------------------------------------------------------------------------- /VS2008OpenMesh.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 10.00 2 | # Visual Studio 2008 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "src\OpenMesh\Core\VS2008Core.vcproj", "{68E46D49-FF4B-337F-9909-E8CC0C457A5D}" 4 | EndProject 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools", "src\OpenMesh\Tools\VS2008Tools.vcproj", "{A84C45D6-CAE9-38A7-8A45-631F520C70CC}" 6 | ProjectSection(ProjectDependencies) = postProject 7 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D} = {68E46D49-FF4B-337F-9909-E8CC0C457A5D} 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VS2008MConvert", "src\OpenMesh\Apps\mconvert\VS2008mconvert.vcproj", "{C2F9DF8D-9293-4B6C-839C-57A38D1C873B}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D} = {68E46D49-FF4B-337F-9909-E8CC0C457A5D} 13 | {A84C45D6-CAE9-38A7-8A45-631F520C70CC} = {A84C45D6-CAE9-38A7-8A45-631F520C70CC} 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Win32 = Debug|Win32 19 | Release|Win32 = Release|Win32 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D}.Debug|Win32.Build.0 = Debug|Win32 24 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D}.Release|Win32.ActiveCfg = Release|Win32 25 | {68E46D49-FF4B-337F-9909-E8CC0C457A5D}.Release|Win32.Build.0 = Release|Win32 26 | {A84C45D6-CAE9-38A7-8A45-631F520C70CC}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {A84C45D6-CAE9-38A7-8A45-631F520C70CC}.Debug|Win32.Build.0 = Debug|Win32 28 | {A84C45D6-CAE9-38A7-8A45-631F520C70CC}.Release|Win32.ActiveCfg = Release|Win32 29 | {A84C45D6-CAE9-38A7-8A45-631F520C70CC}.Release|Win32.Build.0 = Release|Win32 30 | {C2F9DF8D-9293-4B6C-839C-57A38D1C873B}.Debug|Win32.ActiveCfg = Debug|Win32 31 | {C2F9DF8D-9293-4B6C-839C-57A38D1C873B}.Debug|Win32.Build.0 = Debug|Win32 32 | {C2F9DF8D-9293-4B6C-839C-57A38D1C873B}.Release|Win32.ActiveCfg = Release|Win32 33 | {C2F9DF8D-9293-4B6C-839C-57A38D1C873B}.Release|Win32.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /cmake/ACGOutput.cmake: -------------------------------------------------------------------------------- 1 | # fill string with spaces 2 | macro (acg_format_string str length return) 3 | string (LENGTH "${str}" _str_len) 4 | math (EXPR _add_chr "${length} - ${_str_len}") 5 | set (${return} "${str}") 6 | while (_add_chr GREATER 0) 7 | set (${return} "${${return}} ") 8 | math (EXPR _add_chr "${_add_chr} - 1") 9 | endwhile () 10 | endmacro () 11 | 12 | # print message with color escape sequences if CMAKE_COLOR_MAKEFILE is set 13 | string (ASCII 27 _escape) 14 | function (acg_color_message _str) 15 | if (CMAKE_COLOR_MAKEFILE AND NOT WIN32) 16 | message (${_str}) 17 | else () 18 | string (REGEX REPLACE "${_escape}.[0123456789;]*m" "" __str ${_str}) 19 | message (${__str}) 20 | endif () 21 | endfunction () 22 | 23 | # info header 24 | function (acg_print_configure_header _id _name) 25 | acg_format_string ("${_name}" 40 _project) 26 | acg_format_string ("${${_id}_VERSION}" 40 _version) 27 | acg_color_message ("\n${_escape}[40;37m************************************************************${_escape}[0m") 28 | acg_color_message ("${_escape}[40;37m* ${_escape}[1;31mACG ${_escape}[0;40;34mBuildsystem${_escape}[0m${_escape}[40;37m *${_escape}[0m") 29 | acg_color_message ("${_escape}[40;37m* *${_escape}[0m") 30 | acg_color_message ("${_escape}[40;37m* Package : ${_escape}[32m${_project} ${_escape}[37m *${_escape}[0m") 31 | acg_color_message ("${_escape}[40;37m* Version : ${_escape}[32m${_version} ${_escape}[37m *${_escape}[0m") 32 | 33 | # Just artistic. remove 2 spaces for release to make it look nicer ;-) 34 | if (${CMAKE_BUILD_TYPE} MATCHES "Debug") 35 | acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") 36 | else() 37 | acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") 38 | endif() 39 | 40 | acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m") 41 | endfunction () 42 | 43 | # info line 44 | function (acg_print_configure_footer) 45 | acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m\n") 46 | endfunction () 47 | 48 | -------------------------------------------------------------------------------- /cmake/FindGLEW.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find GLEW 2 | # Once done this will define 3 | # 4 | # GLEW_FOUND - system has GLEW 5 | # GLEW_INCLUDE_DIR - the GLEW include directory 6 | # GLEW_LIBRARY_DIR - where the libraries are 7 | # GLEW_LIBRARY - Link these to use GLEW 8 | # 9 | 10 | IF (GLEW_INCLUDE_DIR) 11 | # Already in cache, be silent 12 | SET(GLEW_FIND_QUIETLY TRUE) 13 | ENDIF (GLEW_INCLUDE_DIR) 14 | 15 | if( WIN32 ) 16 | if( MSVC80 ) 17 | set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC" ) 18 | endif( MSVC80 ) 19 | if( MSVC71 ) 20 | set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ .NET\ 2003/Vc7" ) 21 | endif( MSVC71 ) 22 | FIND_PATH( GLEW_INCLUDE_DIR gl/glew.h gl/wglew.h 23 | PATHS "c:/glew/include" "c:/libs/glew/include" ${COMPILER_PATH}/PlatformSDK/Include ) 24 | SET( GLEW_NAMES glew32 ) 25 | FIND_LIBRARY( GLEW_LIBRARY 26 | NAMES ${GLEW_NAMES} 27 | PATHS "c:/glew/lib" "c:/libs/glew/lib" ${COMPILER_PATH}/PlatformSDK/Lib ) 28 | else( WIN32 ) 29 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h GL/wglew.h 30 | PATHS /usr/local/include /usr/include ) 31 | SET( GLEW_NAMES glew GLEW ) 32 | FIND_LIBRARY( GLEW_LIBRARY 33 | NAMES ${GLEW_NAMES} 34 | PATHS /usr/lib /usr/local/lib ) 35 | endif( WIN32 ) 36 | 37 | GET_FILENAME_COMPONENT( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} PATH ) 38 | 39 | IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) 40 | SET(GLEW_FOUND TRUE) 41 | ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) 42 | SET( GLEW_FOUND FALSE ) 43 | SET( GLEW_LIBRARY_DIR ) 44 | ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) 45 | 46 | -------------------------------------------------------------------------------- /cmake/fixbundle.cmake.in: -------------------------------------------------------------------------------- 1 | # gp_item_default_embedded_path_override item default_embedded_path_var 2 | # 3 | # Return the path that others should refer to the item by when the item 4 | # is embedded inside a bundle. 5 | # 6 | # This is a project-specific override of BundleUtilities.cmake's 7 | # gp_item_default_embedded_path 8 | # 9 | function(gp_item_default_embedded_path_override item default_embedded_path_var) 10 | 11 | # By default, embed items as set by gp_item_default_embedded_path: 12 | # 13 | set(path "${${default_embedded_path_var}}") 14 | 15 | # But for OpenFlipper... 16 | # 17 | # ...embed *.dylib in the Libraries folder: 18 | # 19 | if(item MATCHES "\\.dylib$") 20 | set(path "@executable_path/../Libraries") 21 | endif() 22 | 23 | # ...embed qt plugins in the Libraries folder: 24 | # 25 | if(item MATCHES "@QT_PLUGINS_DIR@" AND item MATCHES "\\.bundle") 26 | file (RELATIVE_PATH _plugin "@QT_PLUGINS_DIR@" "${item}") 27 | get_filename_component(_dir "${_plugin}" PATH) 28 | set(path "@executable_path/../Resources/QtPlugins/${_dir}") 29 | endif() 30 | 31 | # ...embed *.so in the Plugins folder: 32 | # 33 | if(item MATCHES "\\.so$") 34 | set(path "@executable_path/../Resources/Plugins") 35 | endif() 36 | 37 | set(${default_embedded_path_var} "${path}" PARENT_SCOPE) 38 | endfunction(gp_item_default_embedded_path_override) 39 | 40 | include (BundleUtilities) 41 | 42 | #if ( @BUILD_APPS@ ) 43 | # message("Fixing up bundle ...") 44 | # 45 | # # copy qt plugins to bundle 46 | # file (GLOB _plugins "@CMAKE_BINARY_DIR@/Build/OpenFlipper.app/Contents/Resources/Plugins/*.so") 47 | # file (GLOB_RECURSE _qtplugins "@QT_PLUGINS_DIR@/*.bundle") 48 | # foreach (_qtp ${_qtplugins}) 49 | # get_filename_component(_dir "${_qtp}" PATH) 50 | # list(APPEND _qtdirs "${_dir}") 51 | # endforeach () 52 | 53 | # # Get library paths 54 | # get_filename_component(_GlutDir "@GLUT_glut_LIBRARY@" PATH) 55 | 56 | # # fix all dependencies 57 | # fixup_bundle (@CMAKE_BINARY_DIR@/Build/bin/QtViewer "${_qtplugins}" "/usr/lib;${_qtdirs};${_GlutDir}") 58 | # 59 | #endif() 60 | 61 | # create qt plugin configuration file 62 | # file(WRITE "@CMAKE_BINARY_DIR@/Build/OpenMesh.app/Contents/Resources/qt.conf" "[Paths]\nPlugins = Resources/QtPlugins") 63 | 64 | -------------------------------------------------------------------------------- /cmake/fixbundle.cmake.win.in: -------------------------------------------------------------------------------- 1 | # gp_item_default_embedded_path_override item default_embedded_path_var 2 | # 3 | # Return the path that others should refer to the item by when the item 4 | # is embedded inside a bundle. 5 | # 6 | # This is a project-specific override of BundleUtilities.cmake's 7 | # gp_item_default_embedded_path 8 | # 9 | function(gp_item_default_embedded_path_override item default_embedded_path_var) 10 | 11 | # By default, embed items as set by gp_item_default_embedded_path: 12 | # 13 | set(path "${${default_embedded_path_var}}") 14 | 15 | set(${default_embedded_path_var} "${path}" PARENT_SCOPE) 16 | endfunction(gp_item_default_embedded_path_override) 17 | 18 | include (BundleUtilities) 19 | 20 | # Get library paths 21 | get_filename_component(_GlutDir "@GLUT_glut_LIBRARY@" PATH) 22 | 23 | # fix all dependencies 24 | fixup_bundle ("@CMAKE_BINARY_DIR@/Build/Smoothing.exe" "" "${_GlutDir};@QT_BINARY_DIR@") 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | openmesh (2.0-0~ppa1~maverick1) maverick; urgency=low 2 | 3 | * First maverick version of the official openmesh v2 release. 4 | * Adding libxi-dev, libxmu-dev dependencies to build the apps. 5 | 6 | -- Jean Pierre Charalambos Sun, 02 Jan 2011 10:29:02 -0500 7 | 8 | openmesh (2.0~svn216-0~ppa3~karmic1) karmic; urgency=low 9 | 10 | * Fix UPSTREAM SVN REPOSITORY in rules. Thanks to Jan Möbius. 11 | 12 | -- Jean Pierre Charalambos Wed, 11 Nov 2009 17:14:27 -0500 13 | 14 | openmesh (2.0~svn216-0~ppa2~karmic1) karmic; urgency=low 15 | 16 | * Same as first karmic version but this one includes the changelog from Jaunty versions 17 | * Karmic versions fix PACKAGE name in rules from libopenmesh to openmesh 18 | * Karmic versions remove debian directory from svn export 19 | * It remains to fix a SONAMES warning. Maybe it has to see with the upper case letters usage? 20 | 21 | -- Jean Pierre Charalambos Thu, 05 Nov 2009 14:53:02 -0500 22 | 23 | openmesh (2.0~svn216-0~ppa1~karmic1) karmic; urgency=low 24 | 25 | * Fisrt karmic version 26 | * New upstream SVN snapshot taken from revision 216 27 | 28 | -- Jean Pierre Charalambos Tue, 03 Nov 2009 21:32:38 -0500 29 | 30 | openmesh (2.0~svn177-0~ppa2~jaunty1) jaunty; urgency=low 31 | 32 | * Adding the documentation package. 33 | 34 | -- Jean Pierre Charalambos Thu, 25 Jun 2009 20:07:43 -0500 35 | 36 | openmesh (2.0~svn177-0~ppa1~jaunty1) jaunty; urgency=low 37 | 38 | * New upstream SVN snapshot. 39 | * Splitting the library into libopenmesh and libopenmesh-dev, after 40 | fixes to SONAMES added at this upstream revision. 41 | * No documentation added yet. 42 | * Removing r167 packages from the ppa because they do not conform with 43 | packaging sources directly imported from SVN. According to debian 44 | policies, in this case get-orig-source must be used. 45 | 46 | -- Jean Pierre Charalambos Wed, 24 Jun 2009 22:26:31 -0500 47 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by: 2 | 3 | Jean Pierre Charalambos on Sun, 21 Jun 2009 17:49:34 -0500 4 | 5 | It was downloaded from: 6 | 7 | http://www.openmesh.org 8 | 9 | Upstream Author: 10 | 11 | Computer Graphics Group, RWTH Aachen 12 | 13 | Copyright: 14 | 15 | Copyright (C) 2001-2013 by Computer Graphics Group, RWTH Aachen 16 | 17 | License: 18 | 19 | This package is free software; you can redistribute it and/or modify 20 | it under the terms of the GNU General Public License as published by 21 | the Free Software Foundation; either version 2 of the License, or 22 | (at your option) any later version. 23 | 24 | This package is distributed in the hope that it will be useful, 25 | but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | GNU General Public License for more details. 28 | 29 | You should have received a copy of the GNU General Public License 30 | along with this package; if not, write to the Free Software 31 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 32 | 33 | On Debian systems, the complete text of the GNU General 34 | Public License can be found in `/usr/share/common-licenses/GPL'. 35 | 36 | The Debian packaging is: 37 | 38 | Copyright C) 2009, Jean Pierre Charalambos 39 | 40 | and is licensed under the GPL, see above. 41 | 42 | 43 | LICENSE_EXCEPTION added by the upstream authors 44 | 45 | As a special exception to the GNU Lesser General Public License, 46 | you may use any file of this software library without restriction. 47 | Specifically, if other files instantiate templates or use macros 48 | or inline functions from this file, or you compile this file and 49 | link it with other files to produce an executable, this file does 50 | not by itself cause the resulting executable to be covered by the 51 | GNU Lesser General Public License. This exception does not however 52 | invalidate any other reasons why the executable file might be 53 | covered by the GNU Lesser General Public License. 54 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | include /usr/share/cdbs/1/rules/debhelper.mk 4 | include /usr/share/cdbs/1/class/cmake.mk 5 | 6 | build/libopenmesh-doc:: 7 | cd $(DEB_BUILDDIR) && $(MAKE) doc 8 | mkdir -p debian/tmp/usr/share/doc/ 9 | cp -r $(DEB_BUILDDIR)/Build/share/OpenMesh/Doc/html debian/tmp/usr/share/doc/OpenMesh 10 | 11 | install/libopenmesh:: 12 | ln -sf libOpenMeshCore.so.2.0 debian/tmp/usr/lib/OpenMesh/libOpenMeshCore.so.2 13 | ln -sf libOpenMeshTools.so.2.0 debian/tmp/usr/lib/OpenMesh/libOpenMeshTools.so.2 14 | dh_install -plibopenmesh debian/tmp/usr/lib/OpenMesh/lib*.so.* /usr/lib/ 15 | 16 | install/libopenmesh-dev:: 17 | dh_install -plibopenmesh-dev debian/tmp/usr/lib/OpenMesh/lib*.so /usr/lib/ 18 | dh_install -plibopenmesh-dev debian/tmp/usr/lib/OpenMesh/lib*.a /usr/lib/ 19 | dh_install -plibopenmesh-dev --autodest debian/tmp/usr/include/OpenMesh 20 | 21 | install/libopenmesh-apps:: 22 | dh_install -plibopenmesh-apps debian/tmp/usr/bin/* /usr/lib/OpenMesh/Apps 23 | 24 | install/libopenmesh-doc:: 25 | dh_install -plibopenmesh-doc debian/tmp/usr/share/doc/* 26 | -------------------------------------------------------------------------------- /qmake/architecture.include: -------------------------------------------------------------------------------- 1 | 2 | ################################################################################ 3 | # Architecture detection 4 | # The following Variables are defined by this include: 5 | # OPERATING_SYSTEM : Debian / Fedora / Windows 6 | # ARCHITECTURE : 32 / 64 7 | # MODE : Debug / Release 8 | # BUILDDIRECTORY : Concat of all above variables sesparated by underscores e.g. Debian_64_debug 9 | ################################################################################ 10 | 11 | unix { 12 | 13 | OPERATING_SYSTEM = UNKNOWN_OS 14 | 15 | exists( /etc/lsb-release ) { 16 | OPERATING_SYSTEM = Ubuntu 17 | } 18 | 19 | 20 | exists( /etc/debian_version ) | exists( /etc/debian_release ) { 21 | OPERATING_SYSTEM = Debian 22 | } 23 | 24 | exists( /etc/fedora-release ) { 25 | OPERATING_SYSTEM = Fedora 26 | } 27 | 28 | exists( /etc/gentoo-release ) { 29 | OPERATING_SYSTEM = Gentoo 30 | } 31 | 32 | exists( /etc/lfs-release ) { 33 | OPERATING_SYSTEM = Linux_From_Scratch 34 | } 35 | 36 | exists( /etc/mandrake-release ) | exists( /etc/mandrakelinux-release ) { 37 | OPERATING_SYSTEM = Mandrake 38 | } 39 | 40 | exists( /etc/mandriva-release ) { 41 | OPERATING_SYSTEM = Mandriva 42 | } 43 | 44 | exists( /etc/redhat-release ) | exists( /etc/redhat_version ) { 45 | OPERATING_SYSTEM = Redhat 46 | } 47 | 48 | exists( /etc/SuSE-release ) | exists( /etc/novell-release ) { 49 | OPERATING_SYSTEM = SuSE 50 | } 51 | 52 | TEST_DARWIN = $$system(uname -s) 53 | contains( TEST_DARWIN, Darwin) { 54 | OPERATING_SYSTEM = Darwin 55 | DEFINES += ARCH_DARWIN 56 | export(DEFINES) 57 | } 58 | 59 | HARDWARE_PLATFORM = $$system(uname -a) 60 | contains( HARDWARE_PLATFORM, x86_64 ) { 61 | # 64-bit Linux 62 | ARCHITECTURE = 64 63 | } else { 64 | # 32-bit Linux 65 | ARCHITECTURE = 32 66 | } 67 | 68 | contains(TEST_DARWIN, Darwin) { 69 | SYSTEMTYPE = Darwin 70 | } else { 71 | SYSTEMTYPE = Linux 72 | } 73 | } 74 | 75 | win32 { 76 | OPERATING_SYSTEM = Windows 77 | ARCHITECTURE = 32 78 | SYSTEMTYPE = Windows 79 | } 80 | 81 | CONFIG( debug, debug|release ){ 82 | MODE = Debug 83 | } else { 84 | MODE = Release 85 | } 86 | 87 | BUILDDIRECTORY = $${OPERATING_SYSTEM}_$${ARCHITECTURE}_$${MODE} 88 | -------------------------------------------------------------------------------- /qmake/compiler.include: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Custom settings for compiler flags and similar 3 | ################################################################################ 4 | 5 | unix { 6 | QMAKE_CC = gcc-4.3 7 | QMAKE_CXX = g++-4.3 8 | macx { 9 | QMAKE_CC = gcc-4.0 10 | QMAKE_CXX = g++-4.0 11 | } 12 | 13 | QMAKE_CFLAGS_RELEASE = -O3 -DINCLUDE_TEMPLATES -W -Wall -Wno-unused -DNDEBUG 14 | QMAKE_CXXFLAGS_RELEASE = -O3 -DINCLUDE_TEMPLATES -ftemplate-depth-100 -W -Wall -Wno-unused -DNDEBUG 15 | QMAKE_CFLAGS_DEBUG = -g -DINCLUDE_TEMPLATES -W -Wall -Wno-unused -DDEBUG 16 | QMAKE_CXXFLAGS_DEBUG = -g -DINCLUDE_TEMPLATES -ftemplate-depth-100 -W -Wall -Wno-unused -DDEBUG 17 | } 18 | 19 | -------------------------------------------------------------------------------- /qmake/functions.include: -------------------------------------------------------------------------------- 1 | 2 | ################################################################################ 3 | # functions collecting all headers in the directory 4 | ################################################################################ 5 | 6 | # getFilesFromDir( directory, pattern ) 7 | # returns a list of all files matching pattern in directory 8 | defineReplace(getFilesFromDir) { 9 | dirs = $$1 10 | pattern = $$2 11 | 12 | files = 13 | 14 | for(dir, dirs) { 15 | found = $$files( $${dir}/$${pattern} ) 16 | files += $$found 17 | } 18 | 19 | return( $$files ) 20 | } 21 | 22 | # addSubdirs(subdirs,deps): Adds directories to the project that depend on 23 | # other directories 24 | defineTest( addSubdirs ) { 25 | for(subdirs, 1) { 26 | entries = $$files($$subdirs) 27 | for(entry, entries) { 28 | name = $$replace(entry, [/\\\\], _) 29 | name = $$replace(name, - , _) 30 | SUBDIRS += $$name 31 | eval ($${name}.subdir = $$entry) 32 | for(dep, 2): { 33 | tempval = $$replace(dep, [/\\\\], _) 34 | eval ($${name}.depends += $$replace(tempval, - , _) ) 35 | } 36 | export ($${name}.subdir) 37 | export ($${name}.depends) 38 | } 39 | } 40 | export (SUBDIRS) 41 | } 42 | 43 | # given a list of paths and a libname this function checks if the lib is there 44 | # adds the path and returns true if found otherwise false 45 | defineTest( addLib ) { 46 | dirs = $$1 47 | name = $$2 48 | 49 | # check for the library 50 | for(dir , dirs) { 51 | check = $${dir}/lib$${name}.so 52 | 53 | # Found, so use it 54 | exists( $$check ) { 55 | LIBS *= -L$${dir} -l$$name 56 | export(LIBS) 57 | return(true) 58 | } 59 | } 60 | 61 | return(false) 62 | } 63 | 64 | 65 | defineReplace( getCurrentDir ) { 66 | DIR = '' 67 | unix { 68 | DIR = $$system( pwd ) 69 | } 70 | 71 | win32 { 72 | DIR = $$system( cd ) 73 | } 74 | 75 | return( $$DIR ) 76 | } 77 | -------------------------------------------------------------------------------- /qmake/packages/packages.Darwin: -------------------------------------------------------------------------------- 1 | 2 | ################################################################################ 3 | # INCLUDE Packages 4 | ################################################################################ 5 | 6 | defineTest( qt ) { 7 | QT += opengl network script sql 8 | export(QT) 9 | } 10 | 11 | defineTest( glew ) { 12 | INCLUDEPATH *= /sw/include/GL 13 | export(INCLUDEPATH) 14 | LIBS *= -L/opt/local/lib/ -lGLEW 15 | export(LIBS) 16 | } 17 | 18 | defineTest( glut ) { 19 | INCLUDEPATH *= /System/Library/Frameworks/GLUT.framework/Headers 20 | export(INCLUDEPATH) 21 | LIBS *= -framework GLUT 22 | export(LIBS) 23 | } 24 | 25 | defineTest( openmesh ) { 26 | QMAKE_LIBDIR += $${TOPDIR}/lib 27 | QMAKE_LIBDIR += $${TOPDIR}/lib 28 | 29 | CONFIG( debug, debug|release ){ 30 | LIBS += -lOpenMeshToolsd 31 | LIBS += -lOpenMeshCored 32 | } else { 33 | LIBS += -lOpenMeshTools 34 | LIBS += -lOpenMeshCore 35 | } 36 | export(QMAKE_LIBDIR) 37 | export(LIBS) 38 | } 39 | -------------------------------------------------------------------------------- /qmake/packages/packages.Linux: -------------------------------------------------------------------------------- 1 | 2 | ################################################################################ 3 | # INCLUDE Packages 4 | ################################################################################ 5 | 6 | defineTest( qt ) { 7 | CONFIG *= uitools 8 | export(CONFIG) 9 | QT += opengl network script sql 10 | export(QT) 11 | } 12 | 13 | defineTest( qwt ) { 14 | INCLUDEPATH *= /usr/include/qwt-qt4/ 15 | export(INCLUDEPATH) 16 | LIBS *= -L/usr/lib/ -lqwt-qt4 17 | export(LIBS) 18 | } 19 | 20 | defineTest( glew ) { 21 | INCLUDEPATH *= /usr/include/GL 22 | export(INCLUDEPATH) 23 | LIBS *= -L/usr/lib -lGLEW 24 | export(LIBS) 25 | } 26 | 27 | defineTest( glut ) { 28 | INCLUDEPATH *=$${ACG}/OpenGL/include 29 | export(INCLUDEPATH) 30 | LIBS *= -L/usr/X11R6/lib -lglut 31 | export(LIBS) 32 | } 33 | 34 | defineTest( openmesh ) { 35 | QMAKE_LIBDIR += $${TOPDIR}/lib/ 36 | QMAKE_LIBDIR += $${TOPDIR}/lib/ 37 | 38 | CONFIG( debug, debug|release ){ 39 | LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCored 40 | LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshToolsd 41 | } else { 42 | LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCore 43 | LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshTools 44 | } 45 | 46 | export(QMAKE_LIBDIR) 47 | export(LIBS) 48 | } 49 | 50 | defineTest( openmp ) { 51 | 52 | addLib( /usr/lib/gcc/x86_64-linux-gnu/4.3 /usr/lib, gomp ) { 53 | 54 | QMAKE_CXXFLAGS_RELEASE += -fopenmp 55 | QMAKE_CXXFLAGS_DEBUG += -fopenmp 56 | QMAKE_CFLAGS_RELEASE += -fopenmp 57 | QMAKE_CFLAGS_DEBUG += -fopenmp 58 | QMAKE_LFLAGS_DEBUG += -fopenmp 59 | QMAKE_LFLAGS_RELEASE += -fopenmp 60 | 61 | export(QMAKE_CXXFLAGS_RELEASE) 62 | export(QMAKE_CFLAGS_RELEASE) 63 | export(QMAKE_CXXFLAGS_DEBUG) 64 | export(QMAKE_CFLAGS_DEBUG) 65 | export(QMAKE_LFLAGS_DEBUG) 66 | export(QMAKE_LFLAGS_RELEASE) 67 | } else { 68 | message("Unable to find OpenMP lib for linking. OpenMP support will be disabled!!") 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /qmake/packages/packages.Windows: -------------------------------------------------------------------------------- 1 | 2 | ################################################################################ 3 | # INCLUDE Packages 4 | ################################################################################ 5 | 6 | 7 | defineTest( glew ) { 8 | 9 | ####################################### 10 | ## Enter here the correct path to GLEW 11 | ####################################### 12 | 13 | GLEW_PATH = c:\libs\glew 14 | 15 | ####################################### 16 | 17 | !exists ( $${GLEW_PATH} ) { 18 | error (ERROR: GLEW not found or wrong path entry in OpenMesh\qmake\packages\packages.Windows! Please adjust it to your path!) 19 | } 20 | INCLUDEPATH *= $${GLEW_PATH}\include 21 | export(INCLUDEPATH) 22 | LIBS *= -L$${GLEW_PATH}\lib -lglew32 23 | export(LIBS) 24 | } 25 | 26 | defineTest( qt ) { 27 | CONFIG *= uitools 28 | export(CONFIG) 29 | QT += opengl network script sql 30 | export(QT) 31 | } 32 | 33 | defineTest( glut ) { 34 | 35 | ####################################### 36 | ## Enter here the correct path to GLUT 37 | ####################################### 38 | 39 | GLUT_PATH = c:\libs\glut-3.7 40 | 41 | ######################################## 42 | 43 | !exists ( $${GLUT_PATH} ) { 44 | error (ERROR: GLUT not found or wrong path entry in OpenMesh\qmake\packages\packages.Windows! Please adjust it to your path!) 45 | } 46 | INCLUDEPATH *= $${GLUT_PATH}\include 47 | export(INCLUDEPATH) 48 | LIBS *= -L$${GLUT_PATH}\lib -lglut32 49 | export(LIBS) 50 | } 51 | 52 | defineTest( openmp ) { 53 | QMAKE_CXXFLAGS_DEBUG += /openmp 54 | QMAKE_CXXFLAGS_RELEASE += /openmp 55 | export(QMAKE_CXXFLAGS_DEBUG) 56 | export(QMAKE_CXXFLAGS_RELEASE) 57 | } 58 | 59 | defineTest( openmesh ) { 60 | DEFINES += _USE_MATH_DEFINES NOMINMAX 61 | 62 | QMAKE_LIBDIR += $${TOPDIR}/lib/ 63 | QMAKE_LIBDIR += $${TOPDIR}/lib/ 64 | 65 | CONFIG( debug, debug|release ){ 66 | LIBS+= -L$${TOPDIR}/lib -lOpenMeshCored 67 | LIBS+= -L$${TOPDIR}/lib -lOpenMeshToolsd 68 | } else { 69 | LIBS+= -L$${TOPDIR}/lib -lOpenMeshCore 70 | LIBS+= -L$${TOPDIR}/lib -lOpenMeshTools 71 | } 72 | 73 | export(DEFINES) 74 | export(QMAKE_LIBDIR) 75 | export(LIBS) 76 | } 77 | 78 | -------------------------------------------------------------------------------- /release.howto: -------------------------------------------------------------------------------- 1 | 1. check files, build on windows,mac,linux with cmake and qmake 2 | 2. check files with release numbers: 3 | Doc/changelog.docu 4 | System/config.h 5 | CHANGELOG 6 | README 7 | VERSION 8 | 3. Tag the current version in the svn (checkout, remove .svn readd as tag) 9 | 4. Create HTML-Documentation in OpenMesh/Docu/ (!) 10 | 5. Create tar-ball and zip-archive 11 | > tar cvzf OpenMesh-.tar.gz OpenMesh-/ 12 | > tar cvjf OpenMesh-.tar.bz2 OpenMesh-/ 13 | > zip -9 -r OpenMesh-.zip OpenMesh-/ 14 | 6. Release Upload 15 | 7. Upload the Documentation to webserver 16 | 8. Set new links in content management system 17 | -------------------------------------------------------------------------------- /src/OpenMesh/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = Core Tools ../Doc 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/ACGMakefile.proj: -------------------------------------------------------------------------------- 1 | # for gcc the max. template depth has to be increased 2 | ifeq ($(CXX_COMP),g++) 3 | CXX_DEFS += -ftemplate-depth-100 -fPIC 4 | endif 5 | 6 | # place links to all executables in ./bin 7 | BINARY_DIR := bin 8 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ${GLUT_INCLUDE_DIR} 7 | ${QT_INCLUDE_DIR} 8 | ) 9 | 10 | 11 | set (targetName DecimaterGui) 12 | 13 | # source code directories 14 | set (directories 15 | ../../QtViewer 16 | ../ 17 | ) 18 | 19 | # collect all header and source files 20 | acg_append_files (headers "*.hh" ${directories}) 21 | 22 | set (sources 23 | ../../QtViewer/QGLViewerWidget.cc 24 | ../../QtViewer/MeshViewerWidgetT.cc 25 | ../DecimaterViewerWidget.cc 26 | ../decimaterviewer.cc 27 | ) 28 | 29 | # remove template cc files from source file list 30 | acg_drop_templates (sources) 31 | 32 | # genereate uic and moc targets 33 | acg_qt4_automoc (moc_targets ${headers}) 34 | 35 | if (WIN32) 36 | acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) 37 | # link to qtmain library to get WinMain function for a non terminal app 38 | target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) 39 | else () 40 | acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) 41 | endif () 42 | 43 | target_link_libraries (${targetName} 44 | OpenMeshCore 45 | OpenMeshTools 46 | ${QT_LIBRARIES} 47 | ${OPENGL_LIBRARIES} 48 | ${GLUT_LIBRARIES} 49 | ) 50 | 51 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Decimating/DecimaterGui/DecimaterGui.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | Application() 8 | 9 | INCLUDEPATH += ../../.. 10 | 11 | Application() 12 | glew() 13 | glut() 14 | openmesh() 15 | 16 | DIRECTORIES = ../../QtViewer ../ 17 | 18 | # Input 19 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 20 | SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../DecimaterViewerWidget.cc 21 | SOURCES += ../decimaterviewer.cc 22 | 23 | 24 | ################################################################################ 25 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName commandlineDecimater) 9 | 10 | # collect all header and source files 11 | set (sources 12 | ../decimater.cc 13 | ) 14 | 15 | acg_add_executable (${targetName} ${sources}) 16 | 17 | target_link_libraries (${targetName} 18 | OpenMeshCore 19 | OpenMeshTools 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Decimating/commandlineDecimater/commandlineDecimater.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | glew() 11 | glut() 12 | openmesh() 13 | 14 | DIRECTORIES = .. 15 | 16 | # Input 17 | SOURCES += ../decimater.cc 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Dualizer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName Dualizer) 9 | 10 | # collect all header and source files 11 | acg_append_files (headers "*.hh" .) 12 | acg_append_files (sources "*.cc" .) 13 | 14 | acg_add_executable (${targetName} ${headers} ${sources}) 15 | 16 | target_link_libraries (${targetName} 17 | OpenMeshCore 18 | OpenMeshTools 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/ProgViewer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt4 glut opengl x11 math 10 | 11 | PROJ_LIBS = OpenMesh/Apps/QtViewer OpenMesh/Tools OpenMesh/Core 12 | 13 | MODULES := moc4 cxx 14 | 15 | 16 | #== SYSTEM PART -- DON'T TOUCH ============================================== 17 | include $(ACGMAKE)/Rules 18 | #============================================================================== 19 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/ProgViewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ${GLUT_INCLUDE_DIR} 7 | ${QT_INCLUDE_DIR} 8 | ) 9 | 10 | set (targetName ProgViewer) 11 | 12 | 13 | # collect all header and source files 14 | acg_append_files (headers "*.hh" .) 15 | acg_append_files (sources "*.cc" .) 16 | 17 | list (APPEND sources "../QtViewer/QGLViewerWidget.cc") 18 | list (APPEND sources "../QtViewer/MeshViewerWidgetT.cc") 19 | 20 | list (APPEND headers "../QtViewer/QGLViewerWidget.hh") 21 | list (APPEND headers "../QtViewer/MeshViewerWidgetT.hh") 22 | 23 | 24 | # # source code directories 25 | # set (directories 26 | # . 27 | # ../QtViewer 28 | # ) 29 | 30 | # # collect all header and source files 31 | # acg_append_files (headers "*.hh" ${directories}) 32 | 33 | # set (sources 34 | # ../../QtViewer/QGLViewerWidget.cc 35 | # ../../QtViewer/MeshViewerWidgetT.cc 36 | # ./ProgViewerWidget.cc 37 | # ) 38 | 39 | # remove template cc files from source file list 40 | acg_drop_templates (sources) 41 | 42 | # genereate uic and moc targets 43 | acg_qt4_automoc (moc_targets ${headers}) 44 | 45 | if (WIN32) 46 | acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) 47 | # link to qtmain library to get WinMain function for a non terminal app 48 | target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) 49 | else () 50 | acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) 51 | endif () 52 | 53 | target_link_libraries (${targetName} 54 | OpenMeshCore 55 | OpenMeshTools 56 | ${QT_LIBRARIES} 57 | ${OPENGL_LIBRARIES} 58 | ${GLUT_LIBRARIES} 59 | ) 60 | 61 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/QtViewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ${GLUT_INCLUDE_DIR} 7 | ${QT_INCLUDE_DIR} 8 | ) 9 | 10 | set (targetName QtViewer) 11 | 12 | # source code directories 13 | set (directories 14 | . 15 | ) 16 | 17 | # collect all header and source files 18 | acg_append_files (headers "*.hh" ${directories}) 19 | acg_append_files (sources "*.cc" ${directories}) 20 | acg_append_files (ui "*.ui" ${directories}) 21 | 22 | # remove template cc files from source file list 23 | acg_drop_templates (sources) 24 | 25 | # genereate uic and moc targets 26 | acg_qt4_autouic (uic_targets ${ui}) 27 | acg_qt4_automoc (moc_targets ${headers}) 28 | 29 | 30 | if (WIN32) 31 | acg_add_executable (${targetName} WIN32 ${uic_targets} ${sources} ${headers} ${moc_targets}) 32 | # link to qtmain library to get WinMain function for a non terminal app 33 | target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) 34 | else () 35 | acg_add_executable (${targetName} ${uic_targets} ${sources} ${headers} ${moc_targets}) 36 | endif () 37 | 38 | target_link_libraries (${targetName} 39 | OpenMeshCore 40 | OpenMeshTools 41 | ${QT_LIBRARIES} 42 | ${OPENGL_LIBRARIES} 43 | ${GLUT_LIBRARIES} 44 | ) 45 | 46 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/QtViewer/QtViewer.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | Application() 8 | glew() 9 | glut() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Smoothing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName Smoothing) 9 | 10 | # collect all header and source files 11 | acg_append_files (headers "*.hh" .) 12 | acg_append_files (sources "*.cc" .) 13 | 14 | acg_add_executable (${targetName} ${headers} ${sources}) 15 | 16 | target_link_libraries (${targetName} 17 | OpenMeshCore 18 | OpenMeshTools 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Smoothing/Smoothing.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | glew() 11 | glut() 12 | openmesh() 13 | 14 | DIRECTORIES = . 15 | 16 | # Input 17 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 18 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 19 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 20 | 21 | ################################################################################ 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ${GLUT_INCLUDE_DIR} 7 | ${QT_INCLUDE_DIR} 8 | ) 9 | 10 | set (targetName SubdividerGui) 11 | 12 | # source code directories 13 | set (directories 14 | ../../QtViewer 15 | ../ 16 | ) 17 | 18 | # collect all header and source files 19 | acg_append_files (headers "*.hh" ${directories}) 20 | 21 | set (sources 22 | ../../QtViewer/QGLViewerWidget.cc 23 | ../../QtViewer/MeshViewerWidgetT.cc 24 | ../SubdivideWidget.cc 25 | ../qtsubdivider.cc 26 | ) 27 | 28 | # remove template cc files from source file list 29 | acg_drop_templates (sources) 30 | 31 | # genereate uic and moc targets 32 | acg_qt4_automoc (moc_targets ${headers}) 33 | 34 | if (WIN32) 35 | acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) 36 | # link to qtmain library to get WinMain function for a non terminal app 37 | target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) 38 | else () 39 | acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) 40 | endif () 41 | 42 | target_link_libraries (${targetName} 43 | OpenMeshCore 44 | OpenMeshTools 45 | ${QT_LIBRARIES} 46 | ${OPENGL_LIBRARIES} 47 | ${GLUT_LIBRARIES} 48 | ) 49 | 50 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/SubdividerGui/SubdividerGui.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | glew() 11 | glut() 12 | openmesh() 13 | 14 | DIRECTORIES = .. ../../QtViewer 15 | 16 | # Input 17 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 18 | SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../SubdivideWidget.cc 19 | SOURCES += ../qtsubdivider.cc 20 | 21 | ################################################################################ 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName commandlineAdaptiveSubdivider) 9 | 10 | # collect all header and source files 11 | set (sources 12 | ../adaptive_subdivider.cc 13 | ) 14 | 15 | acg_add_executable (${targetName} ${sources}) 16 | 17 | target_link_libraries (${targetName} 18 | OpenMeshCore 19 | OpenMeshTools 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/commandlineAdaptiveSubdivider.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | # Input 13 | SOURCES += ../adaptive_subdivider.cc 14 | 15 | ################################################################################ 16 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName commandlineSubdivider) 9 | 10 | # collect all header and source files 11 | set (sources 12 | ../subdivider.cc 13 | ) 14 | 15 | acg_add_executable (${targetName} ${sources}) 16 | 17 | target_link_libraries (${targetName} 18 | OpenMeshCore 19 | OpenMeshTools 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Subdivider/commandlineSubdivider/commandlineSubdivider.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | # Input 13 | SOURCES += ../subdivider.cc 14 | 15 | ################################################################################ 16 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/IvViewer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS := $(call find-subdirs) 7 | 8 | USE_COIN := no 9 | USE_SOQT := no 10 | 11 | ifeq ($(USE_COIN),yes) 12 | USE_SOQT := yes 13 | endif 14 | 15 | ifeq ($(USE_SOQT),yes) 16 | 17 | CXX_DEFS += -DUSE_SOQT=1 18 | 19 | ifeq ($(USE_COIN),yes) 20 | PACKAGES := coin soqt_coin glut opengl qt 21 | else 22 | PACKAGES := Inventor soqt_inventor glut opengl qt 23 | endif 24 | 25 | else 26 | PACKAGES := inventor opengl x11 27 | endif 28 | 29 | 30 | PROJ_LIBS = OpenMesh/Core 31 | 32 | MODULES := cxx 33 | 34 | 35 | #== SYSTEM PART -- DON'T TOUCH ============================================== 36 | include $(ACGMAKE)/Rules 37 | #============================================================================== 38 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/OsgViewer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | #CXX_SRC_EXT := .cc 6 | #CXX_HDR_EXT := .h 7 | 8 | CXX_CFLAGS += -DOM_USE_OSG=1 9 | 10 | SUBDIRS = 11 | 12 | PACKAGES := osg qt glut opengl x11 math 13 | 14 | PROJ_LIBS = OpenMesh/Apps/QtViewer OpenMesh/Tools OpenMesh/Core 15 | 16 | MODULES := moc cxx 17 | 18 | 19 | #== SYSTEM PART -- DON'T TOUCH ============================================== 20 | include $(ACGMAKE)/Rules 21 | #============================================================================== 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/OsgViewer/README: -------------------------------------------------------------------------------- 1 | Usage: 2 | 3 | 1. osgviewer 4 | 5 | Load a model via I/O routines of OpenMesh and save as a OpenSG 6 | binary file in file opensg.bin. 7 | 8 | 2. osgviewer 9 | 10 | Load model previously stored in opensg.bin via OpenSG BINLoader. 11 | 12 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := 13 | 14 | #== SYSTEM PART -- DON'T TOUCH ============================================== 15 | include $(ACGMAKE)/Rules 16 | #============================================================================== 17 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt4 glut opengl 10 | 11 | PROJ_LIBS := OpenMesh/Apps/QtViewer \ 12 | OpenMesh/Core OpenMesh/Tools 13 | 14 | MODULES := moc4 cxx 15 | 16 | 17 | #== SYSTEM PART -- DON'T TOUCH ============================================== 18 | include $(ACGMAKE)/Rules 19 | #============================================================================== 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/camera.cmr: -------------------------------------------------------------------------------- 1 | 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.016996 -0.109919 -0.370638 1.000000 2 | 2.414214 0.000000 0.000000 0.000000 0.000000 2.414214 0.000000 0.000000 0.000000 0.000000 -1.000200 -1.000000 0.000000 0.000000 -0.002487 0.000000 3 | 0.000000 1.000000 0.000000 176744288671350421565538919745292424325033476751523693228169963004884932940091916749086946235466103001193375847224942690972512534721986560.000000 0.000000 nan 425134321045072769729657674081032044702092994459323810191320335465371399515446481741965189098676184821816460416151892487150071042707962836116024422753449790030954505984610613125759424311663740707690994610961772976644207938664290688788945427521964959221153792.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 4 | 0.000000 0.000000 0.000000 1.000000 0.000000 43138399251230245763880957247161123402511258100486738812232497009688599814651595596323661983776768.000000 0.000000 nan 56217166495396395288300850038172311276865324027010017909696113739489719293525015037327494588529843730643950329227434086235241736485385775424471015442015055292454325203222134784.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt4 glut opengl 10 | 11 | PROJ_LIBS := OpenMesh/Core OpenMesh/Tools 12 | 13 | MODULES := moc4 cxx 14 | 15 | 16 | #== SYSTEM PART -- DON'T TOUCH ============================================== 17 | include $(ACGMAKE)/Rules 18 | #============================================================================== 19 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/bunny.pm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/bunny.pm -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/bunny.spm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/bunny.spm -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/rockerArm.pm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/rockerArm.pm -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := 13 | 14 | #== SYSTEM PART -- DON'T TOUCH ============================================== 15 | include $(ACGMAKE)/Rules 16 | #============================================================================== 17 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming/Client/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt glut opengl 10 | 11 | PROJ_LIBS := OpenMesh/Apps/QtViewer \ 12 | OpenMesh/Core OpenMesh/Tools 13 | 14 | MODULES := moc cxx 15 | 16 | 17 | #== SYSTEM PART -- DON'T TOUCH ============================================== 18 | include $(ACGMAKE)/Rules 19 | #============================================================================== 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/Unsupported/Streaming/Server/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt glut opengl 10 | 11 | PROJ_LIBS := OpenMesh/Core OpenMesh/Tools 12 | 13 | MODULES := moc cxx 14 | 15 | 16 | #== SYSTEM PART -- DON'T TOUCH ============================================== 17 | include $(ACGMAKE)/Rules 18 | #============================================================================== 19 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/Analyzer/Analyzer.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../../.. 8 | 9 | CONFIG += glew glut 10 | 11 | Application() 12 | 13 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore 14 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools 15 | LIBS += -lglut 16 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} 17 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} 18 | 19 | DIRECTORIES = . 20 | 21 | # Input 22 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 23 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 24 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 25 | 26 | ################################################################################ 27 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName Analyzer) 9 | 10 | # collect all header and source files 11 | set (sources 12 | ./vdpmanalyzer.cc 13 | ) 14 | 15 | acg_add_executable (${targetName} ${sources}) 16 | 17 | target_link_libraries (${targetName} 18 | OpenMeshCore 19 | OpenMeshTools 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ${GLUT_INCLUDE_DIR} 7 | ${QT_INCLUDE_DIR} 8 | ) 9 | 10 | set (targetName Synthesizer) 11 | 12 | # collect all header and source files 13 | acg_append_files (headers "*.hh" .) 14 | acg_append_files (sources "*.cc" .) 15 | 16 | list (APPEND sources "../../QtViewer/QGLViewerWidget.cc") 17 | list (APPEND sources "../../QtViewer/MeshViewerWidgetT.cc") 18 | 19 | list (APPEND headers "../../QtViewer/QGLViewerWidget.hh") 20 | list (APPEND headers "../../QtViewer/MeshViewerWidgetT.hh") 21 | 22 | # remove template cc files from source file list 23 | acg_drop_templates (sources) 24 | 25 | # genereate uic and moc targets 26 | acg_qt4_automoc (moc_targets ${headers}) 27 | 28 | if (WIN32) 29 | acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets}) 30 | # link to qtmain library to get WinMain function for a non terminal app 31 | target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY}) 32 | else () 33 | acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets}) 34 | endif () 35 | 36 | target_link_libraries (${targetName} 37 | OpenMeshCore 38 | OpenMeshTools 39 | ${QT_LIBRARIES} 40 | ${OPENGL_LIBRARIES} 41 | ${GLUT_LIBRARIES} 42 | ) 43 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/Synthesizer/Synthesizer.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../../.. 8 | 9 | CONFIG += glew glut 10 | 11 | Application() 12 | 13 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore 14 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools 15 | LIBS += -lglut 16 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} 17 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} 18 | 19 | DIRECTORIES = . ../../QtViewer 20 | 21 | # Input 22 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 23 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 24 | SOURCES -= ../../QtViewer/meshviewer.cc 25 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 26 | 27 | ################################################################################ 28 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName mkbalancedpm) 9 | 10 | # collect all header and source files 11 | set (sources 12 | ./mkbalancedpm.cc 13 | ) 14 | 15 | acg_add_executable (${targetName} ${sources}) 16 | 17 | target_link_libraries (${targetName} 18 | OpenMeshCore 19 | OpenMeshTools 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../../.. 8 | 9 | CONFIG += glew glut 10 | 11 | Application() 12 | 13 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore 14 | LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools 15 | LIBS += -lglut 16 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} 17 | QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} 18 | 19 | DIRECTORIES = . 20 | 21 | # Input 22 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 23 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 24 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 25 | 26 | ################################################################################ 27 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/mconvert/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include (ACGCommon) 2 | 3 | include_directories ( 4 | ../../.. 5 | ${CMAKE_CURRENT_SOURCE_DIR} 6 | ) 7 | 8 | set (targetName mconvert) 9 | 10 | # collect all header and source files 11 | acg_append_files (headers "*.hh" .) 12 | acg_append_files (sources "*.cc" .) 13 | 14 | acg_add_executable (${targetName} ${headers} ${sources}) 15 | 16 | target_link_libraries (${targetName} 17 | OpenMeshCore 18 | OpenMeshTools 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /src/OpenMesh/Apps/mconvert/mconvert.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | Application() 8 | 9 | INCLUDEPATH += ../../.. 10 | 11 | glew() 12 | glut() 13 | openmesh() 14 | 15 | DIRECTORIES = . 16 | 17 | # Input 18 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 19 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 20 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 21 | 22 | ################################################################################ 23 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = Geometry Utils Mesh IO Tools System 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | CXXLIB_BUILD_LIB := yes 13 | 14 | MODULES := cxxlib 15 | 16 | 17 | #== SYSTEM PART -- DON'T TOUCH ============================================== 18 | include $(ACGMAKE)/Rules 19 | #============================================================================== 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Core.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | Library() 8 | 9 | contains( OPENFLIPPER , OpenFlipper ){ 10 | DESTDIR = $${TOPDIR}/OpenMesh/lib 11 | } else { 12 | DESTDIR = $${TOPDIR}/lib 13 | } 14 | 15 | 16 | DIRECTORIES = . Geometry IO IO/exporter IO/importer IO/reader IO/writer \ 17 | Mesh Mesh/gen System Utils 18 | 19 | INCLUDEPATH += ../.. 20 | 21 | CONFIG( debug, debug|release ){ 22 | TARGET = OpenMeshCored 23 | } else { 24 | TARGET = OpenMeshCore 25 | } 26 | 27 | win32 { 28 | DEFINES += _USE_MATH_DEFINES NOMINMAX 29 | CONFIG += static 30 | } 31 | 32 | macx { 33 | # Set library binary header to the correct path 34 | QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${DESTDIR}/ 35 | export(QMAKE_LFLAGS_SONAME) 36 | } 37 | 38 | # Input 39 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 40 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 41 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 42 | 43 | ################################################################################ 44 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Geometry/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector > 3 | { 4 | 5 | typedef std::vector< bool > value_type; 6 | typedef value_type::value_type elem_type; 7 | 8 | static const bool is_streamable = true; 9 | 10 | static size_t size_of(void) { return UnknownSize; } 11 | static size_t size_of(const value_type& _v) 12 | { 13 | return _v.size() / 8 + ((_v.size() % 8)!=0); 14 | } 15 | 16 | static 17 | size_t store( std::ostream& _ostr, const value_type& _v, bool ) 18 | { 19 | size_t bytes = 0; 20 | 21 | size_t N = _v.size() / 8; 22 | size_t R = _v.size() % 8; 23 | 24 | size_t idx; // element index 25 | unsigned char bits; // bitset 26 | 27 | for (idx=0; idx < N; ++idx) 28 | { 29 | bits = 0; 30 | bits = bits | (_v[idx+0] ? 1 : 0); 31 | bits = bits | ((_v[idx+1] ? 1 : 0) << 1); 32 | bits = bits | ((_v[idx+2] ? 1 : 0) << 2); 33 | bits = bits | ((_v[idx+3] ? 1 : 0) << 3); 34 | bits = bits | ((_v[idx+4] ? 1 : 0) << 4); 35 | bits = bits | ((_v[idx+5] ? 1 : 0) << 5); 36 | bits = bits | ((_v[idx+6] ? 1 : 0) << 6); 37 | bits = bits | ((_v[idx+7] ? 1 : 0) << 7); 38 | _ostr << bits; 39 | } 40 | bytes = N; 41 | 42 | if (R) 43 | { 44 | bits = 0; 45 | switch(R) 46 | { 47 | case 7: bits = bits | ((_v[idx+6] ? 1 : 0) << 6); 48 | case 6: bits = bits | ((_v[idx+5] ? 1 : 0) << 5); 49 | case 5: bits = bits | ((_v[idx+4] ? 1 : 0) << 4); 50 | case 4: bits = bits | ((_v[idx+3] ? 1 : 0) << 3); 51 | case 3: bits = bits | ((_v[idx+2] ? 1 : 0) << 2); 52 | case 2: bits = bits | ((_v[idx+1] ? 1 : 0) << 1); 53 | case 1: bits = bits | (_v[idx+0] ? 1 : 0); 54 | } 55 | _ostr << bits; 56 | ++bytes; 57 | } 58 | 59 | assert( bytes == size_of(_v) ); 60 | 61 | return bytes; 62 | } 63 | 64 | static 65 | size_t restore( std::istream& _istr, value_type& _v, bool ) 66 | { 67 | size_t bytes = 0; 68 | 69 | size_t N = _v.size() / 8; 70 | size_t R = _v.size() % 8; 71 | 72 | size_t idx; // element index 73 | unsigned char bits; // bitset 74 | 75 | for (idx=0; idx < N; ++idx) 76 | { 77 | _istr >> bits; 78 | _v[idx+0] = ((bits & 0x01)!=0); 79 | _v[idx+1] = ((bits & 0x02)!=0); 80 | _v[idx+2] = ((bits & 0x04)!=0); 81 | _v[idx+3] = ((bits & 0x08)!=0); 82 | _v[idx+4] = ((bits & 0x10)!=0); 83 | _v[idx+5] = ((bits & 0x20)!=0); 84 | _v[idx+6] = ((bits & 0x40)!=0); 85 | _v[idx+7] = ((bits & 0x80)!=0); 86 | } 87 | bytes = N; 88 | 89 | if (R) 90 | { 91 | _istr >> bits; 92 | for(; idx < _v.size(); ++idx) 93 | _v[idx] = (bits & (1 << (idx%8)))!=0; 94 | ++bytes; 95 | } 96 | 97 | return bytes; 98 | } 99 | }; 100 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector< std::string > > 3 | { 4 | // struct binary interface 5 | 6 | typedef std::vector< std::string > value_type; 7 | typedef value_type::value_type elem_type; 8 | 9 | static const bool is_streamable = true; 10 | 11 | // Helper 12 | 13 | struct Sum 14 | { 15 | size_t operator() ( size_t _v1, const elem_type& _s2 ) 16 | { return _v1 + binary::size_of(_s2); } 17 | }; 18 | 19 | // struct binary interface 20 | 21 | static size_t size_of(void) { return UnknownSize; } 22 | 23 | static size_t size_of(const value_type& _v) 24 | { return std::accumulate( _v.begin(), _v.end(), size_t(0), Sum() ); } 25 | 26 | static 27 | size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) 28 | { 29 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 30 | FunctorStore(_os, _swap) ); 31 | } 32 | 33 | static 34 | size_t restore(std::istream& _is, value_type& _v, bool _swap=false) 35 | { 36 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 37 | FunctorRestore(_is, _swap) ); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/exporter/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/importer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/reader/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/IO/writer/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Mesh/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Mesh/gen/footer.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | } // namespace Iterators 3 | } // namespace OpenMesh 4 | //============================================================================= 5 | #endif 6 | //============================================================================= 7 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/System/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Templates/newClass.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | A=`echo $1_ | tr '[:lower:]' '[:upper:]'` 4 | 5 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClass.cc > tmp_newClass.cc 6 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClass.hh > tmp_newClass.hh 7 | 8 | mv -i tmp_newClass.cc $1.cc && echo $1.cc - ok 9 | mv -i tmp_newClass.hh $1.hh && echo $1.hh - ok 10 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Templates/newClassT.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | A=`echo $1_ | tr '[:lower:]' '[:upper:]'` 4 | 5 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClassT.cc > tmp_newClass.cc 6 | sed -e s/newClass/$1/g -e s/NEWCLASS_/$A/g < newClassT.hh > tmp_newClass.hh 7 | 8 | mv -i tmp_newClass.cc $1.cc && echo $1.cc - ok 9 | mv -i tmp_newClass.hh $1.hh && echo $1.hh - ok 10 | -------------------------------------------------------------------------------- /src/OpenMesh/Core/Utils/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Examples.pro: -------------------------------------------------------------------------------- 1 | Subdirs() 2 | 3 | addSubdirs( Tutorial01 ) 4 | addSubdirs( Tutorial02 ) 5 | addSubdirs( Tutorial03 ) 6 | addSubdirs( Tutorial04 ) 7 | addSubdirs( Tutorial05 ) 8 | addSubdirs( Tutorial06 ) 9 | addSubdirs( Tutorial07 ) 10 | addSubdirs( Tutorial08 ) 11 | addSubdirs( Tutorial09 ) 12 | addSubdirs( Tutorial10 ) 13 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial01/Tutorial01.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial02/Tutorial02.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial02/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- OpenMesh 4 | #include 5 | #include 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | 15 | // check command line options 16 | if (argc != 4) 17 | { 18 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 19 | return 1; 20 | } 21 | 22 | 23 | // read mesh from stdin 24 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 25 | { 26 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 27 | return 1; 28 | } 29 | 30 | 31 | // this vector stores the computed centers of gravity 32 | std::vector cogs; 33 | std::vector::iterator cog_it; 34 | cogs.reserve(mesh.n_vertices()); 35 | 36 | 37 | // smoothing mesh argv[1] times 38 | MyMesh::VertexIter v_it, v_end(mesh.vertices_end()); 39 | MyMesh::VertexVertexIter vv_it; 40 | MyMesh::Point cog; 41 | MyMesh::Scalar valence; 42 | unsigned int i, N(atoi(argv[1])); 43 | 44 | 45 | for (i=0; i < N; ++i) 46 | { 47 | cogs.clear(); 48 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 49 | { 50 | cog[0] = cog[1] = cog[2] = valence = 0.0; 51 | 52 | for (vv_it=mesh.vv_iter( v_it ); vv_it; ++vv_it) 53 | { 54 | cog += mesh.point( vv_it ); 55 | ++valence; 56 | } 57 | 58 | cogs.push_back(cog / valence); 59 | } 60 | 61 | for (v_it=mesh.vertices_begin(), cog_it=cogs.begin(); 62 | v_it!=v_end; ++v_it, ++cog_it) 63 | if ( !mesh.is_boundary( v_it ) ) 64 | mesh.set_point( v_it, *cog_it ); 65 | } 66 | 67 | 68 | // write mesh to stdout 69 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 70 | { 71 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 72 | return 1; 73 | } 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial03/Tutorial03.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial03/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- 4 | #include 5 | #include 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | 15 | // check command line options 16 | if (argc != 4) 17 | { 18 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 19 | return 1; 20 | } 21 | 22 | 23 | 24 | // read mesh from stdin 25 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 26 | { 27 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 28 | return 1; 29 | } 30 | 31 | 32 | 33 | // this vertex property stores the computed centers of gravity 34 | OpenMesh::VPropHandleT cogs; 35 | mesh.add_property(cogs); 36 | 37 | // smoothing mesh argv[1] times 38 | MyMesh::VertexIter v_it, v_end(mesh.vertices_end()); 39 | MyMesh::VertexVertexIter vv_it; 40 | MyMesh::Point cog; 41 | MyMesh::Scalar valence; 42 | unsigned int i, N(atoi(argv[1])); 43 | 44 | 45 | for (i=0; i < N; ++i) 46 | { 47 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 48 | { 49 | mesh.property(cogs,v_it).vectorize(0.0f); 50 | valence = 0; 51 | 52 | for (vv_it=mesh.vv_iter( v_it ); vv_it; ++vv_it) 53 | { 54 | mesh.property(cogs,v_it) += mesh.point( vv_it ); 55 | ++valence; 56 | } 57 | mesh.property(cogs,v_it) /= valence; 58 | } 59 | 60 | for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) 61 | if ( !mesh.is_boundary( v_it ) ) 62 | mesh.set_point( v_it, mesh.property(cogs,v_it) ); 63 | } 64 | 65 | 66 | // write mesh to stdout 67 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 68 | { 69 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 70 | return 1; 71 | } 72 | 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial04/Tutorial04.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial04/smooth.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // -------------------- OpenMesh 4 | #include 5 | #include 6 | // -------------------- 7 | #include "smooth_algo.hh" 8 | 9 | 10 | // ---------------------------------------------------------------------------- 11 | 12 | #ifndef DOXY_IGNORE_THIS 13 | 14 | struct MyTraits : public OpenMesh::DefaultTraits 15 | { 16 | HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge); 17 | }; 18 | 19 | #endif 20 | 21 | typedef OpenMesh::TriMesh_ArrayKernelT MyMesh; 22 | 23 | 24 | // ---------------------------------------------------------------------------- 25 | 26 | int main(int argc, char **argv) 27 | { 28 | MyMesh mesh; 29 | 30 | 31 | // check command line options 32 | if (argc != 4) 33 | { 34 | std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n"; 35 | return 1; 36 | } 37 | 38 | 39 | // read mesh from stdin 40 | if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) ) 41 | { 42 | std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl; 43 | return 1; 44 | } 45 | 46 | 47 | // smoothing mesh argv[1] times 48 | SmootherT smoother(mesh); 49 | smoother.smooth(atoi(argv[1])); 50 | 51 | 52 | // write mesh to stdout 53 | if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) ) 54 | { 55 | std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl; 56 | return 1; 57 | } 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial04/smooth_algo.hh: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef DOXY_IGNORE_THIS 5 | 6 | template class SmootherT 7 | { 8 | public: 9 | 10 | typedef typename Mesh::Point cog_t; 11 | typedef OpenMesh::VPropHandleT< cog_t > Property_cog; 12 | 13 | public: 14 | 15 | // construct with a given mesh 16 | SmootherT(Mesh& _mesh) 17 | : mesh_(_mesh) 18 | { 19 | mesh_.add_property( cog_ ); 20 | } 21 | 22 | ~SmootherT() 23 | { 24 | mesh_.remove_property( cog_ ); 25 | } 26 | 27 | // smooth mesh _iterations times 28 | void smooth(unsigned int _iterations) 29 | { 30 | for (unsigned int i=0; i < _iterations; ++i) 31 | { 32 | std::for_each(mesh_.vertices_begin(), 33 | mesh_.vertices_end(), 34 | ComputeCOG(mesh_, cog_)); 35 | 36 | std::for_each(mesh_.vertices_begin(), 37 | mesh_.vertices_end(), 38 | SetCOG(mesh_, cog_)); 39 | } 40 | } 41 | 42 | 43 | private: 44 | 45 | 46 | //--- private classes --- 47 | 48 | class ComputeCOG 49 | { 50 | public: 51 | ComputeCOG(Mesh& _mesh, Property_cog& _cog) 52 | : mesh_(_mesh), cog_(_cog) 53 | {} 54 | 55 | void operator()(typename Mesh::Vertex& _v) 56 | { 57 | typename Mesh::VertexHandle vh( mesh_.handle(_v) ); 58 | typename Mesh::VertexVertexIter vv_it; 59 | typename Mesh::Scalar valence(0.0); 60 | 61 | mesh_.property(cog_, vh) = typename Mesh::Point(0.0, 0.0, 0.0); 62 | 63 | for (vv_it=mesh_.vv_iter(vh); vv_it; ++vv_it) 64 | { 65 | mesh_.property(cog_, vh) += mesh_.point( vv_it ); 66 | ++valence; 67 | } 68 | 69 | mesh_.property(cog_, mesh_.handle(_v) ) /= valence; 70 | } 71 | 72 | private: 73 | Mesh& mesh_; 74 | Property_cog& cog_; 75 | }; 76 | 77 | 78 | class SetCOG 79 | { 80 | public: 81 | SetCOG(Mesh& _mesh, Property_cog& _cog) 82 | : mesh_(_mesh), cog_(_cog) 83 | {} 84 | 85 | void operator()(typename Mesh::Vertex& _v) 86 | { 87 | typename Mesh::VertexHandle vh(mesh_.handle(_v)); 88 | 89 | if (!mesh_.is_boundary(vh)) 90 | mesh_.set_point( vh, mesh_.property(cog_, vh) ); 91 | } 92 | 93 | private: 94 | 95 | Mesh& mesh_; 96 | Property_cog& cog_; 97 | }; 98 | 99 | 100 | //--- private elements --- 101 | 102 | Mesh& mesh_; 103 | Property_cog cog_; 104 | }; 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial05/Tutorial05.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial05/properties.cc: -------------------------------------------------------------------------------- 1 | #include 2 | // -------------------- 3 | #include 4 | #include 5 | 6 | 7 | typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh; 8 | 9 | 10 | int main(int argc, char **argv) 11 | { 12 | MyMesh mesh; 13 | 14 | if (argc!=2) 15 | { 16 | std::cerr << "Usage: " << argv[0] << " \n"; 17 | return 1; 18 | } 19 | 20 | // request vertex normals, so the mesh reader can use normal information 21 | // if available 22 | mesh.request_vertex_normals(); 23 | 24 | // assure we have vertex normals 25 | if (!mesh.has_vertex_normals()) 26 | { 27 | std::cerr << "ERROR: Standard vertex property 'Normals' not available!\n"; 28 | return 1; 29 | } 30 | 31 | OpenMesh::IO::Options opt; 32 | if ( ! OpenMesh::IO::read_mesh(mesh,argv[1], opt)) 33 | { 34 | std::cerr << "Error loading mesh from file " << argv[1] << std::endl; 35 | return 1; 36 | } 37 | 38 | // If the file did not provide vertex normals, then calculate them 39 | if ( !opt.check( OpenMesh::IO::Options::VertexNormal ) ) 40 | { 41 | // we need face normals to update the vertex normals 42 | mesh.request_face_normals(); 43 | 44 | // let the mesh update the normals 45 | mesh.update_normals(); 46 | 47 | // dispose the face normals, as we don't need them anymore 48 | mesh.release_face_normals(); 49 | } 50 | 51 | // move all vertices one unit length along it's normal direction 52 | for (MyMesh::VertexIter v_it = mesh.vertices_begin(); 53 | v_it != mesh.vertices_end(); ++v_it) 54 | { 55 | std::cout << "Vertex #" << v_it << ": " << mesh.point( v_it ); 56 | mesh.set_point( v_it, mesh.point(v_it)+mesh.normal(v_it) ); 57 | std::cout << " moved to " << mesh.point( v_it ) << std::endl; 58 | } 59 | 60 | // don't need the normals anymore? Remove them! 61 | mesh.release_vertex_normals(); 62 | 63 | // just check if it really works 64 | if (mesh.has_vertex_normals()) 65 | { 66 | std::cerr << "Ouch! ERROR! Shouldn't have any vertex normals anymore!\n"; 67 | return 1; 68 | } 69 | 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial06/Tutorial06.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial07/Tutorial07.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial08/Tutorial08.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial09/Tutorial09.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial10/Tutorial10.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | INCLUDEPATH += ../../.. 8 | 9 | Application() 10 | openmesh() 11 | 12 | DIRECTORIES = . 13 | 14 | # Input 15 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 16 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 17 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 18 | 19 | ################################################################################ 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial10/generate_cube.hh: -------------------------------------------------------------------------------- 1 | #ifndef GENERATE_CUBE_HH 2 | #define GENERATE_CUBE_HH 3 | 4 | template 5 | size_t generate_cube( MeshType& mesh ) 6 | { 7 | typedef typename MeshType::VertexHandle VertexHandle; 8 | typedef typename MeshType::Point Point; 9 | 10 | typename MeshType::VertexHandle vhandle[8]; 11 | 12 | vhandle[0] = mesh.add_vertex(Point(-1, -1, 1)); 13 | vhandle[1] = mesh.add_vertex(Point( 1, -1, 1)); 14 | vhandle[2] = mesh.add_vertex(Point( 1, 1, 1)); 15 | vhandle[3] = mesh.add_vertex(Point(-1, 1, 1)); 16 | vhandle[4] = mesh.add_vertex(Point(-1, -1, -1)); 17 | vhandle[5] = mesh.add_vertex(Point( 1, -1, -1)); 18 | vhandle[6] = mesh.add_vertex(Point( 1, 1, -1)); 19 | vhandle[7] = mesh.add_vertex(Point(-1, 1, -1)); 20 | 21 | // generate (quadrilateral) faces 22 | 23 | std::vector< VertexHandle > face_vhandles; 24 | 25 | face_vhandles.clear(); 26 | face_vhandles.push_back(vhandle[0]); 27 | face_vhandles.push_back(vhandle[1]); 28 | face_vhandles.push_back(vhandle[2]); 29 | face_vhandles.push_back(vhandle[3]); 30 | mesh.add_face(face_vhandles); 31 | 32 | face_vhandles.clear(); 33 | face_vhandles.push_back(vhandle[7]); 34 | face_vhandles.push_back(vhandle[6]); 35 | face_vhandles.push_back(vhandle[5]); 36 | face_vhandles.push_back(vhandle[4]); 37 | mesh.add_face(face_vhandles); 38 | 39 | face_vhandles.clear(); 40 | face_vhandles.push_back(vhandle[1]); 41 | face_vhandles.push_back(vhandle[0]); 42 | face_vhandles.push_back(vhandle[4]); 43 | face_vhandles.push_back(vhandle[5]); 44 | mesh.add_face(face_vhandles); 45 | 46 | face_vhandles.clear(); 47 | face_vhandles.push_back(vhandle[2]); 48 | face_vhandles.push_back(vhandle[1]); 49 | face_vhandles.push_back(vhandle[5]); 50 | face_vhandles.push_back(vhandle[6]); 51 | mesh.add_face(face_vhandles); 52 | 53 | face_vhandles.clear(); 54 | face_vhandles.push_back(vhandle[3]); 55 | face_vhandles.push_back(vhandle[2]); 56 | face_vhandles.push_back(vhandle[6]); 57 | face_vhandles.push_back(vhandle[7]); 58 | mesh.add_face(face_vhandles); 59 | 60 | face_vhandles.clear(); 61 | face_vhandles.push_back(vhandle[0]); 62 | face_vhandles.push_back(vhandle[3]); 63 | face_vhandles.push_back(vhandle[7]); 64 | face_vhandles.push_back(vhandle[4]); 65 | mesh.add_face(face_vhandles); 66 | 67 | return mesh.n_vertices(); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial10/int2roman.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #if defined(OM_CC_MIPS) 3 | # include 4 | #else 5 | # include 6 | #endif 7 | #include "int2roman.hh" 8 | 9 | 10 | std::string int2roman( size_t decimal, size_t length ) 11 | { 12 | assert( decimal > 0 && decimal < 1000 ); 13 | 14 | const size_t nrows = 4; 15 | const size_t ncols = 4; 16 | 17 | static size_t table_arabs[ nrows ][ ncols ] = { { 1000, 1000, 1000, 1000 }, 18 | { 900, 500, 400, 100 }, 19 | { 90, 50, 40, 10 }, 20 | { 9, 5, 4, 1 } }; 21 | 22 | static char *table_romans[ nrows ][ ncols ] = { { "M", "M", "M", "M" }, 23 | { "CM", "D", "CD", "C" }, 24 | { "XC", "L", "XL", "X" }, 25 | { "IX", "V", "IV", "I" } }; 26 | 27 | size_t power; // power of ten 28 | size_t index; // Indexes thru values to subtract 29 | 30 | std::string roman; 31 | 32 | roman.reserve(length); 33 | 34 | roman[ 0 ] = '\0'; 35 | 36 | for ( power = 0; power < nrows; power++ ) 37 | for ( index = 0; index < ncols; index++ ) 38 | while ( decimal >= table_arabs[ power ][ index ] ) 39 | { 40 | roman += table_romans[ power ][ index ]; 41 | decimal -= table_arabs[ power ][ index ]; 42 | } 43 | 44 | return roman; 45 | } 46 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial10/int2roman.hh: -------------------------------------------------------------------------------- 1 | #ifndef INT2ROMAN_HH 2 | #define INT2ROMAN_HH 3 | 4 | #include 5 | 6 | std::string int2roman( size_t decimal, size_t length=30 ); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/OpenMesh/Examples/Tutorial10/stats.hh: -------------------------------------------------------------------------------- 1 | #ifndef STATS_HH 2 | #define STATS_HH 3 | 4 | template 5 | void mesh_stats( Mesh& _m, const std::string& prefix = "" ) 6 | { 7 | std::cout << prefix 8 | << _m.n_vertices() << " vertices, " 9 | << _m.n_edges() << " edges, " 10 | << _m.n_faces() << " faces\n"; 11 | } 12 | 13 | template 14 | void mesh_property_stats(Mesh& _m) 15 | { 16 | std::cout << "Current set of properties:\n"; 17 | _m.property_stats(std::cout); 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = Utils Decimater Subdivider VDPM Smoother 7 | 8 | PACKAGES := math 9 | 10 | PROJ_LIBS := OpenMesh/Core 11 | 12 | CXXLIB_BUILD_LIB := yes 13 | 14 | MODULES := cxxlib 15 | 16 | 17 | #== SYSTEM PART -- DON'T TOUCH ============================================== 18 | include $(ACGMAKE)/Rules 19 | #============================================================================== 20 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Decimater/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := opensg boost 9 | 10 | PROJ_LIBS := OpenMesh/Core 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Kernel_OSG/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := opensg boost 9 | 10 | PROJ_LIBS := OpenMesh/Core 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Subdivider/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Subdivider/Adaptive/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := qt glut opengl x11 math 9 | 10 | PROJ_LIBS = OpenMesh/Core 11 | 12 | MODULES := moc cxx 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Subdivider/Adaptive/Composite/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = 7 | 8 | PACKAGES := math 9 | 10 | PROJ_LIBS = OpenMesh/Core 11 | 12 | MODULES := cxx 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Subdivider/Uniform/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Subdivider/Uniform/Composite/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Tools.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | ################################################################################ 4 | 5 | include( $$TOPDIR/qmake/all.include ) 6 | 7 | Library() 8 | 9 | contains( OPENFLIPPER , OpenFlipper ){ 10 | DESTDIR = $${TOPDIR}/OpenMesh/lib 11 | } else { 12 | DESTDIR = $${TOPDIR}/lib 13 | } 14 | 15 | DIRECTORIES = . Decimater Smoother Subdivider/Adaptive/Composite \ 16 | Subdivider/Uniform/Composite Subdivider/Uniform \ 17 | Utils 18 | 19 | INCLUDEPATH += ../.. 20 | 21 | CONFIG( debug, debug|release ){ 22 | TARGET = OpenMeshToolsd 23 | } else { 24 | TARGET = OpenMeshTools 25 | } 26 | 27 | win32 { 28 | DEFINES += _USE_MATH_DEFINES NOMINMAX 29 | CONFIG += static 30 | } 31 | 32 | macx { 33 | # Set library binary header to the correct path 34 | QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${DESTDIR}/ 35 | export(QMAKE_LFLAGS_SONAME) 36 | } 37 | 38 | # Input 39 | HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh) 40 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.c) 41 | SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc) 42 | FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui) 43 | 44 | 45 | ################################################################################ 46 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Utils/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | 6 | SUBDIRS = $(call find-subdirs) 7 | 8 | PACKAGES := 9 | 10 | PROJ_LIBS := 11 | 12 | MODULES := cxxlib 13 | 14 | 15 | #== SYSTEM PART -- DON'T TOUCH ============================================== 16 | include $(ACGMAKE)/Rules 17 | #============================================================================== 18 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/Utils/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef _GETOPT_H_ 2 | #define _GETOPT_H_ 3 | 4 | #include 5 | #include 6 | 7 | #if defined(WIN32) 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 | #else 24 | # include 25 | #endif 26 | 27 | #endif /* _GETOPT_H_ */ 28 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/VDPM/ACGMakefile: -------------------------------------------------------------------------------- 1 | #== SYSTEM PART -- DON'T TOUCH ============================================== 2 | include $(ACGMAKE)/Config 3 | #============================================================================== 4 | 5 | CXX_CFLAGS += -DQT_THREAD_SUPPORT 6 | 7 | SUBDIRS = $(call find-subdirs) 8 | 9 | PACKAGES := qt glut opengl x11 math 10 | 11 | PROJ_LIBS = OpenMesh/Core 12 | 13 | MODULES := cxxlib 14 | 15 | 16 | #== SYSTEM PART -- DON'T TOUCH ============================================== 17 | include $(ACGMAKE)/Rules 18 | #============================================================================== 19 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/VDPM/xpm/fileopen.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *fileopen[] = { 3 | " 16 13 5 1", 4 | ". c #040404", 5 | "# c #808304", 6 | "a c None", 7 | "b c #f3f704", 8 | "c c #f3f7f3", 9 | "aaaaaaaaa...aaaa", 10 | "aaaaaaaa.aaa.a.a", 11 | "aaaaaaaaaaaaa..a", 12 | "a...aaaaaaaa...a", 13 | ".bcb.......aaaaa", 14 | ".cbcbcbcbc.aaaaa", 15 | ".bcbcbcbcb.aaaaa", 16 | ".cbcb...........", 17 | ".bcb.#########.a", 18 | ".cb.#########.aa", 19 | ".b.#########.aaa", 20 | "..#########.aaaa", 21 | "...........aaaaa" 22 | }; 23 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/VDPM/xpm/fileprint.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *fileprint[] = { 3 | " 16 14 6 1", 4 | ". c #000000", 5 | "# c #848284", 6 | "a c #c6c3c6", 7 | "b c #ffff00", 8 | "c c #ffffff", 9 | "d c None", 10 | "ddddd.........dd", 11 | "dddd.cccccccc.dd", 12 | "dddd.c.....c.ddd", 13 | "ddd.cccccccc.ddd", 14 | "ddd.c.....c....d", 15 | "dd.cccccccc.a.a.", 16 | "d..........a.a..", 17 | ".aaaaaaaaaa.a.a.", 18 | ".............aa.", 19 | ".aaaaaa###aa.a.d", 20 | ".aaaaaabbbaa...d", 21 | ".............a.d", 22 | "d.aaaaaaaaa.a.dd", 23 | "dd...........ddd" 24 | }; 25 | -------------------------------------------------------------------------------- /src/OpenMesh/Tools/VDPM/xpm/filesave.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *filesave[] = { 3 | " 14 14 4 1", 4 | ". c #040404", 5 | "# c #808304", 6 | "a c #bfc2bf", 7 | "b c None", 8 | "..............", 9 | ".#.aaaaaaaa.a.", 10 | ".#.aaaaaaaa...", 11 | ".#.aaaaaaaa.#.", 12 | ".#.aaaaaaaa.#.", 13 | ".#.aaaaaaaa.#.", 14 | ".#.aaaaaaaa.#.", 15 | ".##........##.", 16 | ".############.", 17 | ".##.........#.", 18 | ".##......aa.#.", 19 | ".##......aa.#.", 20 | ".##......aa.#.", 21 | "b............." 22 | }; 23 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-normals.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | element vertex 8 4 | property float32 x 5 | property float32 y 6 | property float32 z 7 | property float32 nx 8 | property float32 ny 9 | property float32 nz 10 | element face 6 11 | property list uint8 int32 vertex_indices 12 | end_header 13 | -1 -1 -1 0.0 0.0 1.0 14 | 1 -1 -1 0.0 1.0 0.0 15 | 1 1 -1 0.0 1.0 1.0 16 | -1 1 -1 1.0 0.0 0.0 17 | -1 -1 1 1.0 0.0 1.0 18 | 1 -1 1 1.0 1.0 0.0 19 | 1 1 1 1.0 1.0 1.0 20 | -1 1 1 1.0 1.0 2.0 21 | 4 0 1 2 3 22 | 4 5 4 7 6 23 | 4 6 2 1 5 24 | 4 3 7 4 0 25 | 4 7 3 2 6 26 | 4 5 1 0 4 27 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-texCoords.obj: -------------------------------------------------------------------------------- 1 | g cube 2 | v 0.0 0.0 0.0 3 | v 0.0 0.0 1.0 4 | v 0.0 1.0 0.0 5 | v 0.0 1.0 1.0 6 | v 1.0 0.0 0.0 7 | v 1.0 0.0 1.0 8 | v 1.0 1.0 0.0 9 | v 1.0 1.0 1.0 10 | vn 0.0 0.0 1.0 11 | vn 0.0 0.0 -1.0 12 | vn 0.0 1.0 0.0 13 | vn 0.0 -1.0 0.0 14 | vn 1.0 0.0 0.0 15 | vn -1.0 0.0 0.0 16 | vt 1.0 1.0 17 | vt 2.0 2.0 18 | vt 3.0 3.0 19 | vt 4.0 4.0 20 | vt 5.0 5.0 21 | vt 6.0 6.0 22 | vt 7.0 7.0 23 | vt 8.0 8.0 24 | vt 9.0 9.0 25 | vt 10.0 10.0 26 | vt 11.0 11.0 27 | vt 12.0 12.0 28 | f 1/1/2 7/1/2 5/1/2 29 | f 1/2/2 3/2/2 7/2/2 30 | f 1/3/6 4/3/6 3/3/6 31 | f 1/4/6 2/4/6 4/4/6 32 | f 3/5/3 8/5/3 7/5/3 33 | f 3/6/3 4/6/3 8/6/3 34 | f 5/7/5 7/7/5 8/7/5 35 | f 5/8/5 8/8/5 6/8/5 36 | f 1/9/4 5/9/4 6/9/4 37 | f 1/10/4 6/10/4 2/10/4 38 | f 2/11/1 6/11/1 8/11/1 39 | f 2/12/1 8/12/1 4/12/1 40 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-texCoords.om: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/Unittests/TestFiles/cube-minimal-texCoords.om -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-texCoords.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment ================================= 4 | comment Exported via OpenFlipper 1.4 5 | comment www.openflipper.org 6 | comment ================================= 7 | element vertex 8 8 | property float x 9 | property float y 10 | property float z 11 | property int32 u 12 | property int32 v 13 | element face 12 14 | property list uchar int32 vertex_index 15 | end_header 16 | 0 0 0 10 10 17 | 0 0 1 12 12 18 | 0 1 0 6 6 19 | 0 1 1 12 12 20 | 1 0 0 9 9 21 | 1 0 1 11 11 22 | 1 1 0 7 7 23 | 1 1 1 12 12 24 | 3 0 6 4 25 | 3 0 2 6 26 | 3 0 3 2 27 | 3 0 1 3 28 | 3 2 7 6 29 | 3 2 3 7 30 | 3 4 6 7 31 | 3 4 7 5 32 | 3 0 4 5 33 | 3 0 5 1 34 | 3 1 5 7 35 | 3 1 7 3 36 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-vertex-colors-after-vertex-definition.obj: -------------------------------------------------------------------------------- 1 | g cube 2 | v 0.0 0.0 0.0 0 0 0 3 | v 0.0 0.0 1.0 0 0 255 4 | v 0.0 1.0 0.0 0 255 0 5 | v 0.0 1.0 1.0 0 255 255 6 | v 1.0 0.0 0.0 255 0 0 7 | v 1.0 0.0 1.0 255 0 255 8 | v 1.0 1.0 0.0 255 255 0 9 | v 1.0 1.0 1.0 255 255 255 10 | vn 0.0 0.0 1.0 11 | vn 0.0 0.0 -1.0 12 | vn 0.0 1.0 0.0 13 | vn 0.0 -1.0 0.0 14 | vn 1.0 0.0 0.0 15 | vn -1.0 0.0 0.0 16 | f 1//2 7//2 5//2 17 | f 1//2 3//2 7//2 18 | f 1//6 4//6 3//6 19 | f 1//6 2//6 4//6 20 | f 3//3 8//3 7//3 21 | f 3//3 4//3 8//3 22 | f 5//5 7//5 8//5 23 | f 5//5 8//5 6//5 24 | f 1//4 5//4 6//4 25 | f 1//4 6//4 2//4 26 | f 2//1 6//1 8//1 27 | f 2//1 8//1 4//1 28 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-vertex-colors-as-vc-lines.obj: -------------------------------------------------------------------------------- 1 | g cube 2 | v 0.0 0.0 0.0 3 | v 0.0 0.0 1.0 4 | v 0.0 1.0 0.0 5 | v 0.0 1.0 1.0 6 | v 1.0 0.0 0.0 7 | v 1.0 0.0 1.0 8 | v 1.0 1.0 0.0 9 | v 1.0 1.0 1.0 10 | vc 0 0 0 11 | vc 0 0 255 12 | vc 0 255 0 13 | vc 0 255 255 14 | vc 255 0 0 15 | vc 255 0 255 16 | vc 255 255 0 17 | vc 255 255 255 18 | vn 0.0 0.0 1.0 19 | vn 0.0 0.0 -1.0 20 | vn 0.0 1.0 0.0 21 | vn 0.0 -1.0 0.0 22 | vn 1.0 0.0 0.0 23 | vn -1.0 0.0 0.0 24 | f 1//2 7//2 5//2 25 | f 1//2 3//2 7//2 26 | f 1//6 4//6 3//6 27 | f 1//6 2//6 4//6 28 | f 3//3 8//3 7//3 29 | f 3//3 4//3 8//3 30 | f 5//5 7//5 8//5 31 | f 5//5 8//5 6//5 32 | f 1//4 5//4 6//4 33 | f 1//4 6//4 2//4 34 | f 2//1 6//1 8//1 35 | f 2//1 8//1 4//1 36 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-vertexColors.om: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/Unittests/TestFiles/cube-minimal-vertexColors.om -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal-vertexColors.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment ================================= 4 | comment Exported via OpenFlipper 1.4 5 | comment www.openflipper.org 6 | comment ================================= 7 | element vertex 8 8 | property float x 9 | property float y 10 | property float z 11 | property uchar red 12 | property uchar green 13 | property uchar blue 14 | element face 12 15 | property list uchar int32 vertex_index 16 | end_header 17 | 0 0 0 255 0 0 18 | 0 0 1 255 0 0 19 | 0 1 0 255 0 0 20 | 0 1 1 255 0 0 21 | 1 0 0 0 0 255 22 | 1 0 1 0 0 255 23 | 1 1 0 0 0 255 24 | 1 1 1 0 0 255 25 | 3 0 6 4 26 | 3 0 2 6 27 | 3 0 3 2 28 | 3 0 1 3 29 | 3 2 7 6 30 | 3 2 3 7 31 | 3 4 6 7 32 | 3 4 7 5 33 | 3 0 4 5 34 | 3 0 5 1 35 | 3 1 5 7 36 | 3 1 7 3 37 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal.obj: -------------------------------------------------------------------------------- 1 | g cube 2 | v 0.0 0.0 0.0 3 | v 0.0 0.0 1.0 4 | v 0.0 1.0 0.0 5 | v 0.0 1.0 1.0 6 | v 1.0 0.0 0.0 7 | v 1.0 0.0 1.0 8 | v 1.0 1.0 0.0 9 | v 1.0 1.0 1.0 10 | vn 0.0 0.0 1.0 11 | vn 0.0 0.0 -1.0 12 | vn 0.0 1.0 0.0 13 | vn 0.0 -1.0 0.0 14 | vn 1.0 0.0 0.0 15 | vn -1.0 0.0 0.0 16 | f 1//2 7//2 5//2 17 | f 1//2 3//2 7//2 18 | f 1//6 4//6 3//6 19 | f 1//6 2//6 4//6 20 | f 3//3 8//3 7//3 21 | f 3//3 4//3 8//3 22 | f 5//5 7//5 8//5 23 | f 5//5 8//5 6//5 24 | f 1//4 5//4 6//4 25 | f 1//4 6//4 2//4 26 | f 2//1 6//1 8//1 27 | f 2//1 8//1 4//1 28 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal.om: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/Unittests/TestFiles/cube-minimal.om -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube-minimal.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | element vertex 8 4 | property float32 x 5 | property float32 y 6 | property float32 z 7 | element face 6 8 | property list uint8 int32 vertex_indices 9 | end_header 10 | -1 -1 -1 11 | 1 -1 -1 12 | 1 1 -1 13 | -1 1 -1 14 | -1 -1 1 15 | 1 -1 1 16 | 1 1 1 17 | -1 1 1 18 | 4 0 1 2 3 19 | 4 5 4 7 6 20 | 4 6 2 1 5 21 | 4 3 7 4 0 22 | 4 7 3 2 6 23 | 4 5 1 0 4 24 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube1Binary.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/Unittests/TestFiles/cube1Binary.stl -------------------------------------------------------------------------------- /src/Unittests/TestFiles/cube1_customProps.om: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otherlab/openmesh/1b57069ba1902edf5c1d27e5a5f61c13c1b82787/src/Unittests/TestFiles/cube1_customProps.om -------------------------------------------------------------------------------- /src/Unittests/TestFiles/meshlab.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment VCGLIB generated 4 | element vertex 8 5 | property float x 6 | property float y 7 | property float z 8 | property uchar red 9 | property uchar green 10 | property uchar blue 11 | property uchar alpha 12 | element face 12 13 | property list uchar int vertex_indices 14 | end_header 15 | 0.5 0.5 0.5 0 0 255 255 16 | -0.5 0.5 0.5 0 0 255 255 17 | 0.5 -0.5 0.5 0 0 255 255 18 | -0.5 -0.5 0.5 0 0 255 255 19 | 0.5 0.5 -0.5 0 0 255 255 20 | -0.5 0.5 -0.5 0 0 255 255 21 | 0.5 -0.5 -0.5 0 0 255 255 22 | -0.5 -0.5 -0.5 0 0 255 255 23 | 3 0 1 2 24 | 3 3 2 1 25 | 3 0 2 4 26 | 3 6 4 2 27 | 3 0 4 1 28 | 3 5 1 4 29 | 3 7 5 6 30 | 3 4 6 5 31 | 3 7 6 3 32 | 3 2 3 6 33 | 3 7 3 5 34 | 3 1 5 3 35 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/pointCloudBadEncoding.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | element vertex 10 4 | property float x 5 | property float y 6 | property float z 7 | property float nx 8 | property float ny 9 | property float nz 10 | property uchar diffuse_red 11 | property uchar diffuse_green 12 | property uchar diffuse_blue 13 | end_header 14 | -0.774382 0.446049 -2.05893 0.386853 -0.197849 0.900667 76 52 41 15 | -0.762621 0.446872 -2.06314 0.0431574 -0.643148 0.764525 77 58 46 16 | -0.769175 0.436518 -2.0635 0.257818 -0.156835 0.95338 121 97 88 17 | -1.07959 0.381204 -1.95964 0.948941 -0.303889 0.0846349 126 117 97 18 | -1.05841 0.398189 -1.98803 0.230719 0.341539 0.911109 103 90 86 19 | -1.04905 0.388091 -1.97944 -0.0175732 -0.131422 0.991171 72 62 70 20 | -0.784233 0.428294 -2.06324 -0.0394355 0.268678 0.962422 167 93 80 21 | -0.773624 0.429338 -2.06101 0.373176 -0.105125 0.921785 172 135 126 22 | -0.779554 0.433575 -2.06273 -0.0113203 -0.243327 0.969878 165 102 90 23 | -0.764714 0.428742 -2.06643 0.31292 -0.294884 0.902843 139 119 109 24 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/pointCloudGoodEncoding.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | element vertex 10 4 | property float x 5 | property float y 6 | property float z 7 | property float nx 8 | property float ny 9 | property float nz 10 | property uchar diffuse_red 11 | property uchar diffuse_green 12 | property uchar diffuse_blue 13 | end_header 14 | -0.774382 0.446049 -2.05893 0.386853 -0.197849 0.900667 76 52 41 15 | -0.762621 0.446872 -2.06314 0.0431574 -0.643148 0.764525 77 58 46 16 | -0.769175 0.436518 -2.0635 0.257818 -0.156835 0.95338 121 97 88 17 | -1.07959 0.381204 -1.95964 0.948941 -0.303889 0.0846349 126 117 97 18 | -1.05841 0.398189 -1.98803 0.230719 0.341539 0.911109 103 90 86 19 | -1.04905 0.388091 -1.97944 -0.0175732 -0.131422 0.991171 72 62 70 20 | -0.784233 0.428294 -2.06324 -0.0394355 0.268678 0.962422 167 93 80 21 | -0.773624 0.429338 -2.06101 0.373176 -0.105125 0.921785 172 135 126 22 | -0.779554 0.433575 -2.06273 -0.0113203 -0.243327 0.969878 165 102 90 23 | -0.764714 0.428742 -2.06643 0.31292 -0.294884 0.902843 139 119 109 24 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/square_material.mtl: -------------------------------------------------------------------------------- 1 | newmtl Colored 2 | Ka 0.500 0.500 0.500 3 | Kd 0.500 0.500 0.500 4 | Ks 0.500 0.500 0.500 5 | -------------------------------------------------------------------------------- /src/Unittests/TestFiles/square_material.obj: -------------------------------------------------------------------------------- 1 | mtllib square_material.mtl 2 | 3 | v 0.000000 2.000000 0.000000 4 | v 0.000000 0.000000 0.000000 5 | v 2.000000 0.000000 0.000000 6 | v 2.000000 2.000000 0.000000 7 | vt 0.000000 1.000000 0.000000 8 | vt 0.000000 0.000000 0.000000 9 | vt 1.000000 0.000000 0.000000 10 | vt 1.000000 1.000000 0.000000 11 | 12 | usemtl Colored 13 | f 1/1 2/2 3/3 4/4 14 | -------------------------------------------------------------------------------- /src/Unittests/generate_cube.hh: -------------------------------------------------------------------------------- 1 | #ifndef GENERATE_CUBE_HH 2 | #define GENERATE_CUBE_HH 3 | 4 | template 5 | size_t generate_cube( MeshType& mesh ) 6 | { 7 | typedef typename MeshType::VertexHandle VertexHandle; 8 | typedef typename MeshType::Point Point; 9 | 10 | typename MeshType::VertexHandle vhandle[8]; 11 | 12 | vhandle[0] = mesh.add_vertex(Point(-1, -1, 1)); 13 | vhandle[1] = mesh.add_vertex(Point( 1, -1, 1)); 14 | vhandle[2] = mesh.add_vertex(Point( 1, 1, 1)); 15 | vhandle[3] = mesh.add_vertex(Point(-1, 1, 1)); 16 | vhandle[4] = mesh.add_vertex(Point(-1, -1, -1)); 17 | vhandle[5] = mesh.add_vertex(Point( 1, -1, -1)); 18 | vhandle[6] = mesh.add_vertex(Point( 1, 1, -1)); 19 | vhandle[7] = mesh.add_vertex(Point(-1, 1, -1)); 20 | 21 | // generate (quadrilateral) faces 22 | 23 | std::vector< VertexHandle > face_vhandles; 24 | 25 | face_vhandles.clear(); 26 | face_vhandles.push_back(vhandle[0]); 27 | face_vhandles.push_back(vhandle[1]); 28 | face_vhandles.push_back(vhandle[2]); 29 | face_vhandles.push_back(vhandle[3]); 30 | mesh.add_face(face_vhandles); 31 | 32 | face_vhandles.clear(); 33 | face_vhandles.push_back(vhandle[7]); 34 | face_vhandles.push_back(vhandle[6]); 35 | face_vhandles.push_back(vhandle[5]); 36 | face_vhandles.push_back(vhandle[4]); 37 | mesh.add_face(face_vhandles); 38 | 39 | face_vhandles.clear(); 40 | face_vhandles.push_back(vhandle[1]); 41 | face_vhandles.push_back(vhandle[0]); 42 | face_vhandles.push_back(vhandle[4]); 43 | face_vhandles.push_back(vhandle[5]); 44 | mesh.add_face(face_vhandles); 45 | 46 | face_vhandles.clear(); 47 | face_vhandles.push_back(vhandle[2]); 48 | face_vhandles.push_back(vhandle[1]); 49 | face_vhandles.push_back(vhandle[5]); 50 | face_vhandles.push_back(vhandle[6]); 51 | mesh.add_face(face_vhandles); 52 | 53 | face_vhandles.clear(); 54 | face_vhandles.push_back(vhandle[3]); 55 | face_vhandles.push_back(vhandle[2]); 56 | face_vhandles.push_back(vhandle[6]); 57 | face_vhandles.push_back(vhandle[7]); 58 | mesh.add_face(face_vhandles); 59 | 60 | face_vhandles.clear(); 61 | face_vhandles.push_back(vhandle[0]); 62 | face_vhandles.push_back(vhandle[3]); 63 | face_vhandles.push_back(vhandle[7]); 64 | face_vhandles.push_back(vhandle[4]); 65 | mesh.add_face(face_vhandles); 66 | 67 | return mesh.n_vertices(); 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/Unittests/int2roman.hh: -------------------------------------------------------------------------------- 1 | #ifndef INT2ROMAN_HH 2 | #define INT2ROMAN_HH 3 | 4 | #include 5 | 6 | std::string int2roman( size_t decimal, size_t length = 30 ) 7 | { 8 | assert( decimal > 0 && decimal < 1000 ); 9 | 10 | const size_t nrows = 4; 11 | const size_t ncols = 4; 12 | 13 | static size_t table_arabs[ nrows ][ ncols ] = { { 1000, 1000, 1000, 1000 }, 14 | { 900, 500, 400, 100 }, 15 | { 90, 50, 40, 10 }, 16 | { 9, 5, 4, 1 } }; 17 | 18 | static const char *table_romans[ nrows ][ ncols ] = { { "M", "M", "M", "M" }, 19 | { "CM", "D", "CD", "C" }, 20 | { "XC", "L", "XL", "X" }, 21 | { "IX", "V", "IV", "I" } }; 22 | 23 | size_t power; // power of ten 24 | size_t index; // Indexes thru values to subtract 25 | 26 | std::string roman = ""; 27 | roman.reserve(length); 28 | 29 | for ( power = 0; power < nrows; power++ ) 30 | for ( index = 0; index < ncols; index++ ) 31 | while ( decimal >= table_arabs[ power ][ index ] ) 32 | { 33 | roman += table_romans[ power ][ index ]; 34 | decimal -= table_arabs[ power ][ index ]; 35 | } 36 | 37 | return roman; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Unittests/unittests.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int _argc, char** _argv) { 4 | 5 | testing::InitGoogleTest(&_argc, _argv); 6 | return RUN_ALL_TESTS(); 7 | } 8 | -------------------------------------------------------------------------------- /src/Unittests/unittests_common.hh: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_UNITTESTS_COMMON_HH 2 | #define INCLUDE_UNITTESTS_COMMON_HH 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | struct CustomTraits : public OpenMesh::DefaultTraits { 11 | }; 12 | 13 | typedef OpenMesh::TriMesh_ArrayKernelT Mesh; 14 | 15 | typedef OpenMesh::PolyMesh_ArrayKernelT PolyMesh; 16 | 17 | /* 18 | * Simple test setting. 19 | */ 20 | 21 | class OpenMeshBase : public testing::Test { 22 | 23 | protected: 24 | 25 | // This function is called before each test is run 26 | virtual void SetUp() { 27 | 28 | // Do some initial stuff with the member data here... 29 | } 30 | 31 | // This function is called after all tests are through 32 | virtual void TearDown() { 33 | 34 | // Do some final stuff with the member data here... 35 | } 36 | 37 | // This member will be accessible in all tests 38 | Mesh mesh_; 39 | }; 40 | 41 | /* 42 | * Simple test setting. 43 | */ 44 | 45 | class OpenMeshBasePoly : public testing::Test { 46 | 47 | protected: 48 | 49 | // This function is called before each test is run 50 | virtual void SetUp() { 51 | 52 | // Do some initial stuff with the member data here... 53 | } 54 | 55 | // This function is called after all tests are through 56 | virtual void TearDown() { 57 | 58 | // Do some final stuff with the member data here... 59 | } 60 | 61 | // This member will be accessible in all tests 62 | PolyMesh mesh_; 63 | }; 64 | 65 | 66 | 67 | #endif // INCLUDE GUARD 68 | -------------------------------------------------------------------------------- /src/Unittests/unittests_faceless_mesh.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | namespace { 7 | 8 | class OpenMeshFacelessMesh : public OpenMeshBase { 9 | 10 | protected: 11 | 12 | // This function is called before each test is run 13 | virtual void SetUp() { 14 | 15 | // Do some initial stuff with the member data here... 16 | } 17 | 18 | // This function is called after all tests are through 19 | virtual void TearDown() { 20 | 21 | // Do some final stuff with the member data here... 22 | } 23 | 24 | // Member already defined in OpenMeshBase 25 | //Mesh mesh_; 26 | }; 27 | 28 | ///* 29 | // * ==================================================================== 30 | // * Define tests below 31 | // * ==================================================================== 32 | // */ 33 | // 34 | // */ 35 | //TEST_F(OpenMeshFacelessMesh, TestCirculatorsAndIterators) { 36 | // 37 | // This setup is not supported by OpenMesh, we keep this test, if somebody creates 38 | // a connectivity class for faceless graph setup. 39 | //// mesh_.clear(); 40 | //// 41 | //// // Add some vertices 42 | //// Mesh::VertexHandle vhandle[4]; 43 | //// 44 | //// vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 0, 0)); 45 | //// vhandle[1] = mesh_.add_vertex(Mesh::Point(0, 1, 0)); 46 | //// vhandle[2] = mesh_.add_vertex(Mesh::Point(1, 1, 0)); 47 | //// vhandle[3] = mesh_.add_vertex(Mesh::Point(1, 0, 0)); 48 | //// 49 | //// 50 | //// Mesh::HalfedgeHandle heh00 = mesh_.new_edge(vhandle[0], vhandle[1]); 51 | //// Mesh::HalfedgeHandle heh10 = mesh_.new_edge(vhandle[1], vhandle[2]); 52 | //// 53 | //// 54 | //// // Halfedge Handles do not work in this setting! 55 | //// Mesh::HalfedgeHandle invalid_heh = mesh_.next_halfedge_handle(heh00); 56 | // 57 | //// //second he circulators does not work 58 | //// 59 | //// auto invalid_heh_circ = mesh_.cvoh_iter(vh1); 60 | //// 61 | //// //third, and most important, split_edge fails 62 | //// 63 | //// Mesh::VertexHandle vh12 = mesh_.new_vertex(Mesh::Point(1.5, 0, 0)); 64 | //// mesh_.split_edge(mesh_.edge_handle(heh10), vh12); //runtime error 65 | // 66 | //} 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/Unittests/unittests_mesh_cast.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | 8 | namespace { 9 | 10 | class OpenMeshMeshCastTest: public testing::Test { 11 | }; 12 | 13 | struct TriTraits1: public OpenMesh::DefaultTraits { 14 | typedef OpenMesh::Vec3d Point; 15 | }; 16 | struct TriTraits2: public OpenMesh::DefaultTraits { 17 | typedef OpenMesh::Vec3d Point; 18 | }; 19 | 20 | TEST_F(OpenMeshMeshCastTest, PerformCast) { 21 | OpenMesh::TriMesh_ArrayKernelT a; 22 | OpenMesh::TriMesh_ArrayKernelT &b = 23 | OpenMesh::mesh_cast&>(a); 24 | /* 25 | OpenMesh::TriMesh_ArrayKernelT < TriTraits2 > &b = 26 | OpenMesh::MeshCast< 27 | TriMesh_ArrayKernelT&, 28 | OpenMesh::TriMesh_ArrayKernelT& 29 | >::cast(a); 30 | */ 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Unittests/unittests_mesh_dual.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | namespace { 7 | 8 | class OpenMeshMeshDual : public OpenMeshBasePoly { 9 | 10 | protected: 11 | 12 | // This function is called before each test is run 13 | virtual void SetUp() { 14 | 15 | // Do some initial stuff with the member data here... 16 | } 17 | 18 | // This function is called after all tests are through 19 | virtual void TearDown() { 20 | 21 | // Do some final stuff with the member data here... 22 | } 23 | 24 | // Member already defined in OpenMeshBase 25 | //Mesh mesh_; 26 | }; 27 | 28 | /* 29 | * ==================================================================== 30 | * Define tests below 31 | * ==================================================================== 32 | */ 33 | 34 | /* 35 | */ 36 | TEST_F(OpenMeshMeshDual, Dualize) { 37 | 38 | bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off"); 39 | 40 | ASSERT_TRUE(ok); 41 | 42 | PolyMesh* dualMesh; 43 | 44 | dualMesh = OpenMesh::Util::MeshDual(mesh_); 45 | 46 | EXPECT_EQ(15048u, dualMesh->n_vertices()) << "The number of vertices after dual computation is not correct!"; 47 | EXPECT_EQ(22572u, dualMesh->n_edges()) << "The number of edges after dual computation is not correct!"; 48 | EXPECT_EQ(7526u, dualMesh->n_faces()) << "The number of faces after dual computation is not correct!"; 49 | 50 | delete(dualMesh); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Unittests/unittests_randomNumberGenerator.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | namespace { 6 | 7 | class RandomNumberGenerator : public testing::Test { 8 | 9 | protected: 10 | 11 | // This function is called before each test is run 12 | virtual void SetUp() { 13 | 14 | // Do some initial stuff with the member data here... 15 | } 16 | 17 | // This function is called after all tests are through 18 | virtual void TearDown() { 19 | 20 | // Do some final stuff with the member data here... 21 | } 22 | 23 | // Member already defined in OpenMeshBase 24 | //Mesh mesh_; 25 | }; 26 | 27 | /* 28 | * ==================================================================== 29 | * Define tests below 30 | * ==================================================================== 31 | */ 32 | 33 | TEST_F(RandomNumberGenerator, RandomNumberGeneratorMaxTestHighres) { 34 | 35 | 36 | OpenMesh::RandomNumberGenerator rng(100000000); 37 | 38 | unsigned int lowerZero = 0; 39 | unsigned int above1 = 0; 40 | 41 | double average = 0.0; 42 | 43 | for ( unsigned int i = 0 ; i < 100000000 ; ++i) { 44 | double randomNumber = rng.getRand(); 45 | if ( randomNumber < 0.0 ) 46 | lowerZero++; 47 | 48 | if ( randomNumber > 1.0 ) 49 | above1++; 50 | 51 | average += randomNumber; 52 | } 53 | 54 | average /= 100000000.0; 55 | 56 | EXPECT_EQ(0u, lowerZero ) << "Below zero!"; 57 | EXPECT_EQ(0u, above1 ) << "Above zero!"; 58 | 59 | EXPECT_TRUE( (average - 0.5) < 0.01 ) << "Expected value not 0.5"; 60 | } 61 | 62 | TEST_F(RandomNumberGenerator, RandomNumberGeneratorMaxTestLowres) { 63 | 64 | OpenMesh::RandomNumberGenerator rng(1000); 65 | 66 | unsigned int lowerZero = 0; 67 | unsigned int above1 = 0; 68 | 69 | double average = 0.0; 70 | 71 | for ( unsigned int i = 0 ; i < 10000000 ; ++i) { 72 | 73 | double randomNumber = rng.getRand(); 74 | if ( randomNumber < 0.0 ) 75 | lowerZero++; 76 | 77 | if ( randomNumber > 1.0 ) { 78 | above1++; 79 | } 80 | 81 | average += randomNumber; 82 | } 83 | 84 | average /= 10000000.0; 85 | 86 | EXPECT_EQ(0u, lowerZero ) << "Below zero!"; 87 | EXPECT_EQ(0u, above1 ) << "Above zero!"; 88 | 89 | EXPECT_TRUE( (average - 0.5) < 0.01 ) << "Expected value not 0.5"; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/Unittests/unittests_stripifier.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | namespace { 7 | 8 | class OpenMeshStripify : public OpenMeshBase { 9 | 10 | protected: 11 | 12 | // This function is called before each test is run 13 | virtual void SetUp() { 14 | 15 | // Do some initial stuff with the member data here... 16 | } 17 | 18 | // This function is called after all tests are through 19 | virtual void TearDown() { 20 | 21 | // Do some final stuff with the member data here... 22 | } 23 | 24 | // Member already defined in OpenMeshBase 25 | //Mesh mesh_; 26 | }; 27 | 28 | /* 29 | * ==================================================================== 30 | * Define tests below 31 | * ==================================================================== 32 | */ 33 | 34 | /* 35 | */ 36 | TEST_F(OpenMeshStripify, Stripify) { 37 | 38 | bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off"); 39 | 40 | ASSERT_TRUE(ok); 41 | 42 | OpenMesh::StripifierT stripifier(mesh_); 43 | 44 | size_t strips = stripifier.stripify(); 45 | 46 | EXPECT_EQ(1269u, strips) << "The number of computed strips is not correct!"; 47 | EXPECT_TRUE(stripifier.is_valid()) << "Strips not computed!"; 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Unittests/unittests_vector_type.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace { 6 | 7 | class OpenMeshVectorTest : public testing::Test { 8 | 9 | protected: 10 | 11 | // This function is called before each test is run 12 | virtual void SetUp() { 13 | 14 | // Do some initial stuff with the member data here... 15 | } 16 | 17 | // This function is called after all tests are through 18 | virtual void TearDown() { 19 | 20 | // Do some final stuff with the member data here... 21 | } 22 | 23 | }; 24 | 25 | 26 | 27 | /* 28 | * ==================================================================== 29 | * Define tests below 30 | * ==================================================================== 31 | */ 32 | 33 | /* Compute surface area via cross product 34 | */ 35 | TEST_F(OpenMeshVectorTest, ComputeTriangleSurfaceWithCrossProduct) { 36 | 37 | 38 | // 39 | // vec1 40 | // x 41 | // | 42 | // | 43 | // | 44 | // x------>x vec2 45 | // 46 | 47 | OpenMesh::Vec3d vec1(0.0,1.0,0.0); 48 | OpenMesh::Vec3d vec2(1.0,0.0,0.0); 49 | 50 | double area = 0.5 * cross(vec1,vec2).norm(); 51 | EXPECT_EQ(0.5f , area ) << "Wrong area in cross product function"; 52 | 53 | area = 0.5 * ( vec1 % vec2 ).norm(); 54 | EXPECT_EQ(0.5f , area ) << "Wrong area in cross product operator"; 55 | 56 | } 57 | 58 | /* Check OpenMesh Vector type abs function 59 | */ 60 | TEST_F(OpenMeshVectorTest, AbsTest) { 61 | 62 | OpenMesh::Vec3d vec1(0.5,0.5,-0.5); 63 | 64 | EXPECT_EQ( vec1.l8_norm() , 0.5f ) << "Wrong l8norm computation"; 65 | 66 | } 67 | 68 | 69 | 70 | } 71 | --------------------------------------------------------------------------------