From 5b9326a0dde8c9fdd6a2d7480208a37b3d53e330 Mon Sep 17 00:00:00 2001 From: Isaak Lim Date: Tue, 31 Jan 2017 09:39:17 +0100 Subject: [PATCH 01/10] fix the stripping of the python libs version string where subsequent numbers after 'rc' (release candidate) were not matched correctly --- src/Python/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index 099786d1..cafb785b 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -66,8 +66,8 @@ IF(OPENMESH_BUILD_PYTHON_BINDINGS) IF(COMPILE_WORKS) # Look for the python interpreter to check if the example works - # strip version string of any characters (e.g. # '+') than 0-9 and . - STRING(REGEX REPLACE "[^ 0-9 | \\.]" "" PYTHONLIBS_VERSION_STRING_STRIPPED ${PYTHONLIBS_VERSION_STRING}) + # 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) From 25178d9dcb1be4fcfd03b57d96851753ef867c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 2 Feb 2017 13:53:46 +0100 Subject: [PATCH 02/10] Fixed explicit making cppcheck fail and some lineendings --- .../Unsupported/IvViewer/SoOpenMeshNodeT.hh | 2 +- src/OpenMesh/Core/System/mostream.hh | 2 +- .../Core/Utils/RandomNumberGenerator.hh | 2 +- src/OpenMesh/Tools/Decimater/Observer.hh | 2 +- .../Tools/Subdivider/Uniform/CatmullClarkT.hh | 2 +- .../Uniform/Composite/CompositeT.hh | 424 +++++++++--------- .../Tools/Subdivider/Uniform/SubdividerT.hh | 2 +- src/OpenMesh/Tools/Utils/Gnuplot.hh | 4 +- src/OpenMesh/Tools/Utils/MeshCheckerT.hh | 2 +- .../Tools/VDPM/VHierarchyNodeIndex.hh | 188 ++++---- 10 files changed, 315 insertions(+), 315 deletions(-) diff --git a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh index fb7c7ae2..0a88e561 100644 --- a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh +++ b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh @@ -85,7 +85,7 @@ class SoOpenMeshNodeT : public SoShape public: static void initClass(); - SoOpenMeshNodeT(const Mesh* _mesh=0); + explicit SoOpenMeshNodeT(const Mesh* _mesh=0); void setMesh(const Mesh* mesh) { d_mesh = mesh; } diff --git a/src/OpenMesh/Core/System/mostream.hh b/src/OpenMesh/Core/System/mostream.hh index c197a49b..ac4235c3 100644 --- a/src/OpenMesh/Core/System/mostream.hh +++ b/src/OpenMesh/Core/System/mostream.hh @@ -96,7 +96,7 @@ template class multiplex_target : public basic_multiplex_target { public: - multiplex_target(T& _t) : target_(_t) {} + explicit multiplex_target(T& _t) : target_(_t) {} virtual void operator<<(const std::string& _s) { target_ << _s; } private: T& target_; diff --git a/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh b/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh index 2c9f7779..aaedfcdf 100644 --- a/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh +++ b/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh @@ -90,7 +90,7 @@ public: * * @param _resolution specifies the desired resolution for the random number generated */ - RandomNumberGenerator(const size_t _resolution); + explicit RandomNumberGenerator(const size_t _resolution); /// returns a random double between 0.0 and 1.0 with a guaranteed resolution double getRand() const; diff --git a/src/OpenMesh/Tools/Decimater/Observer.hh b/src/OpenMesh/Tools/Decimater/Observer.hh index f86cf29c..f42b300d 100644 --- a/src/OpenMesh/Tools/Decimater/Observer.hh +++ b/src/OpenMesh/Tools/Decimater/Observer.hh @@ -87,7 +87,7 @@ public: * * @param _notificationInterval Interval of decimation steps between notifications. */ - Observer(size_t _notificationInterval); + explicit Observer(size_t _notificationInterval); /// Destructor virtual ~Observer(); diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh index 1afc3687..c756a0fa 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh @@ -115,7 +115,7 @@ public: CatmullClarkT( ) : parent_t() { } /// Constructor - CatmullClarkT(MeshType &_m) : parent_t(_m) { } + explicit CatmullClarkT(MeshType &_m) : parent_t(_m) { } virtual ~CatmullClarkT() {} diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh index 91754b21..6566d0a9 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh @@ -37,215 +37,215 @@ * 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$ * - * * -\*===========================================================================*/ - -/** \file Uniform/Composite/CompositeT.hh - - */ - -//============================================================================= -// -// CLASS CompositeT -// -//============================================================================= - -#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH -#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH - - -//== INCLUDES ================================================================= - -#include -#include -// -------------------- -#include - -//== NAMESPACE ================================================================ - -namespace OpenMesh { // BEGIN_NS_OPENMESH -namespace Subdivider { // BEGIN_NS_DECIMATER -namespace Uniform { // BEGIN_NS_UNIFORM - - -//== CLASS DEFINITION ========================================================= - -/** This class provides the composite subdivision rules for the uniform case. - * - * To create a subdivider derive from this class and overload the functions - * name() and apply_rules(). In the latter one call the wanted rules. - * - * For details on the composite scheme refer to - * - P. Oswald, - * P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes", - * CAGD 20, 3, 2003, 135--164 - - * \note Not all rules are implemented! - * \see class Adaptive::CompositeT - */ -template -class CompositeT : public SubdividerT< MeshType, RealType > -{ -public: - - typedef RealType real_t; - typedef MeshType mesh_t; - typedef SubdividerT< mesh_t, real_t > parent_t; - -public: - - CompositeT(void) : parent_t(), p_mesh_(NULL) {} - CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {}; - virtual ~CompositeT() { } - -public: // inherited interface - - virtual const char *name( void ) const = 0; - -protected: // inherited interface - - bool prepare( MeshType& _m ); - - bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true ) - { - assert( p_mesh_ == &_m ); - - while(_n--) - { - apply_rules(); - commit(_m); - } - - return true; - } - -#ifdef NDEBUG - bool cleanup( MeshType& ) -#else - bool cleanup( MeshType& _m ) -#endif - { - assert( p_mesh_ == &_m ); - p_mesh_=NULL; - return true; - } - -protected: - - /// Assemble here the rule sequence, by calling the constructor - /// of the wanted rules. - virtual void apply_rules(void) = 0; - -protected: - - /// Move vertices to new positions after the rules have been applied - /// to the mesh (called by subdivide()). - void commit( MeshType &_m) - { - typename MeshType::VertexIter v_it; - - for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it) - _m.set_point(*v_it, _m.data(*v_it).position()); - } - - -public: - - /// Abstract base class for coefficient functions - struct Coeff - { - virtual ~Coeff() { } - virtual double operator() (size_t _valence) = 0; - }; - - -protected: - - typedef typename MeshType::Scalar scalar_t; - typedef typename MeshType::VertexHandle VertexHandle; - typedef typename MeshType::FaceHandle FaceHandle; - typedef typename MeshType::EdgeHandle EdgeHandle; - typedef typename MeshType::HalfedgeHandle HalfedgeHandle; - - /// \name Uniform composite subdivision rules - //@{ - - - void Tvv3(); ///< Split Face, using Vertex information (1-3 split) - void Tvv4(); ///< Split Face, using Vertex information (1-4 split) - void Tfv(); ///< Split Face, using Face Information - - void FF(); ///< Face to face averaging. - void FFc(Coeff& _coeff); ///< Weighted face to face averaging. - void FFc(scalar_t _c); ///< Weighted face to face averaging. - - void FV(); ///< Face to vertex averaging. - void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps - void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps - - void FE(); ///< Face to edge averaging. - - void VF(); ///< Vertex to Face Averaging. - void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted. - void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted. - - void VV(); ///< Vertex to vertex averaging. - void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted. - void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted. - - void VE(); ///< VE Step (Vertex to Edge Averaging) - - - void VdE(); ///< Vertex to edge averaging, using diamond of edges. - void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges - - /// Weigthed vertex to edge averaging, using diamond of edges for - /// irregular vertices. - void VdEg(Coeff& _coeff); - /// Weigthed vertex to edge averaging, using diamond of edges for - /// irregular vertices. - void VdEg(scalar_t _gamma); - - void EF(); ///< Edge to face averaging. - - void EV(); ///< Edge to vertex averaging. - void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging. - void EVc(scalar_t _c); ///< Weighted edge to vertex averaging. - - void EdE(); ///< Edge to edge averaging w/ flap rule. - void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule. - - - //@} - - void corner_cutting(HalfedgeHandle _heh); - - VertexHandle split_edge(HalfedgeHandle _heh); - -private: - - MeshType* p_mesh_; - -}; - - -//============================================================================= -} // END_NS_UNIFORM -} // END_NS_SUBDIVIDER -} // END_NS_OPENMESH -//============================================================================= -#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC) -#define OPENMESH_SUBDIVIDER_TEMPLATES -#include "CompositeT.cc" -#endif -//============================================================================= -#endif // COMPOSITET_HH defined -//============================================================================= - + * ========================================================================= */ + +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ + +/** \file Uniform/Composite/CompositeT.hh + + */ + +//============================================================================= +// +// CLASS CompositeT +// +//============================================================================= + +#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH +#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH + + +//== INCLUDES ================================================================= + +#include +#include +// -------------------- +#include + +//== NAMESPACE ================================================================ + +namespace OpenMesh { // BEGIN_NS_OPENMESH +namespace Subdivider { // BEGIN_NS_DECIMATER +namespace Uniform { // BEGIN_NS_UNIFORM + + +//== CLASS DEFINITION ========================================================= + +/** This class provides the composite subdivision rules for the uniform case. + * + * To create a subdivider derive from this class and overload the functions + * name() and apply_rules(). In the latter one call the wanted rules. + * + * For details on the composite scheme refer to + * - P. Oswald, + * P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes", + * CAGD 20, 3, 2003, 135--164 + + * \note Not all rules are implemented! + * \see class Adaptive::CompositeT + */ +template +class CompositeT : public SubdividerT< MeshType, RealType > +{ +public: + + typedef RealType real_t; + typedef MeshType mesh_t; + typedef SubdividerT< mesh_t, real_t > parent_t; + +public: + + CompositeT(void) : parent_t(), p_mesh_(NULL) {} + explicit CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {}; + virtual ~CompositeT() { } + +public: // inherited interface + + virtual const char *name( void ) const = 0; + +protected: // inherited interface + + bool prepare( MeshType& _m ); + + bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true ) + { + assert( p_mesh_ == &_m ); + + while(_n--) + { + apply_rules(); + commit(_m); + } + + return true; + } + +#ifdef NDEBUG + bool cleanup( MeshType& ) +#else + bool cleanup( MeshType& _m ) +#endif + { + assert( p_mesh_ == &_m ); + p_mesh_=NULL; + return true; + } + +protected: + + /// Assemble here the rule sequence, by calling the constructor + /// of the wanted rules. + virtual void apply_rules(void) = 0; + +protected: + + /// Move vertices to new positions after the rules have been applied + /// to the mesh (called by subdivide()). + void commit( MeshType &_m) + { + typename MeshType::VertexIter v_it; + + for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it) + _m.set_point(*v_it, _m.data(*v_it).position()); + } + + +public: + + /// Abstract base class for coefficient functions + struct Coeff + { + virtual ~Coeff() { } + virtual double operator() (size_t _valence) = 0; + }; + + +protected: + + typedef typename MeshType::Scalar scalar_t; + typedef typename MeshType::VertexHandle VertexHandle; + typedef typename MeshType::FaceHandle FaceHandle; + typedef typename MeshType::EdgeHandle EdgeHandle; + typedef typename MeshType::HalfedgeHandle HalfedgeHandle; + + /// \name Uniform composite subdivision rules + //@{ + + + void Tvv3(); ///< Split Face, using Vertex information (1-3 split) + void Tvv4(); ///< Split Face, using Vertex information (1-4 split) + void Tfv(); ///< Split Face, using Face Information + + void FF(); ///< Face to face averaging. + void FFc(Coeff& _coeff); ///< Weighted face to face averaging. + void FFc(scalar_t _c); ///< Weighted face to face averaging. + + void FV(); ///< Face to vertex averaging. + void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps + void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps + + void FE(); ///< Face to edge averaging. + + void VF(); ///< Vertex to Face Averaging. + void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted. + void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted. + + void VV(); ///< Vertex to vertex averaging. + void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted. + void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted. + + void VE(); ///< VE Step (Vertex to Edge Averaging) + + + void VdE(); ///< Vertex to edge averaging, using diamond of edges. + void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges + + /// Weigthed vertex to edge averaging, using diamond of edges for + /// irregular vertices. + void VdEg(Coeff& _coeff); + /// Weigthed vertex to edge averaging, using diamond of edges for + /// irregular vertices. + void VdEg(scalar_t _gamma); + + void EF(); ///< Edge to face averaging. + + void EV(); ///< Edge to vertex averaging. + void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging. + void EVc(scalar_t _c); ///< Weighted edge to vertex averaging. + + void EdE(); ///< Edge to edge averaging w/ flap rule. + void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule. + + + //@} + + void corner_cutting(HalfedgeHandle _heh); + + VertexHandle split_edge(HalfedgeHandle _heh); + +private: + + MeshType* p_mesh_; + +}; + + +//============================================================================= +} // END_NS_UNIFORM +} // END_NS_SUBDIVIDER +} // END_NS_OPENMESH +//============================================================================= +#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC) +#define OPENMESH_SUBDIVIDER_TEMPLATES +#include "CompositeT.cc" +#endif +//============================================================================= +#endif // COMPOSITET_HH defined +//============================================================================= + diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh index ad6d038d..08b2c0b4 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh @@ -107,7 +107,7 @@ public: /// Constructor to be used with interface 1 (calls attach()) /// \see operator()( MeshType&, size_t ) - SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); } + explicit SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); } //@} diff --git a/src/OpenMesh/Tools/Utils/Gnuplot.hh b/src/OpenMesh/Tools/Utils/Gnuplot.hh index 94b4a2ac..faf2e50c 100644 --- a/src/OpenMesh/Tools/Utils/Gnuplot.hh +++ b/src/OpenMesh/Tools/Utils/Gnuplot.hh @@ -74,7 +74,7 @@ using namespace std; class GnuplotException : public runtime_error { public: - GnuplotException(const string &msg) : runtime_error(msg){} + explicit GnuplotException(const string &msg) : runtime_error(msg){} }; // ---------------------------------------------------------------------------- @@ -113,7 +113,7 @@ public: Gnuplot(); /// Set a style during construction. - Gnuplot(const string & _style); + explicit Gnuplot(const string & _style); /// Constructor calling plot_xy(). Gnuplot(const string & _title, diff --git a/src/OpenMesh/Tools/Utils/MeshCheckerT.hh b/src/OpenMesh/Tools/Utils/MeshCheckerT.hh index 9db382d2..2357ab26 100644 --- a/src/OpenMesh/Tools/Utils/MeshCheckerT.hh +++ b/src/OpenMesh/Tools/Utils/MeshCheckerT.hh @@ -80,7 +80,7 @@ class MeshCheckerT public: /// constructor - MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {} + explicit MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {} /// destructor ~MeshCheckerT() {} diff --git a/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh b/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh index edfa0724..5b17d8ec 100644 --- a/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh +++ b/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh @@ -37,97 +37,97 @@ * 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 newClass -// -//============================================================================= - -#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH -#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH - -//== INCLUDES ================================================================= - -#include -#include - -//== FORWARDDECLARATIONS ====================================================== - - -//== NAMESPACES =============================================================== - -namespace OpenMesh { -namespace VDPM { - -//== CLASS DEFINITION ========================================================= - - -/** Index of vertex hierarchy node - */ - - -class VHierarchyNodeIndex -{ -private: - unsigned int value_; - -public: - - static const VHierarchyNodeIndex InvalidIndex; - -public: - - VHierarchyNodeIndex() - { value_ = 0; } - - VHierarchyNodeIndex(unsigned int _value) - { value_ = _value; } - - VHierarchyNodeIndex(const VHierarchyNodeIndex &_other) - { value_ = _other.value_; } - - VHierarchyNodeIndex(unsigned int _tree_id, - unsigned int _node_id, - unsigned short _tree_id_bits) - { - assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits)); - assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits))); - value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id; - } - - bool is_valid(unsigned short _tree_id_bits) const - { return node_id(_tree_id_bits) != 0 ? true : false; } - - unsigned int tree_id(unsigned short _tree_id_bits) const - { return value_ >> (32 - _tree_id_bits); } - - unsigned int node_id(unsigned short _tree_id_bits) const - { return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); } - - bool operator< (const VHierarchyNodeIndex &other) const - { return (value_ < other.value_) ? true : false; } - - unsigned int value() const - { return value_; } -}; - - -/// Container for vertex hierarchy node indices -typedef std::vector VHierarchyNodeIndexContainer; - - -//============================================================================= -} // namespace VDPM -} // namespace OpenMesh -//============================================================================= -#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined -//============================================================================= + * ========================================================================= */ + +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ + +//============================================================================= +// +// CLASS newClass +// +//============================================================================= + +#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH +#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH + +//== INCLUDES ================================================================= + +#include +#include + +//== FORWARDDECLARATIONS ====================================================== + + +//== NAMESPACES =============================================================== + +namespace OpenMesh { +namespace VDPM { + +//== CLASS DEFINITION ========================================================= + + +/** Index of vertex hierarchy node + */ + + +class VHierarchyNodeIndex +{ +private: + unsigned int value_; + +public: + + static const VHierarchyNodeIndex InvalidIndex; + +public: + + VHierarchyNodeIndex() + { value_ = 0; } + + explicit VHierarchyNodeIndex(unsigned int _value) + { value_ = _value; } + + VHierarchyNodeIndex(const VHierarchyNodeIndex &_other) + { value_ = _other.value_; } + + VHierarchyNodeIndex(unsigned int _tree_id, + unsigned int _node_id, + unsigned short _tree_id_bits) + { + assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits)); + assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits))); + value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id; + } + + bool is_valid(unsigned short _tree_id_bits) const + { return node_id(_tree_id_bits) != 0 ? true : false; } + + unsigned int tree_id(unsigned short _tree_id_bits) const + { return value_ >> (32 - _tree_id_bits); } + + unsigned int node_id(unsigned short _tree_id_bits) const + { return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); } + + bool operator< (const VHierarchyNodeIndex &other) const + { return (value_ < other.value_) ? true : false; } + + unsigned int value() const + { return value_; } +}; + + +/// Container for vertex hierarchy node indices +typedef std::vector VHierarchyNodeIndexContainer; + + +//============================================================================= +} // namespace VDPM +} // namespace OpenMesh +//============================================================================= +#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined +//============================================================================= From bd4b1e6ffdec79eafcf0bc6c1010e0251bdd774d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 2 Feb 2017 14:02:28 +0100 Subject: [PATCH 03/10] Remove c++98 autobuilds and enable c++14 --- .gitlab-ci.yml | 14 +++++++------- CI/ci-linux.sh | 4 ++++ CI/ci-mac.sh | 4 ++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69c34245..d24c8c1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,13 +8,13 @@ clang-c++11: tags: - Linux -gcc-c++98: - script: "CI/ci-linux.sh gcc C++98" +gcc-c++14: + script: "CI/ci-linux.sh gcc C++14" tags: - Linux -clang-c++98: - script: "CI/ci-linux.sh clang C++98" +clang-c++14: + script: "CI/ci-linux.sh clang C++14" tags: - Linux @@ -28,13 +28,13 @@ macos-c++11: - build-release-cpp11/*.tar.gz macos-c++98: - script: "CI/ci-mac.sh C++98" + script: "CI/ci-mac.sh C++14" tags: - Apple artifacts: paths: - - build-release-cpp98/*.dmg - - build-release-cpp98/*.tar.gz + - build-release-cpp14/*.dmg + - build-release-cpp14/*.tar.gz cppcheck: script: "CI/ci-cppcheck.sh" diff --git a/CI/ci-linux.sh b/CI/ci-linux.sh index b8d3162a..f7632198 100755 --- a/CI/ci-linux.sh +++ b/CI/ci-linux.sh @@ -33,6 +33,10 @@ elif [ "$LANGUAGE" == "C++11" ]; then echo "Building with C++11"; OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' " BUILDPATH="$BUILDPATH-cpp11" +elif [ "$LANGUAGE" == "C++14" ]; then + echo "Building with C++14"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' " + BUILDPATH="$BUILDPATH-cpp14" fi #===================================== diff --git a/CI/ci-mac.sh b/CI/ci-mac.sh index 5ea9c755..9dd14577 100755 --- a/CI/ci-mac.sh +++ b/CI/ci-mac.sh @@ -18,6 +18,10 @@ elif [ "$LANGUAGE" == "C++11" ]; then echo "Building with C++11"; OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' " BUILDPATH="cpp11" +elif [ "$LANGUAGE" == "C++14" ]; then + echo "Building with C++14"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' " + BUILDPATH="cpp14" fi #===================================== From 8712eac97dd45db84342cd544ac873dab0a64fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 09:16:49 +0100 Subject: [PATCH 04/10] Updated finder to search for latest googletest as well --- cmake/FindGoogleTest.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake index 503bc80e..d75ba753 100644 --- a/cmake/FindGoogleTest.cmake +++ b/cmake/FindGoogleTest.cmake @@ -42,6 +42,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) else(GTEST_PREFIX) find_path(_GTEST_INCLUDE_DIR "gtest/gtest.h" PATHS + ~/sw/gtest-1.8.0/include ~/sw/gtest-1.7.0/include ~/sw/gtest/include /ACG/acgdev/gcc-4.7-x86_64/gtest/include @@ -52,6 +53,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) NO_DEFAULT_PATH ) find_library(_GTEST_LIBRARY gtest PATHS + ~/sw/gtest-1.8.0/lib ~/sw/gtest-1.7.0/lib ~/sw/gtest/lib /ACG/acgdev/gcc-4.7-x86_64/gtest/lib @@ -62,6 +64,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) NO_DEFAULT_PATH ) find_library(_GTEST_MAIN_LIBRARY gtest_main PATHS + ~/sw/gtest-1.8.0/lib ~/sw/gtest-1.7.0/lib ~/sw/gtest/lib /ACG/acgdev/gcc-4.7-x86_64/gtest/lib From fd5b60fcba25ad1db26adcc1c21e0fb5441d73ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 2 Feb 2017 13:53:46 +0100 Subject: [PATCH 05/10] Fixed explicit making cppcheck fail and some lineendings (cherry picked from commit 25178d9dcb1be4fcfd03b57d96851753ef867c61) --- .../Unsupported/IvViewer/SoOpenMeshNodeT.hh | 2 +- src/OpenMesh/Core/System/mostream.hh | 2 +- .../Core/Utils/RandomNumberGenerator.hh | 2 +- src/OpenMesh/Tools/Decimater/Observer.hh | 2 +- .../Tools/Subdivider/Uniform/CatmullClarkT.hh | 2 +- .../Uniform/Composite/CompositeT.hh | 424 +++++++++--------- .../Tools/Subdivider/Uniform/SubdividerT.hh | 2 +- src/OpenMesh/Tools/Utils/Gnuplot.hh | 4 +- src/OpenMesh/Tools/Utils/MeshCheckerT.hh | 2 +- .../Tools/VDPM/VHierarchyNodeIndex.hh | 188 ++++---- 10 files changed, 315 insertions(+), 315 deletions(-) diff --git a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh index fb7c7ae2..0a88e561 100644 --- a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh +++ b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh @@ -85,7 +85,7 @@ class SoOpenMeshNodeT : public SoShape public: static void initClass(); - SoOpenMeshNodeT(const Mesh* _mesh=0); + explicit SoOpenMeshNodeT(const Mesh* _mesh=0); void setMesh(const Mesh* mesh) { d_mesh = mesh; } diff --git a/src/OpenMesh/Core/System/mostream.hh b/src/OpenMesh/Core/System/mostream.hh index c197a49b..ac4235c3 100644 --- a/src/OpenMesh/Core/System/mostream.hh +++ b/src/OpenMesh/Core/System/mostream.hh @@ -96,7 +96,7 @@ template class multiplex_target : public basic_multiplex_target { public: - multiplex_target(T& _t) : target_(_t) {} + explicit multiplex_target(T& _t) : target_(_t) {} virtual void operator<<(const std::string& _s) { target_ << _s; } private: T& target_; diff --git a/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh b/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh index 2c9f7779..aaedfcdf 100644 --- a/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh +++ b/src/OpenMesh/Core/Utils/RandomNumberGenerator.hh @@ -90,7 +90,7 @@ public: * * @param _resolution specifies the desired resolution for the random number generated */ - RandomNumberGenerator(const size_t _resolution); + explicit RandomNumberGenerator(const size_t _resolution); /// returns a random double between 0.0 and 1.0 with a guaranteed resolution double getRand() const; diff --git a/src/OpenMesh/Tools/Decimater/Observer.hh b/src/OpenMesh/Tools/Decimater/Observer.hh index f86cf29c..f42b300d 100644 --- a/src/OpenMesh/Tools/Decimater/Observer.hh +++ b/src/OpenMesh/Tools/Decimater/Observer.hh @@ -87,7 +87,7 @@ public: * * @param _notificationInterval Interval of decimation steps between notifications. */ - Observer(size_t _notificationInterval); + explicit Observer(size_t _notificationInterval); /// Destructor virtual ~Observer(); diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh index 1afc3687..c756a0fa 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh @@ -115,7 +115,7 @@ public: CatmullClarkT( ) : parent_t() { } /// Constructor - CatmullClarkT(MeshType &_m) : parent_t(_m) { } + explicit CatmullClarkT(MeshType &_m) : parent_t(_m) { } virtual ~CatmullClarkT() {} diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh index 91754b21..6566d0a9 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh @@ -37,215 +37,215 @@ * 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$ * - * * -\*===========================================================================*/ - -/** \file Uniform/Composite/CompositeT.hh - - */ - -//============================================================================= -// -// CLASS CompositeT -// -//============================================================================= - -#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH -#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH - - -//== INCLUDES ================================================================= - -#include -#include -// -------------------- -#include - -//== NAMESPACE ================================================================ - -namespace OpenMesh { // BEGIN_NS_OPENMESH -namespace Subdivider { // BEGIN_NS_DECIMATER -namespace Uniform { // BEGIN_NS_UNIFORM - - -//== CLASS DEFINITION ========================================================= - -/** This class provides the composite subdivision rules for the uniform case. - * - * To create a subdivider derive from this class and overload the functions - * name() and apply_rules(). In the latter one call the wanted rules. - * - * For details on the composite scheme refer to - * - P. Oswald, - * P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes", - * CAGD 20, 3, 2003, 135--164 - - * \note Not all rules are implemented! - * \see class Adaptive::CompositeT - */ -template -class CompositeT : public SubdividerT< MeshType, RealType > -{ -public: - - typedef RealType real_t; - typedef MeshType mesh_t; - typedef SubdividerT< mesh_t, real_t > parent_t; - -public: - - CompositeT(void) : parent_t(), p_mesh_(NULL) {} - CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {}; - virtual ~CompositeT() { } - -public: // inherited interface - - virtual const char *name( void ) const = 0; - -protected: // inherited interface - - bool prepare( MeshType& _m ); - - bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true ) - { - assert( p_mesh_ == &_m ); - - while(_n--) - { - apply_rules(); - commit(_m); - } - - return true; - } - -#ifdef NDEBUG - bool cleanup( MeshType& ) -#else - bool cleanup( MeshType& _m ) -#endif - { - assert( p_mesh_ == &_m ); - p_mesh_=NULL; - return true; - } - -protected: - - /// Assemble here the rule sequence, by calling the constructor - /// of the wanted rules. - virtual void apply_rules(void) = 0; - -protected: - - /// Move vertices to new positions after the rules have been applied - /// to the mesh (called by subdivide()). - void commit( MeshType &_m) - { - typename MeshType::VertexIter v_it; - - for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it) - _m.set_point(*v_it, _m.data(*v_it).position()); - } - - -public: - - /// Abstract base class for coefficient functions - struct Coeff - { - virtual ~Coeff() { } - virtual double operator() (size_t _valence) = 0; - }; - - -protected: - - typedef typename MeshType::Scalar scalar_t; - typedef typename MeshType::VertexHandle VertexHandle; - typedef typename MeshType::FaceHandle FaceHandle; - typedef typename MeshType::EdgeHandle EdgeHandle; - typedef typename MeshType::HalfedgeHandle HalfedgeHandle; - - /// \name Uniform composite subdivision rules - //@{ - - - void Tvv3(); ///< Split Face, using Vertex information (1-3 split) - void Tvv4(); ///< Split Face, using Vertex information (1-4 split) - void Tfv(); ///< Split Face, using Face Information - - void FF(); ///< Face to face averaging. - void FFc(Coeff& _coeff); ///< Weighted face to face averaging. - void FFc(scalar_t _c); ///< Weighted face to face averaging. - - void FV(); ///< Face to vertex averaging. - void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps - void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps - - void FE(); ///< Face to edge averaging. - - void VF(); ///< Vertex to Face Averaging. - void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted. - void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted. - - void VV(); ///< Vertex to vertex averaging. - void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted. - void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted. - - void VE(); ///< VE Step (Vertex to Edge Averaging) - - - void VdE(); ///< Vertex to edge averaging, using diamond of edges. - void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges - - /// Weigthed vertex to edge averaging, using diamond of edges for - /// irregular vertices. - void VdEg(Coeff& _coeff); - /// Weigthed vertex to edge averaging, using diamond of edges for - /// irregular vertices. - void VdEg(scalar_t _gamma); - - void EF(); ///< Edge to face averaging. - - void EV(); ///< Edge to vertex averaging. - void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging. - void EVc(scalar_t _c); ///< Weighted edge to vertex averaging. - - void EdE(); ///< Edge to edge averaging w/ flap rule. - void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule. - - - //@} - - void corner_cutting(HalfedgeHandle _heh); - - VertexHandle split_edge(HalfedgeHandle _heh); - -private: - - MeshType* p_mesh_; - -}; - - -//============================================================================= -} // END_NS_UNIFORM -} // END_NS_SUBDIVIDER -} // END_NS_OPENMESH -//============================================================================= -#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC) -#define OPENMESH_SUBDIVIDER_TEMPLATES -#include "CompositeT.cc" -#endif -//============================================================================= -#endif // COMPOSITET_HH defined -//============================================================================= - + * ========================================================================= */ + +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ + +/** \file Uniform/Composite/CompositeT.hh + + */ + +//============================================================================= +// +// CLASS CompositeT +// +//============================================================================= + +#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH +#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH + + +//== INCLUDES ================================================================= + +#include +#include +// -------------------- +#include + +//== NAMESPACE ================================================================ + +namespace OpenMesh { // BEGIN_NS_OPENMESH +namespace Subdivider { // BEGIN_NS_DECIMATER +namespace Uniform { // BEGIN_NS_UNIFORM + + +//== CLASS DEFINITION ========================================================= + +/** This class provides the composite subdivision rules for the uniform case. + * + * To create a subdivider derive from this class and overload the functions + * name() and apply_rules(). In the latter one call the wanted rules. + * + * For details on the composite scheme refer to + * - P. Oswald, + * P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes", + * CAGD 20, 3, 2003, 135--164 + + * \note Not all rules are implemented! + * \see class Adaptive::CompositeT + */ +template +class CompositeT : public SubdividerT< MeshType, RealType > +{ +public: + + typedef RealType real_t; + typedef MeshType mesh_t; + typedef SubdividerT< mesh_t, real_t > parent_t; + +public: + + CompositeT(void) : parent_t(), p_mesh_(NULL) {} + explicit CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {}; + virtual ~CompositeT() { } + +public: // inherited interface + + virtual const char *name( void ) const = 0; + +protected: // inherited interface + + bool prepare( MeshType& _m ); + + bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true ) + { + assert( p_mesh_ == &_m ); + + while(_n--) + { + apply_rules(); + commit(_m); + } + + return true; + } + +#ifdef NDEBUG + bool cleanup( MeshType& ) +#else + bool cleanup( MeshType& _m ) +#endif + { + assert( p_mesh_ == &_m ); + p_mesh_=NULL; + return true; + } + +protected: + + /// Assemble here the rule sequence, by calling the constructor + /// of the wanted rules. + virtual void apply_rules(void) = 0; + +protected: + + /// Move vertices to new positions after the rules have been applied + /// to the mesh (called by subdivide()). + void commit( MeshType &_m) + { + typename MeshType::VertexIter v_it; + + for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it) + _m.set_point(*v_it, _m.data(*v_it).position()); + } + + +public: + + /// Abstract base class for coefficient functions + struct Coeff + { + virtual ~Coeff() { } + virtual double operator() (size_t _valence) = 0; + }; + + +protected: + + typedef typename MeshType::Scalar scalar_t; + typedef typename MeshType::VertexHandle VertexHandle; + typedef typename MeshType::FaceHandle FaceHandle; + typedef typename MeshType::EdgeHandle EdgeHandle; + typedef typename MeshType::HalfedgeHandle HalfedgeHandle; + + /// \name Uniform composite subdivision rules + //@{ + + + void Tvv3(); ///< Split Face, using Vertex information (1-3 split) + void Tvv4(); ///< Split Face, using Vertex information (1-4 split) + void Tfv(); ///< Split Face, using Face Information + + void FF(); ///< Face to face averaging. + void FFc(Coeff& _coeff); ///< Weighted face to face averaging. + void FFc(scalar_t _c); ///< Weighted face to face averaging. + + void FV(); ///< Face to vertex averaging. + void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps + void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps + + void FE(); ///< Face to edge averaging. + + void VF(); ///< Vertex to Face Averaging. + void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted. + void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted. + + void VV(); ///< Vertex to vertex averaging. + void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted. + void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted. + + void VE(); ///< VE Step (Vertex to Edge Averaging) + + + void VdE(); ///< Vertex to edge averaging, using diamond of edges. + void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges + + /// Weigthed vertex to edge averaging, using diamond of edges for + /// irregular vertices. + void VdEg(Coeff& _coeff); + /// Weigthed vertex to edge averaging, using diamond of edges for + /// irregular vertices. + void VdEg(scalar_t _gamma); + + void EF(); ///< Edge to face averaging. + + void EV(); ///< Edge to vertex averaging. + void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging. + void EVc(scalar_t _c); ///< Weighted edge to vertex averaging. + + void EdE(); ///< Edge to edge averaging w/ flap rule. + void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule. + + + //@} + + void corner_cutting(HalfedgeHandle _heh); + + VertexHandle split_edge(HalfedgeHandle _heh); + +private: + + MeshType* p_mesh_; + +}; + + +//============================================================================= +} // END_NS_UNIFORM +} // END_NS_SUBDIVIDER +} // END_NS_OPENMESH +//============================================================================= +#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC) +#define OPENMESH_SUBDIVIDER_TEMPLATES +#include "CompositeT.cc" +#endif +//============================================================================= +#endif // COMPOSITET_HH defined +//============================================================================= + diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh index ad6d038d..08b2c0b4 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh @@ -107,7 +107,7 @@ public: /// Constructor to be used with interface 1 (calls attach()) /// \see operator()( MeshType&, size_t ) - SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); } + explicit SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); } //@} diff --git a/src/OpenMesh/Tools/Utils/Gnuplot.hh b/src/OpenMesh/Tools/Utils/Gnuplot.hh index 94b4a2ac..faf2e50c 100644 --- a/src/OpenMesh/Tools/Utils/Gnuplot.hh +++ b/src/OpenMesh/Tools/Utils/Gnuplot.hh @@ -74,7 +74,7 @@ using namespace std; class GnuplotException : public runtime_error { public: - GnuplotException(const string &msg) : runtime_error(msg){} + explicit GnuplotException(const string &msg) : runtime_error(msg){} }; // ---------------------------------------------------------------------------- @@ -113,7 +113,7 @@ public: Gnuplot(); /// Set a style during construction. - Gnuplot(const string & _style); + explicit Gnuplot(const string & _style); /// Constructor calling plot_xy(). Gnuplot(const string & _title, diff --git a/src/OpenMesh/Tools/Utils/MeshCheckerT.hh b/src/OpenMesh/Tools/Utils/MeshCheckerT.hh index 9db382d2..2357ab26 100644 --- a/src/OpenMesh/Tools/Utils/MeshCheckerT.hh +++ b/src/OpenMesh/Tools/Utils/MeshCheckerT.hh @@ -80,7 +80,7 @@ class MeshCheckerT public: /// constructor - MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {} + explicit MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {} /// destructor ~MeshCheckerT() {} diff --git a/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh b/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh index edfa0724..5b17d8ec 100644 --- a/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh +++ b/src/OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh @@ -37,97 +37,97 @@ * 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 newClass -// -//============================================================================= - -#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH -#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH - -//== INCLUDES ================================================================= - -#include -#include - -//== FORWARDDECLARATIONS ====================================================== - - -//== NAMESPACES =============================================================== - -namespace OpenMesh { -namespace VDPM { - -//== CLASS DEFINITION ========================================================= - - -/** Index of vertex hierarchy node - */ - - -class VHierarchyNodeIndex -{ -private: - unsigned int value_; - -public: - - static const VHierarchyNodeIndex InvalidIndex; - -public: - - VHierarchyNodeIndex() - { value_ = 0; } - - VHierarchyNodeIndex(unsigned int _value) - { value_ = _value; } - - VHierarchyNodeIndex(const VHierarchyNodeIndex &_other) - { value_ = _other.value_; } - - VHierarchyNodeIndex(unsigned int _tree_id, - unsigned int _node_id, - unsigned short _tree_id_bits) - { - assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits)); - assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits))); - value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id; - } - - bool is_valid(unsigned short _tree_id_bits) const - { return node_id(_tree_id_bits) != 0 ? true : false; } - - unsigned int tree_id(unsigned short _tree_id_bits) const - { return value_ >> (32 - _tree_id_bits); } - - unsigned int node_id(unsigned short _tree_id_bits) const - { return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); } - - bool operator< (const VHierarchyNodeIndex &other) const - { return (value_ < other.value_) ? true : false; } - - unsigned int value() const - { return value_; } -}; - - -/// Container for vertex hierarchy node indices -typedef std::vector VHierarchyNodeIndexContainer; - - -//============================================================================= -} // namespace VDPM -} // namespace OpenMesh -//============================================================================= -#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined -//============================================================================= + * ========================================================================= */ + +/*===========================================================================*\ + * * + * $Revision$ * + * $Date$ * + * * +\*===========================================================================*/ + +//============================================================================= +// +// CLASS newClass +// +//============================================================================= + +#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH +#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH + +//== INCLUDES ================================================================= + +#include +#include + +//== FORWARDDECLARATIONS ====================================================== + + +//== NAMESPACES =============================================================== + +namespace OpenMesh { +namespace VDPM { + +//== CLASS DEFINITION ========================================================= + + +/** Index of vertex hierarchy node + */ + + +class VHierarchyNodeIndex +{ +private: + unsigned int value_; + +public: + + static const VHierarchyNodeIndex InvalidIndex; + +public: + + VHierarchyNodeIndex() + { value_ = 0; } + + explicit VHierarchyNodeIndex(unsigned int _value) + { value_ = _value; } + + VHierarchyNodeIndex(const VHierarchyNodeIndex &_other) + { value_ = _other.value_; } + + VHierarchyNodeIndex(unsigned int _tree_id, + unsigned int _node_id, + unsigned short _tree_id_bits) + { + assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits)); + assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits))); + value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id; + } + + bool is_valid(unsigned short _tree_id_bits) const + { return node_id(_tree_id_bits) != 0 ? true : false; } + + unsigned int tree_id(unsigned short _tree_id_bits) const + { return value_ >> (32 - _tree_id_bits); } + + unsigned int node_id(unsigned short _tree_id_bits) const + { return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); } + + bool operator< (const VHierarchyNodeIndex &other) const + { return (value_ < other.value_) ? true : false; } + + unsigned int value() const + { return value_; } +}; + + +/// Container for vertex hierarchy node indices +typedef std::vector VHierarchyNodeIndexContainer; + + +//============================================================================= +} // namespace VDPM +} // namespace OpenMesh +//============================================================================= +#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined +//============================================================================= From 9fbf5033b20957e43df3b24976c497402e34d4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 09:53:10 +0100 Subject: [PATCH 06/10] Allow some errors in cppcheck --- CI/ci-cppcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh index 1f713ed7..3990d209 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -38,7 +38,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -if [ $COUNT -gt 0 ]; then +if [ $COUNT -gt 8 ]; then echo -e ${WARNING} echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed"; echo -e "${NC}" From bc70351587e52b0759594bec76f3ea88e7bca028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 09:54:02 +0100 Subject: [PATCH 07/10] Allow some errors in cppcheck --- CI/ci-cppcheck.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh index 3990d209..a0df41be 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -38,9 +38,11 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -if [ $COUNT -gt 8 ]; then +MAX_COUNT=8 + +if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING} - echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed"; + echo "Total CPPCHECK error Count is $COUNT, which is too High (max is $MAX_COUNT)! CPPCHECK Run failed"; echo -e "${NC}" exit 1; else From e956bace15ba8d0d94a07895ef1bf91a08f997e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 13:12:04 +0100 Subject: [PATCH 08/10] Silence warnings for timer implementation --- src/OpenMesh/Tools/Utils/Timer.cc | 5 +++-- src/OpenMesh/Tools/Utils/Timer.hh | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OpenMesh/Tools/Utils/Timer.cc b/src/OpenMesh/Tools/Utils/Timer.cc index 3a82f4c1..98d6e409 100644 --- a/src/OpenMesh/Tools/Utils/Timer.cc +++ b/src/OpenMesh/Tools/Utils/Timer.cc @@ -261,7 +261,8 @@ void TimerImplStd::stop(void) // ----------------------------------------------------------------- Timer ---- -Timer::Timer(void) +Timer::Timer(void) : + state_(Stopped) { #if defined(WIN32) && (defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__MINGW32__)) impl_ = new TimerImplWin32; @@ -280,7 +281,7 @@ Timer::Timer(void) #else impl_ = new TimerImplStd; #endif - state_ = Stopped; + } Timer::~Timer(void) diff --git a/src/OpenMesh/Tools/Utils/Timer.hh b/src/OpenMesh/Tools/Utils/Timer.hh index 15c736a6..91347c21 100644 --- a/src/OpenMesh/Tools/Utils/Timer.hh +++ b/src/OpenMesh/Tools/Utils/Timer.hh @@ -102,6 +102,9 @@ public: }; Timer(void); + + Timer(const Timer& _other) = delete; + ~Timer(void); /// Returns true if self is in a valid state! From 91887738ac47dce6422a53435a2c3963da2b0cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 13:12:41 +0100 Subject: [PATCH 09/10] Reduse allowed cppcheck error count --- CI/ci-cppcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh index a0df41be..43bc9824 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -38,7 +38,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -MAX_COUNT=8 +MAX_COUNT=6 if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING} From 9ba365743e3e23403aae2966989ef51733d34a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 6 Feb 2017 13:19:22 +0100 Subject: [PATCH 10/10] Updated changelog --- Doc/changelog.docu | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index b98d28c7..a798ae16 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -8,6 +8,11 @@ 7.0 (?/?/?) +Breaking changes +
    +
  • The minimal standard for C++ has been raised to C++11. Compilers not supporting C++11 or higher are no longer supported
  • +
+ Core
  • Implemented a cast from polyMesh to Mesh and vice versa using static_cast(polymeshInstance) or static_cast(trimeshInstance)
  • @@ -43,6 +48,11 @@
  • Added unittest to write and read faceTexcoords with a test obj file
+Python +
    +
  • fix the stripping of the python libs version string
  • +
+ General
  • Updated Logo