diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh index 520ed1be..914376c2 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -30,7 +30,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -MAX_COUNT=27 +MAX_COUNT=26 if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING} diff --git a/cmake/ACGCompiler.cmake b/cmake/ACGCompiler.cmake index f5260c9b..464d4f49 100644 --- a/cmake/ACGCompiler.cmake +++ b/cmake/ACGCompiler.cmake @@ -62,7 +62,7 @@ if (UNIX) # add our standard flags for Template inclusion list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" ) list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" ) - + ################################################################################ # OS Defines ################################################################################ @@ -108,9 +108,10 @@ if (UNIX) list(APPEND ADDITIONAL_C_FLAGS ${COMPILER_WARNINGS} ) - if ("${CMAKE_CXX_COMPILER}" MATCHES ".*clang.*") + if ("${CMAKE_CXX_COMPILER}" MATCHES "Clang") list(APPEND ADDITIONAL_CXX_FLAGS "-Weverything") list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat") + list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat-pedantic") list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-padded") list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-old-style-cast") list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-documentation-unknown-command") @@ -120,7 +121,7 @@ if (UNIX) list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-deprecated") list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-weak-vtables") endif() - + ################################################################################ # STL Vector checks ################################################################################ diff --git a/src/OpenMesh/Apps/Decimating/CmdOption.hh b/src/OpenMesh/Apps/Decimating/CmdOption.hh index 978d32df..0861087d 100644 --- a/src/OpenMesh/Apps/Decimating/CmdOption.hh +++ b/src/OpenMesh/Apps/Decimating/CmdOption.hh @@ -74,7 +74,7 @@ public: operator T () const { return val_; } // operator const T& () const { return val_; } - operator T* () const { return is_valid() ? &val_ : NULL; } + operator T* () const { return is_valid() ? &val_ : nullptr; } private: diff --git a/src/OpenMesh/Apps/Decimating/decimaterviewer.cc b/src/OpenMesh/Apps/Decimating/decimaterviewer.cc index 042f97c6..5edaf767 100644 --- a/src/OpenMesh/Apps/Decimating/decimaterviewer.cc +++ b/src/OpenMesh/Apps/Decimating/decimaterviewer.cc @@ -68,7 +68,7 @@ int main(int argc, char **argv) if ( !QGLFormat::hasOpenGL() ) { QString msg = "System has no OpenGL support!"; - QMessageBox::critical( NULL, "OpenGL", msg + argv[1] ); + QMessageBox::critical( nullptr, "OpenGL", msg + argv[1] ); return -1; } @@ -103,7 +103,7 @@ int main(int argc, char **argv) QString msg = "Cannot read mesh from file:\n '"; msg += argv[optind]; msg += "'"; - QMessageBox::critical( NULL, w.windowTitle(), msg ); + QMessageBox::critical( nullptr, w.windowTitle(), msg ); return 1; } } @@ -118,7 +118,7 @@ int main(int argc, char **argv) msg += "- Mesh file didn't provide texture coordinates\n"; msg += "- Texture file does not exist\n"; msg += "- Texture file is not accessible.\n"; - QMessageBox::warning( NULL, w.windowTitle(), msg ); + QMessageBox::warning( nullptr, w.windowTitle(), msg ); } } diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc index d85b9426..7385e596 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidget.cc @@ -63,7 +63,7 @@ MeshViewerWidget::MeshViewerWidget(QWidget* parent) : MeshViewerWidgetT QString msg = "Cannot read mesh from file:\n '"; msg += fname; msg += "'"; - QMessageBox::critical( NULL, windowTitle(), msg); + QMessageBox::critical( nullptr, windowTitle(), msg); } t.stop(); std::cout << "Loaded mesh in ~" << t.as_string() << std::endl; @@ -80,7 +80,7 @@ void MeshViewerWidget::open_texture_gui(QString fname) msg += "- Mesh file didn't provide texture coordinates\n"; msg += "- Texture file does not exist\n"; msg += "- Texture file is not accessible.\n"; - QMessageBox::warning( NULL, windowTitle(), msg ); + QMessageBox::warning( nullptr, windowTitle(), msg ); } } diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT_impl.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT_impl.hh index dc10a9a7..9dda329b 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT_impl.hh +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT_impl.hh @@ -131,7 +131,6 @@ MeshViewerWidgetT::open_mesh(const char* _filename, IO::Options _opt) typename Mesh::ConstVertexIter vIt(mesh_.vertices_begin()); typename Mesh::ConstVertexIter vEnd(mesh_.vertices_end()); - typedef typename Mesh::Point Point; using OpenMesh::Vec3f; Vec3f bbMin, bbMax; diff --git a/src/OpenMesh/Apps/Subdivider/SubdivideWidget.cc b/src/OpenMesh/Apps/Subdivider/SubdivideWidget.cc index 40220942..7434a8b9 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdivideWidget.cc +++ b/src/OpenMesh/Apps/Subdivider/SubdivideWidget.cc @@ -87,7 +87,7 @@ using namespace OpenMesh::Subdivider; SubdivideWidget:: SubdivideWidget(QWidget* _parent, const char* _name) : QWidget(_parent), - timer_(NULL), animate_step_(0), max_animate_steps_(4), msecs_(0) + timer_(nullptr), animate_step_(0), max_animate_steps_(4), msecs_(0) { setWindowTitle( QString(_name) ); diff --git a/src/OpenMesh/Apps/Subdivider/qtsubdivider.cc b/src/OpenMesh/Apps/Subdivider/qtsubdivider.cc index fae98b26..665274dc 100644 --- a/src/OpenMesh/Apps/Subdivider/qtsubdivider.cc +++ b/src/OpenMesh/Apps/Subdivider/qtsubdivider.cc @@ -60,7 +60,7 @@ int main(int argc, char **argv) if ( !QGLFormat::hasOpenGL() ) { QString msg = "System has no OpenGL support!"; - QMessageBox::critical( NULL, "OpenGL", msg + argv[1], QMessageBox::Ok ); + QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], QMessageBox::Ok ); return -1; } @@ -77,7 +77,7 @@ int main(int argc, char **argv) if ( ! w->open_mesh(argv[1]) ) { QString msg = "Cannot read mesh from file "; - QMessageBox::critical( NULL, argv[1], msg + argv[1], QMessageBox::Ok ); + QMessageBox::critical( nullptr, argv[1], msg + argv[1], QMessageBox::Ok ); return -1; } } diff --git a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh index c323e0af..7c38018f 100644 --- a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh +++ b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh @@ -78,9 +78,9 @@ PRIVATE_NODE_TYPESYSTEM_SOURCE(_class_); \ SO_NODE_SOURCE_TEMPLATE \ unsigned int _class_::classinstances = 0; \ SO_NODE_SOURCE_TEMPLATE \ -const SoFieldData ** _class_::parentFieldData = NULL; \ +const SoFieldData ** _class_::parentFieldData = nullptr; \ SO_NODE_SOURCE_TEMPLATE \ -SoFieldData * _class_::fieldData = NULL; \ +SoFieldData * _class_::fieldData = nullptr; \ \ SO_NODE_SOURCE_TEMPLATE \ const SoFieldData ** \ diff --git a/src/OpenMesh/Apps/Unsupported/OsgViewer/meshviewer.cc b/src/OpenMesh/Apps/Unsupported/OsgViewer/meshviewer.cc index c35867b9..bd127bb1 100644 --- a/src/OpenMesh/Apps/Unsupported/OsgViewer/meshviewer.cc +++ b/src/OpenMesh/Apps/Unsupported/OsgViewer/meshviewer.cc @@ -78,7 +78,7 @@ int main(int argc, char **argv) if ( !QGLFormat::hasOpenGL() ) { QString msg = "System has no OpenGL support!"; - QMessageBox::critical( NULL, "OpenGL", msg + argv[1], 0 ); + QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], 0 ); return -1; } @@ -115,7 +115,7 @@ int main(int argc, char **argv) QString msg = "Cannot read mesh from file:\n '"; msg += argv[optind]; msg += "'"; - QMessageBox::critical( NULL, w->caption(), msg, 0 ); + QMessageBox::critical( nullptr, w->caption(), msg, 0 ); return 1; } } @@ -130,7 +130,7 @@ int main(int argc, char **argv) msg += "- Mesh file didn't provide texture coordinates\n"; msg += "- Texture file does not exist\n"; msg += "- Texture file is not accessible.\n"; - QMessageBox::warning( NULL, w->caption(), msg, 0 ); + QMessageBox::warning( nullptr, w->caption(), msg, 0 ); } } diff --git a/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc b/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc index e7520abb..c23e7174 100644 --- a/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc +++ b/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc @@ -325,7 +325,7 @@ void mouse(int button, int state, int x, int y) { g.mgr->mouseButtonRelease(button, x, y); // if ( g.mode & FLYMODE ) -// glutIdleFunc(NULL); +// glutIdleFunc(nullptr); } else { diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc index e4af2fdc..b7ad1171 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc @@ -64,7 +64,7 @@ set_vdpm(const char _vdpm_name[256]) } #endif vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name); - if (vdpm_ == NULL) + if (vdpm_ == nullptr) return false; vhierarchy_ = &vdpm_->vhierarchy(); diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc index cad28022..3fdc6011 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc @@ -72,7 +72,7 @@ get_vdpm(const char _vdpm_name[256]) } } - return NULL; + return nullptr; } void diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerSession.cc b/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerSession.cc index fa47a34a..dac0b24a 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerSession.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerSession.cc @@ -64,7 +64,7 @@ set_vdpm(const char _vdpm_name[256]) } #endif vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name); - if (vdpm_ == NULL) + if (vdpm_ == nullptr) return false; vhierarchy_ = &vdpm_->vhierarchy(); diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc index 84eb92eb..2d4e0532 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc @@ -71,7 +71,7 @@ get_vdpm(const char _vdpm_name[256]) } } - return NULL; + return nullptr; } void diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc index ae3e7077..77b7dae6 100644 --- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc +++ b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc @@ -114,7 +114,7 @@ public: // inherited n_roots_ = calc_bits_for_roots(n_vertices_); } - virtual float collapse_priority(const CollapseInfo& _ci) + virtual float collapse_priority(const CollapseInfo& _ci) override { level_t newlevel = std::max( BaseModQ::mesh().property( level_, _ci.v0 ), BaseModQ::mesh().property( level_, _ci.v1 ) )+1; @@ -135,7 +135,7 @@ public: // inherited } /// post-process halfedge collapse (accumulate quadrics) - void postprocess_collapse(const CollapseInfo& _ci) + void postprocess_collapse(const CollapseInfo& _ci) override { BaseModQ::postprocess_collapse( _ci ); diff --git a/src/OpenMesh/Core/IO/IOManager.cc b/src/OpenMesh/Core/IO/IOManager.cc index 454edb2a..8b3a4193 100644 --- a/src/OpenMesh/Core/IO/IOManager.cc +++ b/src/OpenMesh/Core/IO/IOManager.cc @@ -258,7 +258,7 @@ find_writer(const std::string& _format) if ((*it)->can_u_write(filename)) return *it; - return NULL; + return nullptr; } diff --git a/src/OpenMesh/Core/IO/OMFormat.cc b/src/OpenMesh/Core/IO/OMFormat.cc index 6511e3e2..97175088 100644 --- a/src/OpenMesh/Core/IO/OMFormat.cc +++ b/src/OpenMesh/Core/IO/OMFormat.cc @@ -135,7 +135,7 @@ namespace OMFormat { default: std::clog << "as_string(Chunk::Entity): Invalid value!"; } - return NULL; + return nullptr; } @@ -153,7 +153,7 @@ namespace OMFormat { case Chunk::Type_Custom: return "Custom"; case Chunk::Type_Topology: return "Topology"; } - return NULL; + return nullptr; } @@ -172,7 +172,7 @@ namespace OMFormat { case Chunk::Dim_7D: return "7D"; case Chunk::Dim_8D: return "8D"; } - return NULL; + return nullptr; } @@ -187,7 +187,7 @@ namespace OMFormat { case Chunk::Integer_32 : return "32"; case Chunk::Integer_64 : return "64"; } - return NULL; + return nullptr; } const char *as_string(Chunk::Float_Size d) @@ -198,7 +198,7 @@ namespace OMFormat { case Chunk::Float_64 : return "64"; case Chunk::Float_128: return "128"; } - return NULL; + return nullptr; } diff --git a/src/OpenMesh/Core/IO/exporter/BaseExporter.hh b/src/OpenMesh/Core/IO/exporter/BaseExporter.hh index 9903a851..86290720 100644 --- a/src/OpenMesh/Core/IO/exporter/BaseExporter.hh +++ b/src/OpenMesh/Core/IO/exporter/BaseExporter.hh @@ -144,7 +144,7 @@ public: virtual OpenMesh::Attributes::StatusInfo status(HalfedgeHandle _heh) const = 0; // get reference to base kernel - virtual const BaseKernel* kernel() { return 0; } + virtual const BaseKernel* kernel() { return nullptr; } // query number of faces, vertices, normals, texcoords diff --git a/src/OpenMesh/Core/IO/importer/BaseImporter.hh b/src/OpenMesh/Core/IO/importer/BaseImporter.hh index 3513e279..ff86dadd 100644 --- a/src/OpenMesh/Core/IO/importer/BaseImporter.hh +++ b/src/OpenMesh/Core/IO/importer/BaseImporter.hh @@ -196,7 +196,7 @@ public: virtual void add_texture_information( int _id , std::string _name ) = 0; // get reference to base kernel - virtual BaseKernel* kernel() { return 0; } + virtual BaseKernel* kernel() { return nullptr; } virtual bool is_triangle_mesh() const { return false; } diff --git a/src/OpenMesh/Core/IO/reader/BaseReader.hh b/src/OpenMesh/Core/IO/reader/BaseReader.hh index 6361bfd3..9f6c23bb 100644 --- a/src/OpenMesh/Core/IO/reader/BaseReader.hh +++ b/src/OpenMesh/Core/IO/reader/BaseReader.hh @@ -48,10 +48,7 @@ // //============================================================================= - -#ifndef __BASEREADER_HH__ -#define __BASEREADER_HH__ - +#pragma once //=== INCLUDES ================================================================ @@ -91,7 +88,7 @@ class OPENMESHDLLEXPORT BaseReader public: /// Destructor - virtual ~BaseReader() {}; + virtual ~BaseReader() {} /// Returns a brief description of the file type that can be parsed. virtual std::string get_description() const = 0; @@ -204,5 +201,3 @@ static inline std::string &trim(std::string &_string) { } // namespace IO } // namespace OpenMesh //============================================================================= -#endif -//============================================================================= diff --git a/src/OpenMesh/Core/IO/reader/OFFReader.hh b/src/OpenMesh/Core/IO/reader/OFFReader.hh index 25717b6f..2efe6e4a 100644 --- a/src/OpenMesh/Core/IO/reader/OFFReader.hh +++ b/src/OpenMesh/Core/IO/reader/OFFReader.hh @@ -48,10 +48,7 @@ // //============================================================================= - -#ifndef __OFFREADER_HH__ -#define __OFFREADER_HH__ - +#pragma once //=== INCLUDES ================================================================ @@ -162,5 +159,3 @@ OPENMESHDLLEXPORT _OFFReader_& OFFReader(); } // namespace IO } // namespace OpenMesh //============================================================================= -#endif -//============================================================================= diff --git a/src/OpenMesh/Core/Mesh/BaseKernel.cc b/src/OpenMesh/Core/Mesh/BaseKernel.cc index 1a375cec..1cdd9cf3 100644 --- a/src/OpenMesh/Core/Mesh/BaseKernel.cc +++ b/src/OpenMesh/Core/Mesh/BaseKernel.cc @@ -64,27 +64,27 @@ void BaseKernel::property_stats(std::ostream& _ostr) const _ostr << vprops_.size() << " vprops:\n"; for (it=vps.begin(); it!=vps.end(); ++it) { - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } _ostr << hprops_.size() << " hprops:\n"; for (it=hps.begin(); it!=hps.end(); ++it) { - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } _ostr << eprops_.size() << " eprops:\n"; for (it=eps.begin(); it!=eps.end(); ++it) { - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } _ostr << fprops_.size() << " fprops:\n"; for (it=fps.begin(); it!=fps.end(); ++it) { - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } _ostr << mprops_.size() << " mprops:\n"; for (it=mps.begin(); it!=mps.end(); ++it) { - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } } @@ -97,7 +97,7 @@ void BaseKernel::vprop_stats( std::string& _string ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& vps = vprops_.properties(); for (it=vps.begin(); it!=vps.end(); ++it) - if ( *it == NULL ) + if ( *it == nullptr ) _string += "[deleted] \n"; else { _string += (*it)->name(); @@ -113,7 +113,7 @@ void BaseKernel::hprop_stats( std::string& _string ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& hps = hprops_.properties(); for (it=hps.begin(); it!=hps.end(); ++it) - if ( *it == NULL ) + if ( *it == nullptr ) _string += "[deleted] \n"; else { _string += (*it)->name(); @@ -129,7 +129,7 @@ void BaseKernel::eprop_stats( std::string& _string ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& eps = eprops_.properties(); for (it=eps.begin(); it!=eps.end(); ++it) - if ( *it == NULL ) + if ( *it == nullptr ) _string += "[deleted] \n"; else { _string += (*it)->name(); @@ -144,7 +144,7 @@ void BaseKernel::fprop_stats( std::string& _string ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& fps = fprops_.properties(); for (it=fps.begin(); it!=fps.end(); ++it) - if ( *it == NULL ) + if ( *it == nullptr ) _string += "[deleted] \n"; else { _string += (*it)->name(); @@ -160,7 +160,7 @@ void BaseKernel::mprop_stats( std::string& _string ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& mps = mprops_.properties(); for (it=mps.begin(); it!=mps.end(); ++it) - if ( *it == NULL ) + if ( *it == nullptr ) _string += "[deleted] \n"; else { _string += (*it)->name(); @@ -178,7 +178,7 @@ void BaseKernel::vprop_stats(std::ostream& _ostr ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& vps = vprops_.properties(); for (it=vps.begin(); it!=vps.end(); ++it) - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } void BaseKernel::hprop_stats() const @@ -190,7 +190,7 @@ void BaseKernel::hprop_stats(std::ostream& _ostr ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& hps = hprops_.properties(); for (it=hps.begin(); it!=hps.end(); ++it) - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } void BaseKernel::eprop_stats() const @@ -202,7 +202,7 @@ void BaseKernel::eprop_stats(std::ostream& _ostr ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& eps = eprops_.properties(); for (it=eps.begin(); it!=eps.end(); ++it) - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } void BaseKernel::fprop_stats() const @@ -214,7 +214,7 @@ void BaseKernel::fprop_stats(std::ostream& _ostr ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& fps = fprops_.properties(); for (it=fps.begin(); it!=fps.end(); ++it) - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } void BaseKernel::mprop_stats() const @@ -226,7 +226,7 @@ void BaseKernel::mprop_stats(std::ostream& _ostr ) const PropertyContainer::Properties::const_iterator it; const PropertyContainer::Properties& mps = mprops_.properties(); for (it=mps.begin(); it!=mps.end(); ++it) - *it == NULL ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); + *it == nullptr ? (void)(_ostr << "[deleted]" << "\n") : (*it)->stats(_ostr); } diff --git a/src/OpenMesh/Core/System/mostream.hh b/src/OpenMesh/Core/System/mostream.hh index 5463750d..e774d7bc 100644 --- a/src/OpenMesh/Core/System/mostream.hh +++ b/src/OpenMesh/Core/System/mostream.hh @@ -285,7 +285,7 @@ class mostream : public std::ostream public: /// Explicit constructor - explicit mostream() : std::ostream(NULL) { init(&streambuffer_); } + explicit mostream() : std::ostream(nullptr) { init(&streambuffer_); } /// Connect target to multiplexer diff --git a/src/OpenMesh/Core/Utils/AutoPropertyHandleT.hh b/src/OpenMesh/Core/Utils/AutoPropertyHandleT.hh index f9b157af..19afb46e 100644 --- a/src/OpenMesh/Core/Utils/AutoPropertyHandleT.hh +++ b/src/OpenMesh/Core/Utils/AutoPropertyHandleT.hh @@ -70,7 +70,7 @@ protected: public: AutoPropertyHandleT() - : m_(NULL), own_property_(false) + : m_(nullptr), own_property_(false) {} AutoPropertyHandleT(const Self& _other) diff --git a/src/OpenMesh/Core/Utils/Property.hh b/src/OpenMesh/Core/Utils/Property.hh index cda3f9bf..629225c6 100644 --- a/src/OpenMesh/Core/Utils/Property.hh +++ b/src/OpenMesh/Core/Utils/Property.hh @@ -363,7 +363,7 @@ public: } /// Make a copy of self. - PropertyT* clone() const + PropertyT* clone() const override { PropertyT* p = new PropertyT( *this ); return p; @@ -434,7 +434,7 @@ public: const value_type* data() const { if( data_.empty() ) - return 0; + return nullptr; return (value_type*) &data_[0]; } @@ -451,7 +451,7 @@ public: return ((value_type*) &data_[0])[_idx]; } - PropertyT* clone() const { + PropertyT* clone() const override { PropertyT* p = new PropertyT( *this ); return p; } diff --git a/src/OpenMesh/Core/Utils/PropertyContainer.hh b/src/OpenMesh/Core/Utils/PropertyContainer.hh index fd5a5fad..dcc9a3ac 100644 --- a/src/OpenMesh/Core/Utils/PropertyContainer.hh +++ b/src/OpenMesh/Core/Utils/PropertyContainer.hh @@ -102,8 +102,8 @@ public: { Properties::iterator p_it=properties_.begin(), p_end=properties_.end(); int idx=0; - for ( ; p_it!=p_end && *p_it!=NULL; ++p_it, ++idx ) {}; - if (p_it==p_end) properties_.push_back(NULL); + for ( ; p_it!=p_end && *p_it!=nullptr; ++p_it, ++idx ) {}; + if (p_it==p_end) properties_.push_back(nullptr); properties_[idx] = new PropertyT(_name); return BasePropHandleT(idx); } @@ -115,11 +115,11 @@ public: Properties::const_iterator p_it = properties_.begin(); for (int idx=0; p_it != properties_.end(); ++p_it, ++idx) { - if (*p_it != NULL && + if (*p_it != nullptr && (*p_it)->name() == _name //skip deleted properties // Skip type check #ifndef OM_FORCE_STATIC_CAST - && dynamic_cast*>(properties_[idx]) != NULL //check type + && dynamic_cast*>(properties_[idx]) != nullptr //check type #endif ) { @@ -134,23 +134,23 @@ public: Properties::const_iterator p_it = properties_.begin(); for (int idx=0; p_it != properties_.end(); ++p_it, ++idx) { - if (*p_it != NULL && (*p_it)->name() == _name) //skip deleted properties + if (*p_it != nullptr && (*p_it)->name() == _name) //skip deleted properties { return *p_it; } } - return NULL; + return nullptr; } template PropertyT& property(BasePropHandleT _h) { assert(_h.idx() >= 0 && _h.idx() < (int)properties_.size()); - assert(properties_[_h.idx()] != NULL); + assert(properties_[_h.idx()] != nullptr); #ifdef OM_FORCE_STATIC_CAST return *static_cast *> (properties_[_h.idx()]); #else PropertyT* p = dynamic_cast*>(properties_[_h.idx()]); - assert(p != NULL); + assert(p != nullptr); return *p; #endif } @@ -159,12 +159,12 @@ public: template const PropertyT& property(BasePropHandleT _h) const { assert(_h.idx() >= 0 && _h.idx() < (int)properties_.size()); - assert(properties_[_h.idx()] != NULL); + assert(properties_[_h.idx()] != nullptr); #ifdef OM_FORCE_STATIC_CAST return *static_cast*>(properties_[_h.idx()]); #else PropertyT* p = dynamic_cast*>(properties_[_h.idx()]); - assert(p != NULL); + assert(p != nullptr); return *p; #endif } @@ -174,7 +174,7 @@ public: { assert(_h.idx() >= 0 && _h.idx() < (int)properties_.size()); delete properties_[_h.idx()]; - properties_[_h.idx()] = NULL; + properties_[_h.idx()] = nullptr; } @@ -281,8 +281,8 @@ protected: // generic add/get { Properties::iterator p_it=properties_.begin(), p_end=properties_.end(); size_t idx=0; - for (; p_it!=p_end && *p_it!=NULL; ++p_it, ++idx) {}; - if (p_it==p_end) properties_.push_back(NULL); + for (; p_it!=p_end && *p_it!=nullptr; ++p_it, ++idx) {}; + if (p_it==p_end) properties_.push_back(nullptr); properties_[idx] = _bp; return idx; } @@ -290,18 +290,18 @@ protected: // generic add/get BaseProperty& _property( size_t _idx ) { assert( _idx < properties_.size()); - assert( properties_[_idx] != NULL); + assert( properties_[_idx] != nullptr); BaseProperty *p = properties_[_idx]; - assert( p != NULL ); + assert( p != nullptr ); return *p; } const BaseProperty& _property( size_t _idx ) const { assert( _idx < properties_.size()); - assert( properties_[_idx] != NULL); + assert( properties_[_idx] != nullptr); BaseProperty *p = properties_[_idx]; - assert( p != NULL ); + assert( p != nullptr ); return *p; } diff --git a/src/OpenMesh/Core/Utils/SingletonT.hh b/src/OpenMesh/Core/Utils/SingletonT.hh index 2945debb..438cd655 100644 --- a/src/OpenMesh/Core/Utils/SingletonT.hh +++ b/src/OpenMesh/Core/Utils/SingletonT.hh @@ -48,10 +48,7 @@ // //============================================================================= - -#ifndef __SINGLETON_HH__ -#define __SINGLETON_HH__ - +#pragma once //=== INCLUDES ================================================================ @@ -145,5 +142,3 @@ private: # include "SingletonT_impl.hh" #endif //============================================================================= -#endif // __SINGLETON_HH__ -//============================================================================= diff --git a/src/OpenMesh/Tools/Decimater/BaseDecimaterT_impl.hh b/src/OpenMesh/Tools/Decimater/BaseDecimaterT_impl.hh index 780dfa34..68d57b09 100644 --- a/src/OpenMesh/Tools/Decimater/BaseDecimaterT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/BaseDecimaterT_impl.hh @@ -67,7 +67,7 @@ namespace Decimater { template BaseDecimaterT::BaseDecimaterT(Mesh& _mesh) : - mesh_(_mesh), cmodule_(NULL), initialized_(false), observer_(NULL) { + mesh_(_mesh), cmodule_(nullptr), initialized_(false), observer_(nullptr) { // default properties mesh_.request_vertex_status(); mesh_.request_edge_status(); @@ -249,8 +249,8 @@ bool BaseDecimaterT::initialize() { // priority module explicitly. // find the priority module: either the only non-binary module in the list, or "Quadric" - Module *quadric = NULL; - Module *pmodule = NULL; + Module *quadric = nullptr; + Module *pmodule = nullptr; for (ModuleListIterator m_it = all_modules_.begin(), m_end = all_modules_.end(); m_it != m_end; ++m_it) { if ((*m_it)->name() == "Quadric") diff --git a/src/OpenMesh/Tools/Decimater/DecimaterT_impl.hh b/src/OpenMesh/Tools/Decimater/DecimaterT_impl.hh index 7f61a777..e7211a0c 100644 --- a/src/OpenMesh/Tools/Decimater/DecimaterT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/DecimaterT_impl.hh @@ -75,7 +75,7 @@ DecimaterT::DecimaterT(Mesh& _mesh) : #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) heap_(nullptr) #else - heap_(NULL) + heap_(nullptr) #endif { diff --git a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh index 4977fa6d..0213cbbb 100644 --- a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh +++ b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh @@ -111,16 +111,16 @@ class ModAspectRatioT: public ModBaseT { } /// precompute face aspect ratio - void initialize(); + void initialize() override; /// Returns the collapse priority - float collapse_priority(const CollapseInfo& _ci); + float collapse_priority(const CollapseInfo& _ci) override; /// update aspect ratio of one-ring - void preprocess_collapse(const CollapseInfo& _ci); + void preprocess_collapse(const CollapseInfo& _ci) override; /// set percentage of aspect ratio - void set_error_tolerance_factor(double _factor); + void set_error_tolerance_factor(double _factor) override; private: diff --git a/src/OpenMesh/Tools/Decimater/ModBaseT.hh b/src/OpenMesh/Tools/Decimater/ModBaseT.hh index d972cda6..f89e907e 100644 --- a/src/OpenMesh/Tools/Decimater/ModBaseT.hh +++ b/src/OpenMesh/Tools/Decimater/ModBaseT.hh @@ -90,14 +90,14 @@ public: public: /// Default constructor - ModHandleT() : mod_(NULL) {} + ModHandleT() : mod_(nullptr) {} /// Destructor ~ModHandleT() { /* don't delete mod_, since handle is not owner! */ } /// Check handle status /// \return \c true, if handle is valid, else \c false. - bool is_valid() const { return mod_ != NULL; } + bool is_valid() const { return mod_ != nullptr; } private: @@ -107,7 +107,7 @@ private: template friend class BaseDecimaterT; #endif - void clear() { mod_ = NULL; } + void clear() { mod_ = nullptr; } void init(Module* _m) { mod_ = _m; } Module* module() { return mod_; } @@ -128,7 +128,7 @@ private: /// Macro that sets up the name() function /// \internal #define DECIMATER_MODNAME(_mod_name) \ - virtual const std::string& name() const { \ + virtual const std::string& name() const override { \ static std::string _s_modname_(#_mod_name); return _s_modname_; \ } @@ -212,8 +212,8 @@ public: /// Virtual desctructor virtual ~ModBaseT() { } - /// Set module's name (using DECIMATER_MODNAME macro) - DECIMATER_MODNAME(ModBase); + /// Set module's name + virtual const std::string& name() const { static std::string _s_modname_("ModBase"); return _s_modname_; } /// Returns true if criteria returns a binary value. diff --git a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh index 4b7ec155..e8e75a39 100644 --- a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh +++ b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh @@ -98,10 +98,10 @@ class ModEdgeLengthT: public ModBaseT { Cont. mode: Collapse smallest edge first, but don't collapse edges longer as edge_length_ */ - float collapse_priority(const CollapseInfo& _ci); + float collapse_priority(const CollapseInfo& _ci) override; /// set the percentage of edge length - void set_error_tolerance_factor(double _factor); + void set_error_tolerance_factor(double _factor) override; private: diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh index 7d7d040b..74c76373 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh @@ -108,7 +108,7 @@ class ModHausdorffT: public ModBaseT { } /// reset per-face point lists - virtual void initialize(); + virtual void initialize() override; /** \brief compute Hausdorff error for one-ring * @@ -120,13 +120,13 @@ class ModHausdorffT: public ModBaseT { * @return Binary return, if collapse is legal or illegal */ - virtual float collapse_priority(const CollapseInfo& _ci); + virtual float collapse_priority(const CollapseInfo& _ci) override; /// re-distribute points - virtual void postprocess_collapse(const CollapseInfo& _ci); + virtual void postprocess_collapse(const CollapseInfo& _ci) override; /// set the percentage of tolerance - void set_error_tolerance_factor(double _factor); + void set_error_tolerance_factor(double _factor) override; private: diff --git a/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh b/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh index c7c4895c..7a416af7 100644 --- a/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh +++ b/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh @@ -77,7 +77,7 @@ class ModIndependentSetsT: public ModBaseT { } /// override - void postprocess_collapse(const CollapseInfo& _ci) { + void postprocess_collapse(const CollapseInfo& _ci) override { typename Mesh::VertexVertexIter vv_it; Base::mesh().status(_ci.v1).set_locked(true); diff --git a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh index 1c11a93c..9966d826 100644 --- a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh +++ b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh @@ -140,7 +140,7 @@ public: /// Allocate and init normal cones - void initialize() { + void initialize() override { if (!normal_cones_.is_valid()) mesh_.add_property(normal_cones_); @@ -165,7 +165,7 @@ public: * @param _ci Collapse info data * @return Half of the normal cones size (radius in radians) */ - float collapse_priority(const CollapseInfo& _ci) { + float collapse_priority(const CollapseInfo& _ci) override { // simulate collapse mesh_.set_point(_ci.v0, _ci.p1); @@ -203,7 +203,7 @@ public: } /// set the percentage of normal deviation - void set_error_tolerance_factor(double _factor) { + void set_error_tolerance_factor(double _factor) override { if (_factor >= 0.0 && _factor <= 1.0) { // the smaller the factor, the smaller normal_deviation_ gets // thus creating a stricter constraint @@ -216,7 +216,7 @@ public: } - void postprocess_collapse(const CollapseInfo& _ci) { + void postprocess_collapse(const CollapseInfo& _ci) override { // account for changed normals typename Mesh::VertexFaceIter vf_it(mesh_, _ci.v1); for (; vf_it.is_valid(); ++vf_it) diff --git a/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh b/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh index 9833e182..b2a00fd3 100644 --- a/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh +++ b/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh @@ -122,7 +122,7 @@ public: * * \see set_max_normal_deviation() */ - float collapse_priority(const CollapseInfo& _ci) + float collapse_priority(const CollapseInfo& _ci) override { // simulate collapse Base::mesh().set_point(_ci.v0, _ci.p1); @@ -154,7 +154,7 @@ public: } /// set the percentage of maximum normal deviation - void set_error_tolerance_factor(double _factor) { + void set_error_tolerance_factor(double _factor) override { if (_factor >= 0.0 && _factor <= 1.0) { // the smaller the factor, the smaller max_deviation_ gets // thus creating a stricter constraint diff --git a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh index 43c02982..dbedc07c 100644 --- a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh +++ b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh @@ -130,7 +130,7 @@ public: // inherited /// Stores collapse information in a queue. /// \see infolist() - void postprocess_collapse(const CollapseInfo& _ci) + void postprocess_collapse(const CollapseInfo& _ci) override { pmi_.push_back( Info( _ci ) ); } diff --git a/src/OpenMesh/Tools/Decimater/ModQuadricT.hh b/src/OpenMesh/Tools/Decimater/ModQuadricT.hh index 444c1098..2f431bf4 100644 --- a/src/OpenMesh/Tools/Decimater/ModQuadricT.hh +++ b/src/OpenMesh/Tools/Decimater/ModQuadricT.hh @@ -110,7 +110,7 @@ public: // inherited * \see ModBaseT::collapse_priority() for return values * \see set_max_err() */ - virtual float collapse_priority(const CollapseInfo& _ci) + virtual float collapse_priority(const CollapseInfo& _ci) override { using namespace OpenMesh; @@ -131,7 +131,7 @@ public: // inherited /// Post-process halfedge collapse (accumulate quadrics) - virtual void postprocess_collapse(const CollapseInfo& _ci) + virtual void postprocess_collapse(const CollapseInfo& _ci) override { Base::mesh().property(quadrics_, _ci.v1) += Base::mesh().property(quadrics_, _ci.v0); diff --git a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh index 5b3c1485..afd5ade4 100644 --- a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh +++ b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh @@ -117,7 +117,7 @@ class ModRoundnessT : public ModBaseT * \return LEGAL_COLLAPSE or ILLEGAL_COLLAPSE in binary mode * \see set_min_roundness() */ - float collapse_priority(const CollapseInfo& _ci) + float collapse_priority(const CollapseInfo& _ci) override { // using namespace OpenMesh; @@ -174,7 +174,7 @@ class ModRoundnessT : public ModBaseT } /// set the percentage of minimum roundness - void set_error_tolerance_factor(double _factor) { + void set_error_tolerance_factor(double _factor) override { if (this->is_binary()) { if (_factor >= 0.0 && _factor <= 1.0) { // the smaller the factor, the smaller min_r_ gets diff --git a/src/OpenMesh/Tools/Kernel_OSG/PropertyT.hh b/src/OpenMesh/Tools/Kernel_OSG/PropertyT.hh index 47990e58..cd0680f9 100644 --- a/src/OpenMesh/Tools/Kernel_OSG/PropertyT.hh +++ b/src/OpenMesh/Tools/Kernel_OSG/PropertyT.hh @@ -108,7 +108,7 @@ public: // oPropertyT( const std::string& _name = "" ) - : BaseProperty(_name), data_(NULL) + : BaseProperty(_name), data_(nullptr) { data_ = property_t::create(); diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.hh b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.hh index 2d5d0c35..b9298263 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.hh @@ -148,7 +148,7 @@ public: /// Constructor explicit CompositeT(Mesh& _mesh) : subdiv_type_(0), - subdiv_rule_(NULL), /*first_rule_(NULL), last_rule_(NULL),*/ mesh_(_mesh) + subdiv_rule_(nullptr), /*first_rule_(nullptr), last_rule_(nullptr),*/ mesh_(_mesh) { } /// @@ -161,7 +161,7 @@ public: void cleanup(void) { subdiv_type_ = 0; - subdiv_rule_ = NULL; + subdiv_rule_ = nullptr; std::for_each(rule_sequence_.begin(), rule_sequence_.end(), DeleteRule() ); diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh index 576193de..2c2e7679 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.hh @@ -101,8 +101,8 @@ public: explicit Tvv3(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(3); }; - void raise(typename M::FaceHandle& _fh, state_t _target_state); - void raise(typename M::VertexHandle& _vh, state_t _target_state); + 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 }; @@ -126,9 +126,9 @@ public: explicit Tvv4(M& _mesh) : Inherited(_mesh) { Base::set_subdiv_type(4); }; - void raise(typename M::FaceHandle& _fh, state_t _target_state); - void raise(typename M::VertexHandle& _vh, state_t _target_state); - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::FaceHandle& _fh, state_t _target_state) override; + void raise(typename M::VertexHandle& _vh, state_t _target_state) override; + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; private: @@ -154,7 +154,7 @@ public: explicit VF(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::FaceHandle& _fh, state_t _target_state); + void raise(typename M::FaceHandle& _fh, state_t _target_state) override; MIPS_WARN_WA(Edge) MIPS_WARN_WA(Vertex) }; @@ -176,7 +176,7 @@ public: explicit FF(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::FaceHandle& _fh, state_t _target_state); + void raise(typename M::FaceHandle& _fh, state_t _target_state) override; MIPS_WARN_WA(Vertex) // avoid warning MIPS_WARN_WA(Edge ) // avoid warning }; @@ -198,7 +198,7 @@ public: explicit FFc(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::FaceHandle& _fh, state_t _target_state); + void raise(typename M::FaceHandle& _fh, state_t _target_state) override; MIPS_WARN_WA(Vertex) // avoid warning MIPS_WARN_WA(Edge ) // avoid warning }; @@ -220,7 +220,7 @@ public: explicit FV(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::VertexHandle& _vh, state_t _target_state); + void raise(typename M::VertexHandle& _vh, state_t _target_state) override; MIPS_WARN_WA(Face) // avoid warning MIPS_WARN_WA(Edge) // avoid warning }; @@ -279,7 +279,7 @@ public: explicit VV(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::VertexHandle& _vh, state_t _target_state); + void raise(typename M::VertexHandle& _vh, state_t _target_state) override; MIPS_WARN_WA(Face) // avoid warning MIPS_WARN_WA(Edge) // avoid warning }; @@ -301,7 +301,7 @@ public: explicit VVc(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::VertexHandle& _vh, state_t _target_state); + void raise(typename M::VertexHandle& _vh, state_t _target_state) override; MIPS_WARN_WA(Face) // avoid warning MIPS_WARN_WA(Edge) // avoid warning }; @@ -323,7 +323,7 @@ public: explicit VE(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -345,7 +345,7 @@ public: explicit VdE(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -367,7 +367,7 @@ public: explicit VdEc(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -389,7 +389,7 @@ public: explicit EV(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::VertexHandle& _vh, state_t _target_state); + void raise(typename M::VertexHandle& _vh, state_t _target_state) override; MIPS_WARN_WA(Face) // avoid warning MIPS_WARN_WA(Edge) // avoid warning }; @@ -448,7 +448,7 @@ public: explicit EF(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::FaceHandle& _fh, state_t _target_state); + void raise(typename M::FaceHandle& _fh, state_t _target_state) override; MIPS_WARN_WA(Edge ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -470,7 +470,7 @@ public: explicit FE(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -492,7 +492,7 @@ public: explicit EdE(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; @@ -514,7 +514,7 @@ public: explicit EdEc(M& _mesh) : Inherited(_mesh) {} - void raise(typename M::EdgeHandle& _eh, state_t _target_state); + void raise(typename M::EdgeHandle& _eh, state_t _target_state) override; MIPS_WARN_WA(Face ) // avoid warning MIPS_WARN_WA(Vertex) // avoid warning }; diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT_impl.hh b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT_impl.hh index a117618f..40978930 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT_impl.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT_impl.hh @@ -333,7 +333,6 @@ CatmullClarkT::update_vertex( MeshType& _m, const VertexHandl // and http://www.cs.utah.edu/~lacewell/subdeval if ( _m.is_boundary( _vh)) { - Normal Vec; pos = _m.point(_vh); VertexEdgeIter ve_itr; for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr) diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh index 3227ded9..6a9b2fb0 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh @@ -96,8 +96,8 @@ public: public: - CompositeT(void) : parent_t(), p_mesh_(NULL) {} - explicit CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {}; + CompositeT(void) : parent_t(), p_mesh_(nullptr) {} + explicit CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(nullptr) {}; virtual ~CompositeT() { } public: // inherited interface @@ -122,13 +122,13 @@ protected: // inherited interface } #ifdef NDEBUG - bool cleanup( MeshType& ) + bool cleanup( MeshType& ) override #else bool cleanup( MeshType& _m ) override #endif { assert( p_mesh_ == &_m ); - p_mesh_=NULL; + p_mesh_=nullptr; return true; } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh index 6330797e..d3b7199c 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh @@ -409,7 +409,7 @@ private: typename MeshType::HalfedgeHandle heh; typename MeshType::VertexHandle vh1, vh2, vh3, vh4, vhl, vhr; - typename MeshType::Point zero(0,0,0), P1, P2, P3, P4; + typename MeshType::Point P1, P2, P3, P4; /* // *---------*---------* diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh index a27c038f..d39070f8 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh @@ -102,7 +102,7 @@ public: /// Constructor to be used with interface 1 (calls attach()) /// \see operator()( MeshType&, size_t ) - explicit SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); } + explicit SubdividerT( MeshType &_m ) : attached_(nullptr) { attach(_m); } //@} @@ -157,7 +157,7 @@ public: /// \name Interface 2 if ( attached_ ) { cleanup( *attached_ ); - attached_ = NULL; + attached_ = nullptr; } } //@} diff --git a/src/OpenMesh/Tools/Utils/Gnuplot.cc b/src/OpenMesh/Tools/Utils/Gnuplot.cc index a70ca1ad..88e91607 100644 --- a/src/OpenMesh/Tools/Utils/Gnuplot.cc +++ b/src/OpenMesh/Tools/Utils/Gnuplot.cc @@ -38,7 +38,7 @@ # define access _access # define ACCESS_OK 0 # define PATH_SEP ";" -# define MKTEMP_AND_CHECK_FAILED(name) (_mktemp(name) == NULL) +# define MKTEMP_AND_CHECK_FAILED(name) (_mktemp(name) == nullptr) #else # define ACCESS_OK X_OK # define PATH_SEP ":" @@ -368,7 +368,7 @@ void Gnuplot::plot_x(vector d, const string &title) // //open temporary files for output #ifdef WIN32 - if ( _mktemp(name) == NULL) + if ( _mktemp(name) == nullptr) #else if ( mkstemp(name) == -1 ) #endif diff --git a/src/OpenMesh/Tools/Utils/conio.cc b/src/OpenMesh/Tools/Utils/conio.cc index 4d053893..9b0debf9 100644 --- a/src/OpenMesh/Tools/Utils/conio.cc +++ b/src/OpenMesh/Tools/Utils/conio.cc @@ -120,7 +120,7 @@ int kbhit(void) error += tcsetattr(0, TCSANOW, &Otty); tv.tv_sec = 0; tv.tv_usec = 100; /* insert at least a minimal delay */ - select(1, NULL, NULL, NULL, &tv); + select(1, nullptr, nullptr, nullptr, &tv); } return (error == 0 ? cnt : -1 ); } diff --git a/src/OpenMesh/Tools/VDPM/VHierarchyWindow.cc b/src/OpenMesh/Tools/VDPM/VHierarchyWindow.cc index 18d50558..4a97cda7 100644 --- a/src/OpenMesh/Tools/VDPM/VHierarchyWindow.cc +++ b/src/OpenMesh/Tools/VDPM/VHierarchyWindow.cc @@ -73,7 +73,7 @@ namespace VDPM { VHierarchyWindow:: VHierarchyWindow() : - vhierarchy_(NULL), buffer_(NULL),buffer_min_ (0), buffer_max_(0), current_pos_(0) , window_min_(0), window_max_(0), n_shift_(0) + vhierarchy_(nullptr), buffer_(nullptr),buffer_min_ (0), buffer_max_(0), current_pos_(0) , window_min_(0), window_max_(0), n_shift_(0) { } @@ -81,7 +81,7 @@ VHierarchyWindow() : VHierarchyWindow:: VHierarchyWindow(VHierarchy &_vhierarchy) : - vhierarchy_(&_vhierarchy),buffer_(NULL),buffer_min_ (0), buffer_max_(0), current_pos_(0) , window_min_(0), window_max_(0) ,n_shift_(0) + vhierarchy_(&_vhierarchy),buffer_(nullptr),buffer_min_ (0), buffer_max_(0), current_pos_(0) , window_min_(0), window_max_(0) ,n_shift_(0) { } @@ -89,7 +89,7 @@ VHierarchyWindow(VHierarchy &_vhierarchy) : VHierarchyWindow:: ~VHierarchyWindow(void) { - if (buffer_ != NULL) + if (buffer_ != nullptr) free(buffer_); } @@ -138,7 +138,7 @@ update_buffer(VHierarchyNodeHandle _node_handle) void VHierarchyWindow::init(VHierarchyNodeHandleContainer &_roots) { - if (buffer_ != NULL) + if (buffer_ != nullptr) free(buffer_); buffer_min_ = 0;