Merge branch 'master' into compile-time-connectivity-type
This commit is contained in:
136
.gitlab-ci.yml
136
.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
|
||||
|
||||
|
||||
15
.qmake.cache
15
.qmake.cache
@@ -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 )
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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 ..
|
||||
|
||||
106
CI/ci-mac.sh
106
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
|
||||
|
||||
|
||||
|
||||
|
||||
34
CI/ci-source.sh
Executable file
34
CI/ci-source.sh
Executable file
@@ -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
|
||||
|
||||
12
CMakeLists.txt
Normal file → Executable file
12
CMakeLists.txt
Normal file → Executable file
@@ -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)
|
||||
# ========================================================================
|
||||
|
||||
@@ -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"
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
public:
|
||||
|
||||
// construct with a given mesh
|
||||
SmootherT(Mesh& _mesh)
|
||||
explicit SmootherT(Mesh& _mesh)
|
||||
: mesh_(_mesh)
|
||||
{
|
||||
mesh_.add_property( cog_ );
|
||||
|
||||
@@ -6,11 +6,48 @@
|
||||
|
||||
<!-- --------------------------------------------------------------------- -->
|
||||
|
||||
<tr valign=top><td><b>7.0</b> (?/?/?)</td><td>
|
||||
|
||||
<tr valign=top><td><b>7.2</b> (?/?/?)</td><td>
|
||||
|
||||
<b>IO</b>
|
||||
<ul>
|
||||
<li>PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign=top><td><b>7.1</b> (2018/05/29)</td><td>
|
||||
|
||||
<b>IO</b>
|
||||
<ul>
|
||||
<li>OBJ Reader: Fixed slow OBJ reader (Thanks to Etienne Danvoye for the patch) </li>
|
||||
</ul>
|
||||
|
||||
<b>Documentation</b>
|
||||
<ul>
|
||||
<li>Updated build instructions.</li>
|
||||
</ul>
|
||||
|
||||
<b>Build System</b>
|
||||
<ul>
|
||||
<li>Default to C++11 in cmake files</li>
|
||||
<li>Remove old qmake project files. Unmaintained for a very long time</li>
|
||||
<li>Replaced Qt finders</li>
|
||||
<li>Added VS 2017 to CI builds</li>
|
||||
</ul>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign=top><td><b>7.0</b> (2018/04/19)</td><td>
|
||||
|
||||
<b>Breaking changes</b>
|
||||
<ul>
|
||||
<li>The minimal standard for C++ has been raised to C++11. Compilers not supporting C++11 or higher are no longer supported</li>
|
||||
<li>Removed the python bindings from this project. They have migrated to a <a href="https://www.graphics.rwth-aachen.de:9000/OpenMesh/openmesh-python">seperate project</a>.</li>
|
||||
</ul>
|
||||
|
||||
<b>Core</b>
|
||||
@@ -19,14 +56,25 @@
|
||||
<li>make all negative handles invalid, not just -1</li>
|
||||
<li>Several warnings fixed (Including the checked iterators)</li>
|
||||
<li>split_copy and split_edge_copy operations now also copy internal properties.</li>
|
||||
<li>copy face properties in split_copy(EdgeHandle, VertexHandle)</li>
|
||||
<li>fix halfedge indices in OpenMeshTrimeshCirculatorHalfedgeLoop CWAndCCWCheck</li>
|
||||
<li>Fix wrong behaviour of HalfedgeLoopIterators by changing the template parameter</li>
|
||||
<li>Added 1-4 triangle split funtion(splits all edges at Midpoints)</li>
|
||||
<li>Boost range support (Thanks to Bastian Pranzas for the patch)</li>
|
||||
<li>Made the face and edge split operations that copy properties also copy builtin properties</li>
|
||||
<li>calc_sector_angle: Check for real division by zero not with epsilon that was way to large</li>
|
||||
<li>Don't return invalid iterators for empty element ranges</li>
|
||||
<li>Mark halfedges as deleted after collapse</li>
|
||||
<li>Let default range-based for skip deleted elements and add a version that includes deleted elements</li>
|
||||
<li>Moved length() by norm() to external functions. This allows us to support other vector types instead of Vec3d (e.g. via Eigen) </li>
|
||||
</ul>
|
||||
|
||||
<b>Utils</b>
|
||||
<ul>
|
||||
<li>enable c++11 features of many classes for Visual Studio 2013</li>
|
||||
<li>Fixed broken version macros (Thanks to Frederik Salomonsson for the fix)</li>
|
||||
<li>Fixed Build on gcc-7.2 (Thanks to Gero Müller and Martial Tola for the patches)</li>
|
||||
<li>Small compilation fix for MINGW64 cross-compilation(Thanks to Manuel Massing for the patch)</li>
|
||||
</ul>
|
||||
|
||||
<b>Tools</b>
|
||||
@@ -39,21 +87,26 @@
|
||||
<ul>
|
||||
<li>QuadricT: implement Q+Q and Q*scalar operators for convenience.</li>
|
||||
<li>Vector11T: Make converting ctor only accept 2 arguments</li>
|
||||
<li>Only compute normals for faces that are not deleted</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<b>IO</b>
|
||||
<ul>
|
||||
<li>ImporterT: Modified the add_face function of importerT to always return a valid FaceHandle</li>
|
||||
<li>ImporterT: Return a valid FaceHandle when adding non-manifold faces.</li>
|
||||
<li>BaseExporter: Added accessor functions for HalfEdgeHandles and faceTexCoords to base exporter and exporter template.</li>
|
||||
<li>OBJ Writer: Fail if vertex color export was requested (Thanks to Manuel Massing)</li>
|
||||
<li>OBJ Writer: Added functionality to store FaceTexCoords to objwriter</li>
|
||||
<li>OBJ Writer: Applied fix for bad or missing vertex tex coords (Thanks to Gero Müller for the patch)</li>
|
||||
<li>OBJ Writer: Fix vertex texture coordinates export in OBJ writer</li>
|
||||
<li>OBJ Loader: range check for vertex colors and normals in OBJ loader</li>
|
||||
<li>OBJ Loader: fixed handling of negative indices in OBJ loader</li>
|
||||
<li>OM Writer: Fixed OMWriter when no faces are available (Thanks to Jamie Kydd for the patch)</li>
|
||||
<li>OM Writer: Added Mark to the format header to identify end of stream correctly (Thanks to Jamie Kydd for the patch)</li>
|
||||
<li>PLY Reader: Skip reading extra elements after face</li>
|
||||
<li>PLY Reader: Return error when reaching EOF</li>
|
||||
|
||||
<li>OMFormat: Fix implicit fallthrough warning on gcc(Thanks to Manuel Massing for the patch)</li>
|
||||
</ul>
|
||||
|
||||
<b>Unittests</b>
|
||||
@@ -62,14 +115,10 @@
|
||||
<li>Added unittest for split_edge_copy operations on Tri and PolyMeshes</li>
|
||||
</ul>
|
||||
|
||||
<b>Python</b>
|
||||
<ul>
|
||||
<li>fix the stripping of the python libs version string</li>
|
||||
</ul>
|
||||
|
||||
<b>General</b>
|
||||
<ul>
|
||||
<li>Updated Logo</li>
|
||||
<li>Only Issue Warning if compile Order for MeshIO.hh is violated. Check will be removed if no errors are reported.</li>
|
||||
</ul>
|
||||
|
||||
</tr>
|
||||
|
||||
163
Doc/compiling.docu
Normal file
163
Doc/compiling.docu
Normal file
@@ -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
|
||||
|
||||
<table>
|
||||
|
||||
<tr><td> Linux </td><td>
|
||||
gcc >= 4.8.x<br>
|
||||
clang >= 3.3<br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td> Windows </td><td>
|
||||
Microsoft Visual Studio 2013<br>
|
||||
Microsoft Visual Studio 2015<br>
|
||||
Microsoft Visual Studio 2017<br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td> Tested MacOS X Compilers</td>
|
||||
<td>
|
||||
XCode <br>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
\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:<br><br>
|
||||
<table>
|
||||
<tr><td>Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">https://www.qt.io/download</a></td></tr>
|
||||
</table><br>
|
||||
|
||||
\section build_systems Chosing build system
|
||||
|
||||
%OpenMesh can be built using the <b>cmake</b> build system.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
\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. <b>Change to the newly created directory</b> and type
|
||||
<br/><br/>
|
||||
<tt>
|
||||
cmake .. ## Generates the appropriate Makefiles<br>
|
||||
make ## Builds the project<br>
|
||||
</tt><br>
|
||||
|
||||
\warning If your compiler does not support c++11 natively, you might have to enable it by changing the cmake call to: <br>
|
||||
<tt>cmake .. -DCMAKE_CXX_FLAGS=-std=c++98</tt>
|
||||
|
||||
You can choose the build type by using cmake with the flag<br>
|
||||
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b> The default is: Release <br>
|
||||
|
||||
Other flags are:<br/>
|
||||
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
|
||||
<b>-DCMAKE_INSTALL_PREFIX=<path></b> to specify the install path.<br/>
|
||||
|
||||
When calling <b>make install</b> 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 <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
|
||||
|
||||
|
||||
There are some additional targets:<br>
|
||||
<b>doc</b>: Builds the Documentation<br>
|
||||
<b>doc-install</b>: Builds the Documentation and installs it<br>
|
||||
<br>
|
||||
\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.
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li> Get Visual Studio ( 2013-2017 ) </li>
|
||||
<li> Extract %OpenMesh source code. </li>
|
||||
<li> Get all required libraries and install them ( including headers! ).</li>
|
||||
<li> Download and install cmake: <a href="https://cmake.org/download/">www.cmake.org</a>.<br> </li>
|
||||
<li> Start the cmake gui and open the %OpenMesh toplevel directory as source directory </li>
|
||||
<li> Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder) </li>
|
||||
<li> Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly. <br>
|
||||
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. </li>
|
||||
<li> Click generate to create the visual studio project files </li>
|
||||
<li> You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake </li>
|
||||
<li> Now you can build %OpenMesh from within Visual Studio using the newly created project file. </li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
\section sec_compiling_macosx MacOS X
|
||||
|
||||
Download and install required libraries as stated above.
|
||||
You can download %OpenMesh's sources from <tt>www.openmesh.org</tt> or check out the latest repository via GIT:<br/>
|
||||
<tt>https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh</tt>.<br/><br/>
|
||||
|
||||
\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.<br/>
|
||||
Once installed, change to %OpenMesh's root directory and create a directory
|
||||
named e.g. "buildDebug" (assuming you want to build with debug symbols).<br/>
|
||||
Then type in the following command to initially set up the build environment:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
cmake .. ## Generates the appropriate Makefiles<br>
|
||||
</tt>
|
||||
<br/>
|
||||
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:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
ccmake . ## Configure build environment<br>
|
||||
</tt>
|
||||
<br/>
|
||||
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:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
make ## Build %OpenMesh<br>
|
||||
</tt>
|
||||
<br/>
|
||||
And optionally:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
make doc ## Build %OpenMesh's documentation<br>
|
||||
</tt>
|
||||
<br>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -87,14 +87,6 @@ repeatedly replacing each vertex' position by the center of gravity
|
||||
|
||||
<br /><br />
|
||||
|
||||
\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
|
||||
|
||||
<br /><br />
|
||||
|
||||
\subpage additional_information
|
||||
|
||||
\li \ref mesh_first_to_read
|
||||
|
||||
163
Doc/misc.docu
163
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.
|
||||
|
||||
<table>
|
||||
|
||||
<tr><td> Linux </td><td>
|
||||
gcc 4.6.x<br>
|
||||
gcc 4.7.x<br>
|
||||
gcc 4.8.x<br>
|
||||
gcc 4.9.x<br>
|
||||
clang 3.3<br>
|
||||
clang 3.4<br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td> Windows </td><td>
|
||||
Microsoft Visual Studio 2008<br>
|
||||
Microsoft Visual Studio 2010<br>
|
||||
Microsoft Visual Studio 2012<br>
|
||||
Microsoft Visual Studio 2013<br>
|
||||
Microsoft Visual Studio 2015<br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td> Tested MacOS X Compilers</td>
|
||||
<td>
|
||||
XCode 4.3 <br>
|
||||
XCode 4.4 <br>
|
||||
XCode 4.5 <br>
|
||||
XCode 5.1.1 <br>
|
||||
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) <br>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
\section req_libs Required libraries (Only for included Apps)
|
||||
|
||||
Install the following external libraries / frameworks if you want to use the included Applications:<br><br>
|
||||
<table>
|
||||
<tr><td>Qt4/Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">http://qt-project.org/downloads</a></td></tr>
|
||||
</table><br>
|
||||
|
||||
\section build_systems Chosing build system
|
||||
|
||||
%OpenMesh can be built using the <b>cmake</b> build system.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
\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. <b>Change to the newly created directory</b> and type
|
||||
<br/><br/>
|
||||
<tt>
|
||||
cmake .. ## Generates the appropriate Makefiles<br>
|
||||
make ## Builds the project<br>
|
||||
</tt><br>
|
||||
You can choose the build type by using cmake with the flag<br>
|
||||
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b><br>
|
||||
The default is: Debug
|
||||
<br>
|
||||
Other flags are:<br/>
|
||||
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
|
||||
<b>-DCMAKE_INSTALL_PREFIX=<path></b> to specify the install path.
|
||||
<br/>
|
||||
When calling <b>make install</b> 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 <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
|
||||
|
||||
There are some additional targets:<br>
|
||||
<b>doc</b>: Builds the Documentation<br>
|
||||
<b>doc-install</b>: Builds the Documentation and installs it<br>
|
||||
<br>
|
||||
\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,<br>
|
||||
download and install CMake from <a href="http://www.cmake.org/cmake/resources/software.html">www.cmake.org</a>.<br>
|
||||
(Note: This is not mandatory since there are already VS2008 solution files included in %OpenMesh).<br><br>
|
||||
<ul>
|
||||
<li> Get Visual Studio ( 2008-2013 ) </li>
|
||||
<li> Extract %OpenMesh source code. </li>
|
||||
<li> Get all required libraries and install them ( including headers! ).</li>
|
||||
<li> Get cmake for windows from http://www.cmake.org/cmake/resources/software.html </li>
|
||||
<li> Start the cmake gui and open the %OpenMesh toplevel directory as source directory </li>
|
||||
<li> Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder) </li>
|
||||
<li> 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. </li>
|
||||
<li> Click generate to create the visual studio project files </li>
|
||||
<li> You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake </li>
|
||||
<li> Now you can build %OpenMesh from within Visual Studio using the newly created project file. </li>
|
||||
</ul>
|
||||
|
||||
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.
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
\section sec_compiling_macosx MacOS X
|
||||
|
||||
Download and install required libraries as stated above.
|
||||
You can download %OpenMesh's sources from <tt>www.openmesh.org</tt> or check out the latest repository via SVN:<br/>
|
||||
<tt>svn co http://www.openmesh.org/svnrepo/OpenMesh/trunk %OpenMesh</tt>.<br/><br/>
|
||||
|
||||
\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.<br/>
|
||||
Once installed, change to %OpenMesh's root directory and create a directory
|
||||
named e.g. "buildDebug" (assuming you want to build with debug symbols).<br/>
|
||||
Then type in the following command to initially set up the build environment:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
cmake .. ## Generates the appropriate Makefiles<br>
|
||||
</tt>
|
||||
<br/>
|
||||
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:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
ccmake . ## Configure build environment<br>
|
||||
</tt>
|
||||
<br/>
|
||||
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:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
make ## Build %OpenMesh<br>
|
||||
</tt>
|
||||
<br/>
|
||||
And optionally:
|
||||
<br/><br/>
|
||||
<tt>
|
||||
make doc ## Build %OpenMesh's documentation<br>
|
||||
</tt>
|
||||
<br>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -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. <prefix>/include
|
||||
BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/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.
|
||||
|
||||
|
||||
|
||||
<br>The complete source looks like this:
|
||||
|
||||
\include python_tutorial.py
|
||||
|
||||
|
||||
**/
|
||||
18
OpenMesh.pro
18
OpenMesh.pro
@@ -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)
|
||||
26
README.md
26
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.
|
||||
|
||||
|
||||
4
VERSION
4
VERSION
@@ -1,6 +1,6 @@
|
||||
VERSION=7.0
|
||||
VERSION=7.2
|
||||
MAJOR=7
|
||||
MINOR=0
|
||||
MINOR=2
|
||||
PATCH=0
|
||||
ID=OPENMESH
|
||||
|
||||
|
||||
@@ -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} <path to the sources>\".")
|
||||
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} <path to the sources>\".")
|
||||
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
|
||||
$<TARGET_FILE:${_target}>
|
||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
|
||||
add_custom_command (TARGET ${_target} POST_BUILD
|
||||
add_custom_command (TARGET ${_target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
copy_if_different
|
||||
$<TARGET_LINKER_FILE:${_target}>
|
||||
@@ -671,22 +341,22 @@ function (acg_add_library _target _libtype)
|
||||
$<TARGET_FILE:${_target}>
|
||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/$<TARGET_FILE_NAME:${_target}>)
|
||||
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
|
||||
$<TARGET_FILE:${_target}>
|
||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
|
||||
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
|
||||
$<TARGET_FILE:${_target}>
|
||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/$<TARGET_FILE_NAME:${_target}>)
|
||||
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 ()
|
||||
|
||||
396
cmake/ACGQt.cmake
Normal file
396
cmake/ACGQt.cmake
Normal file
@@ -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>${_file}</file>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
string(REGEX REPLACE "plugin" ${plugin} newline ${_line})
|
||||
file(APPEND ${qhp_file} "${newline}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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!!")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
################################################################################
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
|
||||
|
||||
/// default constructor
|
||||
DecimaterViewerWidget(QWidget* _parent=0)
|
||||
explicit DecimaterViewerWidget(QWidget* _parent=0)
|
||||
: MeshViewerWidget(_parent),
|
||||
animate_(false),
|
||||
timer_(0),
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
################################################################################
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include( $$TOPDIR/qmake/all.include )
|
||||
|
||||
INCLUDEPATH += ../../..
|
||||
|
||||
Application()
|
||||
glew()
|
||||
glut()
|
||||
openmesh()
|
||||
|
||||
DIRECTORIES = ..
|
||||
|
||||
# Input
|
||||
SOURCES += ../decimater.cc
|
||||
|
||||
################################################################################
|
||||
@@ -82,7 +82,7 @@ class MeshViewerWidget : public MeshViewerWidgetT<MyMesh>
|
||||
Q_OBJECT
|
||||
public:
|
||||
/// default constructor
|
||||
MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT<MyMesh>(parent)
|
||||
explicit MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT<MyMesh>(parent)
|
||||
{}
|
||||
OpenMesh::IO::Options& options() { return _options; }
|
||||
const OpenMesh::IO::Options& options() const { return _options; }
|
||||
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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
|
||||
|
||||
################################################################################
|
||||
@@ -1,15 +0,0 @@
|
||||
################################################################################
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include( $$TOPDIR/qmake/all.include )
|
||||
|
||||
INCLUDEPATH += ../../..
|
||||
|
||||
Application()
|
||||
openmesh()
|
||||
|
||||
# Input
|
||||
SOURCES += ../adaptive_subdivider.cc
|
||||
|
||||
################################################################################
|
||||
@@ -1,15 +0,0 @@
|
||||
################################################################################
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include( $$TOPDIR/qmake/all.include )
|
||||
|
||||
INCLUDEPATH += ../../..
|
||||
|
||||
Application()
|
||||
openmesh()
|
||||
|
||||
# Input
|
||||
SOURCES += ../subdivider.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));
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
ServerSideVDPM() { clear(); }
|
||||
ServerSideVDPM() :name_(""),tree_id_bits_(0) { clear(); }
|
||||
void clear();
|
||||
|
||||
const char* name() const { return name_; }
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
ServerSideVDPM() { clear(); }
|
||||
ServerSideVDPM(): name_(""),tree_id_bits_(0) { clear(); }
|
||||
void clear();
|
||||
|
||||
const char* name() const { return name_; }
|
||||
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -718,6 +718,47 @@ noexcept(noexcept(_v1.swap(_v2))) {
|
||||
_v1.swap(_v2);
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member norm
|
||||
template<typename Scalar, int DIM>
|
||||
Scalar norm(const VectorT<Scalar, DIM>& _v) {
|
||||
return _v.norm();
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member sqrnorm
|
||||
template<typename Scalar, int DIM>
|
||||
Scalar sqrnorm(const VectorT<Scalar, DIM>& _v) {
|
||||
return _v.sqrnorm();
|
||||
}
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member vectorize
|
||||
template<typename Scalar, int DIM, typename OtherScalar>
|
||||
VectorT<Scalar, DIM>& vectorize(VectorT<Scalar, DIM>& _v, OtherScalar const& _val) {
|
||||
return _v.vectorize(_val);
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member normalize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& normalize(VectorT<Scalar, DIM>& _v) {
|
||||
return _v.normalize();
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member maximize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& maximize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.maximize(_v2);
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member minimize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& minimize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.minimize(_v2);
|
||||
}
|
||||
|
||||
//== TYPEDEFS =================================================================
|
||||
|
||||
/** 1-byte signed vector */
|
||||
|
||||
@@ -274,6 +274,52 @@ cross(const VectorT<Scalar,N>& _v1, const VectorT<Scalar,N>& _v2) {
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member norm
|
||||
template<typename Scalar, int DIM>
|
||||
Scalar norm(const VectorT<Scalar, DIM>& _v) {
|
||||
return _v.norm();
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member sqrnorm
|
||||
template<typename Scalar, int DIM>
|
||||
Scalar sqrnorm(const VectorT<Scalar, DIM>& _v) {
|
||||
return _v.sqrnorm();
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member vectorize
|
||||
template<typename Scalar, int DIM, typename OtherScalar>
|
||||
VectorT<Scalar, DIM>& vectorize(VectorT<Scalar, DIM>& _v, OtherScalar const& _val) {
|
||||
return _v.vectorize(_val);
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member normalize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& normalize(VectorT<Scalar, DIM>& _v) {
|
||||
return _v.normalize();
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member maximize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& maximize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.maximize(_v2);
|
||||
}
|
||||
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member minimize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& minimize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.minimize(_v2);
|
||||
}
|
||||
|
||||
|
||||
//== TYPEDEFS =================================================================
|
||||
|
||||
@@ -55,11 +55,24 @@
|
||||
|
||||
// -------------------- system settings
|
||||
#include <OpenMesh/Core/System/config.h>
|
||||
|
||||
// -------------------- 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 <OpenMesh/Core/IO/SR_store.hh>
|
||||
#include <OpenMesh/Core/IO/IOManager.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;
|
||||
|
||||
@@ -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<T>(v);
|
||||
break;
|
||||
}
|
||||
case OMFormat::Chunk::Integer_32:
|
||||
{
|
||||
OMFormat::int32 v;
|
||||
bytes = restore( _is, v, _swap );
|
||||
_val = static_cast<T>(v);
|
||||
break;
|
||||
}
|
||||
case OMFormat::Chunk::Integer_64:
|
||||
{
|
||||
OMFormat::int64 v;
|
||||
bytes = restore( _is, v, _swap );
|
||||
_val = static_cast<T>(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,
|
||||
|
||||
@@ -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<int, int>(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<int, int>(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<int, int>(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<int, int>(std::isspace))).base(), _string.end());
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
return _string;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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<nF; ++i)
|
||||
for (size_t i=0, nV=_be.n_vertices(); i<nV; ++i)
|
||||
{
|
||||
vh = VertexHandle(static_cast<int>(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
|
||||
|
||||
@@ -163,7 +163,7 @@ _OMWriter_::write(std::ostream& _os, BaseExporter& _be, Options _opt, std::strea
|
||||
#ifndef DOXY_IGNORE_THIS
|
||||
template <typename T> 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<nF; ++i)
|
||||
{
|
||||
nV = _be.get_vhandles(FaceHandle(i), vhandles);
|
||||
//nV = _be.get_vhandles(FaceHandle(i), vhandles);
|
||||
_be.get_vhandles(FaceHandle(i), vhandles);
|
||||
if ( header.mesh_ == 'P' )
|
||||
bytes += store( _os, vhandles.size(), OMFormat::Chunk::Integer_16, swap );
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ write_stla(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
|
||||
|
||||
|
||||
|
||||
int i, nF(int(_be.n_faces())), nV;
|
||||
int i, nF(int(_be.n_faces()));
|
||||
Vec3f a, b, c, n;
|
||||
std::vector<VertexHandle> vhandles;
|
||||
FaceHandle fh;
|
||||
@@ -172,7 +172,7 @@ write_stla(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
|
||||
for (i=0; i<nF; ++i)
|
||||
{
|
||||
fh = FaceHandle(i);
|
||||
nV = _be.get_vhandles(fh, vhandles);
|
||||
const int nV = _be.get_vhandles(fh, vhandles);
|
||||
|
||||
if (nV == 3)
|
||||
{
|
||||
@@ -211,7 +211,7 @@ write_stla(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
|
||||
{
|
||||
omlog() << "[STLWriter] : write ascii file\n";
|
||||
|
||||
int i, nF(int(_be.n_faces())), nV;
|
||||
int i, nF(int(_be.n_faces()));
|
||||
Vec3f a, b, c, n;
|
||||
std::vector<VertexHandle> vhandles;
|
||||
FaceHandle fh;
|
||||
@@ -226,7 +226,7 @@ write_stla(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
|
||||
for (i=0; i<nF; ++i)
|
||||
{
|
||||
fh = FaceHandle(i);
|
||||
nV = _be.get_vhandles(fh, vhandles);
|
||||
const int nV = _be.get_vhandles(fh, vhandles);
|
||||
|
||||
if (nV == 3)
|
||||
{
|
||||
@@ -273,7 +273,7 @@ write_stlb(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
|
||||
}
|
||||
|
||||
|
||||
int i, nF(int(_be.n_faces())), nV;
|
||||
int i, nF(int(_be.n_faces()));
|
||||
Vec3f a, b, c, n;
|
||||
std::vector<VertexHandle> vhandles;
|
||||
FaceHandle fh;
|
||||
@@ -294,7 +294,7 @@ write_stlb(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
|
||||
for (i=0; i<nF; ++i)
|
||||
{
|
||||
fh = FaceHandle(i);
|
||||
nV = _be.get_vhandles(fh, vhandles);
|
||||
const int nV = _be.get_vhandles(fh, vhandles);
|
||||
|
||||
if (nV == 3)
|
||||
{
|
||||
@@ -344,7 +344,7 @@ write_stlb(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
|
||||
omlog() << "[STLWriter] : write binary file\n";
|
||||
|
||||
|
||||
int i, nF(int(_be.n_faces())), nV;
|
||||
int i, nF(int(_be.n_faces()));
|
||||
Vec3f a, b, c, n;
|
||||
std::vector<VertexHandle> vhandles;
|
||||
FaceHandle fh;
|
||||
@@ -366,7 +366,7 @@ write_stlb(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
|
||||
for (i=0; i<nF; ++i)
|
||||
{
|
||||
fh = FaceHandle(i);
|
||||
nV = _be.get_vhandles(fh, vhandles);
|
||||
const int nV = _be.get_vhandles(fh, vhandles);
|
||||
|
||||
if (nV == 3)
|
||||
{
|
||||
|
||||
@@ -37,146 +37,145 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||
* *
|
||||
* ========================================================================= */
|
||||
|
||||
/*===========================================================================*\
|
||||
* *
|
||||
* $Revision$ *
|
||||
* $Date$ *
|
||||
* *
|
||||
\*===========================================================================*/
|
||||
|
||||
#include <OpenMesh/Core/Mesh/ArrayKernel.hh>
|
||||
|
||||
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<VertexHandle*> empty_vh;
|
||||
std::vector<HalfedgeHandle*> empty_hh;
|
||||
std::vector<FaceHandle*> empty_fh;
|
||||
garbage_collection( empty_vh,empty_hh,empty_fh,_v, _e, _f);
|
||||
}
|
||||
|
||||
* ========================================================================= */
|
||||
|
||||
/*===========================================================================*\
|
||||
* *
|
||||
* $Revision$ *
|
||||
* $Date$ *
|
||||
* *
|
||||
\*===========================================================================*/
|
||||
|
||||
#include <OpenMesh/Core/Mesh/ArrayKernel.hh>
|
||||
|
||||
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<VertexHandle*> empty_vh;
|
||||
std::vector<HalfedgeHandle*> empty_hh;
|
||||
std::vector<FaceHandle*> 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_);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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 ;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -165,8 +165,9 @@ namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<OpenMesh::BaseHandle >
|
||||
: public std::unary_function<OpenMesh::BaseHandle, std::size_t>
|
||||
{
|
||||
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<OpenMesh::BaseHandle >
|
||||
|
||||
template <>
|
||||
struct hash<OpenMesh::VertexHandle >
|
||||
: public std::unary_function<OpenMesh::VertexHandle, std::size_t>
|
||||
{
|
||||
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<OpenMesh::VertexHandle >
|
||||
|
||||
template <>
|
||||
struct hash<OpenMesh::HalfedgeHandle >
|
||||
: public std::unary_function<OpenMesh::HalfedgeHandle, std::size_t>
|
||||
{
|
||||
|
||||
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<OpenMesh::HalfedgeHandle >
|
||||
|
||||
template <>
|
||||
struct hash<OpenMesh::EdgeHandle >
|
||||
: public std::unary_function<OpenMesh::EdgeHandle, std::size_t>
|
||||
{
|
||||
|
||||
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<OpenMesh::EdgeHandle >
|
||||
|
||||
template <>
|
||||
struct hash<OpenMesh::FaceHandle >
|
||||
: public std::unary_function<OpenMesh::FaceHandle, std::size_t>
|
||||
{
|
||||
|
||||
typedef OpenMesh::FaceHandle argument_type;
|
||||
typedef std::size_t result_type;
|
||||
|
||||
std::size_t operator()(const OpenMesh::FaceHandle& h) const
|
||||
{
|
||||
return h.idx();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -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<
|
||||
|
||||
@@ -139,18 +139,18 @@ PolyMeshT<Kernel>::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<typename Normal::value_type>(a[1] * b[2]);
|
||||
n[1] += static_cast<typename Normal::value_type>(a[2] * b[0]);
|
||||
n[2] += static_cast<typename Normal::value_type>(a[0] * b[1]);
|
||||
n[0] += static_cast<typename vector_traits<Normal>::value_type>(a[1] * b[2]);
|
||||
n[1] += static_cast<typename vector_traits<Normal>::value_type>(a[2] * b[0]);
|
||||
n[2] += static_cast<typename vector_traits<Normal>::value_type>(a[0] * b[1]);
|
||||
}
|
||||
|
||||
const typename vector_traits<Normal>::value_type norm = n.length();
|
||||
const typename vector_traits<Normal>::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<Normal>::value_type(0))
|
||||
? ((n *= (typename vector_traits<Normal>::value_type(1)/norm)), n)
|
||||
return (length != typename vector_traits<Normal>::value_type(0))
|
||||
? ((n *= (typename vector_traits<Normal>::value_type(1)/length)), n)
|
||||
: Normal(0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -194,20 +194,22 @@ calc_face_normal_impl(const Point& _p0,
|
||||
Normal p1p2(vector_cast<Normal>(_p2)); p1p2 -= vector_cast<Normal>(_p1);
|
||||
|
||||
Normal n = cross(p1p2, p1p0);
|
||||
typename vector_traits<Normal>::value_type norm = n.length();
|
||||
typename vector_traits<Normal>::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<Normal>::value_type(0)) ? ((n *= (typename vector_traits<Normal>::value_type(1)/norm)),n) : Normal(0,0,0);
|
||||
return (length != typename vector_traits<Normal>::value_type(0))
|
||||
? ((n *= (typename vector_traits<Normal>::value_type(1)/length)),n)
|
||||
: Normal(0,0,0);
|
||||
#else
|
||||
Point p1p0 = _p0; p1p0 -= _p1;
|
||||
Point p1p2 = _p2; p1p2 -= _p1;
|
||||
|
||||
Normal n = vector_cast<Normal>(cross(p1p2, p1p0));
|
||||
typename vector_traits<Normal>::value_type norm = n.length();
|
||||
typename vector_traits<Normal>::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<Kernel>::
|
||||
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<Kernel>::
|
||||
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<fhs.size(); ++i)
|
||||
n += Kernel::normal(fhs[i]);
|
||||
|
||||
return n.normalize();
|
||||
return normalize(n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,8 +380,8 @@ calc_vertex_normal(VertexHandle _vh) const
|
||||
Normal n;
|
||||
calc_vertex_normal_fast(_vh,n);
|
||||
|
||||
Scalar norm = n.length();
|
||||
if (norm != 0.0) n *= (Scalar(1.0)/norm);
|
||||
Scalar length = norm(n);
|
||||
if (length != 0.0) n *= (Scalar(1.0)/length);
|
||||
|
||||
return n;
|
||||
}
|
||||
@@ -389,7 +391,7 @@ template <class Kernel>
|
||||
void PolyMeshT<Kernel>::
|
||||
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 <class Kernel>
|
||||
void PolyMeshT<Kernel>::
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<typename vector_traits<Point>::value_type >(0.5);
|
||||
const Point new1 = (this->point(p0) + this->point(p1)) * static_cast<typename vector_traits<Point>::value_type >(0.5);
|
||||
const Point new2 = (this->point(p1) + this->point(p2)) * static_cast<typename vector_traits<Point>::value_type >(0.5);
|
||||
|
||||
// Add vertices at midpoint coordinates
|
||||
VertexHandle v0 = this->add_vertex(new0);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -95,7 +95,6 @@ inline void vector_cast( const src_t & /*_src*/, dst_t & /*_dst*/, GenProg::Int2
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template <typename src_t, typename dst_t, int n>
|
||||
inline void vector_copy( const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
public:
|
||||
|
||||
// construct with a given mesh
|
||||
SmootherT(Mesh& _mesh)
|
||||
explicit SmootherT(Mesh& _mesh)
|
||||
: mesh_(_mesh)
|
||||
{
|
||||
mesh_.add_property( cog_ );
|
||||
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -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)
|
||||
|
||||
################################################################################
|
||||
@@ -181,7 +181,7 @@ compute_new_positions_C1()
|
||||
if (diag) uu *= static_cast<typename Mesh::Scalar>(1.0) / diag;
|
||||
|
||||
// damping
|
||||
uu *= static_cast<typename Mesh::Normal::value_type>(0.25);
|
||||
uu *= static_cast<typename vector_traits<typename Mesh::Normal>::value_type>(0.25);
|
||||
|
||||
// store new position
|
||||
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
|
||||
typedef RuleInterfaceT<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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<M> 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
|
||||
|
||||
@@ -346,7 +346,7 @@ CatmullClarkT<MeshType,RealType>::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<typename MeshType::Point::value_type>(3.0);
|
||||
pos /= static_cast<typename vector_traits<typename MeshType::Point>::value_type>(3.0);
|
||||
}
|
||||
else // inner vertex
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
################################################################################
|
||||
@@ -64,7 +64,7 @@ int getche() { return ::_getche(); }
|
||||
} // AS
|
||||
|
||||
// ----------------------------------------------------------------- Win32 ----
|
||||
#elif defined(WIN32)
|
||||
#elif defined(WIN32) || defined(__MINGW32__)
|
||||
|
||||
#include <conio.h>
|
||||
|
||||
@@ -91,6 +91,7 @@ int getche() { return ::getche(); }
|
||||
#endif
|
||||
#include <termios.h> /* tcsetattr() */
|
||||
#include <sys/ioctl.h> /* ioctl() */
|
||||
#include <sys/time.h> /* timeval struct */
|
||||
|
||||
namespace OpenMesh {
|
||||
namespace Utils {
|
||||
|
||||
@@ -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 <memory>
|
||||
|
||||
namespace OpenMesh {
|
||||
namespace Python {
|
||||
|
||||
/**
|
||||
* Expose mesh items to %Python.
|
||||
*/
|
||||
void expose_items() {
|
||||
class_<ArrayItems::Vertex>("Vertex");
|
||||
class_<ArrayItems::Halfedge>("Halfedge");
|
||||
class_<ArrayItems::Edge>("Edge");
|
||||
class_<ArrayItems::Face>("Face");
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose item and property handles to %Python.
|
||||
*/
|
||||
void expose_handles() {
|
||||
class_<BaseHandle>("BaseHandle", init<optional<int> >())
|
||||
.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, bases<BaseHandle> >("VertexHandle", init<optional<int> >());
|
||||
class_<HalfedgeHandle, bases<BaseHandle> >("HalfedgeHandle", init<optional<int> >());
|
||||
class_<EdgeHandle, bases<BaseHandle> >("EdgeHandle", init<optional<int> >());
|
||||
class_<FaceHandle, bases<BaseHandle> >("FaceHandle", init<optional<int> >());
|
||||
|
||||
class_<BasePropHandleT<object>, bases<BaseHandle> >("BasePropHandle", init<optional<int> >());
|
||||
|
||||
class_<VPropHandleT<object>, bases<BasePropHandleT<object> > >("VPropHandle", init<optional<int> >())
|
||||
.def(init<const BasePropHandleT<object>&>());
|
||||
class_<HPropHandleT<object>, bases<BasePropHandleT<object> > >("HPropHandle", init<optional<int> >())
|
||||
.def(init<const BasePropHandleT<object>&>());
|
||||
class_<EPropHandleT<object>, bases<BasePropHandleT<object> > >("EPropHandle", init<optional<int> >())
|
||||
.def(init<const BasePropHandleT<object>&>());
|
||||
class_<FPropHandleT<object>, bases<BasePropHandleT<object> > >("FPropHandle", init<optional<int> >())
|
||||
.def(init<const BasePropHandleT<object>&>());
|
||||
class_<MPropHandleT<object>, bases<BasePropHandleT<object> > >("MPropHandle", init<optional<int> >())
|
||||
.def(init<const BasePropHandleT<object>&>());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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>("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>("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<float, 2>("Vec2f");
|
||||
expose_vec<float, 3>("Vec3f");
|
||||
expose_vec<float, 4>("Vec4f");
|
||||
expose_vec<double, 2>("Vec2d");
|
||||
expose_vec<double, 3>("Vec3d");
|
||||
expose_vec<double, 4>("Vec4d");
|
||||
|
||||
expose_mesh<PolyMesh>("PolyMesh");
|
||||
expose_mesh<TriMesh>("TriMesh");
|
||||
|
||||
expose_iterator<OpenMesh::PolyConnectivity::VertexIter, &OpenMesh::ArrayKernel::n_vertices>("VertexIter");
|
||||
expose_iterator<OpenMesh::PolyConnectivity::HalfedgeIter, &OpenMesh::ArrayKernel::n_halfedges>("HalfedgeIter");
|
||||
expose_iterator<OpenMesh::PolyConnectivity::EdgeIter, &OpenMesh::ArrayKernel::n_edges>("EdgeIter");
|
||||
expose_iterator<OpenMesh::PolyConnectivity::FaceIter, &OpenMesh::ArrayKernel::n_faces>("FaceIter");
|
||||
|
||||
expose_circulator<OpenMesh::PolyConnectivity::VertexVertexIter, VertexHandle>("VertexVertexIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::VertexIHalfedgeIter, VertexHandle>("VertexIHalfedgeIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::VertexOHalfedgeIter, VertexHandle>("VertexOHalfedgeIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::VertexEdgeIter, VertexHandle>("VertexEdgeIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::VertexFaceIter, VertexHandle>("VertexFaceIter");
|
||||
|
||||
expose_circulator<OpenMesh::PolyConnectivity::FaceVertexIter, FaceHandle>("FaceVertexIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::FaceHalfedgeIter, FaceHandle>("FaceHalfedgeIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::FaceEdgeIter, FaceHandle>("FaceEdgeIter");
|
||||
expose_circulator<OpenMesh::PolyConnectivity::FaceFaceIter, FaceHandle>("FaceFaceIter");
|
||||
|
||||
expose_circulator<OpenMesh::PolyConnectivity::HalfedgeLoopIter, HalfedgeHandle>("HalfedgeLoopIter");
|
||||
|
||||
typedef IteratorWrapperT<PolyConnectivity::VertexIter, &ArrayKernel::n_vertices> VertexIterWrapper;
|
||||
typedef IteratorWrapperT<PolyConnectivity::HalfedgeIter, &ArrayKernel::n_halfedges> HalfedgeIterWrapper;
|
||||
typedef IteratorWrapperT<PolyConnectivity::EdgeIter, &ArrayKernel::n_edges> EdgeIterWrapper;
|
||||
typedef IteratorWrapperT<PolyConnectivity::FaceIter, &ArrayKernel::n_faces> FaceIterWrapper;
|
||||
|
||||
expose_property_manager<VPropHandleT<object>, VertexHandle, VertexIterWrapper>("VPropertyManager");
|
||||
expose_property_manager<HPropHandleT<object>, HalfedgeHandle, HalfedgeIterWrapper>("HPropertyManager");
|
||||
expose_property_manager<EPropHandleT<object>, EdgeHandle, EdgeIterWrapper>("EPropertyManager");
|
||||
expose_property_manager<FPropHandleT<object>, FaceHandle, FaceIterWrapper>("FPropertyManager");
|
||||
|
||||
expose_io();
|
||||
|
||||
expose_decimater<PolyMesh>("PolyMesh");
|
||||
expose_decimater<TriMesh>("TriMesh");
|
||||
}
|
||||
|
||||
} // namespace Python
|
||||
} // namespace OpenMesh
|
||||
@@ -1,48 +0,0 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef OPENMESH_PYTHON_BINDINGS_HH
|
||||
#define OPENMESH_PYTHON_BINDINGS_HH
|
||||
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/python/return_internal_reference.hpp>
|
||||
#include <boost/python/reference_existing_object.hpp>
|
||||
#include <boost/python/copy_const_reference.hpp>
|
||||
|
||||
#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<copy_const_reference>()
|
||||
|
||||
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<MeshTraits> TriMesh;
|
||||
typedef OpenMesh::PolyMesh_ArrayKernelT<MeshTraits> PolyMesh;
|
||||
|
||||
} // namespace OpenMesh
|
||||
} // namespace Python
|
||||
|
||||
#endif
|
||||
@@ -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()
|
||||
@@ -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 Circulator, class CenterEntityHandle>
|
||||
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<class Circulator, class CenterEntityHandle>
|
||||
void expose_circulator(const char *_name) {
|
||||
class_<CirculatorWrapperT<Circulator, CenterEntityHandle> >(_name, init<TriMesh&, CenterEntityHandle>())
|
||||
.def(init<PolyMesh&, CenterEntityHandle>())
|
||||
.def("__iter__", &CirculatorWrapperT<Circulator, CenterEntityHandle>::iter)
|
||||
.def("__next__", &CirculatorWrapperT<Circulator, CenterEntityHandle>::next)
|
||||
.def("next", &CirculatorWrapperT<Circulator, CenterEntityHandle>::next)
|
||||
;
|
||||
}
|
||||
|
||||
} // namespace OpenMesh
|
||||
} // namespace Python
|
||||
|
||||
#endif
|
||||
@@ -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 <cstdio>
|
||||
|
||||
namespace OpenMesh {
|
||||
namespace Python {
|
||||
|
||||
#define INIT_MESH_REF init<Mesh&>()[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 <class Handle>
|
||||
void expose_module_handle(const char *_name) {
|
||||
class_<Handle, boost::noncopyable>(_name)
|
||||
.def("is_valid", &Handle::is_valid)
|
||||
;
|
||||
}
|
||||
|
||||
template <class Module>
|
||||
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 <class Mesh>
|
||||
void expose_decimater(const char *_name) {
|
||||
|
||||
typedef Decimater::ModBaseT<Mesh> ModBase;
|
||||
typedef Decimater::ModAspectRatioT<Mesh> ModAspectRatio;
|
||||
typedef Decimater::ModEdgeLengthT<Mesh> ModEdgeLength;
|
||||
typedef Decimater::ModHausdorffT<Mesh> ModHausdorff;
|
||||
typedef Decimater::ModIndependentSetsT<Mesh> ModIndependentSets;
|
||||
typedef Decimater::ModNormalDeviationT<Mesh> ModNormalDeviation;
|
||||
typedef Decimater::ModNormalFlippingT<Mesh> ModNormalFlipping;
|
||||
typedef Decimater::ModProgMeshT<Mesh> ModProgMesh;
|
||||
typedef Decimater::ModQuadricT<Mesh> ModQuadric;
|
||||
typedef Decimater::ModRoundnessT<Mesh> ModRoundness;
|
||||
|
||||
typedef Decimater::ModHandleT<ModAspectRatio> ModAspectRatioHandle;
|
||||
typedef Decimater::ModHandleT<ModEdgeLength> ModEdgeLengthHandle;
|
||||
typedef Decimater::ModHandleT<ModHausdorff> ModHausdorffHandle;
|
||||
typedef Decimater::ModHandleT<ModIndependentSets> ModIndependentSetsHandle;
|
||||
typedef Decimater::ModHandleT<ModNormalDeviation> ModNormalDeviationHandle;
|
||||
typedef Decimater::ModHandleT<ModNormalFlipping> ModNormalFlippingHandle;
|
||||
typedef Decimater::ModHandleT<ModProgMesh> ModProgMeshHandle;
|
||||
typedef Decimater::ModHandleT<ModQuadric> ModQuadricHandle;
|
||||
typedef Decimater::ModHandleT<ModRoundness> ModRoundnessHandle;
|
||||
|
||||
typedef Decimater::BaseDecimaterT<Mesh> BaseDecimater;
|
||||
typedef Decimater::DecimaterT<Mesh> Decimater;
|
||||
|
||||
typedef typename ModProgMesh::Info Info;
|
||||
typedef std::vector<Info> InfoList;
|
||||
|
||||
bool (BaseDecimater::*add1)(ModAspectRatioHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add2)(ModEdgeLengthHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add3)(ModHausdorffHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add4)(ModIndependentSetsHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add5)(ModNormalDeviationHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add6)(ModNormalFlippingHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add7)(ModProgMeshHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add8)(ModQuadricHandle&) = &Decimater::add;
|
||||
bool (BaseDecimater::*add9)(ModRoundnessHandle&) = &Decimater::add;
|
||||
|
||||
bool (BaseDecimater::*remove1)(ModAspectRatioHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove2)(ModEdgeLengthHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove3)(ModHausdorffHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove4)(ModIndependentSetsHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove5)(ModNormalDeviationHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove6)(ModNormalFlippingHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove7)(ModProgMeshHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove8)(ModQuadricHandle&) = &Decimater::remove;
|
||||
bool (BaseDecimater::*remove9)(ModRoundnessHandle&) = &Decimater::remove;
|
||||
|
||||
ModAspectRatio& (BaseDecimater::*module1)(ModAspectRatioHandle&) = &Decimater::module;
|
||||
ModEdgeLength& (BaseDecimater::*module2)(ModEdgeLengthHandle&) = &Decimater::module;
|
||||
ModHausdorff& (BaseDecimater::*module3)(ModHausdorffHandle&) = &Decimater::module;
|
||||
ModIndependentSets& (BaseDecimater::*module4)(ModIndependentSetsHandle&) = &Decimater::module;
|
||||
ModNormalDeviation& (BaseDecimater::*module5)(ModNormalDeviationHandle&) = &Decimater::module;
|
||||
ModNormalFlipping& (BaseDecimater::*module6)(ModNormalFlippingHandle&) = &Decimater::module;
|
||||
ModProgMesh& (BaseDecimater::*module7)(ModProgMeshHandle&) = &Decimater::module;
|
||||
ModQuadric& (BaseDecimater::*module8)(ModQuadricHandle&) = &Decimater::module;
|
||||
ModRoundness& (BaseDecimater::*module9)(ModRoundnessHandle&) = &Decimater::module;
|
||||
|
||||
// Decimater
|
||||
// ----------------------------------------
|
||||
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "Decimater");
|
||||
|
||||
class_<Decimater, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("decimate", &Decimater::decimate, decimate_overloads())
|
||||
.def("decimate_to", &Decimater::decimate_to)
|
||||
.def("decimate_to_faces", &Decimater::decimate_to_faces, decimate_to_faces_overloads())
|
||||
|
||||
.def("initialize", &Decimater::initialize)
|
||||
.def("is_initialized", &Decimater::is_initialized)
|
||||
|
||||
.def("add", add1)
|
||||
.def("add", add2)
|
||||
.def("add", add3)
|
||||
.def("add", add4)
|
||||
.def("add", add5)
|
||||
.def("add", add6)
|
||||
.def("add", add7)
|
||||
.def("add", add8)
|
||||
.def("add", add9)
|
||||
|
||||
.def("remove", remove1)
|
||||
.def("remove", remove2)
|
||||
.def("remove", remove3)
|
||||
.def("remove", remove4)
|
||||
.def("remove", remove5)
|
||||
.def("remove", remove6)
|
||||
.def("remove", remove7)
|
||||
.def("remove", remove8)
|
||||
.def("remove", remove9)
|
||||
|
||||
.def("module", module1, return_value_policy<reference_existing_object>())
|
||||
.def("module", module2, return_value_policy<reference_existing_object>())
|
||||
.def("module", module3, return_value_policy<reference_existing_object>())
|
||||
.def("module", module4, return_value_policy<reference_existing_object>())
|
||||
.def("module", module5, return_value_policy<reference_existing_object>())
|
||||
.def("module", module6, return_value_policy<reference_existing_object>())
|
||||
.def("module", module7, return_value_policy<reference_existing_object>())
|
||||
.def("module", module8, return_value_policy<reference_existing_object>())
|
||||
.def("module", module9, return_value_policy<reference_existing_object>())
|
||||
;
|
||||
|
||||
// ModBase
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModBase");
|
||||
|
||||
class_<ModBase, boost::noncopyable>(buffer, no_init)
|
||||
.def("name", &ModBase::name, OPENMESH_PYTHON_DEFAULT_POLICY)
|
||||
.def("is_binary", &ModBase::is_binary)
|
||||
.def("set_binary", &ModBase::set_binary)
|
||||
.def("initialize", &ModBase::initialize) // TODO VIRTUAL
|
||||
.def("collapse_priority", &ModBase::collapse_priority) // TODO VIRTUAL
|
||||
.def("preprocess_collapse", &ModBase::preprocess_collapse) // TODO VIRTUAL
|
||||
.def("postprocess_collapse", &ModBase::postprocess_collapse) // TODO VIRTUAL
|
||||
.def("set_error_tolerance_factor", &ModBase::set_error_tolerance_factor) // TODO VIRTUAL
|
||||
;
|
||||
|
||||
// ModAspectRatio
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModAspectRatio");
|
||||
|
||||
class_<ModAspectRatio, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("aspect_ratio", &ModAspectRatio::aspect_ratio)
|
||||
.def("set_aspect_ratio", &ModAspectRatio::set_aspect_ratio)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModAspectRatioHandle");
|
||||
expose_module_handle<ModAspectRatioHandle>(buffer);
|
||||
|
||||
// ModEdgeLength
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModEdgeLength");
|
||||
|
||||
class_<ModEdgeLength, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("edge_length", &ModEdgeLength::edge_length)
|
||||
.def("set_edge_length", &ModEdgeLength::set_edge_length)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModEdgeLengthHandle");
|
||||
expose_module_handle<ModEdgeLengthHandle>(buffer);
|
||||
|
||||
// ModHausdorff
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModHausdorff");
|
||||
|
||||
class_<ModHausdorff, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("tolerance", &ModHausdorff::tolerance)
|
||||
.def("set_tolerance", &ModHausdorff::set_tolerance)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModHausdorffHandle");
|
||||
expose_module_handle<ModHausdorffHandle>(buffer);
|
||||
|
||||
// ModIndependentSets
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModIndependentSets");
|
||||
|
||||
class_<ModIndependentSets, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF);
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModIndependentSetsHandle");
|
||||
expose_module_handle<ModIndependentSetsHandle>(buffer);
|
||||
|
||||
// ModNormalDeviation
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModNormalDeviation");
|
||||
|
||||
class_<ModNormalDeviation, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("normal_deviation", &ModNormalDeviation::normal_deviation)
|
||||
.def("set_normal_deviation", &ModNormalDeviation::set_normal_deviation)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModNormalDeviationHandle");
|
||||
expose_module_handle<ModNormalDeviationHandle>(buffer);
|
||||
|
||||
// ModNormalFlipping
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModNormalFlipping");
|
||||
|
||||
class_<ModNormalFlipping, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("max_normal_deviation", &ModNormalFlipping::max_normal_deviation)
|
||||
.def("set_max_normal_deviation", &ModNormalFlipping::set_max_normal_deviation)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModNormalFlippingHandle");
|
||||
expose_module_handle<ModNormalFlippingHandle>(buffer);
|
||||
|
||||
// ModProgMesh
|
||||
// ----------------------------------------
|
||||
|
||||
class_<Info>("Info", no_init)
|
||||
.def_readwrite("v0", &Info::v0)
|
||||
.def_readwrite("v1", &Info::v1)
|
||||
.def_readwrite("vl", &Info::vl)
|
||||
.def_readwrite("vr", &Info::vr)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModProgMesh");
|
||||
|
||||
class_<ModProgMesh, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("pmi", &infolist<ModProgMesh>)
|
||||
.def("infolist", &infolist<ModProgMesh>)
|
||||
.def("write", &ModProgMesh::write)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModProgMeshHandle");
|
||||
expose_module_handle<ModProgMeshHandle>(buffer);
|
||||
|
||||
// ModQuadric
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModQuadric");
|
||||
|
||||
class_<ModQuadric, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("set_max_err", &ModQuadric::set_max_err, set_max_err_overloads())
|
||||
.def("unset_max_err", &ModQuadric::unset_max_err)
|
||||
.def("max_err", &ModQuadric::max_err)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModQuadricHandle");
|
||||
expose_module_handle<ModQuadricHandle>(buffer);
|
||||
|
||||
// ModRoundness
|
||||
// ----------------------------------------
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModRoundness");
|
||||
|
||||
class_<ModRoundness, bases<ModBase>, boost::noncopyable>(buffer, INIT_MESH_REF)
|
||||
.def("set_min_angle", &ModRoundness::set_min_angle)
|
||||
.def("set_min_roundness", &ModRoundness::set_min_roundness, set_min_roundness_overloads())
|
||||
.def("unset_min_roundness", &ModRoundness::unset_min_roundness)
|
||||
.def("roundness", &ModRoundness::roundness)
|
||||
;
|
||||
|
||||
snprintf(buffer, sizeof buffer, "%s%s", _name, "ModRoundnessHandle");
|
||||
expose_module_handle<ModRoundnessHandle>(buffer);
|
||||
}
|
||||
|
||||
} // namespace OpenMesh
|
||||
} // namespace Python
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user