Commit 129365db authored by Jan Möbius's avatar Jan Möbius

Tagged 4.0


git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/tags/trunk@1310 fdac6126-5c0c-442c-9429-916003d36597
parents c64eaf68 34958446
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS = src/OpenMesh Doc
PACKAGES :=
PROJ_LIBS :=
MODULES :=
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
cmake_minimum_required (VERSION 2.6)
enable_testing()
# Only set project name if OpenMesh is built as stand-alone library
if("${PROJECT_NAME}" STREQUAL "")
project (OpenMesh)
endif()
if (NOT WIN32 AND NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set (CMAKE_DEBUG_POSTFIX "d")
......@@ -22,12 +29,32 @@ endif()
include (ACGOutput)
# ========================================================================
# Definitions
# ========================================================================
if (WIN32)
add_definitions(
-D_USE_MATH_DEFINES -DNOMINMAX
-D_CRT_SECURE_NO_WARNINGS
)
endif ()
set(NO_DECREMENT_DEPRECATED_WARNINGS OFF CACHE BOOL "Disables all deprecated warnings warning about decrement operations on normal circulators.")
if(NO_DECREMENT_DEPRECATED_WARNINGS)
add_definitions( -DNO_DECREMENT_DEPRECATED_WARNINGS )
endif()
# ========================================================================
# Windows build style control
# ========================================================================
if ( WIN32 )
if ( NOT DEFINED OPENMESH_BUILD_SHARED )
set( OPENMESH_BUILD_SHARED false CACHE BOOL "Build as shared library(DLL)?" )
endif()
endif()
# ========================================================================
# Add bundle targets here
# ========================================================================
......@@ -64,10 +91,30 @@ add_subdirectory (src/OpenMesh/Apps)
# Do not build unit tests when build as external library
if(${PROJECT_NAME} MATCHES "OpenMesh")
add_subdirectory (src/Unittests)
else()
# If built as a dependent project simulate effects of
# successful finder run:
set (OPENMESH_FOUND true PARENT_SCOPE)
set (OPENMESH_LIBRARIES OpenMeshCore OpenMeshTools PARENT_SCOPE)
set (OPENMESH_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
# Also define variables provided by the old legacy finder.
set (OPENMESH_CORE_LIBRARY OpenMeshCore PARENT_SCOPE)
set (OPENMESH_TOOLS_LIBRARY OpenMeshTools PARENT_SCOPE)
set (OPENMESH_TOOLS_LIBRARY OpenMeshTools PARENT_SCOPE)
set (OPENMESH_LIBRARY OpenMeshCore OpenMeshTools PARENT_SCOPE)
get_target_property(_OPENMESH_LIBRARY_DIR OpenMeshCore LIBRARY_OUTPUT_DIRECTORY)
set (OPENMESH_LIBRARY_DIR "${_OPENMESH_LIBRARY_DIR}" CACHE PATH "The directory where the OpenMesh libraries can be found.")
endif()
add_subdirectory (Doc)
# ========================================================================
# Include Python interface
# ========================================================================
add_subdirectory (src/Python)
# ========================================================================
# Bundle generation (Targets exist, now configure them)
# ========================================================================
......@@ -86,9 +133,9 @@ if(${PROJECT_NAME} MATCHES "OpenMesh")
endif()
endif()
if (APPLE)
# On apple we do a fixbundle, which is only necessary for the apps and not for the libs
if (APPLE AND BUILD_APPS)
# prepare bundle generation cmake file and add a build target for it
configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.in"
"${CMAKE_BINARY_DIR}/fixbundle.cmake" @ONLY IMMEDIATE)
......@@ -99,10 +146,9 @@ if(${PROJECT_NAME} MATCHES "OpenMesh")
# Required for Snow leopard, and the latest qt. Then the resources have to be copied
if ( EXISTS "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib" )
add_custom_command(TARGET OpenMesh POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib" "${CMAKE_BINARY_DIR}/Build/Libraries/qt_menu.nib"
)
COMMAND ${CMAKE_COMMAND} -E copy_directory "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib"
"${CMAKE_BINARY_DIR}/Build/Libraries/qt_menu.nib" )
endif ()
endif ()
endif()
......
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
MODULES := doxygen
DOXY_PROJECT_NAME = OpenMesh
DOXY_FILE_PATTERNS = *.cc *.hh *.docu
DOXY_EXCLUDE_DIRS = $(cur-dir)/Examples $(proj-dir)/Tools/Test $(proj-dir)/Apps
DOXY_EXCLUDE_PATTERNS = CVS $(build-dir) *.moc.cc footer.hh
DOXY_EXAMPLE_PATH = $(cur-dir)/Examples $(cur-dir)/Tutorial
DOXY_EXAMPLE_PATTERNS = *.cc *.hh
DOXY_MACROS = OM_Attribute=class
DOXY_GENERATE_HTML = YES
DOXY_GENERATE_LATEX = NO
DOXY_GENERATE_RTF = NO
DOXY_GENERATE_MAN = NO
DOXY_USE_PDFLATEX = YES
DOXY_ACG_STYLE = YES
DOXY_HAVE_DOT = NO
DOXY_COLLABORATION_GRAPH = NO
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
......@@ -2,10 +2,6 @@ include (ACGDoxygen)
IF (DOXYGEN_FOUND)
if (TARGET doc)
acg_copy_after_build (doc "${CMAKE_CURRENT_SOURCE_DIR}/html" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html")
endif ()
# Add a documentation install target
add_custom_target(doc-install COMMENT "Installing Documentation" VERBATIM )
......@@ -16,4 +12,4 @@ IF (DOXYGEN_FOUND)
acg_copy_after_build (doc-install "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Doc/html" "${CMAKE_INSTALL_PREFIX}/${ACG_PROJECT_DATADIR}/doc/html")
endif()
ENDIF(DOXYGEN_FOUND)
\ No newline at end of file
ENDIF(DOXYGEN_FOUND)
/*===========================================================================*\
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* OpenMesh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* OpenMesh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
* ========================================================================= */
/*===========================================================================*\
* *
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@ MyMesh mesh;
for (MyMesh::VertexIter v_it=mesh.vertices_sbegin(); v_it!=mesh.vertices_end(); ++v_it)
{
// circulate around the current vertex
for (MyMesh::VertexVertexIter vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it)
for (MyMesh::VertexVertexIter vv_it=mesh.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{
// do something with e.g. mesh.point(*vv_it)
}
......
......@@ -10,7 +10,7 @@ typedef TriMesh_ArrayKernelT<> Mesh;
typedef Decimater::DecimaterT< Mesh > Decimater;
// Decimation Module Handle type
typedef Decimater::ModQuadricT< decimater >::Handle HModQuadric;
typedef Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
// ---------------------------------------- decimater setup
......@@ -23,6 +23,13 @@ decimater.add( hModQuadric ); // register module at the decimater
std::cout << decimater.module( hModQuadric ).name() << std::endl;
// the way to access the module
/*
* since we need exactly one priority module (non-binary)
* we have to call set_binary(false) for our priority module
* in the case of HModQuadric, unset_max_err() calls set_binary(false) internally
*/
decimater.module( hModQuadric ).unset_max_err();
decimater.initialize(); // let the decimater initialize the mesh and the
// modules
......
......@@ -2,17 +2,17 @@ MyMesh mesh;
// iterate over all vertices
for (MyMesh::VertexIter v_it=mesh.vertices_begin(); v_it!=mesh.vertices_end(); ++v_it)
...; // do something with *v_it, v_it->, or v_it.handle()
...; // do something with *v_it, v_it->, or *v_it
// iterate over all halfedges
for (MyMesh::HalfedgeIter h_it=mesh.halfedges_begin(); h_it!=mesh.halfedges_end(); ++h_it)
...; // do something with *h_it, h_it->, or h_it.handle()
...; // do something with *h_it, h_it->, or *h_it
// iterate over all edges
for (MyMesh::EdgeIter e_it=mesh.edges_begin(); e_it!=mesh.edges_end(); ++e_it)
...; // do something with *e_it, e_it->, or e_it.handle()
...; // do something with *e_it, e_it->, or *e_it
// iterator over all faces
for (MyMesh::FaceIter f_it=mesh.faces_begin(); f_it!=mesh.faces_end(); ++f_it)
...; // do something with *f_it, f_it->, or f_it.handle()
...; // do something with *f_it, f_it->, or *f_it
// Get the halfedge handle of i.e. the halfedge
// that is associated to the first vertex
// of our set of vertices
PolyMesh::HalfedgeHandle heh = mesh.halfedge_handle(mesh.vertices_begin().handle());
PolyMesh::HalfedgeHandle heh = mesh.halfedge_handle(*(mesh.vertices_begin()));
// Now get the handle of its opposing halfedge
PolyMesh::HalfedgeHandle opposite_heh = mesh.opposite_halfedge_handle(heh);
// Get the handle of the to vertex
OpenMesh::Concepts::KernelT::to_vertex_handle();
// Get the handle of the from vertex
OpenMesh::Concepts::KernelT::from_vertex_handle();
##################################################
# Getting Started
##################################################
from openmesh import *
mesh = TriMesh()
##################################################
# Adding Items to a Mesh
##################################################
# add a a couple of vertices to the mesh
vh0 = mesh.add_vertex(TriMesh.Point(0, 1, 0))
vh1 = mesh.add_vertex(TriMesh.Point(1, 0, 0))
vh2 = mesh.add_vertex(TriMesh.Point(2, 1, 0))
vh3 = mesh.add_vertex(TriMesh.Point(0,-1, 0))
vh4 = mesh.add_vertex(TriMesh.Point(2,-1, 0))
# add a couple of faces to the mesh
fh0 = mesh.add_face(vh0, vh1, vh2)
fh1 = mesh.add_face(vh1, vh3, vh4)
fh2 = mesh.add_face(vh0, vh3, vh1)
# add another face to the mesh, this time using a list
vh_list = [vh2, vh1, vh4]
fh3 = mesh.add_face(vh_list)
# 0 ==== 2
# |\ 0 /|
# | \ / |
# |2 1 3|
# | / \ |
# |/ 1 \|
# 3 ==== 4
##################################################
# Iterators
##################################################
# iterate over all vertices
for vh in mesh.vertices():
print vh.idx()
# iterate over all halfedges
for heh in mesh.halfedges():
print heh.idx()
# iterate over all edges
for eh in mesh.edges():
print eh.idx()
# iterate over all faces
for fh in mesh.faces():
print fh.idx()
##################################################
# Circulators
##################################################
# iterate over all neighboring vertices
for vh in mesh.vv(vh1):
print vh.idx()
# iterate over all incoming halfedges
for heh in mesh.vih(vh1):
print heh.idx()
# iterate over all outgoing halfedges
for heh in mesh.voh(vh1):
print heh.idx()
# iterate over all adjacent edges
for eh in mesh.ve(vh1):
print eh.idx()
# iterate over all adjacent faces
for fh in mesh.vf(vh1):
print fh.idx()
# iterate over the face's vertices
for vh in mesh.fv(fh0):
print vh.idx()
# iterate over the face's halfedges
for heh in mesh.fh(fh0):
print heh.idx()
# iterate over the face's edges
for eh in mesh.fe(fh0):
print eh.idx()
# iterate over all edge-neighboring faces
for fh in mesh.ff(fh0):
print fh.idx()
##################################################
# Properties
##################################################
prop_handle = VPropHandle()
mesh.add_property(prop_handle, "cogs")
for vh in mesh.vertices():
cog = TriMesh.Point(0,0,0)
valence = 0
for neighbor in mesh.vv(vh):
cog += mesh.point(neighbor)
valence += 1
mesh.set_property(prop_handle, vh, cog / valence)
mesh.remove_property(prop_handle)
##################################################
# Property Managers
##################################################
prop_man = VPropertyManager(mesh, "cogs")
prop_man.set_range(mesh.vertices(), TriMesh.Point(0,0,0))
for vh in mesh.vertices():
valence = 0
for neighbor in mesh.vv(vh):
prop_man[vh] += mesh.point(neighbor)
valence += 1
prop_man[vh] /= valence
##################################################
# I/O
##################################################
mesh = TriMesh()
read_mesh(mesh, "bunny.obj")
# modify mesh ...
write_mesh(mesh, "bunny.obj")
mesh = TriMesh()
mesh.request_halfedge_normals()
mesh.request_vertex_normals()
options = Options()
options += Options.VertexNormal
result = read_mesh(mesh, "bunny.obj", options)
if result:
print "everything worked"
else:
print "something went wrong"
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
# subdirs to process
SUBDIRS = $(call find-subdirs)
# programms (files containing main(), w/o suffix)
EXECS = $(call cxx-find-execs)
# packages (qt, opengl, ...)
PACKAGES :=
# project DSOs
PROJ_LIBS := OpenMesh/Core
# modules to use (cxx, c, moc, uic, yacc) ! order-dependent !
MODULES := cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
//=============================================================================
//
// OpenMesh
// Copyright (C) 2001-2005 by Computer Graphics Group, RWTH Aachen
// www.openmesh.org
//
//-----------------------------------------------------------------------------