Commit 34c44c91 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'master' into compile-time-connectivity-type

parents 05292e10 4363a1cb
Pipeline #8259 canceled with stage
in 1 minute and 7 seconds
......@@ -259,21 +259,6 @@ VS2015-32-bit-static-no-apps:
- build-release/*.exe
VS2013-64-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
SHARED: "TRUE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2013
artifacts:
paths:
- build-release/*.exe
VS2013-64-bit-shared-no-apps:
stage: build
variables:
......@@ -288,20 +273,6 @@ VS2013-64-bit-shared-no-apps:
paths:
- build-release/*.exe
VS2013-32-bit-shared-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
SHARED: "TRUE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2013
artifacts:
paths:
- build-release/*.exe
VS2013-32-bit-shared-no-apps:
stage: build
variables:
......@@ -316,20 +287,6 @@ VS2013-32-bit-shared-no-apps:
paths:
- build-release/*.exe
VS2013-64-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x64"
SHARED: "FALSE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2013
artifacts:
paths:
- build-release/*.exe
VS2013-64-bit-static-no-apps:
stage: build
variables:
......@@ -344,20 +301,6 @@ VS2013-64-bit-static-no-apps:
paths:
- build-release/*.exe
VS2013-32-bit-static-apps:
stage: build
variables:
BUILD_PLATFORM: "VS2013"
ARCHITECTURE: "x32"
SHARED: "FALSE"
APPS: "ON"
script: "CI\\Windows.bat"
tags:
- VS2013
artifacts:
paths:
- build-release/*.exe
VS2013-32-bit-static-no-apps:
stage: build
variables:
......
Please look into the doxygen configuration (Generated from Doc/history.docu)
The changelog can be found in the html Documentation.
The latest changelog for the master can be found here:
http://openmesh.org/Daily-Builds/Doc/a00002.html
http://openmesh.org/Daily-Builds/Doc/
......@@ -16,22 +16,6 @@ IF "%SHARED%" == "TRUE" (
set STRING_DLL=
)
IF "%BUILD_PLATFORM%" == "VS2012" (
set LIBPATH=E:\libs\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"
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
)
IF "%ARCHITECTURE%" == "x32" (
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
)
)
IF "%BUILD_PLATFORM%" == "VS2013" (
set LIBPATH=E:\libs\VS2013
set GTESTVERSION=gtest-1.6.0
......@@ -83,10 +67,15 @@ IF "%BUILD_PLATFORM%" == "VS2017" (
IF "%APPS%" == "ON" (
set STRING_APPS=
ECHO "Copying Platform plugins from %QT_INSTALL_PATH%\plugins\platforms to Build\plugins\platforms"
REM Create the platform plugins subdirectory for the qt plugins required to run the gui apps
mkdir Build
mkdir Build\plugins
mkdir Build\plugins\platforms
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
set CMAKE_CONFIGURATION=%QT_BASE_CONFIG%
......@@ -95,6 +84,9 @@ IF "%APPS%" == "ON" (
set CMAKE_CONFIGURATION=
)
ECHO "============================================================="
ECHO "============================================================="
ECHO "Building with :"
......@@ -111,10 +103,26 @@ ECHO "QT_INSTALL_PATH : %QT_INSTALL_PATH%"
ECHO "CMAKE_CONFIGURATION : %CMAKE_CONFIGURATION%"
ECHO "============================================================="
ECHO "============================================================="
ECHO ""
ECHO "Running Build environment checks"
IF EXIST %LIBPATH%\ (
ECHO "LIBPATH ... Ok"
) ELSE (
ECHO "LIBPATH not found!"
exit 10;
)
IF EXIST %QT_INSTALL_PATH%\ (
ECHO "QT_INSTALL_PATH ... Ok"
) ELSE (
ECHO "QT_INSTALL_PATH: %QT_INSTALL_PATH%\ not found!"
exit 10;
)
"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% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_ROOT="%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"
......@@ -134,7 +142,7 @@ mkdir build-debug
cd build-debug
"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% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_ROOT="%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"
......@@ -164,13 +172,13 @@ cd build-release
del *.exe
"C:\Program Files\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_ROOT="%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.1-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
move OpenMesh-*.exe "OpenMesh-8.0-Git-Master-%CI_BUILD_REF%-%BUILD_PLATFORM%-%STRING_ARCH%%STRING_DLL%%STRING_APPS%.exe"
......@@ -10,12 +10,15 @@ OPTIONS=""
MAKE_OPTIONS=""
BUILDPATH=""
# set GTEST path
OPTIONS="-DGTEST_ROOT=~/sw/gtest-1.8.0/"
if [ "$COMPILER" == "gcc" ]; then
echo "Building with GCC";
BUILDPATH="gcc"
# without icecc: no options required
OPTIONS="-DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc"
OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc"
MAKE_OPTIONS="-j16"
export ICECC_CXX=/usr/bin/g++ ; export ICECC_CC=/usr/bin/gcc
......
......@@ -11,6 +11,9 @@ export PATH
OPTIONS=""
# set GTEST path
OPTIONS="$OPTIONS -DGTEST_ROOT=~/sw/gtest-1.7.0/"
if [ "$LANGUAGE" == "C++98" ]; then
echo "Building with C++98";
BUILDPATH="cpp98"
......
......@@ -40,12 +40,7 @@
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
......
......@@ -40,14 +40,6 @@
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Kernel Concept
......
......@@ -39,13 +39,6 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
// -------------------- OpenMesh
......
#include <iostream>
#include <vector>
// --------------------
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <OpenMesh/Core/Utils/PropertyManager.hh>
typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh;
#include <iostream>
#include <vector>
using MyMesh = OpenMesh::TriMesh_ArrayKernelT<>;
int main(int argc, char **argv)
int main(int argc, char** argv)
{
MyMesh mesh;
// check command line options
if (argc != 4)
{
std::cerr << "Usage: " << argv[0] << " #iterations infile outfile\n";
return 1;
}
// read mesh from stdin
if ( ! OpenMesh::IO::read_mesh(mesh, argv[2]) )
{
std::cerr << "Error: Cannot read mesh from " << argv[2] << std::endl;
return 1;
}
// this vertex property stores the computed centers of gravity
OpenMesh::VPropHandleT<MyMesh::Point> cogs;
mesh.add_property(cogs);
// smoothing mesh argv[1] times
MyMesh::VertexIter v_it, v_end(mesh.vertices_end());
MyMesh::VertexVertexIter vv_it;
MyMesh::Point cog;
MyMesh::Scalar valence;
unsigned int i, N(atoi(argv[1]));
for (i=0; i < N; ++i)
{
for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
{
mesh.property(cogs,*v_it).vectorize(0.0f);
valence = 0.0;
for (vv_it=mesh.vv_iter( *v_it ); vv_it; ++vv_it)
{
mesh.property(cogs,*v_it) += mesh.point( *vv_it );
++valence;
}
mesh.property(cogs,*v_it) /= valence;
// Read command line options
MyMesh mesh;
if (argc != 4) {
std::cerr << "Usage: " << argv[0] << " #iterations infile outfile" << std::endl;
return 1;
}
const int iterations = argv[1];
const std::string infile = argv[2];
const std::string outfile = argv[3];
for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
if ( !mesh.is_boundary( *v_it ) )
mesh.set_point( *v_it, mesh.property(cogs,*v_it) );
}
// write mesh to stdout
if ( ! OpenMesh::IO::write_mesh(mesh, argv[3]) )
{
std::cerr << "Error: cannot write mesh to " << argv[3] << std::endl;
return 1;
}
// Read mesh file
if (!OpenMesh::IO::read_mesh(mesh, infile)) {
std::cerr << "Error: Cannot read mesh from " << infile << std::endl;
return 1;
}
return 0;
{
// Add a vertex property storing the computed centers of gravity
auto cog = OpenMesh::makeTemporaryProperty<OpenMesh::VertexHandle, MyMesh::Point>(mesh);
// Smooth the mesh several times
for (int i = 0; i < iterations; ++i) {
// Iterate over all vertices to compute centers of gravity
for (const auto& vh : mesh.vertices()) {
cog[vh] = {0,0,0};
int valence = 0;
// Iterate over all 1-ring vertices around vh
for (const auto& vvh : mesh.vv_range(vh)) {
cog[vh] += mesh.point(vvh);
++valence;
}
cog[vh] /= valence;
}
// Move all vertices to the previously computed positions
for (const auto& vh : mesh.vertices()) {
mesh.point(vh) = cog[vh];
}
}
} // The cog vertex property is removed from the mesh at the end of this scope
// Write mesh file
if (!OpenMesh::IO::read_mesh(mesh, outfile)) {
std::cerr << "Error: Cannot write mesh to " << outfile << std::endl;
return 1;
}
}
......@@ -39,14 +39,6 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision: 736 $ *
* $Date: 2012-10-08 09:30:49 +0200 (Mo, 08. Okt 2012) $ *
* *
\*===========================================================================*/
#include <iostream>
// -------------------- OpenMesh
#include <OpenMesh/Core/IO/MeshIO.hh>
......
......@@ -7,17 +7,28 @@
<!-- --------------------------------------------------------------------- -->
<tr valign=top><td><b>7.2</b> (?/?/?)</td><td>
<tr valign=top><td><b>8.0</b> (?/?/?)</td><td>
<b>Breaking changes:</b>
<ul>
<li>Don't run and test on VS2013 anymore. As VS2013 still lacks some C++11 features, we remove it from our list of supported platforms</li>
</ul>
<b>Core</b>
<ul>
<li>TriConnectivity: Added two functions split_edge and split_edge_copy to mask the PolyConnectivity functions of the same name (Prevents creation of valence 2 vertices on trimeshes)</li>
<li>PolyConnectivity: Fixed PolyConnectivity is_collapse_ok, missing some configurations (Thanks to Simon Flöry for the patch)</li>
</ul>
<b>IO</b>
<ul>
<li>PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)</li>
<li>PLY Reader: Fixed endless loop on unknown property list type</li>
<li>PLY Reader: Fix hang when reading directly from istream (Thanks to Paul Loré for the patch)</li>
<li>OM Writer/Reader: Update file format version to 2.0. Older files can still be read, but older OpenMesh versions cannot read new format.</li>
<li>OM Writer/Reader: Fixed inconsistent writing/reading of edge properties</li>
<li>OM Writer/Reader: Add option to store status</li>
<li>OBJ Writer: Use Fixed as stream option in OBJ writer to avoid problems with other programs reading scientific notation</li>
</ul>
<b>Tools</b>
......@@ -25,6 +36,11 @@
<li>SmartTagger: Added the SmartTagger class to tag primitives (O(1) reset )</li>
</ul>
<b>Apps</b>
<ul>
<li>Fixed several warnings with gcc 8</li>
</ul>
<b>Build System</b>
<ul>
<li>Rename the DEPRECATED macro into OM_DEPRECATED to prevent a macro clash with Intel MKL (Thanks to Morgan Leborgne for the patch)</li>
......
......@@ -12,12 +12,11 @@ supports at least C++11
<table>
<tr><td> Linux </td><td>
gcc >= 4.8.x<br>
gcc >= 6.3<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>
......
This diff is collapsed.
......@@ -24,6 +24,10 @@ Here you can find information on how to build projects using the %OpenMesh libra
as well as further information on mesh handling in %OpenMesh.
The tutorials explain how to use %OpenMesh by demonstrating real code examples.
\section openmesh-python OpenMesh Python Bindings
We also provide python bindings for %OpenMesh. You can find them here:<br/>
<tt>https://www.graphics.rwth-aachen.de:9000/OpenMesh/openmesh-python</tt>
\section iov Building OpenMesh
In this section all necessary information on how to build projects using %OpenMesh
is given.
......
/** \page tutorial_03 Using (custom) properties
This examples shows:
- How to add and remove custom properties,
- How to add and remove custom properties
- How to get and set the value of a custom property
In the last example we computed the barycenter of each vertex'
......@@ -11,44 +11,69 @@ let %OpenMesh manage the data.
It would be even more helpful if we could attach such properties
dynamically to the mesh.
%OpenMesh provides dynamic properties, which can be attached to each
mesh entity (vertex, face, edge, halfedge, and the mesh itself). We
distinguish between custom and standard properties. A custom property
is any user-defined property and is accessed via the member function
\c property(..) via a handle and an entity handle
(e.g. VertexHandle). Whereas the standard properties are accessed via
special member functions, e.g. the vertex position is accessed with \c
point(..) and a vertex handle.
Custom properties can be conveniently created and attached to meshes with the following functions:
- makeTemporaryProperty() creates a property that is temporary to the current scope.
- getOrMakeProperty() is used for creating and accessing permanent named properties on a mesh.
- getProperty() is used for accessing an existing permanent named property on a mesh.
In this example we will store the \c cog-value (see previous example)
in an additional vertex property instead of keeping it in a separate
array. To do so we define first a so-called property handle with the desired
type (\c MyMesh::Point) and register the handle at the mesh:
All three functions take two template arguments:
- First, the type of the mesh element that the property is attached to (i.e. OpenMesh::VertexHandle, OpenMesh::HalfedgeHandle, OpenMesh::EdgeHandle, or OpenMesh::FaceHandle).
- Second, the type of the property value that is attached to each element (e.g., \p int, \p double, etc.).
All three functions return a handle object (of type OpenMesh::PropertyManager) that manages the lifetime of the property and provides read / write access to its values.
In this example, we will store the \c cog value (see previous example) in a vertex property instead of keeping it in a separate array.
To do so, we first add a (temporary) property of the desired element type (OpenMesh::VertexHandle) and value type (\c %MyMesh::Point) to the mesh:
\dontinclude 03-properties/smooth.cc
\skipline vertex property stores
\until mesh.add
\skipline makeTemporaryProperty
<br>The \c mesh allocates enough memory to hold as many elements of type
\c MyMesh::Point as number of vertices exist, and of course the mesh
synchronizes all insert and delete operations on the vertices with the
vertex properties.
Enough memory is allocated to hold as many values of \c %MyMesh::Point as there are vertices.
All insert and delete operations on the mesh are synchronized with the attached properties.
Once the wanted property is registered we can use the property to
calculate the barycenter of the neighborhood of each vertex \c v_it
Once the property is created, we can use it to compute the centers of the neighborhood of each vertex:
\dontinclude 03-properties/smooth.cc
\skipline vv_it=
\skipline mesh.vertices
\until cog[vh] /= valence
\until }
\until mesh.prop
<br>and finally set the new position for each vertex \c v_it
Finally, we set the new position for each vertex:
\dontinclude 03-properties/smooth.cc
\skipline mesh.set_point
\skipline mesh.vertices
\until mesh.point
\until }
---
Since we chose to use makeTemporaryProperty(), the created property is automatically removed from the mesh as soon as we leave the scope of the associated handle variable \c cog.
If, instead, a property is desired to survive its local scope, it should be created with using getOrMakeProperty(). In that case, the property must be given a name that can later be used to retrieve the property. For example:
\code
auto face_area = OpenMesh::makeTemporaryProperty<OpenMesh::FaceHandle, double>(mesh, 'face_area');
\endcode
At a later time, we can use the getProperty() function to obtain a handle to a property that was previously created by refering to its name:
\code
try {
auto face_area = OpenMesh::getProperty<OpenMesh::FaceHandle, double>(mesh, 'face_area');
// Use the face_area property.
}
catch (const std::runtime_error& e) {
// Property not found. Handle the error here.
}
\endcode
---
The functions makeTemporaryProperty(), getOrMakeProperty(), and getProperty() are the convenient high-level interface for creating and accessing mesh properties.
Beneath these convenience functions, there is also a low-level property interface where handle and property lifetime must be managed manually. This interface is accessed through a mesh's add_property(), remove_property(), and property() functions and several property handle classes (OpenMesh::VPropHandleT, OpenMesh::HPropHandleT, OpenMesh::EPropHandleT, OpenMesh::FPropHandleT, OpenMesh::MPropHandleT).
---
<br>Below is the complete source code:
Below is the complete source code:
\include 03-properties/smooth.cc
*/
\ No newline at end of file
*/
# OpenMesh, 7.2
# OpenMesh, 8.0
[![](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/badges/master/pipeline.svg)](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh/commits/master)
......@@ -21,10 +21,10 @@ https://www.graphics.rwth-aachen.de:9000/OpenMesh/openmesh-python
| 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) |