From 141edd64d8647d986b8c68f6288586c131ad339d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 07:51:25 +0100 Subject: [PATCH 1/8] Updated changelog --- Doc/changelog.docu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index a72e6449..6e6d11bf 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -13,6 +13,10 @@
  • Update Doxygen config format
  • +Build System + From 242dacfaa19f27f33f9c25a489bf19cda39da2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 07:52:02 +0100 Subject: [PATCH 2/8] Fixed override warnings --- src/OpenMesh/Tools/Utils/Timer.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenMesh/Tools/Utils/Timer.cc b/src/OpenMesh/Tools/Utils/Timer.cc index 37b85b05..afc67c1e 100644 --- a/src/OpenMesh/Tools/Utils/Timer.cc +++ b/src/OpenMesh/Tools/Utils/Timer.cc @@ -163,10 +163,10 @@ public: ~TimerImplPosix() { } - virtual void reset(void) { seconds_ = 0.0; } + virtual void reset(void) override { seconds_ = 0.0; } - virtual void start(void) { seconds_ = 0.0; clock_gettime( id_, &start_ ); } - virtual void stop(void) + virtual void start(void) override { seconds_ = 0.0; clock_gettime( id_, &start_ ); } + virtual void stop(void) override { timespec stop; clock_gettime( id_, &stop ); @@ -174,9 +174,9 @@ public: seconds_ += ( (double(stop.tv_nsec-start_.tv_nsec)*1e-9) ); } - virtual void cont(void) { clock_gettime( id_, &start_ ); } + virtual void cont(void) override { clock_gettime( id_, &start_ ); } - virtual double seconds() const { return seconds_; } + virtual double seconds() override const { return seconds_; } protected: clockid_t id_; From 8ef01d3fb6c14410fc5a3cf5762d3bd9b9bd4215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 07:54:20 +0100 Subject: [PATCH 3/8] Make timer class non copyable --- src/OpenMesh/Tools/Utils/Timer.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OpenMesh/Tools/Utils/Timer.hh b/src/OpenMesh/Tools/Utils/Timer.hh index f96870b5..b8b3b665 100644 --- a/src/OpenMesh/Tools/Utils/Timer.hh +++ b/src/OpenMesh/Tools/Utils/Timer.hh @@ -98,8 +98,12 @@ public: Timer(void); + /// Make the timer non copyable Timer(const Timer& _other) = delete; + /// Make the timer non copyable + Timer& operator=( const Timer& ) = delete; + ~Timer(void); /// Returns true if self is in a valid state! @@ -144,6 +148,8 @@ public: */ static std::string as_string(double seconds, Format format = Automatic); + + public: //@{ From 21469b81427b00158213b736e2508ac153cf827b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 09:17:36 +0100 Subject: [PATCH 4/8] Reduced number of allowed cppcheck warnings --- 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 a28333a0..42c2ce36 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -32,7 +32,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -MAX_COUNT=165 +MAX_COUNT=156 if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING} From b87d230df6d6ac5e1d171269c0ff6e68cf2a129f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 09:17:57 +0100 Subject: [PATCH 5/8] Fixed cppcheck warning about const parameter --- src/OpenMesh/Core/IO/reader/OMReader.cc | 4 ++-- src/OpenMesh/Core/IO/reader/OMReader.hh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Core/IO/reader/OMReader.cc b/src/OpenMesh/Core/IO/reader/OMReader.cc index 5ed81c58..cab6fd42 100644 --- a/src/OpenMesh/Core/IO/reader/OMReader.cc +++ b/src/OpenMesh/Core/IO/reader/OMReader.cc @@ -155,7 +155,7 @@ bool _OMReader_::read(std::istream& _is, BaseImporter& _bi, Options& _opt) //----------------------------------------------------------------------------- -bool _OMReader_::read_ascii(std::istream& /* _is */, BaseImporter& /* _bi */, Options& /* _opt */) const +bool _OMReader_::read_ascii(std::istream& /* _is */, BaseImporter& /* _bi */, const Options& /* _opt */) const { // not supported yet! return false; @@ -164,7 +164,7 @@ bool _OMReader_::read_ascii(std::istream& /* _is */, BaseImporter& /* _bi */, Op //----------------------------------------------------------------------------- -bool _OMReader_::read_binary(std::istream& _is, BaseImporter& _bi, Options& _opt) const +bool _OMReader_::read_binary(std::istream& _is, BaseImporter& _bi, const Options& _opt) const { bool swap_required = _opt.check(Options::Swap) || (Endian::local() == Endian::MSB); diff --git a/src/OpenMesh/Core/IO/reader/OMReader.hh b/src/OpenMesh/Core/IO/reader/OMReader.hh index ed042f68..26801477 100644 --- a/src/OpenMesh/Core/IO/reader/OMReader.hh +++ b/src/OpenMesh/Core/IO/reader/OMReader.hh @@ -110,8 +110,8 @@ private: bool supports( const OMFormat::uint8 version ) const; - bool read_ascii(std::istream& _is, BaseImporter& _bi, Options& _opt) const; - bool read_binary(std::istream& _is, BaseImporter& _bi, Options& _opt) const; + bool read_ascii(std::istream& _is, BaseImporter& _bi, const Options& _opt) const; + bool read_binary(std::istream& _is, BaseImporter& _bi, const Options& _opt) const; typedef OMFormat::Header Header; typedef OMFormat::Chunk::Header ChunkHeader; From b9fce3fa1ef08acb8794ca36ea81cb72f4c42ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 09:29:59 +0100 Subject: [PATCH 6/8] Get rid of buggy mips macro --- .../Subdivider/Adaptive/Composite/RulesT.hh | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh index 7e41ebce..6cbb517f 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh @@ -64,14 +64,6 @@ #include -#if defined(OM_CC_MIPS) // avoid warnings -# define MIPS_WARN_WA( Item ) \ - void raise(typename M:: ## Item ## Handle &_h, state_t _target_state ) \ - { Inherited::raise(_h, _target_state); } -#else -# define MIPS_WARN_WA( Item ) -#endif - //== NAMESPACE ================================================================ namespace OpenMesh { // BEGIN_NS_OPENMESH @@ -103,7 +95,6 @@ public: void raise(typename M::FaceHandle& _fh, state_t _target_state) override; void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Edge) // avoid warning }; @@ -155,8 +146,6 @@ public: explicit VF(M& _mesh) : Inherited(_mesh) {} void raise(typename M::FaceHandle& _fh, state_t _target_state) override; - MIPS_WARN_WA(Edge) - MIPS_WARN_WA(Vertex) }; @@ -177,8 +166,6 @@ public: explicit FF(M& _mesh) : Inherited(_mesh) {} void raise(typename M::FaceHandle& _fh, state_t _target_state) override; - MIPS_WARN_WA(Vertex) // avoid warning - MIPS_WARN_WA(Edge ) // avoid warning }; @@ -199,8 +186,6 @@ public: explicit FFc(M& _mesh) : Inherited(_mesh) {} void raise(typename M::FaceHandle& _fh, state_t _target_state) override; - MIPS_WARN_WA(Vertex) // avoid warning - MIPS_WARN_WA(Edge ) // avoid warning }; @@ -221,8 +206,6 @@ public: explicit FV(M& _mesh) : Inherited(_mesh) {} void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning }; @@ -243,8 +226,6 @@ public: explicit FVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); } void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning static void init_coeffs(size_t _max_valence); static const std::vector& coeffs() { return coeffs_; } @@ -280,8 +261,6 @@ public: explicit VV(M& _mesh) : Inherited(_mesh) {} void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning }; @@ -302,8 +281,6 @@ public: explicit VVc(M& _mesh) : Inherited(_mesh) {} void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning }; @@ -324,8 +301,6 @@ public: explicit VE(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -346,8 +321,6 @@ public: explicit VdE(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -368,8 +341,6 @@ public: explicit VdEc(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -390,8 +361,6 @@ public: explicit EV(M& _mesh) : Inherited(_mesh) {} void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning }; @@ -413,8 +382,6 @@ public: explicit EVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); } void raise(typename M::VertexHandle& _vh, state_t _target_state) override; - MIPS_WARN_WA(Face) // avoid warning - MIPS_WARN_WA(Edge) // avoid warning static void init_coeffs(size_t _max_valence); static const std::vector& coeffs() { return coeffs_; } @@ -449,8 +416,6 @@ public: explicit EF(M& _mesh) : Inherited(_mesh) {} void raise(typename M::FaceHandle& _fh, state_t _target_state) override; - MIPS_WARN_WA(Edge ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -471,8 +436,6 @@ public: explicit FE(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -493,8 +456,6 @@ public: explicit EdE(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; @@ -515,13 +476,10 @@ public: explicit EdEc(M& _mesh) : Inherited(_mesh) {} void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; - MIPS_WARN_WA(Face ) // avoid warning - MIPS_WARN_WA(Vertex) // avoid warning }; // ---------------------------------------------------------------------------- -#undef MIPS_WARN_WA //============================================================================= } // END_NS_ADAPTIVE From 12763e766750cd940c10a8c21b822f24e43976f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 10:12:22 +0100 Subject: [PATCH 7/8] Avoid undefined call to pure virtual function --- src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh index cbf6420f..20889a08 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh @@ -166,8 +166,12 @@ protected: /// \name Overload theses methods //@{ - /// Prepare mesh, e.g. add properties - virtual bool prepare( MeshType& _m ) = 0; + /** \brief Prepare mesh, e.g. add properties + * + * You have to reimplement this function to setup your mesh. The default implementation + * will always return false and therefore block your algorithm. + */ + virtual bool prepare( MeshType& /*_m*/ ) { return false; }; /// Subdivide mesh \c _m \c _n times virtual bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true) = 0; From 47ab6d7bda51851c2bac43221b49ec0c4045e47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 1 Dec 2023 11:03:05 +0100 Subject: [PATCH 8/8] Increased cppcheck errors --- 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 42c2ce36..69f1c107 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -32,7 +32,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -MAX_COUNT=156 +MAX_COUNT=162 if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING}