From c68c630eabd13ab7264333936c7fad3a6cf9fd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 18 Jun 2018 13:16:33 +0200 Subject: [PATCH 01/20] Prevent endless loop in PLY reader when unknown property types are read. --- src/OpenMesh/Core/IO/reader/PLYReader.cc | 322 +++++++++++----------- src/Unittests/unittests_read_write_PLY.cc | 54 ++++ 2 files changed, 216 insertions(+), 160 deletions(-) diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc index 87078882..37e605a7 100644 --- a/src/OpenMesh/Core/IO/reader/PLYReader.cc +++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc @@ -1201,185 +1201,187 @@ bool _PLYReader_::can_u_read(std::istream& _is) const { _is >> keyword; while (keyword != "end_header") { - if (keyword == "comment") { - std::getline(_is, line); - } else if (keyword == "element") { - _is >> elementName; - _is >> elementCount; + if (keyword == "comment") { + std::getline(_is, line); + } else if (keyword == "element") { + _is >> elementName; + _is >> elementCount; - ElementInfo element; - element.name_ = elementName; - element.count_ = elementCount; + ElementInfo element; + element.name_ = elementName; + element.count_ = elementCount; - if (elementName == "vertex") { - vertexCount_ = elementCount; - element.element_ = VERTEX; - } else if (elementName == "face") { - faceCount_ = elementCount; - element.element_ = FACE; - } else { - omerr() << "PLY header unsupported element type: " << elementName << std::endl; - element.element_ = UNKNOWN; - } + if (elementName == "vertex") { + vertexCount_ = elementCount; + element.element_ = VERTEX; + } else if (elementName == "face") { + faceCount_ = elementCount; + element.element_ = FACE; + } else { + omerr() << "PLY header unsupported element type: " << elementName << std::endl; + element.element_ = UNKNOWN; + } - elements_.push_back(element); - } else if (keyword == "property") { - std::string tmp1; - std::string tmp2; + elements_.push_back(element); + } else if (keyword == "property") { + std::string tmp1; + std::string tmp2; - // Read first keyword, as it might be a list - _is >> tmp1; + // Read first keyword, as it might be a list + _is >> tmp1; - if (tmp1 == "list") { - _is >> listIndexType; - _is >> listEntryType; - _is >> propertyName; + if (tmp1 == "list") { + _is >> listIndexType; + _is >> listEntryType; + _is >> propertyName; - ValueType indexType = Unsupported; - ValueType entryType = Unsupported; + ValueType indexType = Unsupported; + ValueType entryType = Unsupported; - if (listIndexType == "uint8") { - indexType = ValueTypeUINT8; - } else if (listIndexType == "uchar") { - indexType = ValueTypeUCHAR; - } else if (listIndexType == "int") { - indexType = ValueTypeINT; - } else { - omerr() << "Unsupported Index type for property list: " << listIndexType << std::endl; - continue; - } + if (listIndexType == "uint8") { + indexType = ValueTypeUINT8; + } else if (listIndexType == "uint16") { + indexType = ValueTypeUINT16; + } else if (listIndexType == "uchar") { + indexType = ValueTypeUCHAR; + } else if (listIndexType == "int") { + indexType = ValueTypeINT; + } else { + omerr() << "Unsupported Index type for property list: " << listIndexType << std::endl; + return false; + } - entryType = get_property_type(listEntryType, listEntryType); + entryType = get_property_type(listEntryType, listEntryType); - if (entryType == Unsupported) { - omerr() << "Unsupported Entry type for property list: " << listEntryType << std::endl; - } + if (entryType == Unsupported) { + omerr() << "Unsupported Entry type for property list: " << listEntryType << std::endl; + } - PropertyInfo property(CUSTOM_PROP, entryType, propertyName); - property.listIndexType = indexType; + PropertyInfo property(CUSTOM_PROP, entryType, propertyName); + property.listIndexType = indexType; - if (elementName == "face") - { - // special case for vertex indices - if (propertyName == "vertex_index" || propertyName == "vertex_indices") - { - property.property = VERTEX_INDICES; - - if (!elements_.back().properties_.empty()) - { - 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; - } + if (elementName == "face") + { + // special case for vertex indices + if (propertyName == "vertex_index" || propertyName == "vertex_indices") + { + property.property = VERTEX_INDICES; - } - else - omerr() << "property " << propertyName << " belongs to unsupported element " << elementName << std::endl; - - elements_.back().properties_.push_back(property); - - } else { - // as this is not a list property, read second value of property - _is >> tmp2; - - - // Extract name and type of property - // As the order seems to be different in some files, autodetect it. - ValueType valueType = get_property_type(tmp1, tmp2); - propertyName = get_property_name(tmp1, tmp2); - - PropertyInfo entry; - - //special treatment for some vertex properties. - if (elementName == "vertex") { - if (propertyName == "x") { - entry = PropertyInfo(XCOORD, valueType); - vertexDimension_++; - } else if (propertyName == "y") { - entry = PropertyInfo(YCOORD, valueType); - vertexDimension_++; - } else if (propertyName == "z") { - entry = PropertyInfo(ZCOORD, valueType); - vertexDimension_++; - } else if (propertyName == "nx") { - entry = PropertyInfo(XNORM, valueType); - options_ += Options::VertexNormal; - } else if (propertyName == "ny") { - entry = PropertyInfo(YNORM, valueType); - options_ += Options::VertexNormal; - } else if (propertyName == "nz") { - entry = PropertyInfo(ZNORM, valueType); - options_ += Options::VertexNormal; - } else if (propertyName == "u" || propertyName == "s") { - entry = PropertyInfo(TEXX, valueType); - options_ += Options::VertexTexCoord; - } else if (propertyName == "v" || propertyName == "t") { - entry = PropertyInfo(TEXY, valueType); - options_ += Options::VertexTexCoord; - } else if (propertyName == "red") { - entry = PropertyInfo(COLORRED, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "green") { - entry = PropertyInfo(COLORGREEN, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "blue") { - entry = PropertyInfo(COLORBLUE, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "diffuse_red") { - entry = PropertyInfo(COLORRED, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "diffuse_green") { - entry = PropertyInfo(COLORGREEN, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "diffuse_blue") { - entry = PropertyInfo(COLORBLUE, valueType); - options_ += Options::VertexColor; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } else if (propertyName == "alpha") { - entry = PropertyInfo(COLORALPHA, valueType); - options_ += Options::VertexColor; - options_ += Options::ColorAlpha; - if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) - options_ += Options::ColorFloat; - } - } - - //not a special property, load as custom - if (entry.value == Unsupported){ - Property prop = CUSTOM_PROP; - options_ += Options::Custom; - entry = PropertyInfo(prop, valueType, propertyName); - } - - if (entry.property != UNSUPPORTED) + if (!elements_.back().properties_.empty()) { - elements_.back().properties_.push_back(entry); + 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; } + } + else + omerr() << "property " << propertyName << " belongs to unsupported element " << elementName << std::endl; + + elements_.back().properties_.push_back(property); + } else { - omlog() << "Unsupported keyword : " << keyword << std::endl; + // as this is not a list property, read second value of property + _is >> tmp2; + + + // Extract name and type of property + // As the order seems to be different in some files, autodetect it. + ValueType valueType = get_property_type(tmp1, tmp2); + propertyName = get_property_name(tmp1, tmp2); + + PropertyInfo entry; + + //special treatment for some vertex properties. + if (elementName == "vertex") { + if (propertyName == "x") { + entry = PropertyInfo(XCOORD, valueType); + vertexDimension_++; + } else if (propertyName == "y") { + entry = PropertyInfo(YCOORD, valueType); + vertexDimension_++; + } else if (propertyName == "z") { + entry = PropertyInfo(ZCOORD, valueType); + vertexDimension_++; + } else if (propertyName == "nx") { + entry = PropertyInfo(XNORM, valueType); + options_ += Options::VertexNormal; + } else if (propertyName == "ny") { + entry = PropertyInfo(YNORM, valueType); + options_ += Options::VertexNormal; + } else if (propertyName == "nz") { + entry = PropertyInfo(ZNORM, valueType); + options_ += Options::VertexNormal; + } else if (propertyName == "u" || propertyName == "s") { + entry = PropertyInfo(TEXX, valueType); + options_ += Options::VertexTexCoord; + } else if (propertyName == "v" || propertyName == "t") { + entry = PropertyInfo(TEXY, valueType); + options_ += Options::VertexTexCoord; + } else if (propertyName == "red") { + entry = PropertyInfo(COLORRED, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "green") { + entry = PropertyInfo(COLORGREEN, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "blue") { + entry = PropertyInfo(COLORBLUE, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "diffuse_red") { + entry = PropertyInfo(COLORRED, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "diffuse_green") { + entry = PropertyInfo(COLORGREEN, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "diffuse_blue") { + entry = PropertyInfo(COLORBLUE, valueType); + options_ += Options::VertexColor; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } else if (propertyName == "alpha") { + entry = PropertyInfo(COLORALPHA, valueType); + options_ += Options::VertexColor; + options_ += Options::ColorAlpha; + if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32) + options_ += Options::ColorFloat; + } + } + + //not a special property, load as custom + if (entry.value == Unsupported){ + Property prop = CUSTOM_PROP; + options_ += Options::Custom; + entry = PropertyInfo(prop, valueType, propertyName); + } + + if (entry.property != UNSUPPORTED) + { + elements_.back().properties_.push_back(entry); + } } - streamPos = _is.tellg(); - _is >> keyword; - if (_is.bad()) { - omerr() << "Error while reading PLY file header" << std::endl; - return false; - } + } else { + omlog() << "Unsupported keyword : " << keyword << std::endl; + } + + streamPos = _is.tellg(); + _is >> keyword; + if (_is.bad()) { + omerr() << "Error while reading PLY file header" << std::endl; + return false; + } } // As the binary data is directy after the end_header keyword diff --git a/src/Unittests/unittests_read_write_PLY.cc b/src/Unittests/unittests_read_write_PLY.cc index e92a678e..82370bb3 100644 --- a/src/Unittests/unittests_read_write_PLY.cc +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -728,4 +728,58 @@ TEST_F(OpenMeshReadWritePLY, LoadSimpleBinaryPLYWithExtraElements) { EXPECT_EQ(12u, mesh_.n_faces()) << "The number of loaded faces is not correct!"; } + +/* +* Ignore a file that does not contain vertices and faces +*/ +TEST_F(OpenMeshReadWritePLY, IgnoreNonMeshPlyFile) { + + mesh_.clear(); + + std::stringstream data; + data << "ply" << "\n"; + data << "format binary_little_endian 1.0" << "\n"; + data << "comment Image data" << "\n"; + data << "element image 0" << "\n"; + data << "property list uint16 uint16 row" << "\n"; + data << "end_header" << "\n"; + + OpenMesh::IO::Options options = OpenMesh::IO::Options::Binary; + + bool ok = OpenMesh::IO::read_mesh(mesh_, data, ".ply", options); + + EXPECT_TRUE(ok) << "This empty file should be readable without an error!"; + + EXPECT_EQ(0u, mesh_.n_vertices()) << "The number of loaded vertices is not correct!"; + EXPECT_EQ(0u, mesh_.n_edges()) << "The number of loaded edges is not correct!"; + EXPECT_EQ(0u, mesh_.n_faces()) << "The number of loaded faces is not correct!"; +} + + +/* +* Ignore a file that does not contain vertices and faces +*/ +TEST_F(OpenMeshReadWritePLY, FailOnUnknownPropertyTypeForLists) { + + mesh_.clear(); + + std::stringstream data; + data << "ply" << "\n"; + data << "format binary_little_endian 1.0" << "\n"; + data << "comment Image data" << "\n"; + data << "element image 0" << "\n"; + data << "property list blibb blubb row" << "\n"; + data << "end_header" << "\n"; + + OpenMesh::IO::Options options = OpenMesh::IO::Options::Binary; + + bool ok = OpenMesh::IO::read_mesh(mesh_, data, ".ply", options); + + EXPECT_FALSE(ok) << "This file should fail to read!"; + + EXPECT_EQ(0u, mesh_.n_vertices()) << "The number of loaded vertices is not correct!"; + EXPECT_EQ(0u, mesh_.n_edges()) << "The number of loaded edges is not correct!"; + EXPECT_EQ(0u, mesh_.n_faces()) << "The number of loaded faces is not correct!"; +} + } From e5e82e5ff27bbc98507427557a5aa7e5fbd6a4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 18 Jun 2018 15:36:10 +0200 Subject: [PATCH 02/20] Updated changelog [skip ci] --- Doc/changelog.docu | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 1abf1df0..56c24883 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -12,6 +12,7 @@ IO From b0ece67d46199a6ce95f8defe92a1005f16c5e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 09:04:51 +0200 Subject: [PATCH 03/20] 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) closes #51 --- Doc/changelog.docu | 5 +++ src/OpenMesh/Core/Mesh/TriConnectivity.hh | 42 ++++++++++++++++++++--- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 56c24883..9c615cf5 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -9,6 +9,11 @@ 7.2 (?/?/?) +Core +
    +
  • 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)
  • +
+ IO
  • PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)
  • diff --git a/src/OpenMesh/Core/Mesh/TriConnectivity.hh b/src/OpenMesh/Core/Mesh/TriConnectivity.hh index 197420dd..25b665d9 100644 --- a/src/OpenMesh/Core/Mesh/TriConnectivity.hh +++ b/src/OpenMesh/Core/Mesh/TriConnectivity.hh @@ -162,11 +162,28 @@ public: * * \note The properties of the new edges, halfedges, and faces will be undefined! * - * @param _eh Edge handle that should be splitted + * @param _eh Edge handle that should be split * @param _vh Vertex handle that will be inserted at the edge */ void split(EdgeHandle _eh, VertexHandle _vh); + /** \brief Edge split (= 2-to-4 split) + * + * + * The function will introduce two new faces ( non-boundary case) or + * one additional face (if edge is boundary) + * + * \note The properties of the new edges, halfedges, and faces will be undefined! + * + * \note This is an override to prevent a direct call to PolyConnectivity split_edge, + * which would introduce a singular vertex with valence 2 which is not allowed + * on TriMeshes + * + * @param _eh Edge handle that should be split + * @param _vh Vertex handle that will be inserted at the edge + */ + inline void split_edge(EdgeHandle _eh, VertexHandle _vh) { TriConnectivity::split(_eh, _vh); } + /** \brief Edge split (= 2-to-4 split) * * The function will introduce two new faces ( non-boundary case) or @@ -175,14 +192,31 @@ public: * \note The properties of the new edges will be adjusted to the properties of the original edge * \note The properties of the new faces and halfedges will be undefined * - * @param _eh Edge handle that should be splitted + * @param _eh Edge handle that should be split * @param _vh Vertex handle that will be inserted at the edge */ void split_copy(EdgeHandle _eh, VertexHandle _vh); + /** \brief Edge split (= 2-to-4 split) + * + * The function will introduce two new faces ( non-boundary case) or + * one additional face (if edge is boundary) + * + * \note The properties of the new edges will be adjusted to the properties of the original edge + * \note The properties of the new faces and halfedges will be undefined + * + * \note This is an override to prevent a direct call to PolyConnectivity split_edge_copy, + * which would introduce a singular vertex with valence 2 which is not allowed + * on TriMeshes + * + * @param _eh Edge handle that should be split + * @param _vh Vertex handle that will be inserted at the edge + */ + inline void split_edge_copy(EdgeHandle _eh, VertexHandle _vh) { TriConnectivity::split_copy(_eh, _vh); } + /** \brief Face split (= 1-to-3) split, calls corresponding PolyMeshT function). * - * @param _fh Face handle that should be splitted + * @param _fh Face handle that should be split * @param _vh Vertex handle that will be inserted at the face */ inline void split(FaceHandle _fh, VertexHandle _vh) @@ -190,7 +224,7 @@ public: /** \brief Face split (= 1-to-3) split, calls corresponding PolyMeshT function). * - * @param _fh Face handle that should be splitted + * @param _fh Face handle that should be split * @param _vh Vertex handle that will be inserted at the face */ inline void split_copy(FaceHandle _fh, VertexHandle _vh) From 4c80002241e777cbb02499f0ac8adf58b6350493 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 19 Jun 2018 09:24:00 +0200 Subject: [PATCH 04/20] Update documentation of split_copy to reflect the fact that properties are copied from the old face to the new ones. --- src/OpenMesh/Core/Mesh/TriConnectivity.hh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/TriConnectivity.hh b/src/OpenMesh/Core/Mesh/TriConnectivity.hh index 25b665d9..baab7c60 100644 --- a/src/OpenMesh/Core/Mesh/TriConnectivity.hh +++ b/src/OpenMesh/Core/Mesh/TriConnectivity.hh @@ -189,8 +189,9 @@ public: * The function will introduce two new faces ( non-boundary case) or * one additional face (if edge is boundary) * - * \note The properties of the new edges will be adjusted to the properties of the original edge - * \note The properties of the new faces and halfedges will be undefined + * \note The properties of the new edges and faces will be adjusted to the + * properties of the original edge and face + * \note The properties of the new halfedges will be undefined * * @param _eh Edge handle that should be split * @param _vh Vertex handle that will be inserted at the edge @@ -202,8 +203,9 @@ public: * The function will introduce two new faces ( non-boundary case) or * one additional face (if edge is boundary) * - * \note The properties of the new edges will be adjusted to the properties of the original edge - * \note The properties of the new faces and halfedges will be undefined + * \note The properties of the new edges and faces will be adjusted to the + * properties of the original edge and face + * \note The properties of the new halfedges will be undefined * * \note This is an override to prevent a direct call to PolyConnectivity split_edge_copy, * which would introduce a singular vertex with valence 2 which is not allowed From c836f2f8c763082b1f4780bf4ced7cdccb8e10d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 13:29:53 +0200 Subject: [PATCH 05/20] Print debug or release state on all archs except MSVC --- cmake/ACGOutput.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/ACGOutput.cmake b/cmake/ACGOutput.cmake index de488cf8..d06e298c 100644 --- a/cmake/ACGOutput.cmake +++ b/cmake/ACGOutput.cmake @@ -30,11 +30,13 @@ function (acg_print_configure_header _id _name) acg_color_message ("${_escape}[40;37m* Package : ${_escape}[32m${_project} ${_escape}[37m *${_escape}[0m") acg_color_message ("${_escape}[40;37m* Version : ${_escape}[32m${_version} ${_escape}[37m *${_escape}[0m") - # Just artistic. remove 2 spaces for release to make it look nicer ;-) - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") - else() - acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") + if ( NOT WIN32 ) + # Just artistic. remove 2 spaces for release to make it look nicer ;-) + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") + else() + acg_color_message ("${_escape}[40;37m* Type : ${_escape}[32m${CMAKE_BUILD_TYPE} ${_escape}[37m *${_escape}[0m") + endif() endif() acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m") From d3c19f3f96370e2f56f10c61e162476051d62afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 13:33:29 +0200 Subject: [PATCH 06/20] Minimal cmake version raised to 3.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dda2f40a..1c3690e6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # Set and enforce C++-11 flags From 3af06b689b1c4711181084e0f9d9ee47fbfff5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:20:35 +0200 Subject: [PATCH 07/20] Copied over SmartTagger --- .../Tools/SmartTagger/SmartTaggerT.cc | 223 +++++++++++++++++ .../Tools/SmartTagger/SmartTaggerT.hh | 233 ++++++++++++++++++ 2 files changed, 456 insertions(+) create mode 100644 src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc create mode 100644 src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc new file mode 100644 index 00000000..ef70911f --- /dev/null +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc @@ -0,0 +1,223 @@ +/*===========================================================================*\ + * * + * OpenFlipper * + * Copyright (c) 2001-2015, RWTH-Aachen University * + * Department of Computer Graphics and Multimedia * + * All rights reserved. * + * www.openflipper.org * + * * + *---------------------------------------------------------------------------* + * This file is part of OpenFlipper. * + *---------------------------------------------------------------------------* + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * 3. Neither the name of the copyright holder nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * * +\*===========================================================================*/ + +//============================================================================= +// +// CLASS SmartTaggerVT +// +// +// original Author: David Bommes +// $Revision: 18033 $ +// $Author: moeller $ +// $Date: 2014-01-16 17:17:07 +0100 (Do, 16. Jan 2014) $ +// +//============================================================================= + +//============================================================================= +// +// CLASS SmartTaggerT - IMPLEMENTATION +// +//============================================================================= + +#define ACG_SMARTTAGGERT_C + +//== INCLUDES ================================================================= + +#include "SmartTaggerT.hh" + +#include +#include + +//== NAMESPACES =============================================================== + +namespace ACG { + +//== IMPLEMENTATION ========================================================== + +template +SmartTaggerT:: +SmartTaggerT(Mesh& _mesh, unsigned int _tag_range) + : mesh_(_mesh), + current_base_(0), + tag_range_(_tag_range) +{ + // add new property + mesh_.add_property(ep_tag_); + + // reset all tags once + all_tags_to_zero(); +} + + +//----------------------------------------------------------------------------- + + +template +SmartTaggerT:: +~SmartTaggerT() +{ + mesh_.remove_property(ep_tag_); +} + + +//----------------------------------------------------------------------------- + + +template +void +SmartTaggerT:: +untag_all() +{ + unsigned int max_uint = std::numeric_limits::max(); + + if( current_base_ < max_uint - 2*tag_range_) + current_base_ += tag_range_; + else + { + //overflow -> reset all tags +#ifdef STV_DEBUG_CHECKS + std::cerr << "Tagging Overflow occured...\n"; +#endif + current_base_ = 0; + all_tags_to_zero(); + } +} + + +//----------------------------------------------------------------------------- + + +template +void +SmartTaggerT:: +untag_all( const unsigned int _new_tag_range) +{ + set_tag_range(_new_tag_range); +} + + +//----------------------------------------------------------------------------- + +template +void +SmartTaggerT:: +set_tag ( const EHandle _eh, unsigned int _tag) +{ +#ifdef STV_DEBUG_CHECKS + if( _tag > tag_range_) + std::cerr << "ERROR in set_tag tag range!!!\n"; +#endif + + mesh_.property(ep_tag_, _eh) = current_base_ + _tag; +} + + +//----------------------------------------------------------------------------- + + +template +unsigned int +SmartTaggerT:: +get_tag ( const EHandle _eh) const +{ + unsigned int t = mesh_.property(ep_tag_, _eh); + +#ifdef STV_DEBUG_CHECKS + if( t > current_base_ + tag_range_) + std::cerr << "ERROR in get_tag tag range!!!\n"; +#endif + + if( t<= current_base_) return 0; + else return t-current_base_; +} + + +//----------------------------------------------------------------------------- + + +template +bool +SmartTaggerT:: +is_tagged( const EHandle _eh) const +{ + return bool(get_tag(_eh)); +} + + +//----------------------------------------------------------------------------- + + +template +void +SmartTaggerT:: +set_tag_range( const unsigned int _tag_range) +{ + if( _tag_range <= tag_range_) + { + untag_all(); + tag_range_ = _tag_range; + } + else + { + tag_range_ = _tag_range; + untag_all(); + } +} + + +//----------------------------------------------------------------------------- + + +template +void +SmartTaggerT:: +all_tags_to_zero() +{ + // iterate over property vector + for(unsigned int i=0; i +// $Revision$ +// $Author$ +// $Date$ +// +//============================================================================= + + +#ifndef ACG_SMARTTAGGERT_HH +#define ACG_SMARTTAGGERT_HH + + +//== INCLUDES ================================================================= + +// OpenMesh +#include +#include + + +//== DEFINES ================================================================== + +#define STV_DEBUG_CHECKS + +//== NAMESPACES =============================================================== + +namespace ACG { + +//== FORWARD DECLARATIONS ===================================================== + +// Smarttagging for vertices +template< class Mesh> class SmartTaggerVT; +// Smarttagging for edges +template< class Mesh> class SmartTaggerET; +// Smarttagging for faces +template< class Mesh> class SmartTaggerFT; +// Smarttagging for halfedges +template< class Mesh> class SmartTaggerHT; + + +//== CLASS DEFINITION ========================================================= + + +/** \brief Smart Tagger + * + * A tagger class to be used on OpenMesh. It provides an O(1) reset function for the property. + * - Smarttagging for vertices: SmartTaggerVT; + * - Smarttagging for edges: SmartTaggerET; + * - Smarttagging for faces: SmartTaggerFT; + * - Smarttagging for halfedges: SmartTaggerHT; + * + * Usage: + * + * \code + * SmartTaggerVT< MeshType >* tagger = new SmartTaggerVT< MeshType > (mesh_); + * + * // Reset tagged flag on all vertices + * tagger.untag_all(); + * + * // Check if something is tagged + * bool tag = tagger.is_tagged(vh); + * + * // Set tagged: + * tagger.set_tag(vh); + * \endcode + */ +template +class SmartTaggerT +{ +public: + + /// Constructor + SmartTaggerT(Mesh& _mesh, unsigned int _tag_range = 1); + + /// Destructor + ~SmartTaggerT(); + + /** \brief untag all elements + * + */ + inline void untag_all(); + + /** \brief untag all elements and set new tag_range + * + * @param _new_tag_range New tag range of the tagger + */ + inline void untag_all( const unsigned int _new_tag_range); + + /** \brief set tag to a value in [0..tag_range] + * + * @param _eh Edge handle for the tag + * @param _tag Tag value + */ + inline void set_tag ( const EHandle _eh, unsigned int _tag = 1); + + /** \brief get tag value in range [0..tag_range] + * + * @param _eh Edge handle for the tag + * @return Current tag value at that edge + */ + inline unsigned int get_tag ( const EHandle _eh) const; + + /** \brief overloaded member for boolean tags + * + * @param _eh Edge handle for the tag + * @return Current tag value at that edge + */ + inline bool is_tagged( const EHandle _eh) const; + + /** \brief set new tag range and untag_all + * + * Set new tag range and reset tagger + * + * @param _tag_range New tag range of the tagger + */ + inline void set_tag_range( const unsigned int _tag_range); + +protected: + + inline void all_tags_to_zero(); + +protected: + + // Reference to Mesh + Mesh& mesh_; + + // property which holds the current tags + EPHandle ep_tag_; + + // current tags range is [current_base_+1...current_base_+tag_range_] + unsigned int current_base_; + + // number of different tagvalues available + unsigned int tag_range_; +}; + + +//== SPECIALIZATION =========================================================== + + // define standard Tagger + template< class Mesh> + class SmartTaggerVT + : public SmartTaggerT< Mesh, typename Mesh::VertexHandle, OpenMesh::VPropHandleT > + { + public: + typedef SmartTaggerT< Mesh, typename Mesh::VertexHandle, OpenMesh::VPropHandleT > BaseType; + SmartTaggerVT(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} + }; + + template< class Mesh> + class SmartTaggerET + : public SmartTaggerT< Mesh, typename Mesh::EdgeHandle, OpenMesh::EPropHandleT > + { + public: + typedef SmartTaggerT< Mesh, typename Mesh::EdgeHandle, OpenMesh::EPropHandleT > BaseType; + SmartTaggerET(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} + }; + + template< class Mesh> + class SmartTaggerFT + : public SmartTaggerT< Mesh, typename Mesh::FaceHandle, OpenMesh::FPropHandleT > + { + public: + typedef SmartTaggerT< Mesh, typename Mesh::FaceHandle, OpenMesh::FPropHandleT > BaseType; + SmartTaggerFT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range) {} + }; + + template< class Mesh> + class SmartTaggerHT + : public SmartTaggerT< Mesh, typename Mesh::HalfedgeHandle, OpenMesh::HPropHandleT > + { + public: + typedef SmartTaggerT< Mesh, typename Mesh::HalfedgeHandle, OpenMesh::HPropHandleT > BaseType; + SmartTaggerHT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range){} + }; + + +//============================================================================= +} // namespace ACG +//============================================================================= +#if defined(INCLUDE_TEMPLATES) && !defined(ACG_SMARTTAGGERT_C) +#define ACG_SMARTTAGGERT_TEMPLATES +#include "SmartTaggerT.cc" +#endif +//============================================================================= +#endif // ACG_SMARTTAGGERT_HH defined +//============================================================================= + From 2cb04f9988a778f750c84865df7cbe0c89e648b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:21:57 +0200 Subject: [PATCH 08/20] Changed License Header refs #57 --- .../Tools/SmartTagger/SmartTaggerT.cc | 33 +++++++------------ .../Tools/SmartTagger/SmartTaggerT.hh | 27 +++++++-------- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc index ef70911f..53019d1c 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc @@ -1,13 +1,13 @@ -/*===========================================================================*\ +/* ========================================================================= * * * - * OpenFlipper * + * OpenMesh * * Copyright (c) 2001-2015, RWTH-Aachen University * * Department of Computer Graphics and Multimedia * * All rights reserved. * - * www.openflipper.org * + * www.openmesh.org * * * *---------------------------------------------------------------------------* - * This file is part of OpenFlipper. * + * This file is part of OpenMesh. * *---------------------------------------------------------------------------* * * * Redistribution and use in source and binary forms, with or without * @@ -37,26 +37,15 @@ * 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$ * + * * \*===========================================================================*/ -//============================================================================= -// -// CLASS SmartTaggerVT -// -// -// original Author: David Bommes -// $Revision: 18033 $ -// $Author: moeller $ -// $Date: 2014-01-16 17:17:07 +0100 (Do, 16. Jan 2014) $ -// -//============================================================================= - -//============================================================================= -// -// CLASS SmartTaggerT - IMPLEMENTATION -// -//============================================================================= - #define ACG_SMARTTAGGERT_C //== INCLUDES ================================================================= diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh index 4dfd2b21..ff19845e 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh @@ -1,13 +1,13 @@ -/*===========================================================================*\ +/* ========================================================================= * * * - * OpenFlipper * + * OpenMesh * * Copyright (c) 2001-2015, RWTH-Aachen University * * Department of Computer Graphics and Multimedia * * All rights reserved. * - * www.openflipper.org * + * www.openmesh.org * * * *---------------------------------------------------------------------------* - * This file is part of OpenFlipper. * + * This file is part of OpenMesh. * *---------------------------------------------------------------------------* * * * Redistribution and use in source and binary forms, with or without * @@ -37,19 +37,14 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * -\*===========================================================================*/ + * ========================================================================= */ -//============================================================================= -// -// CLASS SmartTaggerVT -// -// -// original Author: David Bommes -// $Revision$ -// $Author$ -// $Date$ -// -//============================================================================= +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ #ifndef ACG_SMARTTAGGERT_HH From a2762b05627077bdd5f03eb142322afd7deaec15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:28:24 +0200 Subject: [PATCH 09/20] Moved to OpenMesh namespace --- .../Tools/SmartTagger/SmartTaggerT.cc | 6 +- .../Tools/SmartTagger/SmartTaggerT.hh | 72 +++++++++---------- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc index 53019d1c..b75e4cef 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.cc @@ -46,7 +46,7 @@ * * \*===========================================================================*/ -#define ACG_SMARTTAGGERT_C +#define OPENMESH_SMARTTAGGERT_C //== INCLUDES ================================================================= @@ -57,7 +57,7 @@ //== NAMESPACES =============================================================== -namespace ACG { +namespace OpenMesh { //== IMPLEMENTATION ========================================================== @@ -208,5 +208,5 @@ all_tags_to_zero() } //============================================================================= -} // namespace ACG +} // namespace OpenMesh //============================================================================= diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh index ff19845e..e6cf86a0 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh @@ -47,8 +47,7 @@ \*===========================================================================*/ -#ifndef ACG_SMARTTAGGERT_HH -#define ACG_SMARTTAGGERT_HH +#pragma once //== INCLUDES ================================================================= @@ -64,7 +63,7 @@ //== NAMESPACES =============================================================== -namespace ACG { +namespace OpenMesh { //== FORWARD DECLARATIONS ===================================================== @@ -177,52 +176,49 @@ protected: //== SPECIALIZATION =========================================================== - // define standard Tagger - template< class Mesh> - class SmartTaggerVT +// define standard Tagger +template< class Mesh> +class SmartTaggerVT : public SmartTaggerT< Mesh, typename Mesh::VertexHandle, OpenMesh::VPropHandleT > - { - public: - typedef SmartTaggerT< Mesh, typename Mesh::VertexHandle, OpenMesh::VPropHandleT > BaseType; - SmartTaggerVT(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} - }; +{ +public: + typedef SmartTaggerT< Mesh, typename Mesh::VertexHandle, OpenMesh::VPropHandleT > BaseType; + SmartTaggerVT(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} +}; - template< class Mesh> - class SmartTaggerET +template< class Mesh> +class SmartTaggerET : public SmartTaggerT< Mesh, typename Mesh::EdgeHandle, OpenMesh::EPropHandleT > - { - public: - typedef SmartTaggerT< Mesh, typename Mesh::EdgeHandle, OpenMesh::EPropHandleT > BaseType; - SmartTaggerET(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} - }; +{ +public: + typedef SmartTaggerT< Mesh, typename Mesh::EdgeHandle, OpenMesh::EPropHandleT > BaseType; + SmartTaggerET(Mesh& _mesh, unsigned int _tag_range = 1) : BaseType(_mesh, _tag_range) {} +}; - template< class Mesh> - class SmartTaggerFT +template< class Mesh> +class SmartTaggerFT : public SmartTaggerT< Mesh, typename Mesh::FaceHandle, OpenMesh::FPropHandleT > - { - public: - typedef SmartTaggerT< Mesh, typename Mesh::FaceHandle, OpenMesh::FPropHandleT > BaseType; - SmartTaggerFT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range) {} - }; +{ +public: + typedef SmartTaggerT< Mesh, typename Mesh::FaceHandle, OpenMesh::FPropHandleT > BaseType; + SmartTaggerFT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range) {} +}; - template< class Mesh> - class SmartTaggerHT +template< class Mesh> +class SmartTaggerHT : public SmartTaggerT< Mesh, typename Mesh::HalfedgeHandle, OpenMesh::HPropHandleT > - { - public: - typedef SmartTaggerT< Mesh, typename Mesh::HalfedgeHandle, OpenMesh::HPropHandleT > BaseType; - SmartTaggerHT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range){} - }; +{ +public: + typedef SmartTaggerT< Mesh, typename Mesh::HalfedgeHandle, OpenMesh::HPropHandleT > BaseType; + SmartTaggerHT(Mesh& _mesh, unsigned int _tag_range = 1): BaseType(_mesh, _tag_range){} +}; //============================================================================= -} // namespace ACG +} // namespace OpenMesh //============================================================================= -#if defined(INCLUDE_TEMPLATES) && !defined(ACG_SMARTTAGGERT_C) -#define ACG_SMARTTAGGERT_TEMPLATES +#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SMARTTAGGERT_C) +#define OPENMESH_SMARTTAGGERT_TEMPLATES #include "SmartTaggerT.cc" #endif -//============================================================================= -#endif // ACG_SMARTTAGGERT_HH defined -//============================================================================= From 9f91de0d86195fc2654eed324922288b5ce04056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:39:59 +0200 Subject: [PATCH 10/20] Added basic unittest for smarttagger on vertices --- .../Tools/SmartTagger/SmartTaggerT.hh | 6 +- src/Unittests/unittests_smarttagger.cc | 143 ++++++++++++++++++ 2 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 src/Unittests/unittests_smarttagger.cc diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh index e6cf86a0..accabc8d 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh @@ -130,7 +130,7 @@ public: * @param _eh Edge handle for the tag * @param _tag Tag value */ - inline void set_tag ( const EHandle _eh, unsigned int _tag = 1); + inline void set_tag ( const EHandle _eh, unsigned int _tag = 1); /** \brief get tag value in range [0..tag_range] * @@ -144,7 +144,7 @@ public: * @param _eh Edge handle for the tag * @return Current tag value at that edge */ - inline bool is_tagged( const EHandle _eh) const; + inline bool is_tagged( const EHandle _eh) const; /** \brief set new tag range and untag_all * @@ -152,7 +152,7 @@ public: * * @param _tag_range New tag range of the tagger */ - inline void set_tag_range( const unsigned int _tag_range); + inline void set_tag_range( const unsigned int _tag_range); protected: diff --git a/src/Unittests/unittests_smarttagger.cc b/src/Unittests/unittests_smarttagger.cc new file mode 100644 index 00000000..fcbc9287 --- /dev/null +++ b/src/Unittests/unittests_smarttagger.cc @@ -0,0 +1,143 @@ +#include +#include +#include +#include + +namespace { + +class OpenMeshSmartTagger : public OpenMeshBase { + + protected: + + // This function is called before each test is run + virtual void SetUp() { + + // Do some initial stuff with the member data here... + } + + // This function is called after all tests are through + virtual void TearDown() { + + // Do some final stuff with the member data here... + } + + // Member already defined in OpenMeshBase + //Mesh mesh_; +}; + +/* + * ==================================================================== + * Define tests below + * ==================================================================== + */ + +/* Checks vertices, if they are boundary vertices + */ +TEST_F(OpenMeshSmartTagger, SmartTaggerVertices) { + + mesh_.clear(); + + // Add some vertices + Mesh::VertexHandle vhandle[7]; + + vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0)); + vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0)); + vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0)); + vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0)); + vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0)); + vhandle[5] = mesh_.add_vertex(Mesh::Point(3, 0, 0)); + + + // Add two faces + std::vector face_vhandles; + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[2]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[4]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[1]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[4]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[5]); + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[4]); + mesh_.add_face(face_vhandles); + + /* Test setup: + 0 ==== 2 + |\ /|\ + | \ / | \ + | 1 | 5 + | / \ | / + |/ \|/ + 3 ==== 4 + + */ + + + OpenMesh::SmartTaggerVT< Mesh > tagger(mesh_); + + + EXPECT_FALSE( tagger.is_tagged(vhandle[0] ) ) << "Vertex should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[1] ) ) << "Vertex should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[2] ) ) << "Vertex should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[3] ) ) << "Vertex should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[4] ) ) << "Vertex should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[5] ) ) << "Vertex should be untagged after init!"; + + // Reset tagged flag on all vertices + tagger.untag_all(); + + EXPECT_FALSE( tagger.is_tagged(vhandle[0] ) ) << "Vertex should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[1] ) ) << "Vertex should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[2] ) ) << "Vertex should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[3] ) ) << "Vertex should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[4] ) ) << "Vertex should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[5] ) ) << "Vertex should be untagged after first untag_all!"; + + + // Set tagged: + tagger.set_tag(vhandle[2]); + tagger.set_tag(vhandle[4]); + + EXPECT_FALSE( tagger.is_tagged(vhandle[0] ) ) << "Vertex should be untagged!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[1] ) ) << "Vertex should be untagged!"; + EXPECT_TRUE( tagger.is_tagged(vhandle[2] ) ) << "Vertex should be tagged!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[3] ) ) << "Vertex should be untagged!"; + EXPECT_TRUE( tagger.is_tagged(vhandle[4] ) ) << "Vertex should be tagged!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[5] ) ) << "Vertex should be untagged!"; + + // Reset tagged flag on all vertices + tagger.untag_all(); + + EXPECT_FALSE( tagger.is_tagged(vhandle[0] ) ) << "Vertex should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[1] ) ) << "Vertex should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[2] ) ) << "Vertex should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[3] ) ) << "Vertex should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[4] ) ) << "Vertex should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged(vhandle[5] ) ) << "Vertex should be untagged after second untag_all!"; + +} + +} From 6ff2ae372b22f46907717b9654d0fdecd365ee32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:42:23 +0200 Subject: [PATCH 11/20] Updated changelog --- Doc/changelog.docu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 9c615cf5..6c4922c6 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -20,6 +20,10 @@
  • PLY Reader: Fixed endless loop on unknown property list type
+Tools +
    +
  • SmartTagger: Added the SmartTagger class to tag primitives (O(1) reset )
  • +
From 3e0849fb7215190f948e2c9d42fa4da60937cebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 14:49:25 +0200 Subject: [PATCH 12/20] Addd SmartTagger Unittest for faces --- src/Unittests/unittests_smarttagger.cc | 111 ++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/src/Unittests/unittests_smarttagger.cc b/src/Unittests/unittests_smarttagger.cc index fcbc9287..112fbf74 100644 --- a/src/Unittests/unittests_smarttagger.cc +++ b/src/Unittests/unittests_smarttagger.cc @@ -31,7 +31,7 @@ class OpenMeshSmartTagger : public OpenMeshBase { * ==================================================================== */ -/* Checks vertices, if they are boundary vertices +/* Checks SmartTagger on vertices */ TEST_F(OpenMeshSmartTagger, SmartTaggerVertices) { @@ -140,4 +140,113 @@ TEST_F(OpenMeshSmartTagger, SmartTaggerVertices) { } +/* Checks SmartTagger on vertices + */ +TEST_F(OpenMeshSmartTagger, SmartTaggerFaces) { + + mesh_.clear(); + + // Add some vertices + Mesh::VertexHandle vhandle[7]; + + vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0)); + vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0)); + vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0)); + vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 0)); + vhandle[4] = mesh_.add_vertex(Mesh::Point(2,-1, 0)); + vhandle[5] = mesh_.add_vertex(Mesh::Point(3, 0, 0)); + + + // Add two faces + std::vector face_vhandles; + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[2]); + Mesh::FaceHandle fh1 = mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[4]); + Mesh::FaceHandle fh2 = mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[1]); + Mesh::FaceHandle fh3 = mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[4]); + Mesh::FaceHandle fh4 = mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[5]); + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[4]); + Mesh::FaceHandle fh5 = mesh_.add_face(face_vhandles); + + /* Test setup: + 0 ==== 2 + |\ /|\ + | \ / | \ + | 1 | 5 + | / \ | / + |/ \|/ + 3 ==== 4 + + */ + + + OpenMesh::SmartTaggerFT< Mesh > tagger(mesh_); + + + EXPECT_FALSE( tagger.is_tagged( fh1 ) ) << "Face should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged( fh2 ) ) << "Face should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged( fh3 ) ) << "Face should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged( fh4 ) ) << "Face should be untagged after init!"; + EXPECT_FALSE( tagger.is_tagged( fh5 ) ) << "Face should be untagged after init!"; + + + // Reset tagged flag on all vertices + tagger.untag_all(); + + EXPECT_FALSE( tagger.is_tagged( fh1 ) ) << "Face should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh2 ) ) << "Face should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh3 ) ) << "Face should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh4 ) ) << "Face should be untagged after first untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh5 ) ) << "Face should be untagged after first untag_all!"; + + + + // Set tagged: + tagger.set_tag(fh3); + tagger.set_tag(fh5); + + + EXPECT_FALSE( tagger.is_tagged(fh1 ) ) << "Face should be untagged!"; + EXPECT_FALSE( tagger.is_tagged(fh2 ) ) << "Face should be untagged!"; + EXPECT_TRUE( tagger.is_tagged(fh3 ) ) << "Face should be tagged!"; + EXPECT_FALSE( tagger.is_tagged(fh4 ) ) << "Face should be tagged!"; + EXPECT_TRUE( tagger.is_tagged(fh5 ) ) << "Face should be tagged!"; + + + // Reset tagged flag on all vertices + tagger.untag_all(); + + EXPECT_FALSE( tagger.is_tagged( fh1 ) ) << "Face should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh2 ) ) << "Face should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh3 ) ) << "Face should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh4 ) ) << "Face should be untagged after second untag_all!"; + EXPECT_FALSE( tagger.is_tagged( fh5 ) ) << "Face should be untagged after second untag_all!"; + +} + } From 9a81b465e358d6ec37373a3d4c648d8353bafe7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 19 Jun 2018 15:12:41 +0200 Subject: [PATCH 13/20] Linked SmartTagger docu into main docu pages --- Doc/tools.docu | 1 + .../Tools/SmartTagger/SmartTaggerT.hh | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Doc/tools.docu b/Doc/tools.docu index 5da44bcd..7ae8c68a 100644 --- a/Doc/tools.docu +++ b/Doc/tools.docu @@ -6,6 +6,7 @@ \li \subpage subdivider_docu \li \subpage vdpm_docu \li \subpage smoother_docu +\li \subpage smarttagger_docu \li Miscellaneous OpenMesh::StripifierT diff --git a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh index accabc8d..fb69f587 100644 --- a/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh +++ b/src/OpenMesh/Tools/SmartTagger/SmartTaggerT.hh @@ -80,6 +80,31 @@ template< class Mesh> class SmartTaggerHT; //== CLASS DEFINITION ========================================================= +/** \page smarttagger_docu Smart Tagger + +The smart tagger can be used to tag vertices/halfedges/edges/faces on the mesh. It provides +an O(1) reset function to untag all primitives at once. + +Usage: + +\code +SmartTaggerVT< MeshType > tagger(mesh); + +// Reset tagged flag on all vertices +tagger.untag_all(); + +// Check if something is tagged +bool tag = tagger.is_tagged(vh); + +// Set tagged: +tagger.set_tag(vh); +\endcode + +For details see OpenMesh::SmartTaggerT + +*/ + + /** \brief Smart Tagger * * A tagger class to be used on OpenMesh. It provides an O(1) reset function for the property. From c79e5b2e6398ad867ed523d5726f77275a5d9652 Mon Sep 17 00:00:00 2001 From: Alexander Dielen Date: Thu, 5 Jul 2018 17:00:02 +0200 Subject: [PATCH 14/20] register vtk writer for static builds --- src/OpenMesh/Core/IO/IOInstances.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OpenMesh/Core/IO/IOInstances.hh b/src/OpenMesh/Core/IO/IOInstances.hh index 744b9a81..96793a67 100644 --- a/src/OpenMesh/Core/IO/IOInstances.hh +++ b/src/OpenMesh/Core/IO/IOInstances.hh @@ -82,6 +82,7 @@ #include #include #include +#include //=== NAMESPACES ============================================================== @@ -104,6 +105,7 @@ static BaseWriter* OFFWriterInstance = &OFFWriter(); static BaseWriter* STLWriterInstance = &STLWriter(); static BaseWriter* OMWriterInstance = &OMWriter(); static BaseWriter* PLYWriterInstance = &PLYWriter(); +static BaseWriter* VTKWriterInstance = &VTKWriter(); //============================================================================= From 18e39fee46a653d4b9a59bb56ec227f613639f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 25 Sep 2018 10:15:47 +0200 Subject: [PATCH 15/20] Rename the DEPRECATED macro into OM_DEPRECATED to prevent a macro clash with Intel MKL (Thanks to Morgan Leborgne for the patch) --- Doc/changelog.docu | 6 ++++++ src/OpenMesh/Core/Mesh/CirculatorsT.hh | 12 ++++++------ src/OpenMesh/Core/Mesh/IteratorsT.hh | 4 ++-- src/OpenMesh/Core/System/config.h | 10 +++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 6c4922c6..c38bd385 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -25,6 +25,12 @@
  • SmartTagger: Added the SmartTagger class to tag primitives (O(1) reset )
  • +Build System +
      +
    • Rename the DEPRECATED macro into OM_DEPRECATED to prevent a macro clash with Intel MKL (Thanks to Morgan Leborgne for the patch)
    • +
    + + diff --git a/src/OpenMesh/Core/Mesh/CirculatorsT.hh b/src/OpenMesh/Core/Mesh/CirculatorsT.hh index 06560599..f3a0c6e2 100644 --- a/src/OpenMesh/Core/Mesh/CirculatorsT.hh +++ b/src/OpenMesh/Core/Mesh/CirculatorsT.hh @@ -470,7 +470,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { To be save, you can use the CW/CCW circulator definitions, which behave\ the same as the original ones, without the previously mentioned issues." - DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT ) + OM_DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT ) #endif // NO_DECREMENT_DEPRECATED_WARNINGS GenericCirculatorT_DEPRECATED& operator--() { assert(this->mesh_); @@ -488,7 +488,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { /// Post-decrement #ifndef NO_DECREMENT_DEPRECATED_WARNINGS - DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT ) + OM_DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT ) #undef DECREMENT_DEPRECATED_WARNINGS_TEXT #endif //NO_DECREMENT_DEPRECATED_WARNINGS GenericCirculatorT_DEPRECATED operator--(int) { @@ -542,7 +542,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { return GenericCirculator_ValueHandleFns::is_valid(this->heh_,this->start_, this->lap_counter_); } - DEPRECATED("current_halfedge_handle() is an implementation detail and should not be accessed from outside the iterator class.") + OM_DEPRECATED("current_halfedge_handle() is an implementation detail and should not be accessed from outside the iterator class.") /** * \deprecated * current_halfedge_handle() is an implementation detail and should not @@ -552,7 +552,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { return this->heh_; } - DEPRECATED("Do not use this error prone implicit cast. Compare to end-iterator or use is_valid(), instead.") + OM_DEPRECATED("Do not use this error prone implicit cast. Compare to end-iterator or use is_valid(), instead.") /** * \deprecated * Do not use this error prone implicit cast. Compare to the @@ -567,7 +567,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { * \deprecated * This function clutters your code. Use dereferencing operators -> and * instead. */ - DEPRECATED("This function clutters your code. Use dereferencing operators -> and * instead.") + OM_DEPRECATED("This function clutters your code. Use dereferencing operators -> and * instead.") value_type handle() const { return **this; } @@ -578,7 +578,7 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { * Implicit casts of iterators are unsafe. Use dereferencing operators * -> and * instead. */ - DEPRECATED("Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.") + OM_DEPRECATED("Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.") operator value_type() const { return **this; } diff --git a/src/OpenMesh/Core/Mesh/IteratorsT.hh b/src/OpenMesh/Core/Mesh/IteratorsT.hh index 6d2c92bc..284004c9 100644 --- a/src/OpenMesh/Core/Mesh/IteratorsT.hh +++ b/src/OpenMesh/Core/Mesh/IteratorsT.hh @@ -126,7 +126,7 @@ class GenericIteratorT { * \deprecated * This function clutters your code. Use dereferencing operators -> and * instead. */ - DEPRECATED("This function clutters your code. Use dereferencing operators -> and * instead.") + OM_DEPRECATED("This function clutters your code. Use dereferencing operators -> and * instead.") value_handle handle() const { return hnd_; } @@ -137,7 +137,7 @@ class GenericIteratorT { * Implicit casts of iterators are unsafe. Use dereferencing operators * -> and * instead. */ - DEPRECATED("Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.") + OM_DEPRECATED("Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.") operator value_handle() const { return hnd_; } diff --git a/src/OpenMesh/Core/System/config.h b/src/OpenMesh/Core/System/config.h index 9d7520c1..bb5a7893 100644 --- a/src/OpenMesh/Core/System/config.h +++ b/src/OpenMesh/Core/System/config.h @@ -83,17 +83,17 @@ #endif #if defined(_MSC_VER) -# define DEPRECATED(msg) __declspec(deprecated(msg)) +# define OM_DEPRECATED(msg) __declspec(deprecated(msg)) #elif defined(__GNUC__) # if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40500 /* Test for GCC >= 4.5.0 */ -# define DEPRECATED(msg) __attribute__ ((deprecated(msg))) +# define OM_DEPRECATED(msg) __attribute__ ((deprecated(msg))) # else -# define DEPRECATED(msg) __attribute__ ((deprecated)) +# define OM_DEPRECATED(msg) __attribute__ ((deprecated)) # endif #elif defined(__clang__) -# define DEPRECATED(msg) __attribute__ ((deprecated(msg))) +# define OM_DEPRECATED(msg) __attribute__ ((deprecated(msg))) #else -# define DEPRECATED(msg) +# define OM_DEPRECATED(msg) #endif typedef unsigned int uint; From df53457064928e30821bc312e9cec732082a12e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 25 Sep 2018 12:36:21 +0200 Subject: [PATCH 16/20] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 545b79db..c40d7e15 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,6 +62,7 @@ VS2017-64-bit-shared-apps: ARCHITECTURE: "x64" SHARED: "TRUE" APPS: "ON" + GIT_CURL_VERBOSE: "1" script: "CI\\Windows.bat" tags: - VS2017 From ef9631be937b29f08348db5ac07a6cb2ec1f1ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 25 Sep 2018 12:58:27 +0200 Subject: [PATCH 17/20] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c40d7e15..545b79db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,7 +62,6 @@ VS2017-64-bit-shared-apps: ARCHITECTURE: "x64" SHARED: "TRUE" APPS: "ON" - GIT_CURL_VERBOSE: "1" script: "CI\\Windows.bat" tags: - VS2017 From 24d8828b26a972e15c680f93804389fd76be38ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 27 Sep 2018 11:23:14 +0200 Subject: [PATCH 18/20] Update Windows.bat --- CI/Windows.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/CI/Windows.bat b/CI/Windows.bat index 4460e6fe..1969128b 100644 --- a/CI/Windows.bat +++ b/CI/Windows.bat @@ -98,6 +98,7 @@ IF "%APPS%" == "ON" ( ECHO "=============================================================" ECHO "=============================================================" ECHO "Building with :" +whoami ECHO "ARCHITECTURE : %ARCHITECTURE%" ECHO "BUILD_PLATFORM : %BUILD_PLATFORM%" ECHO "GTESTVERSION : %GTESTVERSION%" From 7cc7f25c9259fee7c3b4ffa98a6f3c8ef0e9ddd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 27 Sep 2018 13:53:47 +0200 Subject: [PATCH 19/20] Switched Qt Build version for VS2013 to Qt-5.7 --- CI/Windows.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CI/Windows.bat b/CI/Windows.bat index 1969128b..388214b1 100644 --- a/CI/Windows.bat +++ b/CI/Windows.bat @@ -38,13 +38,13 @@ IF "%BUILD_PLATFORM%" == "VS2013" ( set GENERATOR=Visual Studio 12%ARCH_VS% set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com" 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 + set QT_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64 + set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64 ) IF "%ARCHITECTURE%" == "x32" ( - set QT_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl - set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.3.1-vs2013-%STRING_ARCH%\5.3\msvc2013_opengl + set QT_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013 + set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64 ) ) From 1e631a52cfed3bdbdf78f8c086712c8e483280d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 27 Sep 2018 13:54:36 +0200 Subject: [PATCH 20/20] FIxed Typo --- CI/Windows.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Windows.bat b/CI/Windows.bat index 388214b1..c96a9e6c 100644 --- a/CI/Windows.bat +++ b/CI/Windows.bat @@ -44,7 +44,7 @@ IF "%BUILD_PLATFORM%" == "VS2013" ( IF "%ARCHITECTURE%" == "x32" ( set QT_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013 - set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013_64 + set QT_BASE_CONFIG=-DQT5_INSTALL_PATH=E:\Qt\Qt5.7.0\5.7\msvc2013 ) )