diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d24c8c1f..545b79db 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,24 +1,33 @@
+stages:
+ - build
+ - deploy
+
gcc-c++11:
+ stage: build
script: "CI/ci-linux.sh gcc C++11"
tags:
- Linux
clang-c++11:
+ stage: build
script: "CI/ci-linux.sh clang C++11"
tags:
- Linux
gcc-c++14:
+ stage: build
script: "CI/ci-linux.sh gcc C++14"
tags:
- Linux
clang-c++14:
+ stage: build
script: "CI/ci-linux.sh clang C++14"
tags:
- Linux
macos-c++11:
+ stage: build
script: "CI/ci-mac.sh C++11"
tags:
- Apple
@@ -28,6 +37,7 @@ macos-c++11:
- build-release-cpp11/*.tar.gz
macos-c++98:
+ stage: build
script: "CI/ci-mac.sh C++14"
tags:
- Apple
@@ -37,14 +47,106 @@ macos-c++98:
- build-release-cpp14/*.tar.gz
cppcheck:
+ stage: build
script: "CI/ci-cppcheck.sh"
tags:
- Linux
artifacts:
paths:
- cppcheck.log
+
+VS2017-64-bit-shared-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x64"
+ SHARED: "TRUE"
+ APPS: "ON"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ - Qt5101
+ artifacts:
+ paths:
+ - build-release/*.exe
+
+VS2017-64-bit-static-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x64"
+ SHARED: "FALSE"
+ APPS: "ON"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ - Qt5101
+ artifacts:
+ paths:
+ - build-release/*.exe
+
+
+VS2017-64-bit-shared-no-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x64"
+ SHARED: "TRUE"
+ APPS: "OFF"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ artifacts:
+ paths:
+ - build-release/*.exe
+
+
+VS2017-32-bit-shared-no-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x32"
+ SHARED: "TRUE"
+ APPS: "OFF"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ artifacts:
+ paths:
+ - build-release/*.exe
+
+
+VS2017-64-bit-static-no-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x64"
+ SHARED: "FALSE"
+ APPS: "OFF"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ artifacts:
+ paths:
+ - build-release/*.exe
+
+
+VS2017-32-bit-static-no-apps:
+ stage: build
+ variables:
+ BUILD_PLATFORM: "VS2017"
+ ARCHITECTURE: "x32"
+ SHARED: "FALSE"
+ APPS: "OFF"
+ script: "CI\\Windows.bat"
+ tags:
+ - VS2017
+ artifacts:
+ paths:
+ - build-release/*.exe
VS2015-64-bit-shared-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
@@ -57,7 +159,9 @@ VS2015-64-bit-shared-apps:
paths:
- build-release/*.exe
+
VS2015-64-bit-shared-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
@@ -71,6 +175,7 @@ VS2015-64-bit-shared-no-apps:
- build-release/*.exe
VS2015-32-bit-shared-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
@@ -84,6 +189,7 @@ VS2015-32-bit-shared-apps:
- build-release/*.exe
VS2015-32-bit-shared-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
@@ -97,6 +203,7 @@ VS2015-32-bit-shared-no-apps:
- build-release/*.exe
VS2015-64-bit-static-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
@@ -110,6 +217,7 @@ VS2015-64-bit-static-apps:
- build-release/*.exe
VS2015-64-bit-static-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x64"
@@ -123,6 +231,7 @@ VS2015-64-bit-static-no-apps:
- build-release/*.exe
VS2015-32-bit-static-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
@@ -136,6 +245,7 @@ VS2015-32-bit-static-apps:
- build-release/*.exe
VS2015-32-bit-static-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2015"
ARCHITECTURE: "x32"
@@ -151,6 +261,7 @@ VS2015-32-bit-static-no-apps:
VS2013-64-bit-shared-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
@@ -164,6 +275,7 @@ VS2013-64-bit-shared-apps:
- build-release/*.exe
VS2013-64-bit-shared-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
@@ -177,6 +289,7 @@ VS2013-64-bit-shared-no-apps:
- build-release/*.exe
VS2013-32-bit-shared-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
@@ -190,6 +303,7 @@ VS2013-32-bit-shared-apps:
- build-release/*.exe
VS2013-32-bit-shared-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
@@ -203,6 +317,7 @@ VS2013-32-bit-shared-no-apps:
- build-release/*.exe
VS2013-64-bit-static-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
@@ -216,6 +331,7 @@ VS2013-64-bit-static-apps:
- build-release/*.exe
VS2013-64-bit-static-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
@@ -229,6 +345,7 @@ VS2013-64-bit-static-no-apps:
- build-release/*.exe
VS2013-32-bit-static-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
@@ -242,6 +359,7 @@ VS2013-32-bit-static-apps:
- build-release/*.exe
VS2013-32-bit-static-no-apps:
+ stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
@@ -255,15 +373,23 @@ VS2013-32-bit-static-no-apps:
- build-release/*.exe
Doc-publish:
+ stage: deploy
only:
- master
script: "CI/ci-doc.sh"
tags:
- Linux
-
-
-
-
-
+Sources:
+ stage: deploy
+ only:
+ - master
+ script: "CI/ci-source.sh"
+ tags:
+ - Linux
+ artifacts:
+ paths:
+ - OpenMesh*.zip
+ - OpenMesh*.tar.bz2
+ - OpenMesh*.tar.gz
diff --git a/.qmake.cache b/.qmake.cache
deleted file mode 100644
index 20cb5b30..00000000
--- a/.qmake.cache
+++ /dev/null
@@ -1,15 +0,0 @@
-unix {
- TOPDIR = $$system( pwd )/
-}
-
-win32 {
- TOPDIR = $$system( cd )/
-}
-
-#use next qmake.cache if it exists
-exists(../.qmake.cache) {
- include( ../.qmake.cache )
-}
-
-include( qmake/all.include )
-
diff --git a/CI/Windows.bat b/CI/Windows.bat
index 3db66708..4460e6fe 100644
--- a/CI/Windows.bat
+++ b/CI/Windows.bat
@@ -21,7 +21,6 @@ IF "%BUILD_PLATFORM%" == "VS2012" (
set GTESTVERSION=gtest-1.6.0
set GENERATOR=Visual Studio 11%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com"
- set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\4.8.5-vs2012-%STRING_ARCH%\
set QT_BASE_CONFIG=-DQT_QMAKE_EXECUTABLE=E:\Qt\4.8.5-vs2012-%STRING_ARCH%\bin\qmake.exe
@@ -38,7 +37,6 @@ IF "%BUILD_PLATFORM%" == "VS2013" (
set GTESTVERSION=gtest-1.6.0
set GENERATOR=Visual Studio 12%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com"
- set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_64_opengl
@@ -56,7 +54,6 @@ IF "%BUILD_PLATFORM%" == "VS2015" (
set GENERATOR=Visual Studio 14%ARCH_VS%
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com"
- set QT_VERSION=
IF "%ARCHITECTURE%" == "x64" (
set QT_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.6.0-vs2015-%STRING_ARCH%\5.6\msvc2015_64
@@ -69,6 +66,19 @@ IF "%BUILD_PLATFORM%" == "VS2015" (
)
+IF "%BUILD_PLATFORM%" == "VS2017" (
+ set LIBPATH=E:\libs\VS2017
+ set GTESTVERSION=gtest-1.7.0
+ set GENERATOR=Visual Studio 15%ARCH_VS%
+ set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com"
+
+ IF "%ARCHITECTURE%" == "x64" (
+ set QT_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
+ set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.10.1\5.10.1\msvc2017_64
+ )
+
+)
+
IF "%APPS%" == "ON" (
set STRING_APPS=
@@ -79,21 +89,31 @@ IF "%APPS%" == "ON" (
REM Copy the platform plugins subdirectory for the qt plugins required to run the gui apps
xcopy /Y %QT_INSTALL_PATH%\plugins\platforms Build\plugins\platforms
-
- IF "%BUILD_PLATFORM%" == "VS2015" (
- set CMAKE_CONFIGURATION=%QT_BASE_CONFIG% -DGLUT_INCLUDE_DIR="%LIBPATH%\%ARCHITECTURE%\freeglut-3.0.0\include" -DGLUT_glut_LIBRARY="%LIBPATH%\%ARCHITECTURE%\freeglut-3.0.0\lib\freeglut.lib"
-
-
- ) ELSE (
- set CMAKE_CONFIGURATION=%QT_BASE_CONFIG% -DGLUT_INCLUDE_DIR="%LIBPATH%\%ARCHITECTURE%\freeglut-2.8.1\include" -DGLUT_glut_LIBRARY="%LIBPATH%\%ARCHITECTURE%\freeglut-2.8.1\lib\freeglut.lib"
- )
+ set CMAKE_CONFIGURATION=%QT_BASE_CONFIG%
) ELSE (
set STRING_APPS=-no-apps
set CMAKE_CONFIGURATION=
)
+ECHO "============================================================="
+ECHO "============================================================="
+ECHO "Building with :"
+ECHO "ARCHITECTURE : %ARCHITECTURE%"
+ECHO "BUILD_PLATFORM : %BUILD_PLATFORM%"
+ECHO "GTESTVERSION : %GTESTVERSION%"
+ECHO "GENERATOR : %GENERATOR%"
+ECHO "VS_PATH : %VS_PATH%"
+ECHO "LIBPATH : %LIBPATH%"
+ECHO "APPS : %APPS%"
+ECHO "SHARED : %SHARED%"
+ECHO "QT_INSTALL_PATH : %QT_INSTALL_PATH%"
+ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
+ECHO "============================================================="
+ECHO "============================================================="
-"C:\Program Files (x86)\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=%APPS% -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_WINDOWS_LIBS_DIR="e:\libs" -DOPENMESH_BUILD_SHARED=%SHARED% %CMAKE_CONFIGURATION% ..
+
+
+"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=%APPS% -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_WINDOWS_LIBS_DIR="e:\libs" -DOPENMESH_BUILD_SHARED=%SHARED% %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Release" OpenMesh.sln /Project "ALL_BUILD"
@@ -103,6 +123,8 @@ cd unittests
unittests.exe --gtest_output=xml
+unittests_customvec.exe --gtest_output=xml
+
cd ..
cd ..
@@ -111,7 +133,7 @@ mkdir build-debug
cd build-debug
-"C:\Program Files (x86)\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_SHARED=%SHARED% -DBUILD_APPS=%APPS% %CMAKE_CONFIGURATION% ..
+"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_SHARED=%SHARED% -DBUILD_APPS=%APPS% %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Debug" OpenMesh.sln /Project "ALL_BUILD"
@@ -129,6 +151,8 @@ cd unittests
unittests.exe --gtest_output=xml
+unittests_customvec.exe --gtest_output=xml
+
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cd ..
@@ -139,13 +163,13 @@ cd build-release
del *.exe
-"C:\Program Files (x86)\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DBUILD_APPS=%APPS% -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
+"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DBUILD_APPS=%APPS% -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Release" OpenMesh.sln /Project "PACKAGE"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
-move OpenMesh-*.exe "OpenMesh-7.0-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
+move OpenMesh-*.exe "OpenMesh-7.1-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh
index 43bc9824..ec39f140 100755
--- a/CI/ci-cppcheck.sh
+++ b/CI/ci-cppcheck.sh
@@ -18,7 +18,7 @@ echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
-cppcheck --enable=all . -I src -i Doc/ --force --suppress=unusedFunction --suppress=missingIncludeSystem --quiet -Umin -Umax -UBMPOSTFIX -DOPENMESHDLLEXPORT="" &> cppcheck.log
+cppcheck --enable=all . --force --suppress=unusedFunction --suppress=missingIncludeSystem --quiet -Umin -Umax -UCTIME -UBMPOSTFIX -DOPENMESHDLLEXPORT="" -UPRIVATE_NODE_TYPESYSTEM_SOURCE -USO_NODE_ABSTRACT_SOURCE -USO_NODE_SOURCE -UCLOCK_REALTIME_HR -i src/OpenMesh/Apps/Unsupported/ -i Doc/ &> cppcheck.log
echo -e "${OUTPUT}"
echo "=============================================================================="
@@ -38,7 +38,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
-MAX_COUNT=6
+MAX_COUNT=0
if [ $COUNT -gt $MAX_COUNT ]; then
echo -e ${WARNING}
diff --git a/CI/ci-linux.sh b/CI/ci-linux.sh
index f7632198..b3d28017 100755
--- a/CI/ci-linux.sh
+++ b/CI/ci-linux.sh
@@ -76,7 +76,7 @@ fi
cd build-release-$BUILDPATH-Vector-Checks
-cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../
+cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it
make $MAKE_OPTIONS
@@ -96,53 +96,17 @@ cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
-cd ..
-cd ..
-
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
-echo "Building Release version with vectorchecks disabled for python tests"
+echo "Running unittests Release version with custom vector type"
echo "======================================================================"
echo -e "${NC}"
-if [ ! -d build-release-$BUILDPATH ]; then
- mkdir build-release-$BUILDPATH
-fi
-
-cd build-release-$BUILDPATH
-
-cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../
-
-#build it
-make $MAKE_OPTIONS
-
-echo -e "${OUTPUT}"
-echo ""
-echo "======================================================================"
-echo "Running Python unittests Release version "
-echo "======================================================================"
-echo -e "${NC}"
-
-if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then
-
- # Execute Python unittests
- cd Python-Unittests
-
- python -m unittest discover -v
-
- cd ..
-
-else
- echo -e "${WARNING}"
- echo "WARNING! Python unittests disabled !!"
- echo -e "${NC}"
-fi
-
+./unittests_customvec --gtest_color=yes --gtest_output=xml
cd ..
-
-
+cd ..
echo -e "${OUTPUT}"
echo ""
@@ -158,7 +122,7 @@ fi
cd build-debug-$BUILDPATH-Vector-Checks
-cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../
+cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it
make $MAKE_OPTIONS
@@ -179,44 +143,14 @@ cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
-cd ..
-cd ..
-
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
-echo "Building Debug version with vectorchecks disabled for python tests"
+echo "Running unittests Debug version with custom vector type"
echo "======================================================================"
echo -e "${NC}"
-if [ ! -d build-debug-$BUILDPATH ]; then
- mkdir build-debug-$BUILDPATH
-fi
+./unittests_customvec --gtest_color=yes --gtest_output=xml
-cd build-debug-$BUILDPATH
-
-cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../
-
-#build it
-make $MAKE_OPTIONS
-
-echo -e "${OUTPUT}"
-echo ""
-echo "======================================================================"
-echo "Running Python unittests Debug version "
-echo "======================================================================"
-echo -e "${NC}"
-
-if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then
-
- # Execute Python unittests
- cd Python-Unittests
-
- python -m unittest discover -v
-else
-
- echo -e "${WARNING}"
- echo "WARNING! Python unittests disabled !!"
- echo -e "${NC}"
-
-fi
+cd ..
+cd ..
diff --git a/CI/ci-mac.sh b/CI/ci-mac.sh
index 9dd14577..5b7ecd94 100755
--- a/CI/ci-mac.sh
+++ b/CI/ci-mac.sh
@@ -58,7 +58,7 @@ fi
cd build-release-$BUILDPATH-Vector-Checks
-cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
+cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it
make
@@ -78,55 +78,17 @@ cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
-cd ..
-cd ..
-
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
-echo "Building Release version with vectorchecks disabled for python tests"
+echo "Running unittests Release version with minimal vector type"
echo "======================================================================"
echo -e "${NC}"
-if [ ! -d build-release-$BUILDPATH ]; then
- mkdir build-release-$BUILDPATH
-fi
-
-cd build-release-$BUILDPATH
-
-cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF -DCPACK_BINARY_DRAGNDROP=ON $OPTIONS ../
-
-#build it
-make
-
-echo -e "${OUTPUT}"
-echo ""
-echo "======================================================================"
-echo "Running Python unittests Release version "
-echo "======================================================================"
-echo -e "${NC}"
-
-
-if [ "$LANGUAGE" == "C++11" ]; then
-
- # Execute Python unittests
- cd Python-Unittests
-
- rm -f openmesh.so
- cp ../Build/python/openmesh.so .
- python -m unittest discover -v
-
- cd ..
-
-else
- echo -e "${WARNING}"
- echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
- echo -e "${NC}"
-fi
+./unittests_customvec --gtest_color=yes --gtest_output=xml
cd ..
-
-
+cd ..
echo -e "${OUTPUT}"
echo ""
@@ -142,7 +104,7 @@ fi
cd build-debug-$BUILDPATH-Vector-Checks
-cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
+cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it
make
@@ -163,53 +125,16 @@ cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
-cd ..
-cd ..
-
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
-echo "Building Debug version with vectorchecks disabled for python tests"
+echo "Running unittests Debug version with minimal vector type"
echo "======================================================================"
echo -e "${NC}"
-if [ ! -d build-debug-$BUILDPATH ]; then
- mkdir build-debug-$BUILDPATH
-fi
+./unittests_customvec --gtest_color=yes --gtest_output=xml
-cd build-debug-$BUILDPATH
-
-cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../
-
-#build it
-make
-
-echo -e "${OUTPUT}"
-echo ""
-echo "======================================================================"
-echo "Running Python unittests Debug version "
-echo "======================================================================"
-echo -e "${NC}"
-
-if [ "$LANGUAGE" == "C++11" ]; then
-
- # Execute Python unittests
- cd Python-Unittests
-
- rm -f openmesh.so
- cp ../Build/python/openmesh.so .
- python -m unittest discover -v
-
- cd ..
-
-else
-
- echo -e "${WARNING}"
- echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
- echo -e "${NC}"
-
-fi
-
+cd ..
cd ..
echo -e "${OUTPUT}"
@@ -219,10 +144,15 @@ echo "Package creation (DMG and tarball)"
echo "======================================================================"
echo -e "${NC}"
+
+if [ ! -d build-release-$BUILDPATH ]; then
+ mkdir build-release-$BUILDPATH
+fi
+
cd build-release-$BUILDPATH
-cp ../build-debug-$BUILDPATH/Build/lib/* ./Build/lib/
-cmake .
+
+cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=OFF -DCPACK_BINARY_DRAGNDROP=ON $OPTIONS ../
+
+#build it
+make
make package
-
-
-
diff --git a/CI/ci-source.sh b/CI/ci-source.sh
new file mode 100755
index 00000000..5fa53811
--- /dev/null
+++ b/CI/ci-source.sh
@@ -0,0 +1,34 @@
+
+# This script just creates compressed files of OpenMesh sources
+
+# Create Build directory and Build documentation
+mkdir build-doc
+
+cd build-doc
+cmake ..
+make doc
+cd ..
+
+# Extract Version Information
+VERSION=OpenMesh-$(cat VERSION | grep VERSION | tr -d "VERSION=")
+
+# Create Publishing directory
+mkdir $VERSION
+
+# Move all files into Publishing directory
+mv CHANGELOG.md $VERSION/
+mv cmake $VERSION/
+mv CMakeLists.txt $VERSION/
+mv debian $VERSION/
+mv Doc $VERSION/
+mv LICENSE $VERSION/
+mv README.md $VERSION/
+mv src $VERSION/
+mv VERSION $VERSION/
+
+mv build-doc/Build/share/OpenMesh/Doc/html/ $VERSION/Documentation
+
+tar cjf $VERSION.tar.bz2 $VERSION
+tar czf $VERSION.tar.gz $VERSION
+zip -9 -q -r $VERSION.zip $VERSION
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
old mode 100644
new mode 100755
index 3ff533be..dda2f40a
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,10 @@
cmake_minimum_required (VERSION 2.6)
+
+# Set and enforce C++-11 flags
+set( CMAKE_CXX_STANDARD_REQUIRED TRUE )
+set( CMAKE_CXX_STANDARD 11 )
+
enable_testing()
# Only set project name if OpenMesh is built as stand-alone library
@@ -41,6 +46,7 @@ if(${PROJECT_NAME} MATCHES "OpenMesh")
endif()
include (ACGOutput)
+include(ACGQt)
# ========================================================================
# Definitions
@@ -129,12 +135,6 @@ endif()
add_subdirectory (Doc)
-# ========================================================================
-# Include Python interface
-# ========================================================================
-
-add_subdirectory (src/Python)
-
# ========================================================================
# Bundle generation (Targets exist, now configure them)
# ========================================================================
diff --git a/Doc/Examples/python_tutorial.py b/Doc/Examples/python_tutorial.py
deleted file mode 100644
index c43420cf..00000000
--- a/Doc/Examples/python_tutorial.py
+++ /dev/null
@@ -1,158 +0,0 @@
-##################################################
-# 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"
diff --git a/Doc/Tutorial/04-stl_algorithms/smooth_algo.hh b/Doc/Tutorial/04-stl_algorithms/smooth_algo.hh
index b39fd82f..968cbd7b 100644
--- a/Doc/Tutorial/04-stl_algorithms/smooth_algo.hh
+++ b/Doc/Tutorial/04-stl_algorithms/smooth_algo.hh
@@ -13,7 +13,7 @@ public:
public:
// construct with a given mesh
- SmootherT(Mesh& _mesh)
+ explicit SmootherT(Mesh& _mesh)
: mesh_(_mesh)
{
mesh_.add_property( cog_ );
diff --git a/Doc/changelog.docu b/Doc/changelog.docu
index f081c1f7..1abf1df0 100644
--- a/Doc/changelog.docu
+++ b/Doc/changelog.docu
@@ -6,11 +6,48 @@
-
| 7.0 (?/?/?) |
+
+ |
| 7.2 (?/?/?) |
+
+IO
+
+- PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)
+
+
+
+ |
+
+
+| 7.1 (2018/05/29) |
+
+IO
+
+- OBJ Reader: Fixed slow OBJ reader (Thanks to Etienne Danvoye for the patch)
+
+
+Documentation
+
+- Updated build instructions.
+
+
+Build System
+
+- Default to C++11 in cmake files
+- Remove old qmake project files. Unmaintained for a very long time
+- Replaced Qt finders
+- Added VS 2017 to CI builds
+
+
+ |
+
+
+
+| 7.0 (2018/04/19) |
Breaking changes
- The minimal standard for C++ has been raised to C++11. Compilers not supporting C++11 or higher are no longer supported
+- Removed the python bindings from this project. They have migrated to a seperate project.
Core
@@ -19,14 +56,25 @@
make all negative handles invalid, not just -1
Several warnings fixed (Including the checked iterators)
split_copy and split_edge_copy operations now also copy internal properties.
+copy face properties in split_copy(EdgeHandle, VertexHandle)
fix halfedge indices in OpenMeshTrimeshCirculatorHalfedgeLoop CWAndCCWCheck
Fix wrong behaviour of HalfedgeLoopIterators by changing the template parameter
Added 1-4 triangle split funtion(splits all edges at Midpoints)
+Boost range support (Thanks to Bastian Pranzas for the patch)
+Made the face and edge split operations that copy properties also copy builtin properties
+calc_sector_angle: Check for real division by zero not with epsilon that was way to large
+Don't return invalid iterators for empty element ranges
+Mark halfedges as deleted after collapse
+Let default range-based for skip deleted elements and add a version that includes deleted elements
+Moved length() by norm() to external functions. This allows us to support other vector types instead of Vec3d (e.g. via Eigen)
Utils
- enable c++11 features of many classes for Visual Studio 2013
+- Fixed broken version macros (Thanks to Frederik Salomonsson for the fix)
+- Fixed Build on gcc-7.2 (Thanks to Gero Müller and Martial Tola for the patches)
+- Small compilation fix for MINGW64 cross-compilation(Thanks to Manuel Massing for the patch)
Tools
@@ -39,21 +87,26 @@
- QuadricT: implement Q+Q and Q*scalar operators for convenience.
- Vector11T: Make converting ctor only accept 2 arguments
+- Only compute normals for faces that are not deleted
IO
+- ImporterT: Modified the add_face function of importerT to always return a valid FaceHandle
- ImporterT: Return a valid FaceHandle when adding non-manifold faces.
- BaseExporter: Added accessor functions for HalfEdgeHandles and faceTexCoords to base exporter and exporter template.
+- OBJ Writer: Fail if vertex color export was requested (Thanks to Manuel Massing)
- OBJ Writer: Added functionality to store FaceTexCoords to objwriter
+- OBJ Writer: Applied fix for bad or missing vertex tex coords (Thanks to Gero Müller for the patch)
+- OBJ Writer: Fix vertex texture coordinates export in OBJ writer
- OBJ Loader: range check for vertex colors and normals in OBJ loader
- OBJ Loader: fixed handling of negative indices in OBJ loader
- OM Writer: Fixed OMWriter when no faces are available (Thanks to Jamie Kydd for the patch)
- OM Writer: Added Mark to the format header to identify end of stream correctly (Thanks to Jamie Kydd for the patch)
- PLY Reader: Skip reading extra elements after face
- PLY Reader: Return error when reaching EOF
-
+- OMFormat: Fix implicit fallthrough warning on gcc(Thanks to Manuel Massing for the patch)
Unittests
@@ -62,14 +115,10 @@
Added unittest for split_edge_copy operations on Tri and PolyMeshes
-Python
-
-- fix the stripping of the python libs version string
-
-
General
- Updated Logo
+- Only Issue Warning if compile Order for MeshIO.hh is violated. Check will be removed if no errors are reported.
|
diff --git a/Doc/compiling.docu b/Doc/compiling.docu
new file mode 100644
index 00000000..338b2b12
--- /dev/null
+++ b/Doc/compiling.docu
@@ -0,0 +1,163 @@
+//-----------------------------------------------------------------------------
+
+/** \page compiling Compiling OpenMesh
+
+\section compilers Tested compilers
+
+%OpenMesh has been successfully tested for the following operating
+systems / compilers. This is only a list of tested compilers.
+More might be supported but are not tested. Make sure that your compiler
+supports at least C++11
+
+
+
+| Linux |
+gcc >= 4.8.x
+clang >= 3.3
+ |
+
+| Windows |
+Microsoft Visual Studio 2013
+Microsoft Visual Studio 2015
+Microsoft Visual Studio 2017
+ |
+
+| Tested MacOS X Compilers |
+
+XCode
+ |
+
+
+
+\section req_libs Required libraries (Only if you want to build the included Apps)
+
+Install the following external libraries / frameworks if you want to use the included Applications:
+
+
+\section build_systems Chosing build system
+
+%OpenMesh can be built using the cmake build system.
+
+
+
+\section sec_compiling_unix Unix
+
+\subsection linux_using_cmake Compiling OpenMesh using CMake
+
+In order to compile %OpenMesh, create a directory named e.g. "build" in
+OpenMesh's root directory. Change to the newly created directory and type
+
+
+cmake .. ## Generates the appropriate Makefiles
+make ## Builds the project
+
+
+\warning If your compiler does not support c++11 natively, you might have to enable it by changing the cmake call to:
+ cmake .. -DCMAKE_CXX_FLAGS=-std=c++98
+
+You can choose the build type by using cmake with the flag
+-DCMAKE_BUILD_TYPE=(Debug|Release) The default is: Release
+
+Other flags are:
+-DBUILD_APPS=OFF to disable build of applications and
+-DCMAKE_INSTALL_PREFIX=<path> to specify the install path.
+
+When calling make install cmake will install %OpenMesh into this
+directory using the subdirectories lib/include/bin.
+
+CMake builds both shared and static under Linux.
+
+Everything will then be build in the Build subdirectory containing the libraries in lib and the binaries in bin.
+
+
+There are some additional targets:
+doc: Builds the Documentation
+doc-install: Builds the Documentation and installs it
+
+\note When you link against the static libraries of OpenMesh and get the error "can not be used when making a
+shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)
+
+
+
+
+
+
+
+
+\section sec_compiling_windows Windows
+
+\subsection windows_using_cmake Compiling OpenMesh using CMake
+
+Building OpenMesh on Windows requires cmake to generate the project files for Visual Studio.
+
+
+
+
+- Get Visual Studio ( 2013-2017 )
+- Extract %OpenMesh source code.
+- Get all required libraries and install them ( including headers! ).
+- Download and install cmake: www.cmake.org.
+- Start the cmake gui and open the %OpenMesh toplevel directory as source directory
+- Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder)
+- Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly.
+ Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013) (Depending on your version) as
+ generator.
+- Click generate to create the visual studio project files
+- You can now find a Visual Studio solution file (OpenMesh.sln) in the build directory you chose in cmake
+- Now you can build %OpenMesh from within Visual Studio using the newly created project file.
+
+
+
+
+
+\section sec_compiling_macosx MacOS X
+
+Download and install required libraries as stated above.
+You can download %OpenMesh's sources from www.openmesh.org or check out the latest repository via GIT:
+https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh.
+
+\subsection mac_using_cmake Compiling OpenMesh using CMake
+
+We recommend you to use CMake >= 3.7 as build system. This can also easily be installed
+via MacPorts as well as the Qt >= 5.6 library which is used for some example applications
+in %OpenMesh.
+Once installed, change to %OpenMesh's root directory and create a directory
+named e.g. "buildDebug" (assuming you want to build with debug symbols).
+Then type in the following command to initially set up the build environment:
+
+
+cmake .. ## Generates the appropriate Makefiles
+
+
+Note: If the build directory is not a subdirectory of %OpenMesh's root folder, replace ".." with %OpenMesh's
+absolute (or relative) path.
+In order to manually set specific build variables, just type:
+
+
+ccmake . ## Configure build environment
+
+
+This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build
+for release configuration. Now, when everything is set up, just type:
+
+
+make ## Build %OpenMesh
+
+
+And optionally:
+
+
+make doc ## Build %OpenMesh's documentation
+
+
+The mac application bundle will be found under "Build" in the recently created build folder.
+It automatically contains all needed shared objects (libs, fonts, textures, etc.).
+
+CMake builds both shared and static under MacOS X.
+
+**/
+
+
+//-----------------------------------------------------------------------------
diff --git a/Doc/mainpage.docu b/Doc/mainpage.docu
index ad8fa8e9..75d4663c 100644
--- a/Doc/mainpage.docu
+++ b/Doc/mainpage.docu
@@ -87,14 +87,6 @@ repeatedly replacing each vertex' position by the center of gravity
-\section python_and_om OpenMesh Python interface
-OpenMesh itself is written in C++. We also provide a python interface
-to use OpenMesh. A detailed description of the interface can be found
-in the following tutorial:
-\li \subpage python_tutorial
-
-
-
\subpage additional_information
\li \ref mesh_first_to_read
diff --git a/Doc/misc.docu b/Doc/misc.docu
index 864127ef..73db2d39 100644
--- a/Doc/misc.docu
+++ b/Doc/misc.docu
@@ -27,167 +27,4 @@ The following naming conventions are used for the %OpenMesh code:
**/
-
-//-----------------------------------------------------------------------------
-
-
-/** \page compiling Compiling OpenMesh
-
-\section compilers Tested compilers
-
-%OpenMesh has been successfully tested for the following operating
-systems / compilers. This is only a list of tested compilers. More might be supported but are not tested.
-
-
-
-| Linux |
-gcc 4.6.x
-gcc 4.7.x
-gcc 4.8.x
-gcc 4.9.x
-clang 3.3
-clang 3.4
- |
-
-| Windows |
-Microsoft Visual Studio 2008
-Microsoft Visual Studio 2010
-Microsoft Visual Studio 2012
-Microsoft Visual Studio 2013
-Microsoft Visual Studio 2015
- |
-
-| Tested MacOS X Compilers |
-
-XCode 4.3
-XCode 4.4
-XCode 4.5
-XCode 5.1.1
-Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
- |
-
-
-
-\section req_libs Required libraries (Only for included Apps)
-
-Install the following external libraries / frameworks if you want to use the included Applications:
-
-
-\section build_systems Chosing build system
-
-%OpenMesh can be built using the cmake build system.
-
-
-
-\section sec_compiling_unix Unix
-
-\subsection linux_using_cmake Compiling OpenMesh using CMake
-
-In order to compile %OpenMesh, create a directory named e.g. "build" in
-OpenMesh's root directory. Change to the newly created directory and type
-
-
-cmake .. ## Generates the appropriate Makefiles
-make ## Builds the project
-
-You can choose the build type by using cmake with the flag
--DCMAKE_BUILD_TYPE=(Debug|Release)
-The default is: Debug
-
-Other flags are:
--DBUILD_APPS=OFF to disable build of applications and
--DCMAKE_INSTALL_PREFIX=<path> to specify the install path.
-
-When calling make install cmake will install %OpenMesh into this
-directory using the subdirectories lib/include/bin.
-
-CMake builds both shared and static under Linux.
-
-Everything will then be build in the Build subdirectory containing the libraries in lib and the binaries in bin.
-
-There are some additional targets:
-doc: Builds the Documentation
-doc-install: Builds the Documentation and installs it
-
-\note When you link against the static libraries of OpenMesh and get the error "can not be used when making a
-shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)
-
-\section sec_compiling_windows Windows
-
-\subsection windows_using_cmake Compiling OpenMesh using CMake
-
-If you want to use cmake to build your Visual Studio 2008 solution file,
-download and install CMake from www.cmake.org.
-(Note: This is not mandatory since there are already VS2008 solution files included in %OpenMesh).
-
-- Get Visual Studio ( 2008-2013 )
-- Extract %OpenMesh source code.
-- Get all required libraries and install them ( including headers! ).
-- Get cmake for windows from http://www.cmake.org/cmake/resources/software.html
-- Start the cmake gui and open the %OpenMesh toplevel directory as source directory
-- Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder)
-- Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly.
- Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013) (Depending on your version) as
- generator.
-- Click generate to create the visual studio project files
-- You can now find a Visual Studio solution file (OpenMesh.sln) in the build directory you chose in cmake
-- Now you can build %OpenMesh from within Visual Studio using the newly created project file.
-
-
-Note: Set the CMAKE_BUILD_TYPE variable to "Release" if you want %OpenMesh to be built as release.
-In Visual Studio choose "Release" in the appropriate select box and build the solution afterwards.
-
-
-
-
-\section sec_compiling_macosx MacOS X
-
-Download and install required libraries as stated above.
-You can download %OpenMesh's sources from www.openmesh.org or check out the latest repository via SVN:
-svn co http://www.openmesh.org/svnrepo/OpenMesh/trunk %OpenMesh.
-
-\subsection mac_using_cmake Compiling OpenMesh using CMake
-
-We recommend you to use CMake >= 2.8 as build system. This can also easily be installed
-via MacPorts as well as the Qt >= 4.7 library which is used for some example applications
-in %OpenMesh.
-Once installed, change to %OpenMesh's root directory and create a directory
-named e.g. "buildDebug" (assuming you want to build with debug symbols).
-Then type in the following command to initially set up the build environment:
-
-
-cmake .. ## Generates the appropriate Makefiles
-
-
-Note: If the build directory is not a subdirectory of %OpenMesh's root folder, replace ".." with %OpenMesh's
-absolute (or relative) path.
-In order to manually set specific build variables, just type:
-
-
-ccmake . ## Configure build environment
-
-
-This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build
-for release configuration. Now, when everything is set up, just type:
-
-
-make ## Build %OpenMesh
-
-
-And optionally:
-
-
-make doc ## Build %OpenMesh's documentation
-
-
-The mac application bundle will be found under "Build" in the recently created build folder.
-It automatically contains all needed shared objects (libs, fonts, textures, etc.).
-
-CMake builds both shared and static under MacOS X.
-
-**/
-
-
//-----------------------------------------------------------------------------
diff --git a/Doc/python_tutorial.docu b/Doc/python_tutorial.docu
deleted file mode 100644
index 8649d4f9..00000000
--- a/Doc/python_tutorial.docu
+++ /dev/null
@@ -1,288 +0,0 @@
-/** \page python_tutorial Python Tutorial
-
-This tutorial will introduce the basic concepts behind the %OpenMesh Python
-Bindings. We will cover the following topics:
-
-\li How to build the Python Bindings
-\li How to create an empty mesh
-\li How to add vertices and faces to a mesh
-\li How to navigate on a mesh using iterators and circulators
-\li How to add and remove custom properties
-\li How to read and write meshes from files
-
-In addition, we will briefly discuss some of the differences between the Python
-Bindings and the original C++ implementation of %OpenMesh.
-
-
-
-\section python_build Building the Python Bindings
-
-The Python Bindings depend on the following libraries:
-
-\li Python (2.7 or later)
-\li Boost Python (1.54.0 or later)
-
-\note Make sure that your Boost Python and Python versions match, i.e. that
-Boost Python was linked against the correct Python version.
-
-The Python Bindings are automatically built with %OpenMesh. The generated files are written to the
-Build/python subdirectory of the build tree. For more information on how to build %OpenMesh see
-\ref compiling.
-
-If CMake does not find your Python installation (or finds the wrong one) you can
-explicitly specify an installation by setting the following variables:
-
-\verbatim
-PYTHON_LIBRARY - Path to the python library
-PYTHON_INCLUDE_DIR - Path to where Python.h is found
-\endverbatim
-
-Similarly, if CMake does not find your Boost Python installation, set the
-following variables:
-
-\verbatim
-BOOST_ROOT - Preferred installation prefix
-BOOST_INCLUDEDIR - Preferred include directory e.g. /include
-BOOST_LIBRARYDIR - Preferred library directory e.g. /lib
-\endverbatim
-
-
-
-\section python_start Getting Started
-
-To use the %OpenMesh Python Bindings we first need to import the openmesh module:
-
-\dontinclude python_tutorial.py
-\skipline from
-
-The module provides two mesh classes: One for polygonal meshes (PolyMesh) and
-one for triangle meshes (TriMesh). You should use triangle meshes whenever
-possible, since they are usually more efficient. In addition, some algorithms
-are only implemented for triangle meshes while triangle meshes inherit the full
-functionality of polygonal meshes.
-
-The following code creates a new triangle mesh:
-
-\skipline mesh
-
-
-
-\section python_add Adding Items to a Mesh
-
-We can add a new vertex to the mesh by calling the add_vertex() member function.
-This function gets a coordinate and returns a handle to the newly inserted
-vertex.
-
-\skipline vh0
-\until vh4
-
-To add a new face to the mesh we have to call add_face(). This function gets the
-handles of the vertices that make up the new face and returns a handle to the
-newly inserted face:
-
-\skipline fh0
-\until fh2
-
-We can also use a Python list to add a face to the mesh:
-
-\skipline vh_list
-\until fh3
-
-
-
-\section python_iterators Iterators and Circulators
-
-Now that we have added a couple of vertices to the mesh, we can iterate over
-them and print out their indices:
-
-\skipline for
-\until vh.idx()
-
-We can also iterate over halfedges, edges and faces by calling mesh.halfedges(),
-mesh.edges() and mesh.faces() respectively:
-
-\skipline iterate
-\until fh.idx()
-
-To iterate over the items adjacent to another item we can use one of the
-circulator functions. For example, to iterate over the vertices adjacent to
-another vertex we can call mesh.vv() and pass the handle of the center vertex:
-
-\skipline for
-\until vh.idx()
-
-We can also iterate over the adjacent halfedges, edges and faces:
-
-\skipline iterate
-\until fh.idx()
-
-To iterate over the items adjacent to a face we can use the following functions:
-
-\skipline iterate
-\until fh.idx()
-
-
-
-\section python_props Properties
-
-%OpenMesh allows us to dynamically add custom properties to a mesh. We can add
-properties to vertices, halfedges, edges, faces and the mesh itself. To
-add a property to a mesh (and later access its value) we have to use a property
-handle of the appropriate type:
-
-\li VPropHandle (for vertex properties)
-\li HPropHandle (for halfedge properties)
-\li EPropHandle (for edge properties)
-\li FPropHandle (for face properties)
-\li MPropHandle (for mesh properties)
-
-The following code shows how to add a vertex property to a mesh:
-
-\skipline prop_handle
-\until mesh
-
-The second parameter of the function add_property() is optional. The parameter
-is used to specify a name for the new property. This name can later be used
-to retrieve a handle to the property using the get_property_handle() member
-function.
-
-Now that we have added a vertex property to the mesh we can set and get its
-value. Here we will use the property to store the center of gravity of each
-vertex' neighborhood:
-
-\skipline for
-\until mesh.set_property
-
-Properties use Python's type system. This means that we can use the same
-property to store values of different types (e.g. store both strings and
-integers using the same vertex property). Properties are initialized to the
-Python built-in constant None.
-
-To remove a property we have to call remove_property() with the appropriate
-property handle:
-
-\skipline mesh.remove_property
-
-
-
-\section python_propman Property Managers
-
-Another way to add and remove a property is to use a property manager. A
-Property manager encapsulates a property and manages its lifecycle. A Property
-manager also provides a number of convenience functions to access the enclosed
-property.
-
-There are four different types of property managers. One for each type of mesh
-item:
-
-\li VPropertyManager (for vertex properties)
-\li HPropertyManager (for halfedge properties)
-\li EPropertyManager (for edge properties)
-\li FPropertyManager (for face properties)
-
-Property managers automatically add a new property to a mesh when they are
-initialized. Thus the following code not only creates a new vertex property
-manager, but also adds a new vertex property to the mesh:
-
-\skipline prop_man
-
-Property managers allow us to conveniently set the property value for an entire
-range of mesh items:
-
-\skipline prop_man
-
-They also allow us to use the subscript operator to set and get property values.
-Here we will once again use a property to store the center of gravity of each
-vertex' neighborhood:
-
-\skipline for
-\until prop_man[vh] /= valence
-
-Properties that are encapsulated by a property manager are automatically removed
-from the mesh when the property manager goes out of scope (i.e. the property
-manager is garbage collected).
-
-
-
-\section python_io Read and write meshes from files
-
-You can read and write meshes from files using the read_mesh() and write_mesh()
-functions:
-
-\skipline mesh
-\until write_mesh(mesh, "bunny.obj")
-
-The file type is automatically deduced from the file extension. %OpenMesh
-currently supports four file types: .off, .obj, .stl and .om
-
-The behaviour of the I/O functions can be controlled by passing an instance of
-the Options class to either read_mesh() or write_mesh(). The class controls the
-behaviour of the I/O functions by means of enabled/disabled bits in a bitset:
-
-\skipline mesh
-\until print "something went wrong"
-
-Other available option bits include:
-
--# mode bits - control binary reading/writing
- - Options.Binary
- - Options.MSB
- - Options.LSB
- - Options.Swap (MSB|LSB)
--# property bits - controls which standard properties to read/write
- - Options.VertexNormal
- - Options.VertexTexCoord
- - Options.VertexColor
- - Options.FaceNormal
- - Options.FaceColor
- - Options.ColorAlpha
- - Options.ColorFloat
-
-\note You have to pass an instance of the Options class to the I/O functions,
-i.e. you cannot directly pass one of the option bits. For example, directly
-passing Options.Binary to either one of the functions will cause an error.
-
-When reading a file the options are used as hints, i.e. depending on the format
-we can help the reader to interpret the data correctly.
-
-\note If you want to read a property from a file the property must have been
-requested prior to reading the file.
-
-When writing the mesh the mode bits control whether to use the binary variant of
-the respective file format and the desired byte-ordering.
-
-
-
-\section python_examples Additional Code Examples
-
-You can use our unit tests to learn more about the %OpenMesh Python Bindings.
-They are located in the src/Python/Unittests subdirectory.
-
-
-
-\section python_cpp Python and C++
-
-The interface of the Python Bindings is to a large extent identical to the
-interface of the original C++ implementation of %OpenMesh. You should therefore
-be able to use the C++ documentation as a reference for the Python Bindings. In
-particular, the classes KernelT, PolyMeshT and TriMeshT provide a good overview
-of the available mesh member functions. That being said, there are a number of
-small differences. For example, whenever the C++ implementation returns a
-reference to an object that is managed by %OpenMesh, the Python Bindings will
-return a copy of that object. This is due to the fact that Python does not have
-a language feature that is analogous to C++ references. One example of such a
-function is the point() member function of the PolyMesh and TriMesh classes.
-Unlike its C++ counterpart, the function does not return a reference to the
-requested point. It instead returns a copy of the point. This implies that you
-have to use the set_point() member function to change the value of a point. The
-same applies to the following functions: normal(), color(), property(),
-status(), etc.
-
-
-
-
The complete source looks like this:
-
-\include python_tutorial.py
-
-
-**/
diff --git a/OpenMesh.pro b/OpenMesh.pro
deleted file mode 100644
index f5e14c46..00000000
--- a/OpenMesh.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-contains( OPENFLIPPER , OpenFlipper ){
- include( $$TOPDIR/qmake/all.include )
-} else {
- include( $$TOPDIR/OpenMesh/qmake/all.include )
-}
-
-Subdirs()
-
-addSubdirs( src/OpenMesh/Core )
-addSubdirs( src/OpenMesh/Tools , src/OpenMesh/Core )
-addSubdirs( src/OpenMesh/Apps/commandlineDecimater , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/Decimating/DecimaterGui , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/mconvert , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/QtViewer , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/Smoothing , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/Subdivider/commandlineSubdivider , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider , src/OpenMesh/Core src/OpenMesh/Tools)
-addSubdirs( src/OpenMesh/Apps/Subdivider/SubdividerGui , src/OpenMesh/Core src/OpenMesh/Tools)
diff --git a/README.md b/README.md
index d8a82b67..f3a4d17f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-# OpenMesh, 7.0
+# OpenMesh, 7.2
+
+[](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/commits/master)
## Getting OpenMesh
@@ -10,6 +12,28 @@ https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh.git
The gitlab site can be found here:
https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh
+The python bindings can be found here:
+https://www.graphics.rwth-aachen.de:9000/OpenMesh/openmesh-python
+
+## Download Binaries
+
+### Windows
+
+| Visual Studio Version: | 2017 | 2015 | 2013 |
+| -------- | -------- |-------- |-------- |
+| 64-Bit shared, with apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-shared-apps) |
+| 32-Bit shared, with apps | - | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-shared-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-shared-apps) |
+| 64-Bit static, with apps | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-static-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-static-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-static-apps) |
+| 32-Bit static, with apps | - | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-static-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-static-apps) |
+| 64-Bit shared, no apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-shared-no-apps) |
+| 32-Bit shared, no apps | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-32-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-shared-no-apps) | [Download](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-shared-no-apps) |
+| 64-Bit static, no apps | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-64-bit-static-no-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-64-bit-static-no-apps) | [Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-64-bit-static-no-apps) |
+| 32-Bit static, no apps | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2017-32-bit-static-no-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2015-32-bit-static-no-apps) | [ Download ](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/build-release?job=VS2013-32-bit-static-no-apps) |
+
+## Download Sources
+[ Download Sources](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse/?job=Sources )
+
+
## Installing
Unpack the tar-ball to a suitable place.
diff --git a/VERSION b/VERSION
index 7028d24e..c975e25f 100644
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
-VERSION=7.0
+VERSION=7.2
MAJOR=7
-MINOR=0
+MINOR=2
PATCH=0
ID=OPENMESH
diff --git a/cmake/ACGCommon.cmake b/cmake/ACGCommon.cmake
index c7220b82..2f0ecd2a 100644
--- a/cmake/ACGCommon.cmake
+++ b/cmake/ACGCommon.cmake
@@ -3,10 +3,10 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
endif ()
# prevent build in source directory
-if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
- message (SEND_ERROR "Building in the source directory is not supported.")
- message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} \".")
-endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+ if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+ message (SEND_ERROR "Building in the source directory is not supported.")
+ message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} \".")
+ endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# allow only Debug and Release builds
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "")
@@ -132,7 +132,7 @@ macro (acg_set_target_props target)
#BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
)
- endif(NOT (CMAKE_MAJOR_VERSION LESS 3))
+ endif(NOT (CMAKE_MAJOR_VERSION LESS 3) )
elseif (NOT APPLE)
set_target_properties (
@@ -152,155 +152,6 @@ include (ACGCompiler)
# define INCLUDE_TEMPLATES for everything we build
add_definitions (-DINCLUDE_TEMPLATES)
-#unset cached qt variables which are set by all qt versions. version is the major number of the qt version (e.g. 4 or 5, not 4.8)
-macro (acg_unset_qt_shared_variables version)
- if (ACG_INTERNAL_QT_LAST_VERSION)
- if (NOT ${ACG_INTERNAL_QT_LAST_VERSION} EQUAL ${version})
- unset(QT_BINARY_DIR)
- unset(QT_PLUGINS_DIR)
- unset(ACG_INTERNAL_QT_LAST_VERSION)
- endif()
- endif()
- set (ACG_INTERNAL_QT_LAST_VERSION "${version}" CACHE INTERNAL "Qt Version, which was used on the last time")
-endmacro()
-
-# look for selected qt dependencies
-macro (acg_qt4)
- if (NOT QT4_FOUND)
- acg_unset_qt_shared_variables(4)
- find_package (Qt4 COMPONENTS QtCore QtGui ${ARGN})
-
- set (QT_USE_QTOPENGL 1)
- set (QT_USE_QTNETWORK 1)
- set (QT_USE_QTSCRIPT 1)
- set (QT_USE_QTSQL 1)
- set (QT_USE_QTXML 1)
- set (QT_USE_QTXMLPATTERNS 1)
- set (QT_USE_QTHELP 1)
- set (QT_USE_QTWEBKIT 1)
- set (QT_USE_QTUITOOLS 1)
-
- include (${QT_USE_FILE})
- endif ()
-endmacro ()
-
-macro (acg_qt5)
-
- if(POLICY CMP0020)
- # Automatically link Qt executables to qtmain target on Windows
- cmake_policy(SET CMP0020 NEW)
- endif(POLICY CMP0020)
- #if (NOT QT5_FOUND)
-
- #set (QT_MIN_VERSION ${ARGN})
-
- #try to find qt5 automatically
- #for custom installation of qt5, dont use any of these variables
- set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder")
- if (EXISTS "${QT5_INSTALL_PATH}")
- set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${QT5_INSTALL_PATH}")
- set (QT5_INSTALL_PATH_EXISTS TRUE)
- endif()
-
-
-
- find_package (Qt5Core QUIET)
-
- #find WINDOWS_SDK to avoid qt error. This must be done BEFORE Qt5Widgets is searched
- if (Qt5Core_FOUND AND WIN32)
- string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}")
- string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}")
- string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}")
-
- if ( (QT_VERSION_MAJOR EQUAL 5) AND (QT_VERSION_MINOR LESS 3 OR ( QT_VERSION_MINOR EQUAL 3 AND QT_VERSION_PATCH EQUAL 0 )) ) # for all Qt version > 5.0.0 and < 5.3.1
- #glu32.lib is needed by qt5 opengl version. it cannot find it by itself so we help qt
- #this block has to be executed, before Qt5Gui is searched, otherwise we will end up with the (not so useful) QT5 error message
- set(WINDOWS_SDK_LIBS "COULD_NOT_FOUND" CACHE PATH "Path to the latest windows sdk libs which includes glu32.lib. Used by Qt5.")
- if (EXISTS "${WINDOWS_SDK_LIBS}\\glu32.lib")
- set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${WINDOWS_SDK_LIBS}")
- elseif(QT5_INSTALL_PATH_EXISTS) #trying to install qt5. notify about missing sdk before the qt message comes
- message(FATAL_ERROR "Could not find glu32.lib. This is necessary for QT5 OpenGL version for windows, spleace specify glu32.lib in WINDOWS_SDK_LIB or install Qt version >= 5.3.1")
- endif()
- endif()
- endif(Qt5Core_FOUND AND WIN32)
-
- find_package (Qt5Gui QUIET)
- find_package (Qt5OpenGL QUIET)
-
-
- if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND)
- set (QT5_FOUND TRUE)
- endif()
-
- if (QT5_FOUND)
- acg_unset_qt_shared_variables(5)
-
- #set plugin dir
- list(GET Qt5Gui_PLUGINS 0 _plugin)
- if (_plugin)
- get_target_property(_plugin_full ${_plugin} LOCATION)
- get_filename_component(_plugin_dir ${_plugin_full} PATH)
- set (QT_PLUGINS_DIR "${_plugin_dir}/../" CACHE PATH "Path to the qt plugin directory")
- elseif(QT5_INSTALL_PATH_EXISTS)
- set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins/" CACHE PATH "Path to the qt plugin directory")
- elseif()
- set (QT_PLUGINS_DIR "QT_PLUGIN_DIR_NOT_FOUND" CACHE PATH "Path to the qt plugin directory")
- endif(_plugin)
-
- #set binary dir for fixupbundle
- if(QT5_INSTALL_PATH_EXISTS)
- set(_QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin")
- else()
- get_target_property(_QT_BINARY_DIR ${Qt5Widgets_UIC_EXECUTABLE} LOCATION)
- get_filename_component(_QT_BINARY_DIR ${_QT_BINARY_DIR} PATH)
- endif(QT5_INSTALL_PATH_EXISTS)
-
- set (QT_BINARY_DIR "${_QT_BINARY_DIR}" CACHE PATH "Qt5 binary Directory")
- mark_as_advanced(QT_BINARY_DIR)
-
- set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-
- include_directories(${Qt5Core_INCLUDE_DIRS})
- include_directories(${Qt5Gui_INCLUDE_DIRS})
- include_directories(${Qt5OpenGL_INCLUDE_DIRS})
- add_definitions(${Qt5Core_DEFINITIONS})
- add_definitions(${Qt5Gui_DEFINITIONS})
- add_definitions(${Qt5OpenGL_DEFINITIONS})
-
- if ( NOT MSVC )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
- endif()
-
- set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES}
- ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
-
- if (MSVC)
- set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES})
- endif()
-
- #add_definitions(-DQT_NO_OPENGL)
-
- #adding QT_NO_DEBUG to all release modes.
- # Note: for multi generators like msvc you cannot set this definition depending of
- # the current build type, because it may change in the future inside the ide and not via cmake
- if (MSVC_IDE)
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
-
- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
- set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
-
- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
- else(MSVC_IDE)
- if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- add_definitions(-DQT_NO_DEBUG)
- endif()
- endif(MSVC_IDE)
-
- endif ()
-endmacro ()
-
# unsets the given variable
macro (acg_unset var)
set (${var} "" CACHE INTERNAL "")
@@ -314,14 +165,14 @@ endmacro ()
# test for OpenMP
macro (acg_openmp)
if (NOT OPENMP_NOTFOUND)
- find_package(OpenMP)
- if (OPENMP_FOUND)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
- add_definitions(-DUSE_OPENMP)
+ find_package(OpenMP)
+ if (OPENMP_FOUND)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+ add_definitions(-DUSE_OPENMP)
else ()
set (OPENMP_NOTFOUND 1)
- endif ()
+ endif()
endif ()
endmacro ()
@@ -380,192 +231,11 @@ macro (acg_drop_templates list)
endforeach ()
endmacro ()
-# generate moc targets for sources in list
-macro (acg_qt4_automoc moc_SRCS)
- qt4_get_moc_flags (_moc_INCS)
-
- set (_matching_FILES )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
- # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
- # here. this is required to make bouic work correctly:
- # we need to add generated .cpp files to the sources (to compile them),
- # but we cannot let automoc handle them, as the .cpp files don't exist yet when
- # cmake is run for the very first time on them -> however the .cpp files might
- # exist at a later run. at that time we need to skip them, so that we don't add two
- # different rules for the same moc file
- get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC)
-
- if ( NOT _skip AND EXISTS ${_abs_FILE} )
-
- file (READ ${_abs_FILE} _contents)
-
- get_filename_component (_abs_PATH ${_abs_FILE} PATH)
-
- string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
- if (_match)
- get_filename_component (_basename ${_current_FILE} NAME_WE)
- set (_header ${_abs_FILE})
- set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
-
- add_custom_command (OUTPUT ${_moc}
- COMMAND ${QT_MOC_EXECUTABLE}
- ARGS ${_moc_INCS} ${_header} -o ${_moc}
- DEPENDS ${_header}
- )
-
- add_file_dependencies (${_abs_FILE} ${_moc})
- set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
-
- endif ()
- endif ()
- endforeach ()
-endmacro ()
-
-# generate moc targets for sources in list
-macro (acg_qt5_automoc moc_SRCS)
- qt5_get_moc_flags (_moc_INCS)
-
- list(REMOVE_DUPLICATES _moc_INCS)
-
- set (_matching_FILES )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
- # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
- # here. this is required to make bouic work correctly:
- # we need to add generated .cpp files to the sources (to compile them),
- # but we cannot let automoc handle them, as the .cpp files don't exist yet when
- # cmake is run for the very first time on them -> however the .cpp files might
- # exist at a later run. at that time we need to skip them, so that we don't add two
- # different rules for the same moc file
- get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC)
-
- if ( NOT _skip AND EXISTS ${_abs_FILE} )
-
- file (READ ${_abs_FILE} _contents)
-
- get_filename_component (_abs_PATH ${_abs_FILE} PATH)
-
- string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
- if (_match)
- get_filename_component (_basename ${_current_FILE} NAME_WE)
- set (_header ${_abs_FILE})
- set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
-
- add_custom_command (OUTPUT ${_moc}
- COMMAND ${QT_MOC_EXECUTABLE}
- ARGS ${_moc_INCS} ${_header} -o ${_moc}
- DEPENDS ${_header}
- )
-
- add_file_dependencies (${_abs_FILE} ${_moc})
- set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
-
- endif ()
- endif ()
- endforeach ()
-endmacro ()
-
-# generate uic targets for sources in list
-macro (acg_qt4_autouic uic_SRCS)
-
- set (_matching_FILES )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
-
- if ( EXISTS ${_abs_FILE} )
-
- file (READ ${_abs_FILE} _contents)
-
- get_filename_component (_abs_PATH ${_abs_FILE} PATH)
-
- get_filename_component (_basename ${_current_FILE} NAME_WE)
- string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
- set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
- set (_header ${_basename}.hh)
- set (_source ${_abs_PATH}/${_cbasename}.cc)
-
- add_custom_command (OUTPUT ${_outfile}
- COMMAND ${QT_UIC_EXECUTABLE}
- ARGS -o ${_outfile} ${_abs_FILE}
- DEPENDS ${_abs_FILE})
-
- add_file_dependencies (${_source} ${_outfile})
- set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
-
- endif ()
- endforeach ()
-endmacro ()
-
-# generate uic targets for sources in list
-macro (acg_qt5_autouic uic_SRCS)
-
- set (_matching_FILES )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
-
- if ( EXISTS ${_abs_FILE} )
-
- file (READ ${_abs_FILE} _contents)
-
- get_filename_component (_abs_PATH ${_abs_FILE} PATH)
-
- get_filename_component (_basename ${_current_FILE} NAME_WE)
- string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
- set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
- set (_header ${_basename}.hh)
- set (_source ${_abs_PATH}/${_cbasename}.cc)
-
- add_custom_command (OUTPUT ${_outfile}
- COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
- ARGS -o ${_outfile} ${_abs_FILE}
- MAIN_DEPENDENCY ${_abs_FILE} VERBATIM)
-
- add_file_dependencies (${_source} ${_outfile})
- set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
-
- endif ()
- endforeach ()
-endmacro ()
-
-# generate qrc targets for sources in list
-macro (acg_qt4_autoqrc qrc_SRCS)
-
- set (_matching_FILES )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
-
- if ( EXISTS ${_abs_FILE} )
-
- file (READ ${_abs_FILE} _contents)
-
- get_filename_component (_abs_PATH ${_abs_FILE} PATH)
-
- get_filename_component (_basename ${_current_FILE} NAME_WE)
- set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
-
- add_custom_command (OUTPUT ${_outfile}
- COMMAND ${QT_RCC_EXECUTABLE}
- ARGS -o ${_outfile} ${_abs_FILE}
- DEPENDS ${_abs_FILE})
-
- add_file_dependencies (${_source} ${_outfile})
- set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
-
- endif ()
- endforeach ()
-endmacro ()
-
# get all files in directory, but ignore svn
macro (acg_get_files_in_dir ret dir)
file (GLOB_RECURSE __files RELATIVE "${dir}" "${dir}/*")
foreach (_file ${__files})
- if (NOT _file MATCHES ".*svn.*")
+ if ( (NOT _file MATCHES ".*svn.*") AND (NOT _file MATCHES ".DS_Store") )
list (APPEND ${ret} "${_file}")
endif ()
endforeach ()
@@ -600,7 +270,7 @@ function (acg_add_executable _target)
# set common target properties defined in common.cmake
acg_set_target_props (${_target})
-
+
if (WIN32 OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
@@ -656,7 +326,7 @@ function (acg_add_library _target _libtype)
copy_if_different
$
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$)
- add_custom_command (TARGET ${_target} POST_BUILD
+ add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$
@@ -671,22 +341,22 @@ function (acg_add_library _target _libtype)
$
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/$)
elseif (${_type} STREQUAL STATIC)
- add_custom_command (TARGET ${_target} POST_BUILD
+ add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$)
- endif()
-
-
- # make an extra copy for windows into the binary directory
+ endif()
+
+
+ # make an extra copy for windows into the binary directory
if (${_type} STREQUAL SHARED AND WIN32)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/$)
- endif ()
+ endif ()
endif( (WIN32 AND MSVC) OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
@@ -720,57 +390,3 @@ function (acg_add_library _target _libtype)
endfunction ()
-#generates qt translations
-function (acg_add_translations _target _languages _sources)
-
- string (TOUPPER ${_target} _TARGET)
- # generate/use translation files
- # run with UPDATE_TRANSLATIONS set to on to build qm files
- option (UPDATE_TRANSLATIONS_${_TARGET} "Update source translation *.ts files (WARNING: make clean will delete the source .ts files! Danger!)")
-
- set (_new_ts_files)
- set (_ts_files)
-
- foreach (lang ${_languages})
- if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/translations/${_target}_${lang}.ts" OR UPDATE_TRANSLATIONS_${_TARGET})
- list (APPEND _new_ts_files "translations/${_target}_${lang}.ts")
- else ()
- list (APPEND _ts_files "translations/${_target}_${lang}.ts")
- endif ()
- endforeach ()
-
-
- set (_qm_files)
- if ( _new_ts_files )
- qt4_create_translation(_qm_files ${_sources} ${_new_ts_files})
- endif ()
-
- if ( _ts_files )
- qt4_add_translation(_qm_files2 ${_ts_files})
- list (APPEND _qm_files ${_qm_files2})
- endif ()
-
- # create a target for the translation files ( and object files )
- # Use this target, to update only the translations
- add_custom_target (translations_target_${_target} DEPENDS ${_qm_files})
-
- # Build translations with the application
- add_dependencies(${_target} translations_target_${_target} )
-
- if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations)
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations )
- endif ()
-
- foreach (_qm ${_qm_files})
- get_filename_component (_qm_name "${_qm}" NAME)
- add_custom_command (TARGET translations_target_${_target} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E
- copy_if_different
- ${_qm}
- ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations/${_qm_name})
- endforeach ()
-
- if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
- install (FILES ${_qm_files} DESTINATION "${ACG_PROJECT_DATADIR}/Translations")
- endif ()
-endfunction ()
diff --git a/cmake/ACGQt.cmake b/cmake/ACGQt.cmake
new file mode 100644
index 00000000..60949353
--- /dev/null
+++ b/cmake/ACGQt.cmake
@@ -0,0 +1,396 @@
+#unset cached qt variables which are set by all qt versions. version is the major number of the qt version (e.g. 4 or 5, not 4.8)
+macro (acg_unset_qt_shared_variables version)
+ if (ACG_INTERNAL_QT_LAST_VERSION)
+ if (NOT ${ACG_INTERNAL_QT_LAST_VERSION} EQUAL ${version})
+ unset(QT_BINARY_DIR)
+ unset(QT_PLUGINS_DIR)
+ unset(ACG_INTERNAL_QT_LAST_VERSION)
+ endif()
+ endif()
+ set (ACG_INTERNAL_QT_LAST_VERSION "${version}" CACHE INTERNAL "Qt Version, which was used on the last time")
+endmacro()
+
+macro (acg_qt5)
+
+ if(POLICY CMP0020)
+ # Automatically link Qt executables to qtmain target on Windows
+ cmake_policy(SET CMP0020 NEW)
+ endif(POLICY CMP0020)
+ #if (NOT QT5_FOUND)
+
+ #set (QT_MIN_VERSION ${ARGN})
+
+ #try to find qt5 automatically
+ #for custom installation of qt5, dont use any of these variables
+ set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder")
+
+ if (EXISTS "${QT5_INSTALL_PATH}")
+ set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${QT5_INSTALL_PATH}")
+ set (QT5_INSTALL_PATH_EXISTS TRUE)
+ endif(EXISTS "${QT5_INSTALL_PATH}")
+
+ set(QT5_FINDER_FLAGS "" CACHE STRING "Flags for the Qt finder e.g.
+ NO_DEFAULT_PATH if no system installed Qt shall be found")
+ # compute default search paths
+ set(SUPPORTED_QT_VERSIONS 5.9 5.8 5.7 5.6)
+ foreach (suffix gcc_64 clang_64)
+ foreach(version ${SUPPORTED_QT_VERSIONS})
+ list(APPEND QT_DEFAULT_PATH "~/sw/Qt/${version}/${suffix}")
+ endforeach()
+ endforeach()
+
+ find_package (Qt5Core PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ if(Qt5Core_FOUND)
+
+ if(Qt5Core_VERSION) # use the new version variable if it is set
+ set(Qt5Core_VERSION_STRING ${Qt5Core_VERSION})
+ endif(Qt5Core_VERSION)
+
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}")
+
+ find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Gui QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5OpenGL QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Network QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Sql QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Script QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5ScriptTools QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Xml QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5XmlPatterns QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Help QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5UiTools QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Svg QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5PrintSupport QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5Concurrent QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+
+ #do noot look for Webkit and qt declarative on qt version 5.6 or newer
+ if(${QT_VERSION_MINOR} LESS 6)
+ find_package (Qt5Declarative QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ find_package (Qt5WebKit QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ endif(${QT_VERSION_MINOR} LESS 6)
+
+ if (NOT WIN32 AND NOT APPLE)
+ find_package (Qt5X11Extras QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
+ endif ()
+
+ if(${QT_VERSION_MINOR} GREATER 5)
+ if (Qt5Core_FOUND AND Qt5Widgets_FOUND
+ AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
+ AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
+ AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
+ AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
+ AND Qt5PrintSupport_FOUND)
+ set (QT5_FOUND TRUE)
+ endif()
+ else(${QT_VERSION_MINOR} GREATER 5)
+ if (Qt5Core_FOUND AND Qt5Declarative_FOUND AND Qt5Widgets_FOUND
+ AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
+ AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
+ AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
+ AND Qt5WebKit_FOUND AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
+ AND Qt5PrintSupport_FOUND)
+ set (QT5_FOUND TRUE)
+ endif()
+ endif(${QT_VERSION_MINOR} GREATER 5)
+ endif(Qt5Core_FOUND)
+
+ if (QT5_FOUND)
+ acg_unset_qt_shared_variables(5)
+
+ #set plugin dir
+ list(GET Qt5Gui_PLUGINS 0 _plugin)
+ if (_plugin)
+ get_target_property(_plugin_full ${_plugin} LOCATION)
+ get_filename_component(_plugin_dir ${_plugin_full} PATH)
+ set (QT_PLUGINS_DIR "${_plugin_dir}/../" CACHE PATH "Path to the qt plugin directory")
+ elseif(QT5_INSTALL_PATH_EXISTS)
+ set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins/" CACHE PATH "Path to the qt plugin directory")
+ elseif()
+ set (QT_PLUGINS_DIR "QT_PLUGIN_DIR_NOT_FOUND" CACHE PATH "Path to the qt plugin directory")
+ endif(_plugin)
+
+ #set binary dir for fixupbundle
+ if(QT5_INSTALL_PATH_EXISTS)
+ set(_QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin")
+ else()
+ get_target_property(_QT_BINARY_DIR ${Qt5Widgets_UIC_EXECUTABLE} LOCATION)
+ get_filename_component(_QT_BINARY_DIR ${_QT_BINARY_DIR} PATH)
+ endif(QT5_INSTALL_PATH_EXISTS)
+
+ set (QT_BINARY_DIR "${_QT_BINARY_DIR}" CACHE PATH "Qt5 binary Directory")
+ mark_as_advanced(QT_BINARY_DIR)
+
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+ include_directories(${Qt5Core_INCLUDE_DIRS})
+ include_directories(${Qt5Declarative_INCLUDE_DIRS})
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ include_directories(${Qt5Gui_INCLUDE_DIRS})
+ include_directories(${Qt5OpenGL_INCLUDE_DIRS})
+ include_directories(${Qt5Network_INCLUDE_DIRS})
+ include_directories(${Qt5Script_INCLUDE_DIRS})
+ include_directories(${Qt5ScriptTools_INCLUDE_DIRS})
+ include_directories(${Qt5Sql_INCLUDE_DIRS})
+ include_directories(${Qt5Xml_INCLUDE_DIRS})
+ include_directories(${Qt5XmlPatterns_INCLUDE_DIRS})
+ include_directories(${Qt5Help_INCLUDE_DIRS})
+ include_directories(${Qt5WebKit_INCLUDE_DIRS})
+ include_directories(${Qt5UiTools_INCLUDE_DIRS})
+ include_directories(${Qt5Concurrent_INCLUDE_DIRS})
+ include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
+ add_definitions(${Qt5Core_DEFINITIONS})
+ add_definitions(${Qt5Widgets_DEFINITIONS})
+ add_definitions(${Qt5Gui_DEFINITIONS})
+ add_definitions(${Qt5OpenGL_DEFINITIONS})
+ add_definitions(${Qt5Network_DEFINITIONS})
+ add_definitions(${Qt5Script_DEFINITIONS})
+ add_definitions(${Qt5ScriptTools_DEFINITIONS})
+ add_definitions(${Qt5Sql_DEFINITIONS})
+ add_definitions(${Qt5Xml_DEFINITIONS})
+ add_definitions(${Qt5XmlPatterns_DEFINITIONS})
+ add_definitions(${Qt5Help_DEFINITIONS})
+ add_definitions(${Qt5WebKit_DEFINITIONS})
+ add_definitions(${Qt5UiTools_DEFINITIONS})
+ add_definitions(${Qt5Concurrent_DEFINITIONS})
+ add_definitions(${Qt5PrintSupport_DEFINITIONS})
+
+ if (Qt5X11Extras_FOUND)
+ include_directories(${Qt5X11Extras_INCLUDE_DIRS})
+ add_definitions(${Qt5X11Extras_DEFINITIONS})
+ endif ()
+
+ if ( NOT MSVC )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ endif()
+
+ set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Declarative_LIBRARIES} ${Qt5Widgets_LIBRARIES}
+ ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES}
+ ${Qt5Script_LIBRARIES} ${Qt5ScriptTools_LIBRARIES} ${Qt5Sql_LIBRARIES}
+ ${Qt5Xml_LIBRARIES} ${Qt5XmlPatterns_LIBRARIES} ${Qt5Help_LIBRARIES}
+ ${Qt5WebKit_LIBRARIES} ${Qt5UiTools_LIBRARIES} ${Qt5Concurrent_LIBARIES}
+ ${Qt5PrintSupport_LIBRARIES})
+
+ if (Qt5X11Extras_FOUND)
+ list (APPEND QT_LIBRARIES ${Qt5X11Extras_LIBRARIES})
+ endif ()
+
+ if (MSVC)
+ set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES})
+ endif()
+
+ #add_definitions(-DQT_NO_OPENGL)
+
+ #adding QT_NO_DEBUG to all release modes.
+ # Note: for multi generators like msvc you cannot set this definition depending of
+ # the current build type, because it may change in the future inside the ide and not via cmake
+ if (MSVC_IDE)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+
+ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
+ else(MSVC_IDE)
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_definitions(-DQT_NO_DEBUG)
+ endif()
+ endif(MSVC_IDE)
+
+ endif ()
+endmacro ()
+
+# generate moc targets for sources in list
+macro (acg_qt5_automoc moc_SRCS)
+ qt5_get_moc_flags (_moc_INCS)
+
+ list(REMOVE_DUPLICATES _moc_INCS)
+
+ set (_matching_FILES )
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
+ # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
+ # here. this is required to make bouic work correctly:
+ # we need to add generated .cpp files to the sources (to compile them),
+ # but we cannot let automoc handle them, as the .cpp files don't exist yet when
+ # cmake is run for the very first time on them -> however the .cpp files might
+ # exist at a later run. at that time we need to skip them, so that we don't add two
+ # different rules for the same moc file
+ get_source_file_property (_skip ${_abs_FILE} SKIP_AUTOMOC)
+
+ if ( NOT _skip AND EXISTS ${_abs_FILE} )
+
+ file (READ ${_abs_FILE} _contents)
+
+ get_filename_component (_abs_PATH ${_abs_FILE} PATH)
+
+ string (REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
+ if (_match)
+ get_filename_component (_basename ${_current_FILE} NAME_WE)
+ set (_header ${_abs_FILE})
+ set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
+
+ add_custom_command (OUTPUT ${_moc}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${_moc_INCS} ${_header} -o ${_moc}
+ DEPENDS ${_header}
+ )
+
+ add_file_dependencies (${_abs_FILE} ${_moc})
+ set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
+
+ endif ()
+ endif ()
+ endforeach ()
+endmacro ()
+
+# generate uic targets for sources in list
+macro (acg_qt5_autouic uic_SRCS)
+
+ set (_matching_FILES )
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
+
+ if ( EXISTS ${_abs_FILE} )
+
+ file (READ ${_abs_FILE} _contents)
+
+ get_filename_component (_abs_PATH ${_abs_FILE} PATH)
+
+ get_filename_component (_basename ${_current_FILE} NAME_WE)
+ string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
+ set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
+ set (_header ${_basename}.hh)
+ set (_source ${_abs_PATH}/${_cbasename}.cc)
+
+ add_custom_command (OUTPUT ${_outfile}
+ COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
+ ARGS -o ${_outfile} ${_abs_FILE}
+ MAIN_DEPENDENCY ${_abs_FILE} VERBATIM)
+
+ add_file_dependencies (${_source} ${_outfile})
+ set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
+
+ endif ()
+ endforeach ()
+endmacro ()
+
+# generate qrc targets for sources in list
+macro (acg_qt5_autoqrc qrc_SRCS)
+
+ set (_matching_FILES )
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
+
+ if ( EXISTS ${_abs_FILE} )
+
+ file (READ ${_abs_FILE} _contents)
+
+ get_filename_component (_abs_PATH ${_abs_FILE} PATH)
+
+ get_filename_component (_basename ${_current_FILE} NAME_WE)
+ set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
+
+ qt5_add_resources( ${_outfile} ${_abs_FILE} )
+
+ add_file_dependencies (${_source} ${_outfile})
+ set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
+
+ endif ()
+ endforeach ()
+endmacro ()
+
+
+#generates qt translations
+function (acg_add_translations _target _languages _sources)
+
+ string (TOUPPER ${_target} _TARGET)
+ # generate/use translation files
+ # run with UPDATE_TRANSLATIONS set to on to build qm files
+ option (UPDATE_TRANSLATIONS_${_TARGET} "Update source translation *.ts files (WARNING: make clean will delete the source .ts files! Danger!)")
+
+ set (_new_ts_files)
+ set (_ts_files)
+
+ foreach (lang ${_languages})
+ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/translations/${_target}_${lang}.ts" OR UPDATE_TRANSLATIONS_${_TARGET})
+ list (APPEND _new_ts_files "translations/${_target}_${lang}.ts")
+ else ()
+ list (APPEND _ts_files "translations/${_target}_${lang}.ts")
+ endif ()
+ endforeach ()
+
+
+ set (_qm_files)
+ if ( _new_ts_files )
+ if (QT5_FOUND)
+ #qt5_create_translation(_qm_files ${_sources} ${_new_ts_files})
+ endif ()
+ endif ()
+
+ if ( _ts_files )
+ if (QT5_FOUND)
+ #qt5_add_translation(_qm_files2 ${_ts_files})
+ endif()
+ list (APPEND _qm_files ${_qm_files2})
+ endif ()
+
+ # create a target for the translation files ( and object files )
+ # Use this target, to update only the translations
+ add_custom_target (tr_${_target} DEPENDS ${_qm_files})
+ GROUP_PROJECT( tr_${_target} "Translations")
+
+ # Build translations with the application
+ add_dependencies(${_target} tr_${_target} )
+
+ if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations)
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations )
+ endif ()
+
+ foreach (_qm ${_qm_files})
+ get_filename_component (_qm_name "${_qm}" NAME)
+ add_custom_command (TARGET tr_${_target} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E
+ copy_if_different
+ ${_qm}
+ ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations/${_qm_name})
+ endforeach ()
+
+ if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
+ install (FILES ${_qm_files} DESTINATION "${ACG_PROJECT_DATADIR}/Translations")
+ endif ()
+endfunction ()
+
+# Function that writes all generated qch files into one Help.qhcp project file
+function (generate_qhp_file files_loc plugin_name)
+
+ set(qhp_file "${files_loc}/${plugin_name}.qhp")
+ # Read in template file
+ file(STRINGS "${CMAKE_SOURCE_DIR}/OpenFlipper/Documentation/QtHelpResources/QtHelpProject.qhp" qhp_template)
+
+ # Initialize new project file
+ file(WRITE ${qhp_file} "")
+ foreach (_line ${qhp_template})
+ string(STRIP ${_line} stripped)
+ if("${stripped}" STREQUAL "files")
+ acg_get_files_in_dir (_files ${files_loc})
+ foreach (_file ${_files})
+ string(REGEX MATCH ".+[.]+((html)|(htm)|(xml))$" fileresult ${_file})
+ string(LENGTH "${fileresult}" len)
+ if(${len} GREATER 0)
+ file(APPEND ${qhp_file} "${_file}\n")
+ endif()
+ endforeach()
+ else()
+ string(REGEX REPLACE "plugin" ${plugin} newline ${_line})
+ file(APPEND ${qhp_file} "${newline}\n")
+ endif()
+ endforeach()
+endfunction()
+
diff --git a/cmake/FindGLEW.cmake b/cmake/FindGLEW.cmake
index ff2d6a23..c7151187 100644
--- a/cmake/FindGLEW.cmake
+++ b/cmake/FindGLEW.cmake
@@ -32,6 +32,10 @@ if( WIN32 )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
+ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
+ SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
+ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
+ SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
if( MSVC80 )
@@ -45,7 +49,9 @@ if( WIN32 )
PATHS "${CMAKE_WINDOWS_LIBS_DIR}/glew/include"
"${CMAKE_WINDOWS_LIBS_DIR}/glew-1.6.0/include"
${COMPILER_PATH}/PlatformSDK/Include
- "${VS_SEARCH_PATH}glew-1.10.0/include")
+ "${VS_SEARCH_PATH}glew-2.0.0/include"
+ "${VS_SEARCH_PATH}glew-1.10.0/include"
+ "${VS_SEARCH_PATH}glew-1.13.0/include")
SET( GLEW_NAMES glew32 )
FIND_LIBRARY( GLEW_LIBRARY
@@ -53,7 +59,9 @@ if( WIN32 )
PATHS "${CMAKE_WINDOWS_LIBS_DIR}/glew/lib"
"${CMAKE_WINDOWS_LIBS_DIR}/glew-1.6.0/lib"
${COMPILER_PATH}/PlatformSDK/Lib
- "${VS_SEARCH_PATH}glew-1.10.0/lib" )
+ "${VS_SEARCH_PATH}glew-2.0.0/lib"
+ "${VS_SEARCH_PATH}glew-1.10.0/lib"
+ "${VS_SEARCH_PATH}glew-1.13.0/lib" )
else( WIN32 )
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h GL/wglew.h
diff --git a/cmake/FindGLUT.cmake b/cmake/FindGLUT.cmake
index f3a99dfc..5546069c 100644
--- a/cmake/FindGLUT.cmake
+++ b/cmake/FindGLUT.cmake
@@ -40,6 +40,10 @@ IF (WIN32)
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
+ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
+ SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
+ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
+ SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
@@ -49,7 +53,17 @@ IF (WIN32)
"${VS_SEARCH_PATH}/freeglut-3.0.0/include"
"${VS_SEARCH_PATH}/freeglut-2.8.1/include" )
- FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut32 glut freeglut
+ FIND_LIBRARY( GLUT_release_LIBRARY NAMES glut32 glut freeglut
+ PATHS
+ ${OPENGL_LIBRARY_DIR}
+ ${GLUT_ROOT_PATH}/Release
+ "${CMAKE_WINDOWS_LIBS_DIR}/glut-3.7/lib"
+ "${VS_SEARCH_PATH}/freeglut-3.0.0/lib"
+ "${VS_SEARCH_PATH}/freeglut-2.8.1/lib"
+ )
+ GET_FILENAME_COMPONENT( GLUT_LIBRARY_DIR ${GLUT_release_LIBRARY} PATH )
+
+ FIND_LIBRARY( GLUT_debug_LIBRARY NAMES glut32d glutd freeglutd
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Release
@@ -58,7 +72,7 @@ IF (WIN32)
"${VS_SEARCH_PATH}/freeglut-2.8.1/lib"
)
- GET_FILENAME_COMPONENT( GLUT_LIBRARY_DIR ${GLUT_glut_LIBRARY} PATH )
+ set(GLUT_glut_LIBRARY optimized ${GLUT_release_LIBRARY} debug ${GLUT_debug_LIBRARY} CACHE STRING "Path to the glut libraries")
ELSE (WIN32)
@@ -99,9 +113,12 @@ ENDIF (WIN32)
SET( GLUT_FOUND "NO" )
IF(GLUT_INCLUDE_DIR)
IF(GLUT_glut_LIBRARY)
-
+ # Is -lXi and -lXmu required on all platforms that have it?
+ # If not, we need some way to figure out what platform we are on.
SET( GLUT_LIBRARIES
${GLUT_glut_LIBRARY}
+ ${GLUT_Xmu_LIBRARY}
+ ${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY}
)
SET( GLUT_FOUND "YES" )
diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake
index 6918c7d9..15c22cd6 100644
--- a/cmake/FindGoogleTest.cmake
+++ b/cmake/FindGoogleTest.cmake
@@ -59,7 +59,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
/ACG/acgdev/gcc-x86_64/gtest/lib
/opt/local/lib
/usr/local/lib
- /usr/lib
+ /usr/include
"C:/libs/win32/gtest/lib"
NO_DEFAULT_PATH )
find_library(_GTEST_MAIN_LIBRARY gtest_main
@@ -70,7 +70,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
/ACG/acgdev/gcc-x86_64/gtest/lib
/opt/local/lib
/usr/local/lib
- /usr/lib
+ /usr/include
"C:/libs/win32/gtest/lib"
NO_DEFAULT_PATH )
@@ -84,24 +84,29 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
set(GTEST_INCLUDE_DIRS ${_GTEST_INCLUDE_DIR} CACHE PATH
"Include directories for Google Test framework")
- if ( NOT WIN32 )
+ if ( NOT WIN32 )
set(GTEST_LIBRARIES ${_GTEST_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test framework")
set(GTEST_MAIN_LIBRARIES ${_GTEST_MAIN_LIBRARY} CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
- else()
- set(GTEST_LIBRARIES "optimized;gtest;debug;gtestd" CACHE FILEPATH
+ set(GTEST_MAIN_LIBRARY ${_GTEST_MAIN_LIBRARY} CACHE FILEPATH
+ "Libraries to link for Google Test automatic main() definition")
+ else()
+ set(GTEST_LIBRARIES "optimized;gtest;debug;gtestd" CACHE FILEPATH
"Libraries to link for Google Test framework")
set(GTEST_MAIN_LIBRARIES "optimized;gtest_main;debug;gtest_maind" CACHE FILEPATH
"Libraries to link for Google Test automatic main() definition")
- endif()
+ set(GTEST_MAIN_LIBRARY "optimized;gtest_main;debug;gtest_maind" CACHE FILEPATH
+ "Libraries to link for Google Test automatic main() definition")
+ endif()
- # Macro required to use google test with vs2012
- if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
- add_definitions(-D_VARIADIC_MAX=10)
- endif()
+ # Macro required to use google test with vs2012
+ if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
+ add_definitions(-D_VARIADIC_MAX=10)
+ endif()
-
+ set(GTEST_LIBRARY ${_GTEST_LIBRARY} CACHE FILEPATH
+ "GTest Libraries")
set(GTEST_LIBRARY_DIR ${_GTEST_LIBRARY_DIR} CACHE FILEPATH
"Library dir containing Google Test libraries")
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARIES GTEST_MAIN_LIBRARIES GTEST_LIBRARY_DIR )
diff --git a/cmake/FindOpenMesh.cmake b/cmake/FindOpenMesh.cmake
index 693b1517..19509deb 100644
--- a/cmake/FindOpenMesh.cmake
+++ b/cmake/FindOpenMesh.cmake
@@ -63,6 +63,8 @@ IF (NOT OPENMESH_FOUND)
"${CMAKE_SOURCE_DIR}/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src/OpenMesh"
+ "C:/Program Files/OpenMesh 7.2"
+ "C:/Program Files/OpenMesh 7.1"
"C:/Program Files/OpenMesh 7.0"
"C:/Program Files/OpenMesh 6.3"
"C:/Program Files/OpenMesh 6.2"
@@ -82,6 +84,7 @@ IF (NOT OPENMESH_FOUND)
"C:/Program Files/OpenMesh 2.4.1"
"C:/Program Files/OpenMesh 2.4"
"C:/Program Files/OpenMesh 2.0/include"
+ "C:/libs/OpenMesh 7.1"
"C:/libs/OpenMesh 7.0"
"C:/libs/OpenMesh 6.3"
"C:/libs/OpenMesh 6.2"
diff --git a/qmake/all.include b/qmake/all.include
deleted file mode 100644
index 551272e3..00000000
--- a/qmake/all.include
+++ /dev/null
@@ -1,134 +0,0 @@
-
-################################################################################
-# This is a library
-################################################################################
-
-
-################################################################################
-# Needed Qt packages and build plugin
-################################################################################
-
-CONFIG += qt uitools opengl thread debug_and_release
-
-QT += opengl
-
-################################################################################
-# Add toplevel directory to include path
-# TOPDIR has to be specified in a .qmake.cache file in your projects toplevel
-# directory
-################################################################################
-INCLUDEPATH = $$quote( $$TOPDIR/src )
-DEPENDPATH = $$quote( $${TOPDIR}/src )
-
-################################################################################
-# Define header Extension
-# This will also override the header extension for uic output
-# ( Do not change to += otherwise uic output will end with .h ! )
-################################################################################
-QMAKE_EXT_H = .hh .h
-
-################################################################################
-# Architecture detection
-################################################################################
-include( architecture.include )
-
-################################################################################
-# Helper functions
-################################################################################
-include( functions.include )
-
-################################################################################
-# Custom settings for compiler flags and similar
-################################################################################
-include( compiler.include)
-
-################################################################################
-# Extra target definitions
-################################################################################
-include( targets.include )
-
-################################################################################
-# Global package definitions
-################################################################################
-include( packages/packages.$${SYSTEMTYPE} )
-
-################################################################################
-# Local package definitions
-# These lines will include a file from a .qmake directory inside your home.
-# this file will overwrite existing setting
-################################################################################
-
-unix {
- HOME=$$system(echo ~)
-}
-#else {
- #message( TODO : Define Home in Windows )
-#}
-
-exists( $${HOME}/.qmake/config.$${SYSTEMTYPE} ) {
- include( $${HOME}/.qmake/config.$${SYSTEMTYPE} )
-}
-
-################################################################################
-# Set standard build directories
-# ( Everything generated while compiling will go # into a per architecture
-# directory )
-################################################################################
-OBJECTS_DIR = tmp/$$BUILDDIRECTORY
-MOC_DIR = tmp/$$BUILDDIRECTORY
-UI_DIR = tmp/$$BUILDDIRECTORY
-
-################################################################################
-# type definitions
-################################################################################
-
-defineTest(Library) {
- unix{
- TEMPLATE = lib
- contains( OPERATING_SYSTEM, Darwin) {
- CONFIG -= static
- export(CONFIG)
- }
- }
- win32 {
- TEMPLATE = vclib
- }
- export(TEMPLATE)
- DESTDIR = lib/$$BUILDDIRECTORY
- export(DESTDIR)
- defineTargets()
- UI_DIR = include
- export(UI_DIR)
-}
-
-defineTest(Application) {
- unix {
- TEMPLATE = app
- }
- win32 {
- TEMPLATE = vcapp
- }
- macx {
- CONFIG -= app_bundle
- export( CONFIG )
- }
- export(TEMPLATE)
- DESTDIR = $$BUILDDIRECTORY
- export(DESTDIR)
- defineTargets()
-}
-
-
-defineTest(Subdirs) {
- unix {
- TEMPLATE = subdirs
- }
- win32 {
- TEMPLATE = vcsubdirs
- }
- export(TEMPLATE)
- CONFIG += ordered
- export(CONFIG)
- defineTargets()
-}
-
diff --git a/qmake/architecture.include b/qmake/architecture.include
deleted file mode 100644
index 369ff027..00000000
--- a/qmake/architecture.include
+++ /dev/null
@@ -1,87 +0,0 @@
-
-################################################################################
-# Architecture detection
-# The following Variables are defined by this include:
-# OPERATING_SYSTEM : Debian / Fedora / Windows
-# ARCHITECTURE : 32 / 64
-# MODE : Debug / Release
-# BUILDDIRECTORY : Concat of all above variables sesparated by underscores e.g. Debian_64_debug
-################################################################################
-
-unix {
-
- OPERATING_SYSTEM = UNKNOWN_OS
-
- exists( /etc/lsb-release ) {
- OPERATING_SYSTEM = Ubuntu
- }
-
-
- exists( /etc/debian_version ) | exists( /etc/debian_release ) {
- OPERATING_SYSTEM = Debian
- }
-
- exists( /etc/fedora-release ) {
- OPERATING_SYSTEM = Fedora
- }
-
- exists( /etc/gentoo-release ) {
- OPERATING_SYSTEM = Gentoo
- }
-
- exists( /etc/lfs-release ) {
- OPERATING_SYSTEM = Linux_From_Scratch
- }
-
- exists( /etc/mandrake-release ) | exists( /etc/mandrakelinux-release ) {
- OPERATING_SYSTEM = Mandrake
- }
-
- exists( /etc/mandriva-release ) {
- OPERATING_SYSTEM = Mandriva
- }
-
- exists( /etc/redhat-release ) | exists( /etc/redhat_version ) {
- OPERATING_SYSTEM = Redhat
- }
-
- exists( /etc/SuSE-release ) | exists( /etc/novell-release ) {
- OPERATING_SYSTEM = SuSE
- }
-
- TEST_DARWIN = $$system(uname -s)
- contains( TEST_DARWIN, Darwin) {
- OPERATING_SYSTEM = Darwin
- DEFINES += ARCH_DARWIN
- export(DEFINES)
- }
-
- HARDWARE_PLATFORM = $$system(uname -a)
- contains( HARDWARE_PLATFORM, x86_64 ) {
- # 64-bit Linux
- ARCHITECTURE = 64
- } else {
- # 32-bit Linux
- ARCHITECTURE = 32
- }
-
- contains(TEST_DARWIN, Darwin) {
- SYSTEMTYPE = Darwin
- } else {
- SYSTEMTYPE = Linux
- }
-}
-
-win32 {
- OPERATING_SYSTEM = Windows
- ARCHITECTURE = 32
- SYSTEMTYPE = Windows
-}
-
-CONFIG( debug, debug|release ){
- MODE = Debug
-} else {
- MODE = Release
-}
-
-BUILDDIRECTORY = $${OPERATING_SYSTEM}_$${ARCHITECTURE}_$${MODE}
diff --git a/qmake/compiler.include b/qmake/compiler.include
deleted file mode 100644
index 88a4b8be..00000000
--- a/qmake/compiler.include
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Custom settings for compiler flags and similar
-################################################################################
-
-unix {
- QMAKE_CC = gcc-4.3
- QMAKE_CXX = g++-4.3
- macx {
- QMAKE_CC = gcc-4.0
- QMAKE_CXX = g++-4.0
- }
-
- QMAKE_CFLAGS_RELEASE = -O3 -DINCLUDE_TEMPLATES -W -Wall -Wno-unused -DNDEBUG
- QMAKE_CXXFLAGS_RELEASE = -O3 -DINCLUDE_TEMPLATES -ftemplate-depth-100 -W -Wall -Wno-unused -DNDEBUG
- QMAKE_CFLAGS_DEBUG = -g -DINCLUDE_TEMPLATES -W -Wall -Wno-unused -DDEBUG
- QMAKE_CXXFLAGS_DEBUG = -g -DINCLUDE_TEMPLATES -ftemplate-depth-100 -W -Wall -Wno-unused -DDEBUG
-}
-
diff --git a/qmake/functions.include b/qmake/functions.include
deleted file mode 100644
index 5e5771c6..00000000
--- a/qmake/functions.include
+++ /dev/null
@@ -1,76 +0,0 @@
-
-################################################################################
-# functions collecting all headers in the directory
-################################################################################
-
-# getFilesFromDir( directory, pattern )
-# returns a list of all files matching pattern in directory
-defineReplace(getFilesFromDir) {
- dirs = $$1
- pattern = $$2
-
- files =
-
- for(dir, dirs) {
- found = $$files( $${dir}/$${pattern} )
- files += $$found
- }
-
- return( $$files )
-}
-
-# addSubdirs(subdirs,deps): Adds directories to the project that depend on
-# other directories
-defineTest( addSubdirs ) {
- for(subdirs, 1) {
- entries = $$files($$subdirs)
- for(entry, entries) {
- name = $$replace(entry, [/\\\\], _)
- name = $$replace(name, - , _)
- SUBDIRS += $$name
- eval ($${name}.subdir = $$entry)
- for(dep, 2): {
- tempval = $$replace(dep, [/\\\\], _)
- eval ($${name}.depends += $$replace(tempval, - , _) )
- }
- export ($${name}.subdir)
- export ($${name}.depends)
- }
- }
- export (SUBDIRS)
-}
-
-# given a list of paths and a libname this function checks if the lib is there
-# adds the path and returns true if found otherwise false
-defineTest( addLib ) {
- dirs = $$1
- name = $$2
-
- # check for the library
- for(dir , dirs) {
- check = $${dir}/lib$${name}.so
-
- # Found, so use it
- exists( $$check ) {
- LIBS *= -L$${dir} -l$$name
- export(LIBS)
- return(true)
- }
- }
-
- return(false)
-}
-
-
-defineReplace( getCurrentDir ) {
- DIR = ''
- unix {
- DIR = $$system( pwd )
- }
-
- win32 {
- DIR = $$system( cd )
- }
-
- return( $$DIR )
-}
diff --git a/qmake/packages/packages.Darwin b/qmake/packages/packages.Darwin
deleted file mode 100644
index 874f67af..00000000
--- a/qmake/packages/packages.Darwin
+++ /dev/null
@@ -1,38 +0,0 @@
-
-################################################################################
-# INCLUDE Packages
-################################################################################
-
-defineTest( qt ) {
- QT += opengl network script sql
- export(QT)
-}
-
-defineTest( glew ) {
- INCLUDEPATH *= /sw/include/GL
- export(INCLUDEPATH)
- LIBS *= -L/opt/local/lib/ -lGLEW
- export(LIBS)
-}
-
-defineTest( glut ) {
- INCLUDEPATH *= /System/Library/Frameworks/GLUT.framework/Headers
- export(INCLUDEPATH)
- LIBS *= -framework GLUT
- export(LIBS)
-}
-
-defineTest( openmesh ) {
- QMAKE_LIBDIR += $${TOPDIR}/lib
- QMAKE_LIBDIR += $${TOPDIR}/lib
-
- CONFIG( debug, debug|release ){
- LIBS += -lOpenMeshToolsd
- LIBS += -lOpenMeshCored
- } else {
- LIBS += -lOpenMeshTools
- LIBS += -lOpenMeshCore
- }
- export(QMAKE_LIBDIR)
- export(LIBS)
-}
diff --git a/qmake/packages/packages.Linux b/qmake/packages/packages.Linux
deleted file mode 100644
index a71bf22f..00000000
--- a/qmake/packages/packages.Linux
+++ /dev/null
@@ -1,71 +0,0 @@
-
-################################################################################
-# INCLUDE Packages
-################################################################################
-
-defineTest( qt ) {
- CONFIG *= uitools
- export(CONFIG)
- QT += opengl network script sql
- export(QT)
-}
-
-defineTest( qwt ) {
- INCLUDEPATH *= /usr/include/qwt-qt4/
- export(INCLUDEPATH)
- LIBS *= -L/usr/lib/ -lqwt-qt4
- export(LIBS)
-}
-
-defineTest( glew ) {
- INCLUDEPATH *= /usr/include/GL
- export(INCLUDEPATH)
- LIBS *= -L/usr/lib -lGLEW
- export(LIBS)
-}
-
-defineTest( glut ) {
- INCLUDEPATH *=$${ACG}/OpenGL/include
- export(INCLUDEPATH)
- LIBS *= -L/usr/X11R6/lib -lglut
- export(LIBS)
-}
-
-defineTest( openmesh ) {
- QMAKE_LIBDIR += $${TOPDIR}/lib/
- QMAKE_LIBDIR += $${TOPDIR}/lib/
-
- CONFIG( debug, debug|release ){
- LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCored
- LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshToolsd
- } else {
- LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCore
- LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshTools
- }
-
- export(QMAKE_LIBDIR)
- export(LIBS)
-}
-
-defineTest( openmp ) {
-
- addLib( /usr/lib/gcc/x86_64-linux-gnu/4.3 /usr/lib, gomp ) {
-
- QMAKE_CXXFLAGS_RELEASE += -fopenmp
- QMAKE_CXXFLAGS_DEBUG += -fopenmp
- QMAKE_CFLAGS_RELEASE += -fopenmp
- QMAKE_CFLAGS_DEBUG += -fopenmp
- QMAKE_LFLAGS_DEBUG += -fopenmp
- QMAKE_LFLAGS_RELEASE += -fopenmp
-
- export(QMAKE_CXXFLAGS_RELEASE)
- export(QMAKE_CFLAGS_RELEASE)
- export(QMAKE_CXXFLAGS_DEBUG)
- export(QMAKE_CFLAGS_DEBUG)
- export(QMAKE_LFLAGS_DEBUG)
- export(QMAKE_LFLAGS_RELEASE)
- } else {
- message("Unable to find OpenMP lib for linking. OpenMP support will be disabled!!")
- }
-
-}
diff --git a/qmake/packages/packages.Windows b/qmake/packages/packages.Windows
deleted file mode 100644
index a397be34..00000000
--- a/qmake/packages/packages.Windows
+++ /dev/null
@@ -1,77 +0,0 @@
-
-################################################################################
-# INCLUDE Packages
-################################################################################
-
-
-defineTest( glew ) {
-
- #######################################
- ## Enter here the correct path to GLEW
- #######################################
-
- GLEW_PATH = c:\libs\glew
-
- #######################################
-
- !exists ( $${GLEW_PATH} ) {
- error (ERROR: GLEW not found or wrong path entry in OpenMesh\qmake\packages\packages.Windows! Please adjust it to your path!)
- }
- INCLUDEPATH *= $${GLEW_PATH}\include
- export(INCLUDEPATH)
- LIBS *= -L$${GLEW_PATH}\lib -lglew32
- export(LIBS)
-}
-
-defineTest( qt ) {
- CONFIG *= uitools
- export(CONFIG)
- QT += opengl network script sql
- export(QT)
-}
-
-defineTest( glut ) {
-
- #######################################
- ## Enter here the correct path to GLUT
- #######################################
-
- GLUT_PATH = c:\libs\glut-3.7
-
- ########################################
-
- !exists ( $${GLUT_PATH} ) {
- error (ERROR: GLUT not found or wrong path entry in OpenMesh\qmake\packages\packages.Windows! Please adjust it to your path!)
- }
- INCLUDEPATH *= $${GLUT_PATH}\include
- export(INCLUDEPATH)
- LIBS *= -L$${GLUT_PATH}\lib -lglut32
- export(LIBS)
-}
-
-defineTest( openmp ) {
- QMAKE_CXXFLAGS_DEBUG += /openmp
- QMAKE_CXXFLAGS_RELEASE += /openmp
- export(QMAKE_CXXFLAGS_DEBUG)
- export(QMAKE_CXXFLAGS_RELEASE)
-}
-
-defineTest( openmesh ) {
- DEFINES += _USE_MATH_DEFINES NOMINMAX
-
- QMAKE_LIBDIR += $${TOPDIR}/lib/
- QMAKE_LIBDIR += $${TOPDIR}/lib/
-
- CONFIG( debug, debug|release ){
- LIBS+= -L$${TOPDIR}/lib -lOpenMeshCored
- LIBS+= -L$${TOPDIR}/lib -lOpenMeshToolsd
- } else {
- LIBS+= -L$${TOPDIR}/lib -lOpenMeshCore
- LIBS+= -L$${TOPDIR}/lib -lOpenMeshTools
- }
-
- export(DEFINES)
- export(QMAKE_LIBDIR)
- export(LIBS)
-}
-
diff --git a/qmake/targets.include b/qmake/targets.include
deleted file mode 100644
index 57da389c..00000000
--- a/qmake/targets.include
+++ /dev/null
@@ -1,126 +0,0 @@
-################################################################################
-# Custom targets
-################################################################################
-
-defineTest( defineTargets ) {
-
- # internal target ... Use allclean instead!
- # cleanDirs target called by subAllclean.
- # removes all lib tmp and Builddirectories created by these qmake scripts
- !contains( QMAKE_EXTRA_TARGETS , cleanDirs) {
- # Remove temp dirs when doing allclean
- cleanDirs.target = cleanDirs
- cleanDirs.commands = rm -rf tmp
-
- contains( TEMPLATE, app ) {
- cleanDirs.commands += ; rm -rf $${BUILDDIRECTORY}
- }
-
-
- contains( TEMPLATE, lib ) {
- cleanDirs.commands += ; rm -rf lib
- }
-
- export(cleanDirs.target)
- export(cleanDirs.commands)
- export(cleanDirs.depends)
- export(cleanDirs.CONFIG)
-
- QMAKE_EXTRA_TARGETS += cleanDirs
- export(QMAKE_EXTRA_TARGETS)
- }
-
- # internal target ... Use allclean instead!
- # main local subAllclean target called by allclean (see below)
- # this one calls
- # 1. clean to remove temporary files created
- # 2. cleanDirs to remove all tmp and lib directories created by qmake
- # 3. distclean to remove the rest
- !contains( QMAKE_EXTRA_TARGETS , subAllclean) {
- # Remove temp dirs when doing allclean
- subAllclean.target = subAllclean
- subAllclean.depends = clean cleanDirs distclean
-
- export(subAllclean.target)
- export(subAllclean.depends)
-
- QMAKE_EXTRA_TARGETS += subAllclean
- export(QMAKE_EXTRA_TARGETS)
- }
-
-
- # basic allclean target, will cleate a recursive target calling subAllclean in the subdirectories makefiles
- !contains( QMAKE_EXTRA_TARGETS , allclean) {
- allclean.target = allclean
- allclean.CONFIG = recursive
- allclean.recurse_target = subAllclean
-
- export(allclean.target)
- export(allclean.CONFIG)
- export(allclean.recurse_target)
-
- QMAKE_EXTRA_TARGETS += allclean
- export(QMAKE_EXTRA_TARGETS)
- }
-
- !contains( QMAKE_EXTRA_TARGETS , plugindoc ) {
- exists ( Documentation ) {
- plugindoc.target = plugindoc
- PLUGINNAME = $$getCurrentDir()
- PLUGINNAME = $$section( PLUGINNAME, "/" ,-1, -1)
-
- unix {
- plugindoc.commands += rm -rf $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- plugindoc.commands += mkdir $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- plugindoc.commands += cp Documentation/*.html $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- exists ( Documentation/pics ) {
- plugindoc.commands += cp -r Documentation/pics $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- }
- }
-
- win32 {
- message(Documentaion copy not supported on windows platform)
- #plugindoc.commands += rmdir /s $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- #plugindoc.commands += mkdir $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- #plugindoc.commands += xcopy /f Documentation/*.html $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- #exists ( Documentation/pics ) {
- # plugindoc.commands += xcopy /f /s Documentation/pics $${TOPDIR}/OpenFlipper/Docs/User/$$PLUGINNAME ;
- #}
- }
-
- export(plugindoc.target)
- export(plugindoc.commands)
- export(plugindoc.depends)
-
- QMAKE_EXTRA_TARGETS += plugindoc
- export(QMAKE_EXTRA_TARGETS)
- }
- }
-
-
-}
-
-# target for libraries
-# this target will copy all headers to an include subdirectory
-# You have to call this after you defined evertything else for your library.
-# Otherwise this target doesnt know about the required headers.
-
-defineTest( installs ) {
-
- !contains( INSTALLS , includes ) {
- contains( TEMPLATE, lib ) {
-
- includes.path = include/
- includes.extra = cp -f --parents $${HEADERS} include/
-
- export(includes.path)
- export(includes.extra)
-
- INSTALLS *= includes
- export(INSTALLS)
- }
- }
-}
-
-
-
diff --git a/src/OpenMesh/Apps/Decimating/CmdOption.hh b/src/OpenMesh/Apps/Decimating/CmdOption.hh
index 7a0d19b0..bbab79f4 100644
--- a/src/OpenMesh/Apps/Decimating/CmdOption.hh
+++ b/src/OpenMesh/Apps/Decimating/CmdOption.hh
@@ -56,7 +56,7 @@ public:
typedef T value_type;
- CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
+ explicit CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
CmdOption() : val_(T()),valid_(false), enabled_(false) { }
// has been set and has a value
diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/DecimaterGui.pro b/src/OpenMesh/Apps/Decimating/DecimaterGui/DecimaterGui.pro
deleted file mode 100644
index 68862d4b..00000000
--- a/src/OpenMesh/Apps/Decimating/DecimaterGui/DecimaterGui.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-Application()
-
-INCLUDEPATH += ../../..
-
-Application()
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = ../../QtViewer ../
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../DecimaterViewerWidget.cc
-SOURCES += ../decimaterviewer.cc
-
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
index c3caec9a..bb908a61 100644
--- a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
+++ b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
@@ -123,7 +123,7 @@ public:
/// default constructor
- DecimaterViewerWidget(QWidget* _parent=0)
+ explicit DecimaterViewerWidget(QWidget* _parent=0)
: MeshViewerWidget(_parent),
animate_(false),
timer_(0),
diff --git a/src/OpenMesh/Apps/Decimating/commandlineDecimater/commandlineDecimater.pro b/src/OpenMesh/Apps/Decimating/commandlineDecimater/commandlineDecimater.pro
deleted file mode 100644
index bf863090..00000000
--- a/src/OpenMesh/Apps/Decimating/commandlineDecimater/commandlineDecimater.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = ..
-
-# Input
-SOURCES += ../decimater.cc
-
-################################################################################
diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh
index 6addb705..7c8c1cd4 100644
--- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh
+++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.hh
@@ -82,7 +82,7 @@ class MeshViewerWidget : public MeshViewerWidgetT
Q_OBJECT
public:
/// default constructor
- MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT(parent)
+ explicit MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT(parent)
{}
OpenMesh::IO::Options& options() { return _options; }
const OpenMesh::IO::Options& options() const { return _options; }
diff --git a/src/OpenMesh/Apps/QtViewer/QtViewer.pro b/src/OpenMesh/Apps/QtViewer/QtViewer.pro
deleted file mode 100644
index 42fd4ecc..00000000
--- a/src/OpenMesh/Apps/QtViewer/QtViewer.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-Application()
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Smoothing/Smoothing.pro b/src/OpenMesh/Apps/Smoothing/Smoothing.pro
deleted file mode 100644
index d6400e88..00000000
--- a/src/OpenMesh/Apps/Smoothing/Smoothing.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/SubdividerGui.pro b/src/OpenMesh/Apps/Subdivider/SubdividerGui/SubdividerGui.pro
deleted file mode 100644
index 27d05e10..00000000
--- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/SubdividerGui.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = .. ../../QtViewer
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../SubdivideWidget.cc
-SOURCES += ../qtsubdivider.cc
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/commandlineAdaptiveSubdivider.pro b/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/commandlineAdaptiveSubdivider.pro
deleted file mode 100644
index 88bae140..00000000
--- a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/commandlineAdaptiveSubdivider.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-# Input
-SOURCES += ../adaptive_subdivider.cc
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/commandlineSubdivider.pro b/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/commandlineSubdivider.pro
deleted file mode 100644
index f4d941f7..00000000
--- a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/commandlineSubdivider.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-# Input
-SOURCES += ../subdivider.cc
-
-################################################################################
diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc
index 7ce0864b..c328a872 100644
--- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc
+++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc
@@ -139,17 +139,15 @@ void VDPMClientViewerWidget::mesh_coloring()
vEnd(mesh_.vertices_end());
VHierarchyNodeHandle node_handle;
- float ratio;
- unsigned char r, g, b;
for (; vIt!=vEnd; ++vIt)
{
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
- ratio = vhierarchy_.node(node_handle).ratio();
+ const float ratio = vhierarchy_.node(node_handle).ratio();
- r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
- g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
- b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
+ const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
+ const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
+ const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
}
diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh
index 7f05ac66..68804485 100644
--- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh
+++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh
@@ -77,7 +77,7 @@ private:
public:
- ServerSideVDPM() { clear(); }
+ ServerSideVDPM() :name_(""),tree_id_bits_(0) { clear(); }
void clear();
const char* name() const { return name_; }
diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc
index 29439336..0503f456 100644
--- a/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc
+++ b/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc
@@ -138,17 +138,15 @@ void VDPMClientViewerWidget::mesh_coloring()
vEnd(mesh_.vertices_end());
VHierarchyNodeHandle node_handle;
- float ratio;
- unsigned char r, g, b;
for (; vIt!=vEnd; ++vIt)
{
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
- ratio = vhierarchy_.node(node_handle).ratio();
+ const float ratio = vhierarchy_.node(node_handle).ratio();
- r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
- g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
- b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
+ const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
+ const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
+ const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
}
diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh b/src/OpenMesh/Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh
index 5f2b66e5..f20bda74 100644
--- a/src/OpenMesh/Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh
+++ b/src/OpenMesh/Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh
@@ -76,7 +76,7 @@ private:
public:
- ServerSideVDPM() { clear(); }
+ ServerSideVDPM(): name_(""),tree_id_bits_(0) { clear(); }
void clear();
const char* name() const { return name_; }
diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/Analyzer.pro b/src/OpenMesh/Apps/VDProgMesh/Analyzer/Analyzer.pro
deleted file mode 100644
index b93a0cbb..00000000
--- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/Analyzer.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../../..
-
-CONFIG += glew glut
-
-Application()
-
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
-LIBS += -lglut
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/Synthesizer.pro b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/Synthesizer.pro
deleted file mode 100644
index dad78ae1..00000000
--- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/Synthesizer.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../../..
-
-CONFIG += glew glut
-
-Application()
-
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
-LIBS += -lglut
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
-
-DIRECTORIES = . ../../QtViewer
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-SOURCES -= ../../QtViewer/meshviewer.cc
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
index 6fa32743..a73a672b 100644
--- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
+++ b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
@@ -89,7 +89,7 @@ public:
public:
/// Constructor
- ModBalancerT( D &_dec )
+ explicit ModBalancerT( D &_dec )
: BaseModQ( _dec ),
max_level_(0), n_roots_(0), n_vertices_(0)
{
diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.pro b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.pro
deleted file mode 100644
index b93a0cbb..00000000
--- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../../..
-
-CONFIG += glew glut
-
-Application()
-
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
-LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
-LIBS += -lglut
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
-QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Apps/mconvert/mconvert.pro b/src/OpenMesh/Apps/mconvert/mconvert.pro
deleted file mode 100644
index 69592799..00000000
--- a/src/OpenMesh/Apps/mconvert/mconvert.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-Application()
-
-INCLUDEPATH += ../../..
-
-glew()
-glut()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Core/Core.pro b/src/OpenMesh/Core/Core.pro
deleted file mode 100644
index e7101ba3..00000000
--- a/src/OpenMesh/Core/Core.pro
+++ /dev/null
@@ -1,43 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-Library()
-
-contains( OPENFLIPPER , OpenFlipper ){
- DESTDIR = $${TOPDIR}/OpenMesh/lib
-} else {
- DESTDIR = $${TOPDIR}/lib
-}
-
-
-DIRECTORIES = . Geometry IO IO/exporter IO/importer IO/reader IO/writer \
- Mesh Mesh/gen System Utils
-
-INCLUDEPATH += ../..
-
-CONFIG( debug, debug|release ){
- TARGET = OpenMeshCored
-} else {
- TARGET = OpenMeshCore
-}
-
-win32 {
- DEFINES += _USE_MATH_DEFINES NOMINMAX
- CONFIG += static
-}
-
-macx {
- # Set library binary header to the correct path
- QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${DESTDIR}/
- export(QMAKE_LFLAGS_SONAME)
-}
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Core/Geometry/Vector11T.hh b/src/OpenMesh/Core/Geometry/Vector11T.hh
index c9d918ba..b9113a6a 100644
--- a/src/OpenMesh/Core/Geometry/Vector11T.hh
+++ b/src/OpenMesh/Core/Geometry/Vector11T.hh
@@ -718,6 +718,47 @@ noexcept(noexcept(_v1.swap(_v2))) {
_v1.swap(_v2);
}
+/// \relates OpenMesh::VectorT
+/// non-member norm
+template
+Scalar norm(const VectorT& _v) {
+ return _v.norm();
+}
+
+/// \relates OpenMesh::VectorT
+/// non-member sqrnorm
+template
+Scalar sqrnorm(const VectorT& _v) {
+ return _v.sqrnorm();
+}
+/// \relates OpenMesh::VectorT
+/// non-member vectorize
+template
+VectorT& vectorize(VectorT& _v, OtherScalar const& _val) {
+ return _v.vectorize(_val);
+}
+
+/// \relates OpenMesh::VectorT
+/// non-member normalize
+template
+VectorT& normalize(VectorT& _v) {
+ return _v.normalize();
+}
+
+/// \relates OpenMesh::VectorT
+/// non-member maximize
+template
+VectorT& maximize(VectorT& _v1, VectorT& _v2) {
+ return _v1.maximize(_v2);
+}
+
+/// \relates OpenMesh::VectorT
+/// non-member minimize
+template
+VectorT& minimize(VectorT& _v1, VectorT& _v2) {
+ return _v1.minimize(_v2);
+}
+
//== TYPEDEFS =================================================================
/** 1-byte signed vector */
diff --git a/src/OpenMesh/Core/Geometry/VectorT.hh b/src/OpenMesh/Core/Geometry/VectorT.hh
index d8c8f2b1..3384332a 100644
--- a/src/OpenMesh/Core/Geometry/VectorT.hh
+++ b/src/OpenMesh/Core/Geometry/VectorT.hh
@@ -274,6 +274,52 @@ cross(const VectorT& _v1, const VectorT& _v2) {
}
+/// \relates OpenMesh::VectorT
+/// non-member norm
+template
+Scalar norm(const VectorT& _v) {
+ return _v.norm();
+}
+
+
+/// \relates OpenMesh::VectorT
+/// non-member sqrnorm
+template
+Scalar sqrnorm(const VectorT& _v) {
+ return _v.sqrnorm();
+}
+
+
+/// \relates OpenMesh::VectorT
+/// non-member vectorize
+template
+VectorT& vectorize(VectorT& _v, OtherScalar const& _val) {
+ return _v.vectorize(_val);
+}
+
+
+/// \relates OpenMesh::VectorT
+/// non-member normalize
+template
+VectorT& normalize(VectorT& _v) {
+ return _v.normalize();
+}
+
+
+/// \relates OpenMesh::VectorT
+/// non-member maximize
+template
+VectorT& maximize(VectorT& _v1, VectorT& _v2) {
+ return _v1.maximize(_v2);
+}
+
+
+/// \relates OpenMesh::VectorT
+/// non-member minimize
+template
+VectorT& minimize(VectorT& _v1, VectorT& _v2) {
+ return _v1.minimize(_v2);
+}
//== TYPEDEFS =================================================================
diff --git a/src/OpenMesh/Core/IO/MeshIO.hh b/src/OpenMesh/Core/IO/MeshIO.hh
index f63acbf1..49b6f640 100644
--- a/src/OpenMesh/Core/IO/MeshIO.hh
+++ b/src/OpenMesh/Core/IO/MeshIO.hh
@@ -55,11 +55,24 @@
// -------------------- system settings
#include
+
// -------------------- check include order
#if defined (OPENMESH_TRIMESH_ARRAY_KERNEL_HH) || \
defined (OPENMESH_POLYMESH_ARRAY_KERNEL_HH)
-# error "Include MeshIO.hh before including a mesh type!"
+
+ // Issue warning if MeshIO was not included before Mesh Type
+ // Nobody knows why this order was enforced.
+ // If somebody encounters an error resulting from a wrong order, please report it to the OpenMesh developers.
+ // If we don't here about any errors, this check will be removed
+ // @TODO: Remove after reasonable time
+ #ifdef WIN32
+ #pragma message("MeshIO.hh was included after Mesh Type. You may ignore this warning. Please report errors resulting ifrom this order to the developers!")
+ #else
+ #warning "MeshIO.hh was included after Mesh Type. You may ignore this warning. Please report errors resulting from this order to the developers!"
+ #endif
+
#endif
+
// -------------------- OpenMesh
#include
#include
diff --git a/src/OpenMesh/Core/IO/OMFormat.hh b/src/OpenMesh/Core/IO/OMFormat.hh
index 13228e84..9bbcd860 100644
--- a/src/OpenMesh/Core/IO/OMFormat.hh
+++ b/src/OpenMesh/Core/IO/OMFormat.hh
@@ -315,16 +315,16 @@ namespace OMFormat {
/// Return the size of chunk data in bytes
inline size_t chunk_data_size( Header& _hdr, Chunk::Header& _chunk_hdr )
{
- size_t C = 0;
-
+ size_t C;
switch( _chunk_hdr.entity_ )
{
case Chunk::Entity_Vertex: C = _hdr.n_vertices_; break;
case Chunk::Entity_Face: C = _hdr.n_faces_; break;
- case Chunk::Entity_Halfedge: C = _hdr.n_edges_; // no break!
- case Chunk::Entity_Edge: C += _hdr.n_edges_; break;
+ case Chunk::Entity_Halfedge: C = _hdr.n_edges_*2; break;
+ case Chunk::Entity_Edge: C = _hdr.n_edges_; break;
case Chunk::Entity_Mesh: C = 1; break;
default:
+ C = 0;
std::cerr << "Invalid value in _chunk_hdr.entity_\n";
assert( false );
break;
diff --git a/src/OpenMesh/Core/IO/OMFormatT.cc b/src/OpenMesh/Core/IO/OMFormatT.cc
index a61413b6..fa332b12 100644
--- a/src/OpenMesh/Core/IO/OMFormatT.cc
+++ b/src/OpenMesh/Core/IO/OMFormatT.cc
@@ -145,7 +145,7 @@ namespace IO {
}
- // helper to store a an integer
+ // helper to restore a an integer
template< typename T >
size_t
restore( std::istream& _is,
@@ -171,25 +171,28 @@ namespace IO {
OMFormat::int16 v;
bytes = restore( _is, v, _swap );
_val = static_cast(v);
+ break;
}
case OMFormat::Chunk::Integer_32:
{
OMFormat::int32 v;
bytes = restore( _is, v, _swap );
_val = static_cast(v);
+ break;
}
case OMFormat::Chunk::Integer_64:
{
OMFormat::int64 v;
bytes = restore( _is, v, _swap );
_val = static_cast(v);
+ break;
}
}
return bytes;
}
- // helper to store a an unsigned integer
+ // helper to restore a an unsigned integer
template< typename T >
size_t
restore( std::istream& _is,
diff --git a/src/OpenMesh/Core/IO/reader/BaseReader.hh b/src/OpenMesh/Core/IO/reader/BaseReader.hh
index d1eddfc9..463b9c72 100644
--- a/src/OpenMesh/Core/IO/reader/BaseReader.hh
+++ b/src/OpenMesh/Core/IO/reader/BaseReader.hh
@@ -156,7 +156,16 @@ protected:
* @return trimmed string
*/
static inline std::string &left_trim(std::string &_string) {
- _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), std::not1(std::ptr_fun(std::isspace))));
+
+ // Find out if the compiler supports CXX11
+ #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L )
+ // as with CXX11 we can use lambda expressions
+ _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), [](int i)->int { return ! std::isspace(i); }));
+ #else
+ // we do what we did before
+ _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), std::not1(std::ptr_fun(std::isspace))));
+ #endif
+
return _string;
}
@@ -168,7 +177,18 @@ static inline std::string &left_trim(std::string &_string) {
* @return trimmed string
*/
static inline std::string &right_trim(std::string &_string) {
- _string.erase(std::find_if(_string.rbegin(), _string.rend(), std::not1(std::ptr_fun(std::isspace))).base(), _string.end());
+
+ // Find out if the compiler supports CXX11
+ #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L )
+ // as with CXX11 we can use lambda expressions
+ _string.erase(std::find_if(_string.rbegin(), _string.rend(), [](int i)->int { return ! std::isspace(i); } ).base(), _string.end());
+ #else
+ // we do what we did before
+ _string.erase(std::find_if(_string.rbegin(), _string.rend(), std::not1(std::ptr_fun(std::isspace))).base(), _string.end());
+ #endif
+
+
+
return _string;
}
diff --git a/src/OpenMesh/Core/IO/reader/OBJReader.cc b/src/OpenMesh/Core/IO/reader/OBJReader.cc
index 4128b231..6be24e0f 100644
--- a/src/OpenMesh/Core/IO/reader/OBJReader.cc
+++ b/src/OpenMesh/Core/IO/reader/OBJReader.cc
@@ -540,6 +540,7 @@ read(std::istream& _in, BaseImporter& _bi, Options& _opt)
vhandles.clear();
face_texcoords.clear();
+ face_texcoords3d.clear();
// read full line after detecting a face
std::string faceLine;
diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc
index 107fafa7..87078882 100644
--- a/src/OpenMesh/Core/IO/reader/PLYReader.cc
+++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc
@@ -1062,7 +1062,7 @@ std::string get_property_name(std::string _string1, std::string _string2) {
//-----------------------------------------------------------------------------
-_PLYReader_::ValueType get_property_type(std::string _string1, std::string _string2) {
+_PLYReader_::ValueType get_property_type(std::string& _string1, std::string& _string2) {
if (_string1 == "float32" || _string2 == "float32")
@@ -1270,6 +1270,8 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
omerr() << "Custom face Properties defined, before 'vertex_indices' property was defined. They will be skipped" << std::endl;
elements_.back().properties_.clear();
}
+ } else {
+ options_ += Options::Custom;
}
}
diff --git a/src/OpenMesh/Core/IO/reader/STLReader.cc b/src/OpenMesh/Core/IO/reader/STLReader.cc
index 6dd8569b..b3c5af0a 100644
--- a/src/OpenMesh/Core/IO/reader/STLReader.cc
+++ b/src/OpenMesh/Core/IO/reader/STLReader.cc
@@ -176,7 +176,7 @@ class CmpVec
{
public:
- CmpVec(float _eps=FLT_MIN) : eps_(_eps) {}
+ explicit CmpVec(float _eps=FLT_MIN) : eps_(_eps) {}
bool operator()( const Vec3f& _v0, const Vec3f& _v1 ) const
{
diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc
index 66cf3b3f..a592e0da 100644
--- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc
+++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc
@@ -224,12 +224,22 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
if (!check( _be, _opt))
return false;
+ // No binary mode for OBJ
+ if ( _opt.check(Options::Binary) ) {
+ omout() << "[OBJWriter] : Warning, Binary mode requested for OBJ Writer (No support for Binary mode), falling back to standard." << std::endl;
+ }
- // check writer features
- if ( _opt.check(Options::Binary) || // not supported by format
- _opt.check(Options::FaceNormal))
- return false;
+ // check for unsupported writer features
+ if (_opt.check(Options::FaceNormal) ) {
+ omerr() << "[OBJWriter] : FaceNormal not supported by OBJ Writer" << std::endl;
+ return false;
+ }
+ // check for unsupported writer features
+ if (_opt.check(Options::VertexColor) ) {
+ omerr() << "[OBJWriter] : VertexColor not supported by OBJ Writer" << std::endl;
+ return false;
+ }
//create material file if needed
if ( _opt.check(Options::FaceColor) ){
@@ -270,10 +280,10 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
}
}
- //collect Texturevertices from vertices
+ //collect Texture coordinates from vertices
if(_opt.check(Options::VertexTexCoord))
{
- for (size_t i=0, nF=_be.n_faces(); i(i));
t = _be.texcoord(vh);
@@ -363,7 +373,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
{
// write vertex texture coordinate index
if (_opt.check(Options::VertexTexCoord))
- _out << texMap[_be.texcoord(vh)];
+ _out << texMap[_be.texcoord(vhandles[j])];
}
// write vertex normal index
diff --git a/src/OpenMesh/Core/IO/writer/OMWriter.cc b/src/OpenMesh/Core/IO/writer/OMWriter.cc
index 964a5ebc..9c32282f 100644
--- a/src/OpenMesh/Core/IO/writer/OMWriter.cc
+++ b/src/OpenMesh/Core/IO/writer/OMWriter.cc
@@ -163,7 +163,7 @@ _OMWriter_::write(std::ostream& _os, BaseExporter& _be, Options _opt, std::strea
#ifndef DOXY_IGNORE_THIS
template struct Enabler
{
- Enabler( T& obj ) : obj_(obj)
+ explicit Enabler( T& obj ) : obj_(obj)
{}
~Enabler() { obj_.enable(); }
@@ -302,7 +302,8 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
for (i=0, nF=header.n_faces_; i vhandles;
FaceHandle fh;
@@ -172,7 +172,7 @@ write_stla(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
for (i=0; i vhandles;
FaceHandle fh;
@@ -226,7 +226,7 @@ write_stla(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
for (i=0; i vhandles;
FaceHandle fh;
@@ -294,7 +294,7 @@ write_stlb(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
for (i=0; i vhandles;
FaceHandle fh;
@@ -366,7 +366,7 @@ write_stlb(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
for (i=0; i
-
-namespace OpenMesh
-{
-
-ArrayKernel::ArrayKernel()
-: refcount_vstatus_(0), refcount_hstatus_(0),
- refcount_estatus_(0), refcount_fstatus_(0)
-{
- init_bit_masks(); //Status bit masks initialization
-}
-
-ArrayKernel::~ArrayKernel()
-{
- clear();
-}
-
-// ArrayKernel::ArrayKernel(const ArrayKernel& _rhs)
-// : BaseKernel(_rhs),
-// vertices_(_rhs.vertices_), edges_(_rhs.edges_), faces_(_rhs.faces_),
-// vertex_status_(_rhs.vertex_status_), halfedge_status_(_rhs.halfedge_status_),
-// edge_status_(_rhs.edge_status_), face_status_(_rhs.face_status_),
-// refcount_vstatus_(_rhs.refcount_vstatus_), refcount_hstatus_(_rhs.refcount_hstatus_),
-// refcount_estatus_(_rhs.refcount_estatus_), refcount_fstatus_(_rhs.refcount_fstatus_)
-// {}
-
-
-void ArrayKernel::assign_connectivity(const ArrayKernel& _other)
-{
- vertices_ = _other.vertices_;
- edges_ = _other.edges_;
- faces_ = _other.faces_;
-
- vprops_resize(n_vertices());
- hprops_resize(n_halfedges());
- eprops_resize(n_edges());
- fprops_resize(n_faces());
-
-#define COPY_STATUS_PROPERTY(ENTITY) \
- if (_other.ENTITY##_status_.is_valid()) \
- { \
- if (!ENTITY##_status_.is_valid()) \
- { \
- request_##ENTITY##_status(); \
- } \
- property(ENTITY##_status_) = _other.property(_other.ENTITY##_status_); \
- }
- COPY_STATUS_PROPERTY(vertex)
- COPY_STATUS_PROPERTY(halfedge)
- COPY_STATUS_PROPERTY(edge)
- COPY_STATUS_PROPERTY(face)
-
-#undef COPY_STATUS_PROPERTY
-}
-
-// --- handle -> item ---
-VertexHandle ArrayKernel::handle(const Vertex& _v) const
-{
- return VertexHandle( int( &_v - &vertices_.front()));
-}
-
-HalfedgeHandle ArrayKernel::handle(const Halfedge& _he) const
-{
- // Calculate edge belonging to given halfedge
- // There are two halfedges stored per edge
- // Get memory position inside edge vector and devide by size of an edge
- // to get the corresponding edge for the requested halfedge
- size_t eh = ( (char*)&_he - (char*)&edges_.front() ) / sizeof(Edge) ;
- assert((&_he == &edges_[eh].halfedges_[0]) ||
- (&_he == &edges_[eh].halfedges_[1]));
- return ((&_he == &edges_[eh].halfedges_[0]) ?
- HalfedgeHandle( int(eh)<<1) : HalfedgeHandle((int(eh)<<1)+1));
-}
-
-EdgeHandle ArrayKernel::handle(const Edge& _e) const
-{
- return EdgeHandle( int(&_e - &edges_.front() ) );
-}
-
-FaceHandle ArrayKernel::handle(const Face& _f) const
-{
- return FaceHandle( int(&_f - &faces_.front()) );
-}
-
-#define SIGNED(x) signed( (x) )
-
-bool ArrayKernel::is_valid_handle(VertexHandle _vh) const
-{
- return 0 <= _vh.idx() && _vh.idx() < SIGNED(n_vertices());
-}
-
-bool ArrayKernel::is_valid_handle(HalfedgeHandle _heh) const
-{
- return 0 <= _heh.idx() && _heh.idx() < SIGNED(n_edges()*2);
-}
-
-bool ArrayKernel::is_valid_handle(EdgeHandle _eh) const
-{
- return 0 <= _eh.idx() && _eh.idx() < SIGNED(n_edges());
-}
-
-bool ArrayKernel::is_valid_handle(FaceHandle _fh) const
-{
- return 0 <= _fh.idx() && _fh.idx() < SIGNED(n_faces());
-}
-
-#undef SIGNED
-
-unsigned int ArrayKernel::delete_isolated_vertices()
-{
- assert(has_vertex_status());//this function requires vertex status property
- unsigned int n_isolated = 0;
- for (KernelVertexIter v_it = vertices_begin(); v_it != vertices_end(); ++v_it)
- {
- if (is_isolated(handle(*v_it)))
- {
- status(handle(*v_it)).set_deleted(true);
- n_isolated++;
- }
- }
- return n_isolated;
-}
-
-void ArrayKernel::garbage_collection(bool _v, bool _e, bool _f)
-{
- std::vector empty_vh;
- std::vector empty_hh;
- std::vector empty_fh;
- garbage_collection( empty_vh,empty_hh,empty_fh,_v, _e, _f);
-}
-
+ * ========================================================================= */
+
+/*===========================================================================*\
+ * *
+ * $Revision$ *
+ * $Date$ *
+ * *
+\*===========================================================================*/
+
+#include
+
+namespace OpenMesh
+{
+
+ArrayKernel::ArrayKernel()
+: refcount_vstatus_(0), refcount_hstatus_(0),
+ refcount_estatus_(0), refcount_fstatus_(0)
+{
+ init_bit_masks(); //Status bit masks initialization
+}
+
+ArrayKernel::~ArrayKernel()
+{
+ clear();
+}
+
+// ArrayKernel::ArrayKernel(const ArrayKernel& _rhs)
+// : BaseKernel(_rhs),
+// vertices_(_rhs.vertices_), edges_(_rhs.edges_), faces_(_rhs.faces_),
+// vertex_status_(_rhs.vertex_status_), halfedge_status_(_rhs.halfedge_status_),
+// edge_status_(_rhs.edge_status_), face_status_(_rhs.face_status_),
+// refcount_vstatus_(_rhs.refcount_vstatus_), refcount_hstatus_(_rhs.refcount_hstatus_),
+// refcount_estatus_(_rhs.refcount_estatus_), refcount_fstatus_(_rhs.refcount_fstatus_)
+// {}
+
+
+void ArrayKernel::assign_connectivity(const ArrayKernel& _other)
+{
+ vertices_ = _other.vertices_;
+ edges_ = _other.edges_;
+ faces_ = _other.faces_;
+
+ vprops_resize(n_vertices());
+ hprops_resize(n_halfedges());
+ eprops_resize(n_edges());
+ fprops_resize(n_faces());
+
+ //just copy status properties for now,
+ //until a proper solution for refcounted
+ //properties is available
+ vertex_status_ = _other.vertex_status_;
+ halfedge_status_ = _other.halfedge_status_;
+ edge_status_ = _other.edge_status_;
+ face_status_ = _other.face_status_;
+
+ //initialize refcounter to 1 for the new mesh,
+ //if status is available.
+ refcount_estatus_ = _other.refcount_estatus_ > 0 ? 1 : 0;
+ refcount_vstatus_ = _other.refcount_vstatus_ > 0 ? 1 : 0;
+ refcount_hstatus_ = _other.refcount_hstatus_ > 0 ? 1 : 0;
+ refcount_fstatus_ = _other.refcount_fstatus_ > 0 ? 1 : 0;
+}
+
+// --- handle -> item ---
+VertexHandle ArrayKernel::handle(const Vertex& _v) const
+{
+ return VertexHandle( int( &_v - &vertices_.front()));
+}
+
+HalfedgeHandle ArrayKernel::handle(const Halfedge& _he) const
+{
+ // Calculate edge belonging to given halfedge
+ // There are two halfedges stored per edge
+ // Get memory position inside edge vector and devide by size of an edge
+ // to get the corresponding edge for the requested halfedge
+ size_t eh = ( (char*)&_he - (char*)&edges_.front() ) / sizeof(Edge) ;
+ assert((&_he == &edges_[eh].halfedges_[0]) ||
+ (&_he == &edges_[eh].halfedges_[1]));
+ return ((&_he == &edges_[eh].halfedges_[0]) ?
+ HalfedgeHandle( int(eh)<<1) : HalfedgeHandle((int(eh)<<1)+1));
+}
+
+EdgeHandle ArrayKernel::handle(const Edge& _e) const
+{
+ return EdgeHandle( int(&_e - &edges_.front() ) );
+}
+
+FaceHandle ArrayKernel::handle(const Face& _f) const
+{
+ return FaceHandle( int(&_f - &faces_.front()) );
+}
+
+#define SIGNED(x) signed( (x) )
+
+bool ArrayKernel::is_valid_handle(VertexHandle _vh) const
+{
+ return 0 <= _vh.idx() && _vh.idx() < SIGNED(n_vertices());
+}
+
+bool ArrayKernel::is_valid_handle(HalfedgeHandle _heh) const
+{
+ return 0 <= _heh.idx() && _heh.idx() < SIGNED(n_edges()*2);
+}
+
+bool ArrayKernel::is_valid_handle(EdgeHandle _eh) const
+{
+ return 0 <= _eh.idx() && _eh.idx() < SIGNED(n_edges());
+}
+
+bool ArrayKernel::is_valid_handle(FaceHandle _fh) const
+{
+ return 0 <= _fh.idx() && _fh.idx() < SIGNED(n_faces());
+}
+
+#undef SIGNED
+
+unsigned int ArrayKernel::delete_isolated_vertices()
+{
+ assert(has_vertex_status());//this function requires vertex status property
+ unsigned int n_isolated = 0;
+ for (KernelVertexIter v_it = vertices_begin(); v_it != vertices_end(); ++v_it)
+ {
+ if (is_isolated(handle(*v_it)))
+ {
+ status(handle(*v_it)).set_deleted(true);
+ n_isolated++;
+ }
+ }
+ return n_isolated;
+}
+
+void ArrayKernel::garbage_collection(bool _v, bool _e, bool _f)
+{
+ std::vector empty_vh;
+ std::vector empty_hh;
+ std::vector empty_fh;
+ garbage_collection( empty_vh,empty_hh,empty_fh,_v, _e, _f);
+}
+
void ArrayKernel::clean_keep_reservation()
{
vertices_.clear();
@@ -187,74 +186,74 @@ void ArrayKernel::clean_keep_reservation()
}
-void ArrayKernel::clean()
-{
-
- vertices_.clear();
- VertexContainer().swap( vertices_ );
-
- edges_.clear();
- EdgeContainer().swap( edges_ );
-
- faces_.clear();
- FaceContainer().swap( faces_ );
-
-}
-
-
-void ArrayKernel::clear()
-{
- vprops_clear();
- eprops_clear();
- hprops_clear();
- fprops_clear();
-
- clean();
-}
-
-
-
-void ArrayKernel::resize( size_t _n_vertices, size_t _n_edges, size_t _n_faces )
-{
- vertices_.resize(_n_vertices);
- edges_.resize(_n_edges);
- faces_.resize(_n_faces);
-
- vprops_resize(n_vertices());
- hprops_resize(n_halfedges());
- eprops_resize(n_edges());
- fprops_resize(n_faces());
-}
-
-void ArrayKernel::reserve(size_t _n_vertices, size_t _n_edges, size_t _n_faces )
-{
- vertices_.reserve(_n_vertices);
- edges_.reserve(_n_edges);
- faces_.reserve(_n_faces);
-
- vprops_reserve(_n_vertices);
- hprops_reserve(_n_edges*2);
- eprops_reserve(_n_edges);
- fprops_reserve(_n_faces);
-}
-
-// Status Sets API
-void ArrayKernel::init_bit_masks(BitMaskContainer& _bmc)
-{
- for (unsigned int i = Attributes::UNUSED; i != 0; i <<= 1)
- {
- _bmc.push_back(i);
- }
-}
-
-void ArrayKernel::init_bit_masks()
-{
- init_bit_masks(vertex_bit_masks_);
- edge_bit_masks_ = vertex_bit_masks_;//init_bit_masks(edge_bit_masks_);
- face_bit_masks_ = vertex_bit_masks_;//init_bit_masks(face_bit_masks_);
- halfedge_bit_masks_= vertex_bit_masks_;//init_bit_masks(halfedge_bit_masks_);
-}
-
-
-};
-
+void ArrayKernel::clean()
+{
+
+ vertices_.clear();
+ VertexContainer().swap( vertices_ );
+
+ edges_.clear();
+ EdgeContainer().swap( edges_ );
+
+ faces_.clear();
+ FaceContainer().swap( faces_ );
+
+}
+
+
+void ArrayKernel::clear()
+{
+ vprops_clear();
+ eprops_clear();
+ hprops_clear();
+ fprops_clear();
+
+ clean();
+}
+
+
+
+void ArrayKernel::resize( size_t _n_vertices, size_t _n_edges, size_t _n_faces )
+{
+ vertices_.resize(_n_vertices);
+ edges_.resize(_n_edges);
+ faces_.resize(_n_faces);
+
+ vprops_resize(n_vertices());
+ hprops_resize(n_halfedges());
+ eprops_resize(n_edges());
+ fprops_resize(n_faces());
+}
+
+void ArrayKernel::reserve(size_t _n_vertices, size_t _n_edges, size_t _n_faces )
+{
+ vertices_.reserve(_n_vertices);
+ edges_.reserve(_n_edges);
+ faces_.reserve(_n_faces);
+
+ vprops_reserve(_n_vertices);
+ hprops_reserve(_n_edges*2);
+ eprops_reserve(_n_edges);
+ fprops_reserve(_n_faces);
+}
+
+// Status Sets API
+void ArrayKernel::init_bit_masks(BitMaskContainer& _bmc)
+{
+ for (unsigned int i = Attributes::UNUSED; i != 0; i <<= 1)
+ {
+ _bmc.push_back(i);
+ }
+}
+
+void ArrayKernel::init_bit_masks()
+{
+ init_bit_masks(vertex_bit_masks_);
+ edge_bit_masks_ = vertex_bit_masks_;//init_bit_masks(edge_bit_masks_);
+ face_bit_masks_ = vertex_bit_masks_;//init_bit_masks(face_bit_masks_);
+ halfedge_bit_masks_= vertex_bit_masks_;//init_bit_masks(halfedge_bit_masks_);
+}
+
+
+};
+
diff --git a/src/OpenMesh/Core/Mesh/ArrayKernel.hh b/src/OpenMesh/Core/Mesh/ArrayKernel.hh
index 388c9267..ccf2748c 100644
--- a/src/OpenMesh/Core/Mesh/ArrayKernel.hh
+++ b/src/OpenMesh/Core/Mesh/ArrayKernel.hh
@@ -879,10 +879,7 @@ private:
void init_bit_masks(BitMaskContainer& _bmc);
void init_bit_masks();
-private:
- VertexContainer vertices_;
- EdgeContainer edges_;
- FaceContainer faces_;
+protected:
VertexStatusPropertyHandle vertex_status_;
HalfedgeStatusPropertyHandle halfedge_status_;
@@ -894,6 +891,11 @@ private:
unsigned int refcount_estatus_;
unsigned int refcount_fstatus_;
+private:
+ VertexContainer vertices_;
+ EdgeContainer edges_;
+ FaceContainer faces_;
+
BitMaskContainer halfedge_bit_masks_;
BitMaskContainer edge_bit_masks_;
BitMaskContainer vertex_bit_masks_;
diff --git a/src/OpenMesh/Core/Mesh/AttribKernelT.hh b/src/OpenMesh/Core/Mesh/AttribKernelT.hh
index ca1e55ef..c0d52a8f 100644
--- a/src/OpenMesh/Core/Mesh/AttribKernelT.hh
+++ b/src/OpenMesh/Core/Mesh/AttribKernelT.hh
@@ -744,48 +744,34 @@ private:
{
//mesh has no points?
}
- if(this->get_property_handle(vertex_normals_,
- "v:normals"))
- refcount_vnormals_ = 1;
- if(this->get_property_handle(vertex_colors_,
- "v:colors"))
- refcount_vcolors_ = 1;
- if(this->get_property_handle(vertex_texcoords1D_,
- "v:texcoords1D"))
- refcount_vtexcoords1D_ = 1;
- if(this->get_property_handle(vertex_texcoords2D_,
- "v:texcoords2D"))
- refcount_vtexcoords2D_ = 1;
- if(this->get_property_handle(vertex_texcoords3D_,
- "v:texcoords3D"))
- refcount_vtexcoords3D_ = 1;
- if(this->get_property_handle(halfedge_texcoords1D_,
- "h:texcoords1D"))
- refcount_htexcoords1D_ = 1;
- if(this->get_property_handle(halfedge_texcoords2D_,
- "h:texcoords2D"))
- refcount_htexcoords2D_ = 1;
- if(this->get_property_handle(halfedge_texcoords3D_,
- "h:texcoords3D"))
- refcount_htexcoords3D_ = 1;
- if(this->get_property_handle(halfedge_normals_,
- "h:normals"))
- refcount_henormals_ = 1;
- if(this->get_property_handle(halfedge_colors_,
- "h:colors"))
- refcount_hecolors_ = 1;
- if(this->get_property_handle(edge_colors_,
- "e:colors"))
- refcount_ecolors_ = 1;
- if(this->get_property_handle(face_normals_,
- "f:normals"))
- refcount_fnormals_ = 1;
- if(this->get_property_handle(face_colors_,
- "f:colors"))
- refcount_fcolors_ = 1;
- if(this->get_property_handle(face_texture_index_,
- "f:textureindex"))
- refcount_ftextureIndex_ = 1;
+ refcount_vnormals_ = this->get_property_handle(vertex_normals_,
+ "v:normals") ? 1 : 0 ;
+ refcount_vcolors_ = this->get_property_handle(vertex_colors_,
+ "v:colors") ? 1 : 0 ;
+ refcount_vtexcoords1D_ = this->get_property_handle(vertex_texcoords1D_,
+ "v:texcoords1D") ? 1 : 0 ;
+ refcount_vtexcoords2D_ = this->get_property_handle(vertex_texcoords2D_,
+ "v:texcoords2D") ? 1 : 0 ;
+ refcount_vtexcoords3D_ = this->get_property_handle(vertex_texcoords3D_,
+ "v:texcoords3D") ? 1 : 0 ;
+ refcount_htexcoords1D_ = this->get_property_handle(halfedge_texcoords1D_,
+ "h:texcoords1D") ? 1 : 0 ;
+ refcount_htexcoords2D_ = this->get_property_handle(halfedge_texcoords2D_,
+ "h:texcoords2D") ? 1 : 0 ;
+ refcount_htexcoords3D_ = this->get_property_handle(halfedge_texcoords3D_,
+ "h:texcoords3D") ? 1 : 0 ;
+ refcount_henormals_ = this->get_property_handle(halfedge_normals_,
+ "h:normals") ? 1 : 0 ;
+ refcount_hecolors_ = this->get_property_handle(halfedge_colors_,
+ "h:colors") ? 1 : 0 ;
+ refcount_ecolors_ = this->get_property_handle(edge_colors_,
+ "e:colors") ? 1 : 0 ;
+ refcount_fnormals_ = this->get_property_handle(face_normals_,
+ "f:normals") ? 1 : 0 ;
+ refcount_fcolors_ = this->get_property_handle(face_colors_,
+ "f:colors") ? 1 : 0 ;
+ refcount_ftextureIndex_ = this->get_property_handle(face_texture_index_,
+ "f:textureindex") ? 1 : 0 ;
}
};
diff --git a/src/OpenMesh/Core/Mesh/Handles.hh b/src/OpenMesh/Core/Mesh/Handles.hh
index 6cbb8ac4..68ac1d7e 100644
--- a/src/OpenMesh/Core/Mesh/Handles.hh
+++ b/src/OpenMesh/Core/Mesh/Handles.hh
@@ -165,8 +165,9 @@ namespace std {
template <>
struct hash
- : public std::unary_function
{
+ typedef OpenMesh::BaseHandle argument_type;
+ typedef std::size_t result_type;
std::size_t operator()(const OpenMesh::BaseHandle& h) const
{
@@ -176,8 +177,9 @@ struct hash
template <>
struct hash
- : public std::unary_function
{
+ typedef OpenMesh::VertexHandle argument_type;
+ typedef std::size_t result_type;
std::size_t operator()(const OpenMesh::VertexHandle& h) const
{
@@ -187,9 +189,11 @@ struct hash
template <>
struct hash
- : public std::unary_function
{
+ typedef OpenMesh::HalfedgeHandle argument_type;
+ typedef std::size_t result_type;
+
std::size_t operator()(const OpenMesh::HalfedgeHandle& h) const
{
return h.idx();
@@ -198,9 +202,11 @@ struct hash
template <>
struct hash
- : public std::unary_function
{
+ typedef OpenMesh::EdgeHandle argument_type;
+ typedef std::size_t result_type;
+
std::size_t operator()(const OpenMesh::EdgeHandle& h) const
{
return h.idx();
@@ -209,9 +215,11 @@ struct hash
template <>
struct hash
- : public std::unary_function
{
+ typedef OpenMesh::FaceHandle argument_type;
+ typedef std::size_t result_type;
+
std::size_t operator()(const OpenMesh::FaceHandle& h) const
{
return h.idx();
diff --git a/src/OpenMesh/Core/Mesh/IteratorsT.hh b/src/OpenMesh/Core/Mesh/IteratorsT.hh
index 38df6ecf..6d2c92bc 100644
--- a/src/OpenMesh/Core/Mesh/IteratorsT.hh
+++ b/src/OpenMesh/Core/Mesh/IteratorsT.hh
@@ -109,9 +109,6 @@ class GenericIteratorT {
: mesh_(&_mesh), hnd_(_hnd), skip_bits_(0)
{
if (_skip) enable_skipping();
-
- // Set vertex handle invalid if the mesh contains no vertex
- if((mesh_->*PrimitiveCountMember)() == 0) hnd_ = value_handle(-1);
}
/// Standard dereferencing operator.
diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
index 3e26e6d2..e311f5cb 100644
--- a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
+++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
@@ -777,6 +777,11 @@ void PolyConnectivity::collapse_edge(HalfedgeHandle _hh)
// delete stuff
status(edge_handle(h)).set_deleted(true);
status(vo).set_deleted(true);
+ if (has_halfedge_status())
+ {
+ status(h).set_deleted(true);
+ status(o).set_deleted(true);
+ }
}
//-----------------------------------------------------------------------------
@@ -827,6 +832,11 @@ void PolyConnectivity::collapse_loop(HalfedgeHandle _hh)
status(fh).set_deleted(true);
}
status(edge_handle(h0)).set_deleted(true);
+ if (has_halfedge_status())
+ {
+ status(h0).set_deleted(true);
+ status(o0).set_deleted(true);
+ }
}
//-----------------------------------------------------------------------------
diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.hh b/src/OpenMesh/Core/Mesh/PolyConnectivity.hh
index 3a93941f..d2ce6672 100644
--- a/src/OpenMesh/Core/Mesh/PolyConnectivity.hh
+++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.hh
@@ -1138,45 +1138,89 @@ public:
PolyConnectivity::ConstVertexIter,
&PolyConnectivity::vertices_begin,
&PolyConnectivity::vertices_end> ConstVertexRange;
+ typedef EntityRange<
+ const PolyConnectivity,
+ PolyConnectivity::ConstVertexIter,
+ &PolyConnectivity::vertices_sbegin,
+ &PolyConnectivity::vertices_end> ConstVertexRangeSkipping;
typedef EntityRange<
const PolyConnectivity,
PolyConnectivity::ConstHalfedgeIter,
&PolyConnectivity::halfedges_begin,
&PolyConnectivity::halfedges_end> ConstHalfedgeRange;
+ typedef EntityRange<
+ const PolyConnectivity,
+ PolyConnectivity::ConstHalfedgeIter,
+ &PolyConnectivity::halfedges_sbegin,
+ &PolyConnectivity::halfedges_end> ConstHalfedgeRangeSkipping;
typedef EntityRange<
const PolyConnectivity,
PolyConnectivity::ConstEdgeIter,
&PolyConnectivity::edges_begin,
&PolyConnectivity::edges_end> ConstEdgeRange;
+ typedef EntityRange<
+ const PolyConnectivity,
+ PolyConnectivity::ConstEdgeIter,
+ &PolyConnectivity::edges_sbegin,
+ &PolyConnectivity::edges_end> ConstEdgeRangeSkipping;
typedef EntityRange<
const PolyConnectivity,
PolyConnectivity::ConstFaceIter,
&PolyConnectivity::faces_begin,
&PolyConnectivity::faces_end> ConstFaceRange;
+ typedef EntityRange<
+ const PolyConnectivity,
+ PolyConnectivity::ConstFaceIter,
+ &PolyConnectivity::faces_sbegin,
+ &PolyConnectivity::faces_end> ConstFaceRangeSkipping;
/**
* @return The vertices as a range object suitable
- * for C++11 range based for loops.
+ * for C++11 range based for loops. Will skip deleted vertices.
*/
- ConstVertexRange vertices() const { return ConstVertexRange(*this); }
+ ConstVertexRangeSkipping vertices() const { return ConstVertexRangeSkipping(*this); }
+
+ /**
+ * @return The vertices as a range object suitable
+ * for C++11 range based for loops. Will include deleted vertices.
+ */
+ ConstVertexRange all_vertices() const { return ConstVertexRange(*this); }
/**
* @return The halfedges as a range object suitable
- * for C++11 range based for loops.
+ * for C++11 range based for loops. Will skip deleted halfedges.
*/
- ConstHalfedgeRange halfedges() const { return ConstHalfedgeRange(*this); }
+ ConstHalfedgeRangeSkipping halfedges() const { return ConstHalfedgeRangeSkipping(*this); }
/**
- * @return The edges as a range object suitabl
- * for C++11 range based for loops.
+ * @return The halfedges as a range object suitable
+ * for C++11 range based for loops. Will include deleted halfedges.
*/
- ConstEdgeRange edges() const { return ConstEdgeRange(*this); }
+ ConstHalfedgeRange all_halfedges() const { return ConstHalfedgeRange(*this); }
+
+ /**
+ * @return The edges as a range object suitable
+ * for C++11 range based for loops. Will skip deleted edges.
+ */
+ ConstEdgeRangeSkipping edges() const { return ConstEdgeRangeSkipping(*this); }
+
+ /**
+ * @return The edges as a range object suitable
+ * for C++11 range based for loops. Will include deleted edges.
+ */
+ ConstEdgeRange all_edges() const { return ConstEdgeRange(*this); }
/**
* @return The faces as a range object suitable
- * for C++11 range based for loops.
+ * for C++11 range based for loops. Will skip deleted faces.
*/
- ConstFaceRange faces() const { return ConstFaceRange(*this); }
+ ConstFaceRangeSkipping faces() const { return ConstFaceRangeSkipping(*this); }
+
+ /**
+ * @return The faces as a range object suitable
+ * for C++11 range based for loops. Will include deleted faces.
+ */
+ ConstFaceRange all_faces() const { return ConstFaceRange(*this); }
/// Generic class for iterator ranges.
template<
diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.cc b/src/OpenMesh/Core/Mesh/PolyMeshT.cc
index e77c0ba8..64fc9914 100644
--- a/src/OpenMesh/Core/Mesh/PolyMeshT.cc
+++ b/src/OpenMesh/Core/Mesh/PolyMeshT.cc
@@ -139,18 +139,18 @@ PolyMeshT::calc_face_normal_impl(FaceHandle _fh, PointIs3DTag) const
// Due to traits, the value types of normals and points can be different.
// Therefore we cast them here.
- n[0] += static_cast(a[1] * b[2]);
- n[1] += static_cast(a[2] * b[0]);
- n[2] += static_cast(a[0] * b[1]);
+ n[0] += static_cast::value_type>(a[1] * b[2]);
+ n[1] += static_cast::value_type>(a[2] * b[0]);
+ n[2] += static_cast::value_type>(a[0] * b[1]);
}
- const typename vector_traits::value_type norm = n.length();
+ const typename vector_traits::value_type length = norm(n);
// The expression ((n *= (1.0/norm)),n) is used because the OpenSG
// vector class does not return self after component-wise
// self-multiplication with a scalar!!!
- return (norm != typename vector_traits::value_type(0))
- ? ((n *= (typename vector_traits::value_type(1)/norm)), n)
+ return (length != typename vector_traits::value_type(0))
+ ? ((n *= (typename vector_traits::value_type(1)/length)), n)
: Normal(0, 0, 0);
}
@@ -194,20 +194,22 @@ calc_face_normal_impl(const Point& _p0,
Normal p1p2(vector_cast(_p2)); p1p2 -= vector_cast(_p1);
Normal n = cross(p1p2, p1p0);
- typename vector_traits::value_type norm = n.length();
+ typename vector_traits::value_type length = norm(n);
// The expression ((n *= (1.0/norm)),n) is used because the OpenSG
// vector class does not return self after component-wise
// self-multiplication with a scalar!!!
- return (norm != typename vector_traits::value_type(0)) ? ((n *= (typename vector_traits::value_type(1)/norm)),n) : Normal(0,0,0);
+ return (length != typename vector_traits::value_type(0))
+ ? ((n *= (typename vector_traits::value_type(1)/length)),n)
+ : Normal(0,0,0);
#else
Point p1p0 = _p0; p1p0 -= _p1;
Point p1p2 = _p2; p1p2 -= _p1;
Normal n = vector_cast(cross(p1p2, p1p0));
- typename vector_traits::value_type norm = n.length();
+ typename vector_traits::value_type length = norm(n);
- return (norm != 0.0) ? n *= (1.0/norm) : Normal(0,0,0);
+ return (length != 0.0) ? n *= (1.0/length) : Normal(0,0,0);
#endif
}
@@ -226,7 +228,7 @@ PolyMeshT::
calc_face_centroid(FaceHandle _fh) const
{
Point _pt;
- _pt.vectorize(0);
+ vectorize(_pt, 0);
Scalar valence = 0.0;
for (ConstFaceVertexIter cfv_it = this->cfv_iter(_fh); cfv_it.is_valid(); ++cfv_it, valence += 1.0)
{
@@ -261,7 +263,7 @@ void
PolyMeshT::
update_face_normals()
{
- FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
+ FaceIter f_it(Kernel::faces_sbegin()), f_end(Kernel::faces_end());
for (; f_it != f_end; ++f_it)
this->set_normal(*f_it, calc_face_normal(*f_it));
@@ -331,7 +333,7 @@ calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle) const
for(unsigned int i=0; i
void PolyMeshT::
calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const
{
- _n.vectorize(0.0);
+ vectorize(_n, 0.0);
for (ConstVertexFaceIter vf_it = this->cvf_iter(_vh); vf_it.is_valid(); ++vf_it)
_n += this->normal(*vf_it);
}
@@ -399,7 +401,7 @@ template
void PolyMeshT::
calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const
{
- _n.vectorize(0.0);
+ vectorize(_n, 0.0);
ConstVertexIHalfedgeIter cvih_it = this->cvih_iter(_vh);
if (! cvih_it.is_valid() )
{//don't crash on isolated vertices
diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.hh b/src/OpenMesh/Core/Mesh/PolyMeshT.hh
index c4e89dac..48ab8c41 100644
--- a/src/OpenMesh/Core/Mesh/PolyMeshT.hh
+++ b/src/OpenMesh/Core/Mesh/PolyMeshT.hh
@@ -408,7 +408,7 @@ public:
{
Normal edge_vec;
calc_edge_vector(_heh, edge_vec);
- return edge_vec.sqrnorm();
+ return sqrnorm(edge_vec);
}
/** Calculates the midpoint of the halfedge _heh, defined by the positions of
@@ -446,8 +446,8 @@ public:
{
Normal v0, v1;
calc_sector_vectors(_in_heh, v0, v1);
- Scalar denom = v0.norm()*v1.norm();
- if (is_zero(denom))
+ Scalar denom = norm(v0)*norm(v1);
+ if ( denom == Scalar(0))
{
return 0;
}
@@ -472,7 +472,7 @@ public:
Normal in_vec, out_vec;
calc_edge_vector(_in_heh, in_vec);
calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
- Scalar denom = in_vec.norm()*out_vec.norm();
+ Scalar denom = norm(in_vec)*norm(out_vec);
if (is_zero(denom))
{
_cos_a = 1;
@@ -481,7 +481,7 @@ public:
else
{
_cos_a = dot(in_vec, out_vec)/denom;
- _sin_a = cross(in_vec, out_vec).norm()/denom;
+ _sin_a = norm(cross(in_vec, out_vec))/denom;
}
}
*/
@@ -501,7 +501,7 @@ public:
{
Normal sector_normal;
calc_sector_normal(_in_heh, sector_normal);
- return sector_normal.norm()/2;
+ return norm(sector_normal)/2;
}
/** calculates the dihedral angle on the halfedge _heh
@@ -541,7 +541,7 @@ public:
calc_sector_normal(_heh, n0);
calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
calc_edge_vector(_heh, he);
- Scalar denom = n0.norm()*n1.norm();
+ Scalar denom = norm(n0)*norm(n1);
if (denom == Scalar(0))
{
return 0;
diff --git a/src/OpenMesh/Core/Mesh/TriConnectivity.cc b/src/OpenMesh/Core/Mesh/TriConnectivity.cc
index e3d69623..fb77f87e 100644
--- a/src/OpenMesh/Core/Mesh/TriConnectivity.cc
+++ b/src/OpenMesh/Core/Mesh/TriConnectivity.cc
@@ -488,6 +488,11 @@ void TriConnectivity::split(EdgeHandle _eh, VertexHandle _vh)
void TriConnectivity::split_copy(EdgeHandle _eh, VertexHandle _vh)
{
+ const VertexHandle v0 = to_vertex_handle(halfedge_handle(_eh, 0));
+ const VertexHandle v1 = to_vertex_handle(halfedge_handle(_eh, 1));
+
+ const int nf = n_faces();
+
// Split the halfedge ( handle will be preserved)
split(_eh, _vh);
@@ -495,6 +500,22 @@ void TriConnectivity::split_copy(EdgeHandle _eh, VertexHandle _vh)
// have been created
for(VEIter ve_it = ve_iter(_vh); ve_it.is_valid(); ++ve_it)
copy_all_properties(_eh, *ve_it, true);
+
+ for (auto vh : {v0, v1})
+ {
+ // get the halfedge pointing from new vertex to old vertex
+ const HalfedgeHandle h = find_halfedge(_vh, vh);
+ if (!is_boundary(h)) // for boundaries there are no faces whose properties need to be copied
+ {
+ FaceHandle fh0 = face_handle(h);
+ FaceHandle fh1 = face_handle(opposite_halfedge_handle(prev_halfedge_handle(h)));
+ if (fh0.idx() >= nf) // is fh0 the new face?
+ std::swap(fh0, fh1);
+
+ // copy properties from old face to new face
+ copy_all_properties(fh0, fh1, true);
+ }
+ }
}
}// namespace OpenMesh
diff --git a/src/OpenMesh/Core/Mesh/TriMeshT.hh b/src/OpenMesh/Core/Mesh/TriMeshT.hh
index bd2621c8..4d8382c3 100644
--- a/src/OpenMesh/Core/Mesh/TriMeshT.hh
+++ b/src/OpenMesh/Core/Mesh/TriMeshT.hh
@@ -361,9 +361,9 @@ public:
VertexHandle p2 = this->to_vertex_handle(he2);
// Calculate midpoint coordinates
- const Point new0 = (this->point(p0) + this->point(p2)) * static_cast< typename Point::value_type >(0.5);
- const Point new1 = (this->point(p0) + this->point(p1)) * static_cast< typename Point::value_type >(0.5);
- const Point new2 = (this->point(p1) + this->point(p2)) * static_cast< typename Point::value_type >(0.5);
+ const Point new0 = (this->point(p0) + this->point(p2)) * static_cast::value_type >(0.5);
+ const Point new1 = (this->point(p0) + this->point(p1)) * static_cast::value_type >(0.5);
+ const Point new2 = (this->point(p1) + this->point(p2)) * static_cast::value_type >(0.5);
// Add vertices at midpoint coordinates
VertexHandle v0 = this->add_vertex(new0);
diff --git a/src/OpenMesh/Core/System/config.h b/src/OpenMesh/Core/System/config.h
index b48b1536..9d7520c1 100644
--- a/src/OpenMesh/Core/System/config.h
+++ b/src/OpenMesh/Core/System/config.h
@@ -65,15 +65,11 @@
// ----------------------------------------------------------------------------
-#define OM_VERSION 0x70000
-//#define OM_VERSION 0x60300
+#define OM_VERSION 0x70200
-// only defined, if it is a beta version
-//#define OM_VERSION_BETA 4
-
-#define OM_GET_VER ((OM_VERSION && 0xf0000) >> 16)
-#define OM_GET_MAJ ((OM_VERSION && 0x0ff00) >> 8)
-#define OM_GET_MIN (OM_VERSION && 0x000ff)
+#define OM_GET_VER ((OM_VERSION & 0xf0000) >> 16)
+#define OM_GET_MAJ ((OM_VERSION & 0x0ff00) >> 8)
+#define OM_GET_MIN (OM_VERSION & 0x000ff)
#ifdef WIN32
# ifdef min
diff --git a/src/OpenMesh/Core/Utils/vector_cast.hh b/src/OpenMesh/Core/Utils/vector_cast.hh
index 94f991a5..39fca197 100644
--- a/src/OpenMesh/Core/Utils/vector_cast.hh
+++ b/src/OpenMesh/Core/Utils/vector_cast.hh
@@ -95,7 +95,6 @@ inline void vector_cast( const src_t & /*_src*/, dst_t & /*_dst*/, GenProg::Int2
{
}
-
template
inline void vector_copy( const src_t &_src, dst_t &_dst, GenProg::Int2Type )
{
diff --git a/src/OpenMesh/Examples/Examples.pro b/src/OpenMesh/Examples/Examples.pro
deleted file mode 100644
index 556c16f6..00000000
--- a/src/OpenMesh/Examples/Examples.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-Subdirs()
-
-addSubdirs( Tutorial01 )
-addSubdirs( Tutorial02 )
-addSubdirs( Tutorial03 )
-addSubdirs( Tutorial04 )
-addSubdirs( Tutorial05 )
-addSubdirs( Tutorial06 )
-addSubdirs( Tutorial07 )
-addSubdirs( Tutorial08 )
-addSubdirs( Tutorial09 )
-addSubdirs( Tutorial10 )
diff --git a/src/OpenMesh/Examples/Tutorial01/Tutorial01.pro b/src/OpenMesh/Examples/Tutorial01/Tutorial01.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial01/Tutorial01.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial02/Tutorial02.pro b/src/OpenMesh/Examples/Tutorial02/Tutorial02.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial02/Tutorial02.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial03/Tutorial03.pro b/src/OpenMesh/Examples/Tutorial03/Tutorial03.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial03/Tutorial03.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial04/Tutorial04.pro b/src/OpenMesh/Examples/Tutorial04/Tutorial04.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial04/Tutorial04.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial04/smooth_algo.hh b/src/OpenMesh/Examples/Tutorial04/smooth_algo.hh
index 9c564427..788b8b73 100644
--- a/src/OpenMesh/Examples/Tutorial04/smooth_algo.hh
+++ b/src/OpenMesh/Examples/Tutorial04/smooth_algo.hh
@@ -13,7 +13,7 @@ public:
public:
// construct with a given mesh
- SmootherT(Mesh& _mesh)
+ explicit SmootherT(Mesh& _mesh)
: mesh_(_mesh)
{
mesh_.add_property( cog_ );
diff --git a/src/OpenMesh/Examples/Tutorial05/Tutorial05.pro b/src/OpenMesh/Examples/Tutorial05/Tutorial05.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial05/Tutorial05.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial06/Tutorial06.pro b/src/OpenMesh/Examples/Tutorial06/Tutorial06.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial06/Tutorial06.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial07/Tutorial07.pro b/src/OpenMesh/Examples/Tutorial07/Tutorial07.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial07/Tutorial07.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial08/Tutorial08.pro b/src/OpenMesh/Examples/Tutorial08/Tutorial08.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial08/Tutorial08.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial09/Tutorial09.pro b/src/OpenMesh/Examples/Tutorial09/Tutorial09.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial09/Tutorial09.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Examples/Tutorial10/Tutorial10.pro b/src/OpenMesh/Examples/Tutorial10/Tutorial10.pro
deleted file mode 100644
index 5d626522..00000000
--- a/src/OpenMesh/Examples/Tutorial10/Tutorial10.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-INCLUDEPATH += ../../..
-
-Application()
-openmesh()
-
-DIRECTORIES = .
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-################################################################################
diff --git a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc
index 62fa98c1..f038006f 100644
--- a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc
+++ b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc
@@ -181,7 +181,7 @@ compute_new_positions_C1()
if (diag) uu *= static_cast(1.0) / diag;
// damping
- uu *= static_cast(0.25);
+ uu *= static_cast::value_type>(0.25);
// store new position
p = vector_cast(Base::mesh_.point(*v_it));
diff --git a/src/OpenMesh/Tools/Smoother/SmootherT.cc b/src/OpenMesh/Tools/Smoother/SmootherT.cc
index 2bb44bd0..c727aeba 100644
--- a/src/OpenMesh/Tools/Smoother/SmootherT.cc
+++ b/src/OpenMesh/Tools/Smoother/SmootherT.cc
@@ -263,13 +263,13 @@ set_relative_local_error(Scalar _err)
bb_min = bb_max = mesh_.point(*v_it);
for (++v_it; v_it!=v_end; ++v_it)
{
- bb_min.minimize(mesh_.point(*v_it));
- bb_max.maximize(mesh_.point(*v_it));
+ minimize(bb_min, mesh_.point(*v_it));
+ maximize(bb_max, mesh_.point(*v_it));
}
// abs. error = rel. error * bounding-diagonal
- set_absolute_local_error(_err * (bb_max-bb_min).norm());
+ set_absolute_local_error(norm(_err * (bb_max-bb_min)));
}
}
diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh
index 6068ac5c..75d29817 100644
--- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh
+++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh
@@ -104,7 +104,7 @@ public:
typedef RuleInterfaceT Inherited;
- Tvv3(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(3); };
+ explicit Tvv3(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(3); };
void raise(typename M::FaceHandle& _fh, state_t _target_state);
void raise(typename M::VertexHandle& _vh, state_t _target_state);
@@ -129,7 +129,7 @@ public:
typedef RuleInterfaceT Inherited;
- Tvv4(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(4); };
+ explicit Tvv4(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(4); };
void raise(typename M::FaceHandle& _fh, state_t _target_state);
void raise(typename M::VertexHandle& _vh, state_t _target_state);
@@ -157,7 +157,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- VF(M& _mesh) : Inherited(_mesh) {}
+ explicit VF(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::FaceHandle& _fh, state_t _target_state);
MIPS_WARN_WA(Edge)
@@ -179,7 +179,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- FF(M& _mesh) : Inherited(_mesh) {}
+ explicit FF(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::FaceHandle& _fh, state_t _target_state);
MIPS_WARN_WA(Vertex) // avoid warning
@@ -201,7 +201,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- FFc(M& _mesh) : Inherited(_mesh) {}
+ explicit FFc(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::FaceHandle& _fh, state_t _target_state);
MIPS_WARN_WA(Vertex) // avoid warning
@@ -223,7 +223,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- FV(M& _mesh) : Inherited(_mesh) {}
+ explicit FV(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -245,7 +245,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- FVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
+ explicit FVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -282,7 +282,7 @@ public:
typedef RuleInterfaceT Inherited;
- VV(M& _mesh) : Inherited(_mesh) {}
+ explicit VV(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -304,7 +304,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- VVc(M& _mesh) : Inherited(_mesh) {}
+ explicit VVc(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -326,7 +326,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- VE(M& _mesh) : Inherited(_mesh) {}
+ explicit VE(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
@@ -348,7 +348,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- VdE(M& _mesh) : Inherited(_mesh) {}
+ explicit VdE(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
@@ -370,7 +370,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- VdEc(M& _mesh) : Inherited(_mesh) {}
+ explicit VdEc(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
@@ -392,7 +392,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- EV(M& _mesh) : Inherited(_mesh) {}
+ explicit EV(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -415,7 +415,7 @@ public:
typedef RuleInterfaceT Inherited;
- EVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
+ explicit EVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
void raise(typename M::VertexHandle& _vh, state_t _target_state);
MIPS_WARN_WA(Face) // avoid warning
@@ -451,7 +451,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- EF(M& _mesh) : Inherited(_mesh) {}
+ explicit EF(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::FaceHandle& _fh, state_t _target_state);
MIPS_WARN_WA(Edge ) // avoid warning
@@ -473,7 +473,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- FE(M& _mesh) : Inherited(_mesh) {}
+ explicit FE(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
@@ -495,7 +495,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- EdE(M& _mesh) : Inherited(_mesh) {}
+ explicit EdE(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
@@ -517,7 +517,7 @@ private:
public:
typedef RuleInterfaceT Inherited;
- EdEc(M& _mesh) : Inherited(_mesh) {}
+ explicit EdEc(M& _mesh) : Inherited(_mesh) {}
void raise(typename M::EdgeHandle& _eh, state_t _target_state);
MIPS_WARN_WA(Face ) // avoid warning
diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc
index 712ddb51..1813c2fe 100644
--- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc
+++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc
@@ -346,7 +346,7 @@ CatmullClarkT::update_vertex( MeshType& _m, const VertexHandl
for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr)
if ( _m.is_boundary( *ve_itr))
pos += _m.property( ep_pos_, *ve_itr);
- pos /= static_cast(3.0);
+ pos /= static_cast::value_type>(3.0);
}
else // inner vertex
{
diff --git a/src/OpenMesh/Tools/Tools.pro b/src/OpenMesh/Tools/Tools.pro
deleted file mode 100644
index 50933420..00000000
--- a/src/OpenMesh/Tools/Tools.pro
+++ /dev/null
@@ -1,45 +0,0 @@
-################################################################################
-#
-################################################################################
-
-include( $$TOPDIR/qmake/all.include )
-
-Library()
-
-contains( OPENFLIPPER , OpenFlipper ){
- DESTDIR = $${TOPDIR}/OpenMesh/lib
-} else {
- DESTDIR = $${TOPDIR}/lib
-}
-
-DIRECTORIES = . Decimater Smoother Subdivider/Adaptive/Composite \
- Subdivider/Uniform/Composite Subdivider/Uniform \
- Utils
-
-INCLUDEPATH += ../..
-
-CONFIG( debug, debug|release ){
- TARGET = OpenMeshToolsd
-} else {
- TARGET = OpenMeshTools
-}
-
-win32 {
- DEFINES += _USE_MATH_DEFINES NOMINMAX
- CONFIG += static
-}
-
-macx {
- # Set library binary header to the correct path
- QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${DESTDIR}/
- export(QMAKE_LFLAGS_SONAME)
-}
-
-# Input
-HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.c)
-SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
-FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
-
-
-################################################################################
diff --git a/src/OpenMesh/Tools/Utils/conio.cc b/src/OpenMesh/Tools/Utils/conio.cc
index 3a7c04ee..985fbddb 100644
--- a/src/OpenMesh/Tools/Utils/conio.cc
+++ b/src/OpenMesh/Tools/Utils/conio.cc
@@ -64,7 +64,7 @@ int getche() { return ::_getche(); }
} // AS
// ----------------------------------------------------------------- Win32 ----
-#elif defined(WIN32)
+#elif defined(WIN32) || defined(__MINGW32__)
#include
@@ -91,6 +91,7 @@ int getche() { return ::getche(); }
#endif
#include /* tcsetattr() */
#include /* ioctl() */
+#include /* timeval struct */
namespace OpenMesh {
namespace Utils {
diff --git a/src/Python/Bindings.cc b/src/Python/Bindings.cc
deleted file mode 100644
index 61acd6f4..00000000
--- a/src/Python/Bindings.cc
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "Python/Bindings.hh"
-#include "Python/Vector.hh"
-#include "Python/Mesh.hh"
-#include "Python/PropertyManager.hh"
-#include "Python/InputOutput.hh"
-#include "Python/Decimater.hh"
-
-#include
-
-namespace OpenMesh {
-namespace Python {
-
-/**
- * Expose mesh items to %Python.
- */
-void expose_items() {
- class_("Vertex");
- class_("Halfedge");
- class_("Edge");
- class_("Face");
-}
-
-/**
- * Expose item and property handles to %Python.
- */
-void expose_handles() {
- class_("BaseHandle", init >())
- .def("idx", &BaseHandle::idx)
- .def("is_valid", &BaseHandle::is_valid)
- .def("reset", &BaseHandle::reset)
- .def("invalidate", &BaseHandle::invalidate)
- .def(self == self)
- .def(self != self)
- .def(self < self)
- ;
-
- class_ >("VertexHandle", init >());
- class_ >("HalfedgeHandle", init >());
- class_ >("EdgeHandle", init >());
- class_ >("FaceHandle", init >());
-
- class_, bases >("BasePropHandle", init >());
-
- class_, bases > >("VPropHandle", init >())
- .def(init&>());
- class_, bases > >("HPropHandle", init >())
- .def(init&>());
- class_, bases > >("EPropHandle", init >())
- .def(init&>());
- class_, bases > >("FPropHandle", init >())
- .def(init&>());
- class_, bases > >("MPropHandle", init >())
- .def(init&>());
-}
-
-
-/**
- * Expose the StatusBits enum and StatusInfo class to %Python.
- */
-void expose_status_bits_and_info() {
- using OpenMesh::Attributes::StatusBits;
- using OpenMesh::Attributes::StatusInfo;
-
- enum_("StatusBits")
- .value("DELETED", OpenMesh::Attributes::DELETED)
- .value("LOCKED", OpenMesh::Attributes::LOCKED)
- .value("SELECTED", OpenMesh::Attributes::SELECTED)
- .value("HIDDEN", OpenMesh::Attributes::HIDDEN)
- .value("FEATURE", OpenMesh::Attributes::FEATURE)
- .value("TAGGED", OpenMesh::Attributes::TAGGED)
- .value("TAGGED2", OpenMesh::Attributes::TAGGED2)
- .value("FIXEDNONMANIFOLD", OpenMesh::Attributes::FIXEDNONMANIFOLD)
- .value("UNUSED", OpenMesh::Attributes::UNUSED)
- ;
-
- class_("StatusInfo")
- .def("deleted", &StatusInfo::deleted)
- .def("set_deleted", &StatusInfo::set_deleted)
- .def("locked", &StatusInfo::locked)
- .def("set_locked", &StatusInfo::set_locked)
- .def("selected", &StatusInfo::selected)
- .def("set_selected", &StatusInfo::set_selected)
- .def("hidden", &StatusInfo::hidden)
- .def("set_hidden", &StatusInfo::set_hidden)
- .def("feature", &StatusInfo::feature)
- .def("set_feature", &StatusInfo::set_feature)
- .def("tagged", &StatusInfo::tagged)
- .def("set_tagged", &StatusInfo::set_tagged)
- .def("tagged2", &StatusInfo::tagged2)
- .def("set_tagged2", &StatusInfo::set_tagged2)
- .def("fixed_nonmanifold", &StatusInfo::fixed_nonmanifold)
- .def("set_fixed_nonmanifold", &StatusInfo::set_fixed_nonmanifold)
- .def("bits", &StatusInfo::bits)
- .def("set_bits", &StatusInfo::set_bits)
- .def("is_bit_set", &StatusInfo::is_bit_set)
- .def("set_bit", &StatusInfo::set_bit)
- .def("unset_bit", &StatusInfo::unset_bit)
- .def("change_bit", &StatusInfo::change_bit)
- ;
-}
-
-BOOST_PYTHON_MODULE(openmesh) {
- expose_items();
- expose_handles();
- expose_status_bits_and_info();
-
- expose_vec("Vec2f");
- expose_vec("Vec3f");
- expose_vec("Vec4f");
- expose_vec("Vec2d");
- expose_vec("Vec3d");
- expose_vec("Vec4d");
-
- expose_mesh("PolyMesh");
- expose_mesh("TriMesh");
-
- expose_iterator("VertexIter");
- expose_iterator("HalfedgeIter");
- expose_iterator("EdgeIter");
- expose_iterator("FaceIter");
-
- expose_circulator("VertexVertexIter");
- expose_circulator("VertexIHalfedgeIter");
- expose_circulator("VertexOHalfedgeIter");
- expose_circulator("VertexEdgeIter");
- expose_circulator("VertexFaceIter");
-
- expose_circulator("FaceVertexIter");
- expose_circulator("FaceHalfedgeIter");
- expose_circulator("FaceEdgeIter");
- expose_circulator("FaceFaceIter");
-
- expose_circulator("HalfedgeLoopIter");
-
- typedef IteratorWrapperT VertexIterWrapper;
- typedef IteratorWrapperT HalfedgeIterWrapper;
- typedef IteratorWrapperT EdgeIterWrapper;
- typedef IteratorWrapperT FaceIterWrapper;
-
- expose_property_manager, VertexHandle, VertexIterWrapper>("VPropertyManager");
- expose_property_manager, HalfedgeHandle, HalfedgeIterWrapper>("HPropertyManager");
- expose_property_manager, EdgeHandle, EdgeIterWrapper>("EPropertyManager");
- expose_property_manager, FaceHandle, FaceIterWrapper>("FPropertyManager");
-
- expose_io();
-
- expose_decimater("PolyMesh");
- expose_decimater("TriMesh");
-}
-
-} // namespace Python
-} // namespace OpenMesh
diff --git a/src/Python/Bindings.hh b/src/Python/Bindings.hh
deleted file mode 100644
index 0d37cf5c..00000000
--- a/src/Python/Bindings.hh
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file */
-
-#ifndef OPENMESH_PYTHON_BINDINGS_HH
-#define OPENMESH_PYTHON_BINDINGS_HH
-
-#include
-#include
-#include
-#include
-
-#include "OpenMesh/Core/IO/MeshIO.hh"
-#include "OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh"
-#include "OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh"
-
-using namespace boost::python;
-
-namespace OpenMesh {
-
-/**
- * This namespace contains classes and functions that are used to expose
- * %OpenMesh to %Python.
- */
-namespace Python {
-
-/**
- * Return value policy for functions that return references to objects that are
- * managed by %OpenMesh.
- */
-#define OPENMESH_PYTHON_DEFAULT_POLICY return_value_policy()
-
-struct MeshTraits : public OpenMesh::DefaultTraits {
- /** Use double precision points */
- typedef OpenMesh::Vec3d Point;
-
- /** Use double precision normals */
- typedef OpenMesh::Vec3d Normal;
-
- /** Use RGBA colors */
- typedef OpenMesh::Vec4f Color;
-};
-
-typedef OpenMesh::TriMesh_ArrayKernelT TriMesh;
-typedef OpenMesh::PolyMesh_ArrayKernelT PolyMesh;
-
-} // namespace OpenMesh
-} // namespace Python
-
-#endif
diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt
deleted file mode 100644
index cafb785b..00000000
--- a/src/Python/CMakeLists.txt
+++ /dev/null
@@ -1,215 +0,0 @@
-IF(NOT DEFINED OPENMESH_BUILD_PYTHON_BINDINGS)
- SET(OPENMESH_BUILD_PYTHON_BINDINGS TRUE CACHE BOOL "Enable or disable building the Python Bindings.")
-ENDIF()
-
-IF(NOT DEFINED OPENMESH_BUILD_PYTHON_UNIT_TESTS)
- SET(OPENMESH_BUILD_PYTHON_UNIT_TESTS FALSE CACHE BOOL "Enable or disable building the Python unit tests.")
-ENDIF()
-
-IF(NOT DEFINED OPENMESH_PYTHON_VERSION)
- SET(OPENMESH_PYTHON_VERSION "2.7" CACHE STRING "Choose the Python version that is used to build the Python Bindings.")
-ENDIF()
-
-IF(OPENMESH_BUILD_PYTHON_BINDINGS)
- # Create log file
- SET(PYTHONLOG "${CMAKE_CURRENT_BINARY_DIR}/PythonLog.txt")
- FILE(WRITE ${PYTHONLOG} "")
-
- # Look for the python libs
- MESSAGE(STATUS "Looking for PythonLibs")
- FIND_PACKAGE(PythonLibs ${OPENMESH_PYTHON_VERSION} QUIET)
-
- IF(PYTHONLIBS_FOUND)
- MESSAGE(STATUS "Looking for PythonLibs -- found")
-
- # Determine the name of the python component
- STRING(REGEX MATCH "^[0-9]+\\.[0-9]+" PYTHON_VERSION_MAJOR_MINOR ${PYTHONLIBS_VERSION_STRING})
- STRING(REGEX REPLACE "\\." "" PYTHON_VERSION_MAJOR_MINOR ${PYTHON_VERSION_MAJOR_MINOR})
- STRING(REGEX MATCH "^[0-9]" PYTHON_VERSION_MAJOR ${PYTHON_VERSION_MAJOR_MINOR})
-
- MESSAGE(STATUS "Looking for Boost Python")
-
- SET(BOOST_PYTHON_COMPONENT_NAMES "python-py${PYTHON_VERSION_MAJOR_MINOR}" "python${PYTHON_VERSION_MAJOR}" "python")
-
- FOREACH(NAME ${BOOST_PYTHON_COMPONENT_NAMES})
- IF(NOT Boost_FOUND)
- FILE(APPEND ${PYTHONLOG} "Looking for component ${NAME}\n")
- FIND_PACKAGE(Boost QUIET COMPONENTS ${NAME})
- ENDIF()
- ENDFOREACH()
-
- FILE(APPEND ${PYTHONLOG} "\n")
-
- IF(Boost_FOUND)
- MESSAGE(STATUS "Looking for Boost Python -- found")
- MESSAGE(STATUS "Checking the Boost Python configuration")
-
- SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
-
- TRY_COMPILE(
- COMPILE_WORKS
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/Example/
- Example
- CMAKE_FLAGS
- "-DINCLUDE_DIRECTORIES:STRING=${PYTHON_INCLUDE_DIRS};${Boost_INCLUDE_DIRS}"
- "-DLINK_DIRECTORIES:STRING=${Boost_LIBRARY_DIRS}"
- "-DLINK_LIBRARIES:STRING=${PYTHON_LIBRARIES};${Boost_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT_TRY_COMPILE
- )
-
- FILE(APPEND ${PYTHONLOG} "INCLUDE_DIRECTORIES: ${PYTHON_INCLUDE_DIRS};${Boost_INCLUDE_DIRS}\n")
- FILE(APPEND ${PYTHONLOG} "LINK_DIRECTORIES: ${Boost_LIBRARY_DIRS}\n")
- FILE(APPEND ${PYTHONLOG} "LINK_LIBRARIES: ${PYTHON_LIBRARIES};${Boost_LIBRARIES}\n\n")
- FILE(APPEND ${PYTHONLOG} "${OUTPUT_TRY_COMPILE}")
-
- IF(COMPILE_WORKS)
- # Look for the python interpreter to check if the example works
-
- # strip version string of any characters (e.g. rc1 # '+') than 0-9 and .
- STRING(REGEX REPLACE "(rc[0-9]+)|[^ 0-9 | \\.]" "" PYTHONLIBS_VERSION_STRING_STRIPPED ${PYTHONLIBS_VERSION_STRING})
- FIND_PACKAGE(PythonInterp ${PYTHONLIBS_VERSION_STRING_STRIPPED} QUIET)
-
- IF(PYTHONINTERP_FOUND)
-
- IF(MSVC)
- SET(PYTHON_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_TRY_COMPILE_CONFIGURATION}")
- ELSE()
- SET(PYTHON_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}")
- ENDIF()
-
- EXECUTE_PROCESS(
- COMMAND ${PYTHON_EXECUTABLE} -c "from example import *; greet(); planet = World()"
- WORKING_DIRECTORY ${PYTHON_WORKING_DIR}
- RESULT_VARIABLE PYTHON_WORKS
- OUTPUT_QUIET
- ERROR_QUIET
- )
-
- IF(PYTHON_WORKS EQUAL 0)
-
- ### EVERYTHING WORKS ###
-
- MESSAGE(STATUS "Checking the Boost Python configuration -- done")
-
- IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND ${Boost_VERSION} VERSION_LESS 105600)
- MESSAGE("There are known issues with Clang and Boost Python 1.55 and below.")
- MESSAGE("Please consider updating Boost Python.")
- ENDIF()
-
- SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Build/python/)
- FILE(MAKE_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-
- FILE(GLOB SOURCES *.cc *hh)
-
- INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ../)
- LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
-
- ADD_LIBRARY(openmesh SHARED ${SOURCES})
-
- install(TARGETS openmesh DESTINATION ${ACG_PROJECT_LIBDIR}/python )
-
- TARGET_LINK_LIBRARIES(
- openmesh
- OpenMeshCore
- OpenMeshTools
- ${Boost_LIBRARIES}
- ${PYTHON_LIBRARIES}
- )
-
- SET_TARGET_PROPERTIES(
- openmesh
- PROPERTIES
- PREFIX ""
- DEBUG_POSTFIX ""
- RELEASE_POSTFIX ""
- )
-
- IF(APPLE)
- SET_TARGET_PROPERTIES(openmesh PROPERTIES SUFFIX ".so")
- IF (NOT (CMAKE_MAJOR_VERSION LESS 3))
- SET_TARGET_PROPERTIES(openmesh PROPERTIES MACOSX_RPATH TRUE)
- ENDIF()
- ENDIF()
-
- IF(WIN32)
- SET_TARGET_PROPERTIES(openmesh PROPERTIES SUFFIX ".pyd")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
-
- SET(OUTPUTS openmesh.exp openmesh.lib openmesh.pyd)
-
- FOREACH(FILE ${OUTPUTS})
- ADD_CUSTOM_COMMAND(
- TARGET openmesh POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${FILE}
- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- )
- ENDFOREACH()
- ENDIF()
-
- IF(OPENMESH_BUILD_PYTHON_UNIT_TESTS)
- SET(UNITTEST_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Python-Unittests/)
-
- # Copy unit tests
- FILE(GLOB UNITTESTS Unittests/*.py)
- FOREACH(TEST ${UNITTESTS})
- FILE(COPY ${TEST} DESTINATION ${UNITTEST_OUTPUT_DIRECTORY})
- ENDFOREACH()
-
- # Copy test files
- FILE(GLOB TESTFILES ${PROJECT_SOURCE_DIR}/src/Unittests/TestFiles/*(.off|.obj|.mtl|.stl|.ply|.om))
- FOREACH(FILE ${TESTFILES})
- FILE(COPY ${FILE} DESTINATION ${UNITTEST_OUTPUT_DIRECTORY})
- ENDFOREACH()
-
- # Copy library
- IF(WIN32)
- FOREACH(FILE ${OUTPUTS})
- ADD_CUSTOM_COMMAND(
- TARGET openmesh POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${FILE}
- ${UNITTEST_OUTPUT_DIRECTORY}
- )
- ENDFOREACH()
- ELSE()
- ADD_CUSTOM_COMMAND(
- TARGET openmesh POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_BINARY_DIR}/Build/python/openmesh.so
- ${UNITTEST_OUTPUT_DIRECTORY}
- )
- ENDIF()
-
- ADD_TEST(
- NAME Python_tests
- WORKING_DIRECTORY ${UNITTEST_OUTPUT_DIRECTORY}
- COMMAND ${PYTHON_EXECUTABLE} -m unittest discover --verbose
- )
- ENDIF()
-
- ELSE()
- MESSAGE("Checking the Boost Python configuration failed!")
- MESSAGE("Reason: An error occurred while running a small Boost Python test project.")
- MESSAGE("Make sure that your Python and Boost Python libraries match.")
- MESSAGE("Skipping Python Bindings.")
- ENDIF()
- ELSE()
- MESSAGE("Checking the Boost Python configuration failed!")
- MESSAGE("Reason: Python Interpreter ${PYTHONLIBS_VERSION_STRING} not found.")
- MESSAGE("Skipping Python Bindings.")
- ENDIF()
- ELSE()
- MESSAGE("Checking the Boost Python configuration failed!")
- MESSAGE("Reason: Building a small Boost Python test project failed.")
- MESSAGE("Make sure that your Python and Boost Python libraries match.")
- MESSAGE("Skipping Python Bindings.")
- ENDIF()
- ELSE()
- MESSAGE("Boost Python not found! Skipping Python Bindings.")
- ENDIF()
- ELSE()
- MESSAGE("PythonLibs not found! Skipping Python Bindings.")
- ENDIF()
-ENDIF()
diff --git a/src/Python/Circulator.hh b/src/Python/Circulator.hh
deleted file mode 100644
index 5a11e4e2..00000000
--- a/src/Python/Circulator.hh
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef OPENMESH_PYTHON_CIRCULATOR_HH
-#define OPENMESH_PYTHON_CIRCULATOR_HH
-
-#include "Python/Bindings.hh"
-
-namespace OpenMesh {
-namespace Python {
-
-/**
- * Wrapper for circulators.
- *
- * This class template is used to wrap circulators for %Python. It implements
- * %Python's iterator protocol (the magic methods \_\_iter\_\_ and
- * \_\_next\_\_).
- *
- * @tparam Circulator A circulator type.
- */
-template
-class CirculatorWrapperT {
- public:
-
- /**
- * Constructor
- *
- * @param _mesh The mesh that contains the items to iterate over.
- * @param _center The handle to the center item.
- */
- CirculatorWrapperT(PolyMesh& _mesh, CenterEntityHandle _center) :
- circulator_(_mesh, _center) {
- }
-
- /**
- * Constructor
- *
- * @param _mesh The mesh that contains the items to iterate over.
- * @param _center The handle to the center item.
- */
- CirculatorWrapperT(TriMesh& _mesh, CenterEntityHandle _center) :
- circulator_(_mesh, _center) {
- }
-
- /**
- * Implementation of %Python's \_\_iter\_\_ magic method.
- *
- * @return This circulator.
- */
- CirculatorWrapperT iter() const {
- return *this;
- }
-
- /**
- * Implementation of %Python's \_\_next\_\_ magic method.
- *
- * @return The next item. Raises a %Python StopIteration exception if
- * there are no more items.
- */
- typename Circulator::value_type next() {
- if (circulator_.is_valid()) {
- typename Circulator::value_type res = *circulator_;
- ++circulator_;
- return res;
- }
- else {
- PyErr_SetString(PyExc_StopIteration, "No more data.");
- boost::python::throw_error_already_set();
- }
- return typename Circulator::value_type();
- }
-
- private:
- Circulator circulator_;
-};
-
-/**
- * Expose a circulator type to %Python.
- *
- * @tparam Circulator A circulator type.
- *
- * @param _name The name of the circulator type to be exposed.
- *
- * @note Circulators are wrapped by CirculatorWrapperT before they are exposed
- * to %Python, i.e. they are not exposed directly. This means that circulators
- * that are passed from %Python to C++ are instances of CirculatorWrapperT.
- */
-template
-void expose_circulator(const char *_name) {
- class_ >(_name, init())
- .def(init())
- .def("__iter__", &CirculatorWrapperT::iter)
- .def("__next__", &CirculatorWrapperT::next)
- .def("next", &CirculatorWrapperT::next)
- ;
-}
-
-} // namespace OpenMesh
-} // namespace Python
-
-#endif
diff --git a/src/Python/Decimater.hh b/src/Python/Decimater.hh
deleted file mode 100644
index c0825231..00000000
--- a/src/Python/Decimater.hh
+++ /dev/null
@@ -1,297 +0,0 @@
-#ifndef OPENMESH_PYTHON_DECIMATER_HH
-#define OPENMESH_PYTHON_DECIMATER_HH
-
-#include "Python/Bindings.hh"
-#include "OpenMesh/Tools/Decimater/ModBaseT.hh"
-#include "OpenMesh/Tools/Decimater/ModAspectRatioT.hh"
-#include "OpenMesh/Tools/Decimater/ModEdgeLengthT.hh"
-#include "OpenMesh/Tools/Decimater/ModHausdorffT.hh"
-#include "OpenMesh/Tools/Decimater/ModIndependentSetsT.hh"
-#include "OpenMesh/Tools/Decimater/ModNormalDeviationT.hh"
-#include "OpenMesh/Tools/Decimater/ModNormalFlippingT.hh"
-#include "OpenMesh/Tools/Decimater/ModProgMeshT.hh"
-#include "OpenMesh/Tools/Decimater/ModQuadricT.hh"
-#include "OpenMesh/Tools/Decimater/ModRoundnessT.hh"
-#include "OpenMesh/Tools/Decimater/DecimaterT.hh"
-
-#include
-
-namespace OpenMesh {
-namespace Python {
-
-#define INIT_MESH_REF init()[with_custodian_and_ward<1,2>()]
-
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(decimate_overloads, decimate, 0, 1)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(decimate_to_faces_overloads, decimate_to_faces, 0, 2)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(set_max_err_overloads, set_max_err, 1, 2)
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(set_min_roundness_overloads, set_min_roundness, 1, 2)
-
-
-template
-void expose_module_handle(const char *_name) {
- class_(_name)
- .def("is_valid", &Handle::is_valid)
- ;
-}
-
-template
-list infolist(Module& _self) {
- const typename Module::InfoList& infos = _self.infolist();
- list res;
- for (size_t i = 0; i < infos.size(); ++i) {
- res.append(infos[i]);
- }
- return res;
-}
-
-template
-void expose_decimater(const char *_name) {
-
- typedef Decimater::ModBaseT ModBase;
- typedef Decimater::ModAspectRatioT ModAspectRatio;
- typedef Decimater::ModEdgeLengthT ModEdgeLength;
- typedef Decimater::ModHausdorffT ModHausdorff;
- typedef Decimater::ModIndependentSetsT