diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 09dbbe73..0b2076af 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,7 +26,9 @@ cppcheck:
stage: build
script: "CI/ci-cppcheck.sh"
image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container
- tags: [Docker]
+ tags:
+ - Linux
+ - stretch
timeout: 3h
artifacts:
paths:
diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh
index 66b19bad..666efa28 100755
--- a/CI/ci-cppcheck.sh
+++ b/CI/ci-cppcheck.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#/bin/bash
# Exit script on any error
set -e
@@ -22,7 +22,7 @@ echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
-cppcheck --enable=all . -I src -i Doc/ -i src/Unittests --force --suppress=unusedFunction -UCTIME --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -DOPENMESHDLLEXPORT="" -UPRIVATE_NODE_TYPESYSTEM_SOURCE -USO_NODE_ABSTRACT_SOURCE -USO_NODE_SOURCE -UCLOCK_REALTIME_HR -i src/OpenMesh/Apps/Unsupported/ 2>&1 | tee cppcheck.log
+cppcheck --enable=all . -I src -i Doc/ -i src/Unittests --force --suppress=unusedFunction -UCTIME --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -DOPENMESHDLLEXPORT="" -UPRIVATE_NODE_TYPESYSTEM_SOURCE -USO_NODE_ABSTRACT_SOURCE -USO_NODE_SOURCE -UCLOCK_REALTIME_HR -UBMPOSTFIX -i src/OpenMesh/Apps/Unsupported/ 2>&1 | tee cppcheck.log
COUNT=$(wc -l < cppcheck.log )
@@ -32,7 +32,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
-MAX_COUNT=24
+MAX_COUNT=171
if [ $COUNT -gt $MAX_COUNT ]; then
echo -e ${WARNING}
diff --git a/CI/gitlab-ci/linux.yml b/CI/gitlab-ci/linux.yml
index 5499c5fa..3e04242f 100644
--- a/CI/gitlab-ci/linux.yml
+++ b/CI/gitlab-ci/linux.yml
@@ -6,7 +6,9 @@ cppcheck:
stage: build
script: "CI/ci-cppcheck.sh"
image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container
- tags: [Docker]
+ tags:
+ - Linux
+ - stretch
timeout: 3h
artifacts:
paths:
diff --git a/Doc/changelog.docu b/Doc/changelog.docu
index 573c79a0..cc179a95 100644
--- a/Doc/changelog.docu
+++ b/Doc/changelog.docu
@@ -16,6 +16,7 @@
Core
+- legacy vector min max now take const args to avoid matching std implementations
- Fixed several warnings
- Make Previous Halfedge Attribute optional again
diff --git a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
index e51045b5..ac347af7 100644
--- a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
+++ b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
@@ -84,13 +84,13 @@
using namespace OpenMesh;
-struct MyTraits : public DEFAULT_TRAITS
+struct MyDecimaterViewerWidgetTraits : public DEFAULT_TRAITS
{
VertexAttributes ( Attributes::Normal );
FaceAttributes ( Attributes::Normal );
};
-typedef TRIMESH_KERNEL mesh_t;
+typedef TRIMESH_KERNEL mesh_t;
typedef MeshViewerWidgetT MeshViewerWidgetDecimaterBase;
//== CLASS DEFINITION =========================================================
diff --git a/src/OpenMesh/Apps/Decimating/decimater.cc b/src/OpenMesh/Apps/Decimating/decimater.cc
index 712d6b28..9d60c5be 100644
--- a/src/OpenMesh/Apps/Decimating/decimater.cc
+++ b/src/OpenMesh/Apps/Decimating/decimater.cc
@@ -489,15 +489,11 @@ int main(int argc, char* argv[])
std::clog << " Input file: " << ifname << std::endl;
std::clog << " Output file: " << ofname << std::endl;
std::clog << " #collapses: " << opt.n_collapses << std::endl;
- }
- //----------------------------------------
+ //----------------------------------------
-
- if (gverbose)
- {
std::clog << "Begin decimation" << std::endl;
}
@@ -512,6 +508,7 @@ int main(int argc, char* argv[])
}
//----------------------------------------
+
return 0;
}
diff --git a/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh b/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
index 67392a19..ace65af2 100644
--- a/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
+++ b/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
@@ -96,6 +96,7 @@ public:
/// default constructor
explicit ProgViewerWidget(QWidget* _parent=0)
: MeshViewerWidgetProgBase(_parent),
+ animateRefinement_(true),
n_base_vertices_(0),
n_base_faces_(0),
n_detail_vertices_(0),
diff --git a/src/OpenMesh/Apps/Smoothing/smooth.cc b/src/OpenMesh/Apps/Smoothing/smooth.cc
index ebebdbd3..ffb039df 100644
--- a/src/OpenMesh/Apps/Smoothing/smooth.cc
+++ b/src/OpenMesh/Apps/Smoothing/smooth.cc
@@ -54,7 +54,7 @@ using namespace OpenMesh;
using namespace Smoother;
-struct MyTraits : public OpenMesh::DefaultTraits
+struct MySmoothingTraits : public OpenMesh::DefaultTraits
{
#if 1
typedef OpenMesh::Vec3f Point;
@@ -65,7 +65,7 @@ struct MyTraits : public OpenMesh::DefaultTraits
#endif
};
-typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
//-----------------------------------------------------------------------------
diff --git a/src/OpenMesh/Apps/Subdivider/SubdivideWidget.hh b/src/OpenMesh/Apps/Subdivider/SubdivideWidget.hh
index a22afb16..f337be77 100644
--- a/src/OpenMesh/Apps/Subdivider/SubdivideWidget.hh
+++ b/src/OpenMesh/Apps/Subdivider/SubdivideWidget.hh
@@ -88,7 +88,7 @@ public:
public:
/// constructor
- SubdivideWidget(QWidget* _parent=0, const char* _name=0);
+ explicit SubdivideWidget(QWidget* _parent=0, const char* _name=0);
/// destructor
~SubdivideWidget() {};
diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
index 12c3f1fc..65b2288a 100644
--- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
+++ b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
@@ -229,7 +229,10 @@ replace_extension( std::string& _s, const std::string& _e )
if (dot == std::string::npos)
{ _s += "." + _e; }
else
- { _s = _s.substr(0,dot+1)+_e; }
+ {
+ const std::string temp_name = _s.substr(0,dot+1);
+ _s = temp_name + _e;
+ }
return _s;
}
diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc
index 7e387704..2f70c8ab 100644
--- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc
+++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc
@@ -407,7 +407,7 @@ open_vd_prog_mesh(const char* _filename)
}
//
- bool swap = Endian::local() != Endian::LSB;
+ bool swap_required = Endian::local() != Endian::LSB;
// read header
ifs.read(fileformat, 10); fileformat[10] = '\0';
@@ -418,9 +418,9 @@ open_vd_prog_mesh(const char* _filename)
exit(1);
}
- IO::restore(ifs, n_base_vertices_, swap);
- IO::restore(ifs, n_base_faces_, swap);
- IO::restore(ifs, n_details_, swap);
+ IO::restore(ifs, n_base_vertices_, swap_required);
+ IO::restore(ifs, n_base_faces_, swap_required);
+ IO::restore(ifs, n_details_, swap_required);
mesh_.clear();
vfront_.clear();
@@ -431,12 +431,12 @@ open_vd_prog_mesh(const char* _filename)
// load base mesh
for (i=0; i level_;
level_t max_level_; // maximum level reached
@@ -181,9 +178,18 @@ replace_extension( std::string& _s, const std::string& _e )
{
std::string::size_type dot = _s.rfind(".");
if (dot == std::string::npos)
- { _s += "." + _e; }
+ {
+ // The name does not include a dot and therefore no extension. Adding both.
+ _s += "." + _e;
+ }
else
- { _s = _s.substr(0,dot+1)+_e; }
+ {
+ // get everything of the name including the dot but remove the extension.
+ const std::string name = _s.substr(0,dot+1);
+
+ // Add the new extenion
+ _s = name + _e;
+ }
return _s;
}
diff --git a/src/OpenMesh/Apps/mconvert/mconvert.cc b/src/OpenMesh/Apps/mconvert/mconvert.cc
index 566275bd..bec6e9db 100644
--- a/src/OpenMesh/Apps/mconvert/mconvert.cc
+++ b/src/OpenMesh/Apps/mconvert/mconvert.cc
@@ -53,7 +53,7 @@
#include
-struct MyTraits : public OpenMesh::DefaultTraits
+struct MyMConvertTraits : public OpenMesh::DefaultTraits
{
VertexAttributes ( OpenMesh::Attributes::Normal |
OpenMesh::Attributes::Color |
@@ -64,7 +64,7 @@ struct MyTraits : public OpenMesh::DefaultTraits
};
-typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
void usage_and_exit(int xcode)
{
diff --git a/src/OpenMesh/Core/Geometry/Vector11T.hh b/src/OpenMesh/Core/Geometry/Vector11T.hh
index bb38813e..03a61ba2 100644
--- a/src/OpenMesh/Core/Geometry/Vector11T.hh
+++ b/src/OpenMesh/Core/Geometry/Vector11T.hh
@@ -170,8 +170,9 @@ class VectorT {
}
/// construct from an array
- explicit VectorT(container&& _array) {
- values_ = _array;
+ explicit VectorT(container&& _array) :
+ values_(_array)
+ {
}
/// copy & cast constructor (explicit)
diff --git a/src/OpenMesh/Core/Geometry/VectorT.hh b/src/OpenMesh/Core/Geometry/VectorT.hh
index eefb7b36..fa09e253 100644
--- a/src/OpenMesh/Core/Geometry/VectorT.hh
+++ b/src/OpenMesh/Core/Geometry/VectorT.hh
@@ -320,7 +320,7 @@ VectorT& minimize(VectorT& _v1, VectorT&
/// \relates OpenMesh::VectorT
/// non-member max
template
-VectorT max(VectorT& _v1, VectorT& _v2) {
+VectorT max(const VectorT& _v1, const VectorT& _v2) {
return VectorT(_v1).maximize(_v2);
}
@@ -328,7 +328,7 @@ VectorT max(VectorT& _v1, VectorT& _v2) {
/// \relates OpenMesh::VectorT
/// non-member min
template
-VectorT min(VectorT& _v1, VectorT& _v2) {
+VectorT min(const VectorT& _v1, const VectorT& _v2) {
return VectorT(_v1).minimize(_v2);
}
diff --git a/src/OpenMesh/Core/IO/BinaryHelper.cc b/src/OpenMesh/Core/IO/BinaryHelper.cc
index d5386e98..c30d5452 100644
--- a/src/OpenMesh/Core/IO/BinaryHelper.cc
+++ b/src/OpenMesh/Core/IO/BinaryHelper.cc
@@ -74,7 +74,7 @@ namespace IO {
short int read_short(FILE* _in, bool _swap)
{
union u1 { short int s; unsigned char c[2]; } sc;
- fread((char*)sc.c, 1, 2, _in);
+ fread(reinterpret_cast(sc.c), 1, 2, _in);
if (_swap) std::swap(sc.c[0], sc.c[1]);
return sc.s;
}
@@ -86,7 +86,7 @@ short int read_short(FILE* _in, bool _swap)
int read_int(FILE* _in, bool _swap)
{
union u2 { int i; unsigned char c[4]; } ic;
- fread((char*)ic.c, 1, 4, _in);
+ fread(reinterpret_cast(ic.c), 1, 4, _in);
if (_swap) {
std::swap(ic.c[0], ic.c[3]);
std::swap(ic.c[1], ic.c[2]);
@@ -101,7 +101,7 @@ int read_int(FILE* _in, bool _swap)
float read_float(FILE* _in, bool _swap)
{
union u3 { float f; unsigned char c[4]; } fc;
- fread((char*)fc.c, 1, 4, _in);
+ fread(reinterpret_cast(fc.c), 1, 4, _in);
if (_swap) {
std::swap(fc.c[0], fc.c[3]);
std::swap(fc.c[1], fc.c[2]);
@@ -116,7 +116,7 @@ float read_float(FILE* _in, bool _swap)
double read_double(FILE* _in, bool _swap)
{
union u4 { double d; unsigned char c[8]; } dc;
- fread((char*)dc.c, 1, 8, _in);
+ fread(reinterpret_cast(dc.c), 1, 8, _in);
if (_swap) {
std::swap(dc.c[0], dc.c[7]);
std::swap(dc.c[1], dc.c[6]);
@@ -131,7 +131,7 @@ double read_double(FILE* _in, bool _swap)
short int read_short(std::istream& _in, bool _swap)
{
union u1 { short int s; unsigned char c[2]; } sc;
- _in.read((char*)sc.c, 2);
+ _in.read(reinterpret_cast(sc.c), 2);
if (_swap) std::swap(sc.c[0], sc.c[1]);
return sc.s;
}
@@ -143,7 +143,7 @@ short int read_short(std::istream& _in, bool _swap)
int read_int(std::istream& _in, bool _swap)
{
union u2 { int i; unsigned char c[4]; } ic;
- _in.read((char*)ic.c, 4);
+ _in.read(reinterpret_cast(ic.c), 4);
if (_swap) {
std::swap(ic.c[0], ic.c[3]);
std::swap(ic.c[1], ic.c[2]);
@@ -158,7 +158,7 @@ int read_int(std::istream& _in, bool _swap)
float read_float(std::istream& _in, bool _swap)
{
union u3 { float f; unsigned char c[4]; } fc;
- _in.read((char*)fc.c, 4);
+ _in.read(reinterpret_cast(fc.c), 4);
if (_swap) {
std::swap(fc.c[0], fc.c[3]);
std::swap(fc.c[1], fc.c[2]);
@@ -173,7 +173,7 @@ float read_float(std::istream& _in, bool _swap)
double read_double(std::istream& _in, bool _swap)
{
union u4 { double d; unsigned char c[8]; } dc;
- _in.read((char*)dc.c, 8);
+ _in.read(reinterpret_cast(dc.c), 8);
if (_swap) {
std::swap(dc.c[0], dc.c[7]);
std::swap(dc.c[1], dc.c[6]);
@@ -192,7 +192,7 @@ void write_short(short int _i, FILE* _out, bool _swap)
union u1 { short int s; unsigned char c[2]; } sc;
sc.s = _i;
if (_swap) std::swap(sc.c[0], sc.c[1]);
- fwrite((char*)sc.c, 1, 2, _out);
+ fwrite(reinterpret_cast(sc.c), 1, 2, _out);
}
@@ -207,7 +207,7 @@ void write_int(int _i, FILE* _out, bool _swap)
std::swap(ic.c[0], ic.c[3]);
std::swap(ic.c[1], ic.c[2]);
}
- fwrite((char*)ic.c, 1, 4, _out);
+ fwrite(reinterpret_cast(ic.c), 1, 4, _out);
}
@@ -222,7 +222,7 @@ void write_float(float _f, FILE* _out, bool _swap)
std::swap(fc.c[0], fc.c[3]);
std::swap(fc.c[1], fc.c[2]);
}
- fwrite((char*)fc.c, 1, 4, _out);
+ fwrite(reinterpret_cast(fc.c), 1, 4, _out);
}
@@ -239,7 +239,7 @@ void write_double(double _d, FILE* _out, bool _swap)
std::swap(dc.c[2], dc.c[5]);
std::swap(dc.c[3], dc.c[4]);
}
- fwrite((char*)dc.c, 1, 8, _out);
+ fwrite(reinterpret_cast(dc.c), 1, 8, _out);
}
@@ -251,7 +251,7 @@ void write_short(short int _i, std::ostream& _out, bool _swap)
union u1 { short int s; unsigned char c[2]; } sc;
sc.s = _i;
if (_swap) std::swap(sc.c[0], sc.c[1]);
- _out.write((char*)sc.c, 2);
+ _out.write(reinterpret_cast(sc.c), 2);
}
@@ -266,7 +266,7 @@ void write_int(int _i, std::ostream& _out, bool _swap)
std::swap(ic.c[0], ic.c[3]);
std::swap(ic.c[1], ic.c[2]);
}
- _out.write((char*)ic.c, 4);
+ _out.write(reinterpret_cast(ic.c), 4);
}
@@ -281,7 +281,7 @@ void write_float(float _f, std::ostream& _out, bool _swap)
std::swap(fc.c[0], fc.c[3]);
std::swap(fc.c[1], fc.c[2]);
}
- _out.write((char*)fc.c, 4);
+ _out.write(reinterpret_cast(fc.c), 4);
}
@@ -298,7 +298,7 @@ void write_double(double _d, std::ostream& _out, bool _swap)
std::swap(dc.c[2], dc.c[5]);
std::swap(dc.c[3], dc.c[4]);
}
- _out.write((char*)dc.c, 8);
+ _out.write(reinterpret_cast(dc.c), 8);
}
diff --git a/src/OpenMesh/Core/IO/OMFormat.hh b/src/OpenMesh/Core/IO/OMFormat.hh
index 7b508833..440872c1 100644
--- a/src/OpenMesh/Core/IO/OMFormat.hh
+++ b/src/OpenMesh/Core/IO/OMFormat.hh
@@ -141,8 +141,8 @@ namespace OMFormat {
size_t restore( std::istream& _is, bool _swap )
{
- if (_is.read( (char*)this, 4 ).eof())
- return 0;
+ if (_is.read( reinterpret_cast(this) , 4 ).eof())
+ return 0;
size_t bytes = 4;
bytes += binary::restore( _is, n_vertices_, _swap );
@@ -307,7 +307,7 @@ namespace OMFormat {
/// Return the size of chunk data in bytes
- inline size_t chunk_data_size( Header& _hdr, Chunk::Header& _chunk_hdr )
+ inline size_t chunk_data_size( const Header& _hdr, const Chunk::Header& _chunk_hdr )
{
size_t C;
switch( _chunk_hdr.entity_ )
@@ -327,7 +327,7 @@ namespace OMFormat {
return C * vector_size( _chunk_hdr );
}
- inline size_t chunk_size( Header& _hdr, Chunk::Header& _chunk_hdr )
+ inline size_t chunk_size( const Header& _hdr, const Chunk::Header& _chunk_hdr )
{
return chunk_header_size() + chunk_data_size( _hdr, _chunk_hdr );
}
diff --git a/src/OpenMesh/Core/IO/SR_binary.hh b/src/OpenMesh/Core/IO/SR_binary.hh
index 887a24ed..a64ae089 100644
--- a/src/OpenMesh/Core/IO/SR_binary.hh
+++ b/src/OpenMesh/Core/IO/SR_binary.hh
@@ -80,11 +80,6 @@ namespace IO {
//-----------------------------------------------------------------------------
// struct binary, helper for storing/restoring
-#define X \
- std::ostringstream msg; \
- msg << "Type not supported: " << typeid(value_type).name(); \
- throw std::logic_error(msg.str())
-
/// \struct binary SR_binary.hh
///
/// The struct defines how to store and restore the type T.
@@ -119,7 +114,11 @@ template < typename T, typename = void > struct binary
const value_type& /* _v */,
bool /* _swap */ = false ,
bool /* store_size */ = true ) // for vectors
- { X; return 0; }
+ {
+ std::ostringstream msg;
+ msg << "Type not supported: " << typeid(value_type).name();
+ throw std::logic_error(msg.str());
+ }
/// Restore a value of T and return the number of bytes read
static
@@ -127,7 +126,11 @@ template < typename T, typename = void > struct binary
value_type& /* _v */,
bool /* _swap */ = false ,
bool /* store_size */ = true ) // for vectors
- { X; return 0; }
+ {
+ std::ostringstream msg;
+ msg << "Type not supported: " << typeid(value_type).name();
+ throw std::logic_error(msg.str());
+ }
};
#undef X
diff --git a/src/OpenMesh/Core/IO/SR_binary_spec.hh b/src/OpenMesh/Core/IO/SR_binary_spec.hh
index d220b398..265b35be 100644
--- a/src/OpenMesh/Core/IO/SR_binary_spec.hh
+++ b/src/OpenMesh/Core/IO/SR_binary_spec.hh
@@ -190,20 +190,20 @@ SIMPLE_BINARY(unsigned long);
static size_t store( std::ostream& _os, const value_type& _val, \
bool _swap=false) { \
value_type tmp = _val; \
- size_t i, b = size_of(_val), N = value_type::size_; \
+ size_t b = size_of(_val), N = value_type::size_; \
if (_swap) \
- for (i=0; i _OMWriter_::get_version())
@@ -183,7 +183,7 @@ bool _OMReader_::read_binary(std::istream& _is, BaseImporter& _bi, Options& _opt
}
while (!_is.eof()) {
- bytes_ += restore(_is, chunk_header_, swap);
+ bytes_ += restore(_is, chunk_header_, swap_required);
if (_is.eof())
break;
@@ -191,30 +191,30 @@ bool _OMReader_::read_binary(std::istream& _is, BaseImporter& _bi, Options& _opt
// Is this a named property restore the name
if (chunk_header_.name_) {
OMFormat::Chunk::PropertyName pn;
- bytes_ += restore(_is, property_name_, swap);
+ bytes_ += restore(_is, property_name_, swap_required);
}
// Read in the property data. If it is an anonymous or unknown named
// property, then skip data.
switch (chunk_header_.entity_) {
case OMFormat::Chunk::Entity_Vertex:
- if (!read_binary_vertex_chunk(_is, _bi, _opt, swap))
+ if (!read_binary_vertex_chunk(_is, _bi, _opt, swap_required))
return false;
break;
case OMFormat::Chunk::Entity_Face:
- if (!read_binary_face_chunk(_is, _bi, _opt, swap))
+ if (!read_binary_face_chunk(_is, _bi, _opt, swap_required))
return false;
break;
case OMFormat::Chunk::Entity_Edge:
- if (!read_binary_edge_chunk(_is, _bi, _opt, swap))
+ if (!read_binary_edge_chunk(_is, _bi, _opt, swap_required))
return false;
break;
case OMFormat::Chunk::Entity_Halfedge:
- if (!read_binary_halfedge_chunk(_is, _bi, _opt, swap))
+ if (!read_binary_halfedge_chunk(_is, _bi, _opt, swap_required))
return false;
break;
case OMFormat::Chunk::Entity_Mesh:
- if (!read_binary_mesh_chunk(_is, _bi, _opt, swap))
+ if (!read_binary_mesh_chunk(_is, _bi, _opt, swap_required))
return false;
break;
case OMFormat::Chunk::Entity_Sentinel:
@@ -291,7 +291,7 @@ bool _OMReader_::supports(const OMFormat::uint8 /* version */) const
//-----------------------------------------------------------------------------
-bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi, Options &_opt, bool _swap) const
+bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi, const Options &_opt, bool _swap) const
{
using OMFormat::Chunk;
@@ -447,7 +447,7 @@ bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi,
//-----------------------------------------------------------------------------
-bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, Options &_opt, bool _swap) const
+bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, const Options &_opt, bool _swap) const
{
using OMFormat::Chunk;
@@ -589,7 +589,7 @@ bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, Op
//-----------------------------------------------------------------------------
-bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, Options &_opt, bool _swap) const
+bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, const Options &_opt, bool _swap) const
{
using OMFormat::Chunk;
@@ -641,7 +641,7 @@ bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, Op
//-----------------------------------------------------------------------------
-bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi, Options & _opt, bool _swap) const
+bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi, const Options & _opt, bool _swap) const
{
using OMFormat::Chunk;
@@ -749,7 +749,7 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi
//-----------------------------------------------------------------------------
-bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Options& _opt , bool _swap) const
+bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, const Options& _opt , bool _swap) const
{
using OMFormat::Chunk;
diff --git a/src/OpenMesh/Core/IO/reader/OMReader.hh b/src/OpenMesh/Core/IO/reader/OMReader.hh
index 97d364a6..ed042f68 100644
--- a/src/OpenMesh/Core/IO/reader/OMReader.hh
+++ b/src/OpenMesh/Core/IO/reader/OMReader.hh
@@ -126,27 +126,27 @@ private:
bool read_binary_vertex_chunk( std::istream &_is,
BaseImporter &_bi,
- Options &_opt,
+ const Options &_opt,
bool _swap) const;
bool read_binary_face_chunk( std::istream &_is,
BaseImporter &_bi,
- Options &_opt,
+ const Options &_opt,
bool _swap) const;
bool read_binary_edge_chunk( std::istream &_is,
BaseImporter &_bi,
- Options &_opt,
+ const Options &_opt,
bool _swap) const;
bool read_binary_halfedge_chunk( std::istream &_is,
BaseImporter &_bi,
- Options &_opt,
+ const Options &_opt,
bool _swap) const;
bool read_binary_mesh_chunk( std::istream &_is,
BaseImporter &_bi,
- Options &_opt,
+ const Options &_opt,
bool _swap) const;
size_t restore_binary_custom_data(std::istream& _is,
diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc
index 51e5ebcc..6cf882c3 100644
--- a/src/OpenMesh/Core/IO/reader/PLYReader.cc
+++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc
@@ -142,7 +142,7 @@ bool _PLYReader_::read(std::istream& _in, BaseImporter& _bi, Options& _opt) {
}
// filter relevant options for reading
- bool swap = _opt.check(Options::Swap);
+ bool swap_required = _opt.check(Options::Swap);
userOptions_ = _opt;
@@ -178,7 +178,7 @@ bool _PLYReader_::read(std::istream& _in, BaseImporter& _bi, Options& _opt) {
// if ( options_.is_binary() && userOptions_.color_has_alpha() )
// options_ += Options::ColorAlpha;
- return (options_.is_binary() ? read_binary(_in, _bi, swap, _opt) : read_ascii(_in, _bi, _opt));
+ return (options_.is_binary() ? read_binary(_in, _bi, swap_required, _opt) : read_ascii(_in, _bi, _opt));
}
@@ -1384,8 +1384,7 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
elements_.push_back(element);
} else if (keyword == "property") {
- std::string tmp1;
- std::string tmp2;
+ std::string tmp1;
// Read first keyword, as it might be a list
_is >> tmp1;
@@ -1448,6 +1447,9 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
elements_.back().properties_.push_back(property);
} else {
+
+ std::string tmp2;
+
// as this is not a list property, read second value of property
_is >> tmp2;
diff --git a/src/OpenMesh/Core/IO/writer/OMWriter.cc b/src/OpenMesh/Core/IO/writer/OMWriter.cc
index 911db28e..521714fc 100644
--- a/src/OpenMesh/Core/IO/writer/OMWriter.cc
+++ b/src/OpenMesh/Core/IO/writer/OMWriter.cc
@@ -183,7 +183,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
size_t bytes = 0;
- const bool swap =
+ const bool swap_required =
_writeOptions.check(Options::Swap) || (Endian::local() == Endian::MSB);
unsigned int i, nV, nF;
@@ -202,7 +202,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
header.n_faces_ = int(_be.n_faces());
header.n_edges_ = int(_be.n_edges());
- bytes += store( _os, header, swap );
+ bytes += store( _os, header, swap_required );
// ---------------------------------------- write chunks
@@ -234,13 +234,13 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.bits_ = OMFormat::bits(v[0]);
}
- bytes += store( _os, chunk_header, swap );
+ bytes += store( _os, chunk_header, swap_required );
if (_be.is_point_double())
for (i=0, nV=header.n_vertices_; i(i)));
auto face_id = _be.get_face_id(HalfedgeHandle(static_cast(i)));
- bytes += store( _os, next_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap );
- bytes += store( _os, to_vertex_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap );
- bytes += store( _os, face_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap );
+ bytes += store( _os, next_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap_required );
+ bytes += store( _os, to_vertex_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap_required );
+ bytes += store( _os, face_id, OMFormat::Chunk::Integer_Size(chunk_header.bits_), swap_required );
}
}
@@ -357,11 +357,11 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.dim_ = OMFormat::dim(t);
chunk_header.bits_ = OMFormat::bits(t[0]);
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
unsigned int nHE;
for (i = 0, nHE = header.n_edges_*2; i < nHE; ++i)
- bytes += vector_store(_os, _be.texcoord(HalfedgeHandle(i)), swap);
+ bytes += vector_store(_os, _be.texcoord(HalfedgeHandle(i)), swap_required);
}
//---------------------------------------------------------------
@@ -378,9 +378,9 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.dim_ = OMFormat::Chunk::Dim_1D;
chunk_header.bits_ = OMFormat::needed_bits(_be.n_edges()*4); // *2 due to halfedge ids being stored, *2 due to signedness
- bytes += store( _os, chunk_header, swap );
+ bytes += store( _os, chunk_header, swap_required );
for (i=0, nV=header.n_vertices_; istore(_os, swap );
@@ -478,10 +478,10 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.dim_ = OMFormat::dim( c );
chunk_header.bits_ = OMFormat::bits( c[0] );
- bytes += store( _os, chunk_header, swap );
+ bytes += store( _os, chunk_header, swap_required );
#if !NEW_STYLE
for (i=0, nF=header.n_faces_; istore(_os, swap);
}
@@ -503,10 +503,10 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.bits_ = OMFormat::bits(s);
// std::clog << chunk_header << std::endl;
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
for (i = 0, nV = header.n_vertices_; i < nV; ++i)
- bytes += store(_os, _be.status(VertexHandle(i)), swap);
+ bytes += store(_os, _be.status(VertexHandle(i)), swap_required);
}
// ---------- write edge status
@@ -522,10 +522,10 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.bits_ = OMFormat::bits(s);
// std::clog << chunk_header << std::endl;
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
for (i = 0, nV = header.n_edges_; i < nV; ++i)
- bytes += store(_os, _be.status(EdgeHandle(i)), swap);
+ bytes += store(_os, _be.status(EdgeHandle(i)), swap_required);
}
// ---------- write halfedge status
@@ -541,10 +541,10 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.bits_ = OMFormat::bits(s);
// std::clog << chunk_header << std::endl;
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
for (i = 0, nV = header.n_edges_ * 2; i < nV; ++i)
- bytes += store(_os, _be.status(HalfedgeHandle(i)), swap);
+ bytes += store(_os, _be.status(HalfedgeHandle(i)), swap_required);
}
// ---------- write face status
@@ -560,17 +560,17 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
chunk_header.bits_ = OMFormat::bits(s);
// std::clog << chunk_header << std::endl;
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
for (i = 0, nV = header.n_faces_; i < nV; ++i)
- bytes += store(_os, _be.status(FaceHandle(i)), swap);
+ bytes += store(_os, _be.status(FaceHandle(i)), swap_required);
}
// -------------------- write custom properties
if (_writeOptions.check(Options::Custom))
{
- const auto store_property = [this, &_os, swap, &bytes](
+ const auto store_property = [this, &_os, swap_required, &bytes](
const BaseKernel::const_prop_iterator _it_begin,
const BaseKernel::const_prop_iterator _it_end,
const OMFormat::Chunk::Entity _ent)
@@ -582,7 +582,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
{ // skip dead and "private" properties (no name or name matches "?:*")
continue;
}
- bytes += store_binary_custom_chunk(_os, **prop, _ent, swap);
+ bytes += store_binary_custom_chunk(_os, **prop, _ent, swap_required);
}
};
@@ -601,7 +601,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
memset(&chunk_header, 0, sizeof(chunk_header));
chunk_header.name_ = false;
chunk_header.entity_ = OMFormat::Chunk::Entity_Sentinel;
- bytes += store(_os, chunk_header, swap);
+ bytes += store(_os, chunk_header, swap_required);
omlog() << "#bytes written: " << bytes << std::endl;
diff --git a/src/OpenMesh/Core/IO/writer/STLWriter.cc b/src/OpenMesh/Core/IO/writer/STLWriter.cc
index a9f86b7e..29fa185b 100644
--- a/src/OpenMesh/Core/IO/writer/STLWriter.cc
+++ b/src/OpenMesh/Core/IO/writer/STLWriter.cc
@@ -139,7 +139,7 @@ write(std::ostream& _os, BaseExporter& _be, const Options& _writeOptions, std::s
bool
_STLWriter_::
-write_stla(const std::string& _filename, BaseExporter& _be, Options /* _opt */) const
+write_stla(const std::string& _filename, const BaseExporter& _be, Options /* _opt */) const
{
omlog() << "[STLWriter] : write ascii file\n";
@@ -204,7 +204,7 @@ write_stla(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
bool
_STLWriter_::
-write_stla(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::streamsize _precision) const
+write_stla(std::ostream& _out, const BaseExporter& _be, Options /* _opt */, std::streamsize _precision) const
{
omlog() << "[STLWriter] : write ascii file\n";
@@ -256,7 +256,7 @@ write_stla(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::strea
bool
_STLWriter_::
-write_stlb(const std::string& _filename, BaseExporter& _be, Options /* _opt */) const
+write_stlb(const std::string& _filename, const BaseExporter& _be, Options /* _opt */) const
{
omlog() << "[STLWriter] : write binary file\n";
@@ -336,7 +336,7 @@ write_stlb(const std::string& _filename, BaseExporter& _be, Options /* _opt */)
bool
_STLWriter_::
-write_stlb(std::ostream& _out, BaseExporter& _be, Options /* _opt */, std::streamsize _precision) const
+write_stlb(std::ostream& _out, const BaseExporter& _be, Options /* _opt */, std::streamsize _precision) const
{
omlog() << "[STLWriter] : write binary file\n";
diff --git a/src/OpenMesh/Core/IO/writer/STLWriter.hh b/src/OpenMesh/Core/IO/writer/STLWriter.hh
index 3c258299..2deaa7ec 100644
--- a/src/OpenMesh/Core/IO/writer/STLWriter.hh
+++ b/src/OpenMesh/Core/IO/writer/STLWriter.hh
@@ -98,10 +98,10 @@ public:
size_t binary_size(BaseExporter&, const Options&) const override;
private:
- bool write_stla(const std::string&, BaseExporter&, Options) const;
- bool write_stla(std::ostream&, BaseExporter&, Options, std::streamsize _precision = 6) const;
- bool write_stlb(const std::string&, BaseExporter&, Options) const;
- bool write_stlb(std::ostream&, BaseExporter&, Options, std::streamsize _precision = 6) const;
+ bool write_stla(const std::string&, const BaseExporter&, Options) const;
+ bool write_stla(std::ostream&, const BaseExporter&, Options, std::streamsize _precision = 6) const;
+ bool write_stlb(const std::string&, const BaseExporter&, Options) const;
+ bool write_stlb(std::ostream&, const BaseExporter&, Options, std::streamsize _precision = 6) const;
};
diff --git a/src/OpenMesh/Core/IO/writer/VTKWriter.cc b/src/OpenMesh/Core/IO/writer/VTKWriter.cc
index 9015222b..5c5d417a 100644
--- a/src/OpenMesh/Core/IO/writer/VTKWriter.cc
+++ b/src/OpenMesh/Core/IO/writer/VTKWriter.cc
@@ -40,8 +40,6 @@ bool _VTKWriter_::write(const std::string& _filename, BaseExporter& _be, const O
bool _VTKWriter_::write(std::ostream& _out, BaseExporter& _be, const Options& _writeOptions, std::streamsize _precision) const
{
- VertexHandle vh;
-
// check exporter features
if (!check(_be, _writeOptions)) {
return false;
diff --git a/src/OpenMesh/Core/Mesh/ArrayKernel.hh b/src/OpenMesh/Core/Mesh/ArrayKernel.hh
index 56398b70..b9c97fa1 100644
--- a/src/OpenMesh/Core/Mesh/ArrayKernel.hh
+++ b/src/OpenMesh/Core/Mesh/ArrayKernel.hh
@@ -738,7 +738,7 @@ public:
typedef typename HandleContainer::const_iterator
const_iterator;
public:
- ExtStatusSetT(ArrayKernel& _kernel, size_t _capacity_hint = 0)
+ explicit ExtStatusSetT(ArrayKernel& _kernel, size_t _capacity_hint = 0)
: Base(_kernel)
{ handles_.reserve(_capacity_hint); }
diff --git a/src/OpenMesh/Core/Mesh/CirculatorsT.hh b/src/OpenMesh/Core/Mesh/CirculatorsT.hh
index f13fd410..d937908b 100644
--- a/src/OpenMesh/Core/Mesh/CirculatorsT.hh
+++ b/src/OpenMesh/Core/Mesh/CirculatorsT.hh
@@ -68,18 +68,18 @@ namespace Iterators {
template
class GenericCirculator_CenterEntityFnsT {
public:
- static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter);
- static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter);
+ static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter);
+ static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter);
};
template
class GenericCirculator_CenterEntityFnsT {
public:
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
heh = mesh->cw_rotated_halfedge_handle(heh);
if (heh == start) ++lap_counter;
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
if (heh == start) --lap_counter;
heh = mesh->ccw_rotated_halfedge_handle(heh);
}
@@ -88,11 +88,11 @@ class GenericCirculator_CenterEntityFnsT
class GenericCirculator_CenterEntityFnsT {
public:
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
heh = mesh->next_halfedge_handle(heh);
if (heh == start) ++lap_counter;
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
if (heh == start) --lap_counter;
heh = mesh->prev_halfedge_handle(heh);
}
@@ -104,11 +104,11 @@ class GenericCirculator_CenterEntityFnsT
template
class GenericCirculator_CenterEntityFnsT {
public:
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
heh = mesh->ccw_rotated_halfedge_handle(heh);
if (heh == start) ++lap_counter;
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
if (heh == start) --lap_counter;
heh = mesh->cw_rotated_halfedge_handle(heh);
}
@@ -117,11 +117,11 @@ class GenericCirculator_CenterEntityFnsT
class GenericCirculator_CenterEntityFnsT {
public:
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
heh = mesh->prev_halfedge_handle(heh);
if (heh == start) ++lap_counter;
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
if (heh == start) --lap_counter;
heh = mesh->next_halfedge_handle(heh);
}
@@ -171,10 +171,10 @@ class GenericCirculator_ValueHandleFnsT {
}
}
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
GenericCirculator_CenterEntityFnsT::increment(mesh, heh, start, lap_counter);
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
GenericCirculator_CenterEntityFnsT::decrement(mesh, heh, start, lap_counter);
}
};
@@ -426,10 +426,10 @@ class GenericCirculator_ValueHandleFnsT_DEPRECATED {
return ( heh.is_valid() && ((start != heh) || (lap_counter == 0 )) );
}
inline static void init(const Mesh*, typename Mesh::HalfedgeHandle&, typename Mesh::HalfedgeHandle&, int&) {};
- inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void increment(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
GenericCirculator_CenterEntityFnsT::increment(mesh, heh, start, lap_counter);
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
GenericCirculator_CenterEntityFnsT::decrement(mesh, heh, start, lap_counter);
}
};
@@ -442,16 +442,16 @@ class GenericCirculator_ValueHandleFnsT_DEPRECATED::increment(mesh, heh, start, lap_counter);
} while (is_valid(heh, start, lap_counter) && !GenericCirculator_DereferenciabilityCheck::isDereferenciable(mesh, heh));
}
- inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, typename Mesh::HalfedgeHandle &start, int &lap_counter) {
+ inline static void decrement(const Mesh *mesh, typename Mesh::HalfedgeHandle &heh, const typename Mesh::HalfedgeHandle &start, int &lap_counter) {
do {
GenericCirculator_CenterEntityFnsT::decrement(mesh, heh, start, lap_counter);
} while (is_valid(heh, start, lap_counter) && !GenericCirculator_DereferenciabilityCheck::isDereferenciable(mesh, heh));
diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
index 223a5908..9734d254 100644
--- a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
+++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc
@@ -174,7 +174,7 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
// search a free gap
// free gap will be between boundary_prev and boundary_next
outer_prev = opposite_halfedge_handle(inner_next);
- outer_next = opposite_halfedge_handle(inner_prev);
+ //outer_next = opposite_halfedge_handle(inner_prev);
boundary_prev = outer_prev;
do
boundary_prev =
@@ -494,11 +494,8 @@ void PolyConnectivity::delete_vertex(VertexHandle _vh, bool _delete_isolated_ver
// delete collected faces
- std::vector::iterator fh_it(face_handles.begin()),
- fh_end(face_handles.end());
-
- for (; fh_it!=fh_end; ++fh_it)
- delete_face(*fh_it, _delete_isolated_vertices);
+ for (auto delete_fh_it : face_handles)
+ delete_face(delete_fh_it, _delete_isolated_vertices);
status(_vh).set_deleted(true);
}
diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh
index 646b30a4..86c945ed 100644
--- a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh
+++ b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh
@@ -429,7 +429,7 @@ typename PolyMeshT::Normal
PolyMeshT::
calc_normal(EdgeHandle _eh) const
{
- Normal n(0);
+ Normal n(0, 0, 0);
for (int i = 0; i < 2; ++i)
{
const auto heh = this->halfedge_handle(_eh, i);
diff --git a/src/OpenMesh/Core/Utils/PropertyManager.hh b/src/OpenMesh/Core/Utils/PropertyManager.hh
index 93dac7b3..86d5fe3a 100644
--- a/src/OpenMesh/Core/Utils/PropertyManager.hh
+++ b/src/OpenMesh/Core/Utils/PropertyManager.hh
@@ -286,7 +286,7 @@ class PropertyManager {
Storage::swap(rhs, *this);
}
- static bool propertyExists(PolyConnectivity &mesh, const char *propname) {
+ static bool propertyExists(const PolyConnectivity &mesh, const char *propname) {
PROPTYPE dummy;
return mesh.get_property_handle(dummy, propname);
}
diff --git a/src/OpenMesh/Examples/Tutorial04/smooth.cc b/src/OpenMesh/Examples/Tutorial04/smooth.cc
index 3bb7f5aa..201eca7f 100644
--- a/src/OpenMesh/Examples/Tutorial04/smooth.cc
+++ b/src/OpenMesh/Examples/Tutorial04/smooth.cc
@@ -11,14 +11,14 @@
#ifndef DOXY_IGNORE_THIS
-struct MyTraits : public OpenMesh::DefaultTraits
+struct MySmootherExampleTraits : public OpenMesh::DefaultTraits
{
HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge);
};
#endif
-typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
// ----------------------------------------------------------------------------
diff --git a/src/OpenMesh/Examples/Tutorial06/attributes.cc b/src/OpenMesh/Examples/Tutorial06/attributes.cc
index 8d446f72..bf8fe111 100644
--- a/src/OpenMesh/Examples/Tutorial06/attributes.cc
+++ b/src/OpenMesh/Examples/Tutorial06/attributes.cc
@@ -9,7 +9,7 @@
#ifndef DOXY_IGNORE_THIS
// Define my personal traits
-struct MyTraits : OpenMesh::DefaultTraits
+struct MyAttributesExampleTraits : OpenMesh::DefaultTraits
{
// Let Point and Normal be a vector of doubles
typedef OpenMesh::Vec3d Point;
@@ -29,7 +29,7 @@ struct MyTraits : OpenMesh::DefaultTraits
#endif
// Define my mesh with the new traits!
-typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
// ------------------------------------------------------------------ main ----
diff --git a/src/OpenMesh/Examples/Tutorial07/smooth.cc b/src/OpenMesh/Examples/Tutorial07/smooth.cc
index 1710c489..d5cf6ff8 100644
--- a/src/OpenMesh/Examples/Tutorial07/smooth.cc
+++ b/src/OpenMesh/Examples/Tutorial07/smooth.cc
@@ -5,7 +5,7 @@
#include
#include
-struct MyTraits : public OpenMesh::DefaultTraits
+struct MyMeshSmootherExampleTraits : public OpenMesh::DefaultTraits
{
// store barycenter of neighbors in this member
VertexTraits
@@ -21,7 +21,7 @@ struct MyTraits : public OpenMesh::DefaultTraits
};
};
-typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::TriMesh_ArrayKernelT MyMesh;
typedef OpenMesh::TriMesh_ArrayKernelT<> MyMesh2;
// ---------------------------------------------------------------------------
diff --git a/src/OpenMesh/Examples/Tutorial08/delete_geometry.cc b/src/OpenMesh/Examples/Tutorial08/delete_geometry.cc
index 5614bf31..b8daffbc 100644
--- a/src/OpenMesh/Examples/Tutorial08/delete_geometry.cc
+++ b/src/OpenMesh/Examples/Tutorial08/delete_geometry.cc
@@ -49,7 +49,7 @@
// ----------------------------------------------------------------------------
-struct MyTraits : public OpenMesh::DefaultTraits
+struct MyDeleteGeometryExampleTraits : public OpenMesh::DefaultTraits
{
VertexAttributes(OpenMesh::Attributes::Status);
FaceAttributes(OpenMesh::Attributes::Status);
@@ -57,7 +57,7 @@ struct MyTraits : public OpenMesh::DefaultTraits
};
-typedef OpenMesh::PolyMesh_ArrayKernelT MyMesh;
+typedef OpenMesh::PolyMesh_ArrayKernelT MyMesh;
// ----------------------------------------------------------------------------
diff --git a/src/OpenMesh/Examples/Tutorial10/fill_props.hh b/src/OpenMesh/Examples/Tutorial10/fill_props.hh
index 75bed334..a4fc11b8 100644
--- a/src/OpenMesh/Examples/Tutorial10/fill_props.hh
+++ b/src/OpenMesh/Examples/Tutorial10/fill_props.hh
@@ -9,7 +9,7 @@ template
bool
fill_props( Mesh& _m, OpenMesh::VPropHandleT _ph, bool _check=false)
{
- static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
+ const static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
for(typename Mesh::VertexIter it=_m.vertices_begin();
it != _m.vertices_end(); ++it)
@@ -69,10 +69,10 @@ template
bool
fill_props( Mesh& _m, OpenMesh::HPropHandleT _ph, bool _check=false)
{
- static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
- static float b[9] = { 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f };
- static float c[9] = { 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f };
- static float d[9] = { 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f, 3.3f };
+ const static float a[9] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f };
+ const static float b[9] = { 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f };
+ const static float c[9] = { 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f };
+ const static float d[9] = { 4.4f, 5.5f, 6.6f, 7.7f, 8.8f, 9.9f, 1.1f, 2.2f, 3.3f };
// static double values[9] = { 0.1, 0.02, 0.003, 0.0004, 0.00005, 0.000006,
// 0.0000007, 0.00000008, 0.000000009 };
diff --git a/src/OpenMesh/Examples/Tutorial10/int2roman.cc b/src/OpenMesh/Examples/Tutorial10/int2roman.cc
index b0cb5a19..89e03478 100644
--- a/src/OpenMesh/Examples/Tutorial10/int2roman.cc
+++ b/src/OpenMesh/Examples/Tutorial10/int2roman.cc
@@ -27,12 +27,10 @@ std::string int2roman( size_t decimal, size_t length )
size_t power; // power of ten
size_t index; // Indexes thru values to subtract
- std::string roman;
+ std::string roman('\0');
roman.reserve(length);
- roman[ 0 ] = '\0';
-
for ( power = 0; power < nrows; power++ )
for ( index = 0; index < ncols; index++ )
while ( decimal >= table_arabs[ power ][ index ] )
diff --git a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh
index ac15b0a0..ddd3f71d 100644
--- a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.hh
@@ -88,7 +88,7 @@ class ModAspectRatioT: public ModBaseT {
typedef typename Mesh::Point Point;
/// constructor
- ModAspectRatioT(MeshT& _mesh, float _min_aspect = 5.0, bool _is_binary =
+ explicit ModAspectRatioT(MeshT& _mesh, float _min_aspect = 5.0, bool _is_binary =
true) :
Base(_mesh, _is_binary), mesh_(Base::mesh()), min_aspect_(
1.f / _min_aspect) {
diff --git a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh
index e21b3223..cd21bfdb 100644
--- a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT.hh
@@ -79,7 +79,7 @@ class ModEdgeLengthT: public ModBaseT {
;
/// Constructor
- ModEdgeLengthT(MeshT& _mesh, float _edge_length = FLT_MAX,
+ explicit ModEdgeLengthT(MeshT& _mesh, float _edge_length = FLT_MAX,
bool _is_binary = true);
/// get edge_length
diff --git a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh
index 4fbfd5fb..3b64ea73 100644
--- a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh
+++ b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh
@@ -85,8 +85,8 @@ void ModEdgeLengthT::set_error_tolerance_factor(double _factor) {
// the smaller the factor, the smaller edge_length_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
- typename Mesh::Scalar edge_length = edge_length_ * static_cast(_factor / this->error_tolerance_factor_);
- set_edge_length(edge_length);
+ typename Mesh::Scalar new_edge_length = edge_length_ * static_cast(_factor / this->error_tolerance_factor_);
+ set_edge_length(new_edge_length);
this->error_tolerance_factor_ = _factor;
}
}
diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh
index 12b046c5..4f16f623 100644
--- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.hh
@@ -87,7 +87,7 @@ class ModHausdorffT: public ModBaseT {
typedef std::vector Points;
/// Constructor
- ModHausdorffT(MeshT& _mesh, Scalar _error_tolerance = FLT_MAX) :
+ explicit ModHausdorffT(MeshT& _mesh, Scalar _error_tolerance = FLT_MAX) :
Base(_mesh, true), mesh_(Base::mesh()), tolerance_(_error_tolerance) {
mesh_.add_property(points_);
}
diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh
index 5df959da..af310721 100644
--- a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh
+++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh
@@ -267,8 +267,8 @@ void ModHausdorffT::set_error_tolerance_factor(double _factor) {
// the smaller the factor, the smaller tolerance gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
- Scalar tolerance = tolerance_ * Scalar(_factor / this->error_tolerance_factor_);
- set_tolerance(tolerance);
+ Scalar new_tolerance = tolerance_ * Scalar(_factor / this->error_tolerance_factor_);
+ set_tolerance(new_tolerance);
this->error_tolerance_factor_ = _factor;
}
}
diff --git a/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh b/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
index fbeb0266..d3407bf6 100644
--- a/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
@@ -86,10 +86,6 @@ class ModIndependentSetsT: public ModBaseT {
Base::mesh().status(*vv_it).set_locked(true);
}
- private:
-
- /// hide this method
- void set_binary(bool _b) { }
};
//=============================================================================
diff --git a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
index f40be046..c6c0142b 100644
--- a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
@@ -104,7 +104,7 @@ public:
public:
/// Constructor
- ModNormalDeviationT(MeshT& _mesh, float _max_dev = 180.0)
+ explicit ModNormalDeviationT(MeshT& _mesh, float _max_dev = 180.0)
: Base(_mesh, true), mesh_(Base::mesh())
{
set_normal_deviation(_max_dev);
diff --git a/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh b/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
index 47bb7549..7a1610f8 100644
--- a/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
@@ -181,11 +181,6 @@ public:
min_cos_ = cos(max_deviation_);
}
-private:
-
- // hide this method
- void set_binary(bool _b) {}
-
private:
// maximum normal deviation
diff --git a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh
index a8a10840..0906804f 100644
--- a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh
+++ b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh
@@ -171,9 +171,6 @@ public: // specific methods
private:
- // hide this method form user
- void set_binary(bool _b) {}
-
InfoList pmi_;
VPropHandleT idx_;
};
diff --git a/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh b/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh
index cabbe7c5..718ca0a8 100644
--- a/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh
+++ b/src/OpenMesh/Tools/Decimater/ModQuadricT_impl.hh
@@ -139,8 +139,8 @@ void ModQuadricT::set_error_tolerance_factor(double _factor) {
// the smaller the factor, the smaller max_err_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
- double max_err = max_err_ * _factor / this->error_tolerance_factor_;
- set_max_err(max_err);
+ double new_max_err = max_err_ * _factor / this->error_tolerance_factor_;
+ set_max_err(new_max_err);
this->error_tolerance_factor_ = _factor;
initialize();
diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
index 3444f424..30554355 100644
--- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
+++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
@@ -106,10 +106,10 @@ struct CompositeTraits : public OpenMesh::DefaultTraits
void set_green() {red_ = 0; }
bool is_red() { return red_; }
bool is_green() { return !red_; }
- void set_red_halfedge_handle(HalfedgeHandle& _heh)
+ void set_red_halfedge_handle(const HalfedgeHandle& _heh)
{ red_halfedge_handle_ = _heh; }
HalfedgeHandle& red_halfedge_handle() { return red_halfedge_handle_; }
- void set_quality(Scalar& _q) { quality_ = _q; }
+ void set_quality(const Scalar& _q) { quality_ = _q; }
Scalar& quality() { return quality_; }
const Point& midpoint() const { return midpoint_; }
void set_midpoint(const Point& _p) { midpoint_ = _p; }
diff --git a/src/OpenMesh/Tools/Utils/Gnuplot.cc b/src/OpenMesh/Tools/Utils/Gnuplot.cc
index 88e91607..bf852619 100644
--- a/src/OpenMesh/Tools/Utils/Gnuplot.cc
+++ b/src/OpenMesh/Tools/Utils/Gnuplot.cc
@@ -126,7 +126,7 @@ Gnuplot::Gnuplot(const string &style)
Gnuplot::Gnuplot(const string &title,
const string &style,
const string &labelx, const string &labely,
- vector x, vector y)
+ const vector& x, const vector& y)
{
init();
@@ -157,7 +157,7 @@ Gnuplot::Gnuplot(const string &title,
Gnuplot::Gnuplot(const string &title, const string &style,
const string &labelx, const string &labely,
- vector x)
+ const vector& x)
{
init();
@@ -349,7 +349,7 @@ void Gnuplot::plot_equation(const string &equation, const string &title)
// ----------------------------------------------------------------------------
-void Gnuplot::plot_x(vector d, const string &title)
+void Gnuplot::plot_x(const vector& d, const string &title)
{
ofstream tmp;
ostringstream cmdstr;
@@ -418,7 +418,7 @@ void Gnuplot::plot_x(vector d, const string &title)
// ----------------------------------------------------------------------------
-void Gnuplot::plot_xy(vector x, vector y, const string &title)
+void Gnuplot::plot_xy(const vector& x, const vector& y, const string &title)
{
ofstream tmp;
ostringstream cmdstr;
diff --git a/src/OpenMesh/Tools/Utils/Gnuplot.hh b/src/OpenMesh/Tools/Utils/Gnuplot.hh
index faf2e50c..0f6599e4 100644
--- a/src/OpenMesh/Tools/Utils/Gnuplot.hh
+++ b/src/OpenMesh/Tools/Utils/Gnuplot.hh
@@ -120,14 +120,14 @@ public:
const string & _style,
const string & _xlabel,
const string & _ylabel,
- vector _x, vector _y);
+ const vector& _x, const vector& _y);
/// Constructor calling plot_x().
Gnuplot(const string &_title,
const string &_style,
const string &_xlabel,
const string &_ylabel,
- vector _x);
+ const vector& _x);
//@}
~Gnuplot();
@@ -146,10 +146,10 @@ public:
//@{
/// Plot a single vector
- void plot_x(vector _x, const string &_title);
+ void plot_x(const vector& _x, const string &_title);
/// Plot x,y pairs
- void plot_xy(vector _x, vector _y, const string &_title);
+ void plot_xy(const vector& _x, const vector& _y, const string &_title);
/// Plot an equation of the form: y = ax + b
/// You supply a and b
diff --git a/src/OpenMesh/Tools/Utils/HeapT.hh b/src/OpenMesh/Tools/Utils/HeapT.hh
index 817464ea..78d1728d 100644
--- a/src/OpenMesh/Tools/Utils/HeapT.hh
+++ b/src/OpenMesh/Tools/Utils/HeapT.hh
@@ -146,8 +146,8 @@ public:
HeapT() : HeapVector() {}
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
- /// Construct with a given \c HeapIterface.
- HeapT(HeapInterface _interface)
+ /// Construct with a given \c HeapIterface.
+ explicit HeapT(HeapInterface _interface)
: HeapVector(), interface_(std::move(_interface))
{}
#else
diff --git a/src/OpenMesh/Tools/Utils/MeshCheckerT_impl.hh b/src/OpenMesh/Tools/Utils/MeshCheckerT_impl.hh
index f723194a..8a32c648 100644
--- a/src/OpenMesh/Tools/Utils/MeshCheckerT_impl.hh
+++ b/src/OpenMesh/Tools/Utils/MeshCheckerT_impl.hh
@@ -95,7 +95,7 @@ check(unsigned int _targets, std::ostream& _os)
}
}
if (heh.is_valid()) {
- if (heh.idx() < -1 || heh.idx() >= mesh_.n_halfedges()) {
+ if (heh.idx() < -1 || heh.idx() >= (int)mesh_.n_halfedges()) {
_os << "MeshChecker: vertex " << vh
<< " has out-of-bounds outgoing HE: " << heh;
ok = false;
@@ -147,8 +147,8 @@ check(unsigned int _targets, std::ostream& _os)
{
typename Mesh::ConstHalfedgeIter h_it(mesh_.halfedges_begin()),
h_end(mesh_.halfedges_end());
- typename Mesh::HalfedgeHandle hh, hstart, hhh;
- size_t count, n_halfedges = 2*mesh_.n_edges();
+ typename Mesh::HalfedgeHandle hstart, hhh;
+ size_t n_halfedges = 2*mesh_.n_edges();
for (const auto hh: mesh_.halfedges())
{
@@ -193,7 +193,7 @@ check(unsigned int _targets, std::ostream& _os)
// halfedges should form a cycle
- count=0; hstart=hhh=hh;
+ size_t count=0; hstart=hhh=hh;
do
{
hhh = mesh_.next_halfedge_handle(hhh);
@@ -217,7 +217,6 @@ check(unsigned int _targets, std::ostream& _os)
{
typename Mesh::ConstFaceIter f_it(mesh_.faces_begin()),
f_end(mesh_.faces_end());
- typename Mesh::FaceHandle fh;
typename Mesh::ConstFaceHalfedgeIter fh_it;
for(const auto fh: mesh_.faces()) {
diff --git a/src/OpenMesh/Tools/Utils/Timer.cc b/src/OpenMesh/Tools/Utils/Timer.cc
index e686fb78..37b85b05 100644
--- a/src/OpenMesh/Tools/Utils/Timer.cc
+++ b/src/OpenMesh/Tools/Utils/Timer.cc
@@ -111,7 +111,9 @@ TimerImplWin32::TimerImplWin32(void)
{
if (QueryPerformanceFrequency(&freq_)==FALSE)
throw std::runtime_error("Performance counter of of stock!");
- reset();
+
+ memset(&count_,0,sizeof(count_));
+ memset(&start_,0,sizeof(count_));
}
void TimerImplWin32::reset(void)
@@ -231,7 +233,7 @@ static const unsigned long clockticks = CLOCKS_PER_SEC;
class TimerImplStd : public TimerImpl
{
public:
- TimerImplStd() : freq_(clockticks),count_(0),start_(0) { reset(); }
+ TimerImplStd() : freq_(clockticks),count_(0),start_(0) { }
~TimerImplStd() { ; }
virtual void reset(void) override { count_ = 0; }
diff --git a/src/OpenMesh/Tools/VDPM/VHierarchy.cc b/src/OpenMesh/Tools/VDPM/VHierarchy.cc
index 6e59b944..02a0a5cf 100644
--- a/src/OpenMesh/Tools/VDPM/VHierarchy.cc
+++ b/src/OpenMesh/Tools/VDPM/VHierarchy.cc
@@ -99,16 +99,16 @@ add_node(const VHierarchyNode &_node)
void
VHierarchy::
-make_children(VHierarchyNodeHandle &_parent_handle)
+make_children(const VHierarchyNodeHandle &_parent_handle)
{
- VHierarchyNodeHandle lchild_handle = add_node();
- VHierarchyNodeHandle rchild_handle = add_node();
+ VHierarchyNodeHandle new_lchild_handle = add_node();
+ VHierarchyNodeHandle new_rchild_handle = add_node();
VHierarchyNode &parent = node(_parent_handle);
- VHierarchyNode &lchild = node(lchild_handle);
- VHierarchyNode &rchild = node(rchild_handle);
+ VHierarchyNode &lchild = node(new_lchild_handle);
+ VHierarchyNode &rchild = node(new_rchild_handle);
- parent.set_children_handle(lchild_handle);
+ parent.set_children_handle(new_lchild_handle);
lchild.set_parent_handle(_parent_handle);
rchild.set_parent_handle(_parent_handle);
diff --git a/src/OpenMesh/Tools/VDPM/VHierarchy.hh b/src/OpenMesh/Tools/VDPM/VHierarchy.hh
index b512b2d7..1356a7ce 100644
--- a/src/OpenMesh/Tools/VDPM/VHierarchy.hh
+++ b/src/OpenMesh/Tools/VDPM/VHierarchy.hh
@@ -119,7 +119,7 @@ public:
VHierarchyNodeHandle add_node();
VHierarchyNodeHandle add_node(const VHierarchyNode &_node);
- void make_children(VHierarchyNodeHandle &_parent_handle);
+ void make_children(const VHierarchyNodeHandle &_parent_handle);
bool is_ancestor(VHierarchyNodeIndex _ancestor_index,
VHierarchyNodeIndex _descendent_index);