diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh index 02d97139..deb9600a 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh @@ -77,7 +77,7 @@ public: public: /// default constructor - MeshViewerWidgetT(QWidget* _parent=0) + explicit MeshViewerWidgetT(QWidget* _parent=0) : QGLViewerWidget(_parent), f_strips_(false), tex_id_(0), @@ -85,7 +85,8 @@ public: strips_(mesh_), use_color_(true), show_vnormals_(false), - show_fnormals_(false) + show_fnormals_(false), + normal_scale_(1.0) { add_draw_mode("Points"); add_draw_mode("Hidden-Line"); diff --git a/src/OpenMesh/Core/IO/IOManager.hh b/src/OpenMesh/Core/IO/IOManager.hh index fea9e46e..ce958c79 100644 --- a/src/OpenMesh/Core/IO/IOManager.hh +++ b/src/OpenMesh/Core/IO/IOManager.hh @@ -147,7 +147,7 @@ public: bool write(const std::string& _filename, BaseExporter& _be, Options _opt=Options::Default, - std::streamsize _precision = 6); + std::streamsize _precision = 6); /** Write a mesh to open std::ostream _os. The source data structure is specified by the given BaseExporter. The \c save method consecutively queries all @@ -159,7 +159,7 @@ public: const std::string& _ext, BaseExporter& _be, Options _opt=Options::Default, - std::streamsize _precision = 6); + std::streamsize _precision = 6); /// Returns true if the format is supported by one of the reader modules. diff --git a/src/OpenMesh/Core/IO/reader/OBJReader.cc b/src/OpenMesh/Core/IO/reader/OBJReader.cc index 78df8a1b..bdefcd7d 100644 --- a/src/OpenMesh/Core/IO/reader/OBJReader.cc +++ b/src/OpenMesh/Core/IO/reader/OBJReader.cc @@ -135,13 +135,13 @@ read(const std::string& _filename, BaseImporter& _bi, Options& _opt) { #if defined(WIN32) - std::string::size_type dot = _filename.find_last_of("\\/"); + std::string::size_type dot_pos = _filename.find_last_of("\\/"); #else - std::string::size_type dot = _filename.rfind("/"); + std::string::size_type dot_pos = _filename.rfind("/"); #endif - path_ = (dot == std::string::npos) + path_ = (dot_pos == std::string::npos) ? "./" - : std::string(_filename.substr(0,dot+1)); + : std::string(_filename.substr(0,dot_pos+1)); } bool result = read(in, _bi, _opt); diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc index c949066b..019aea89 100644 --- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc @@ -206,7 +206,7 @@ _OBJWriter_:: write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const { unsigned int idx; - size_t i, j,nV, nF; + size_t nV, nF; Vec3f v, n; Vec2f t; VertexHandle vh; @@ -273,7 +273,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec std::vector texCoords; //add all texCoords to map unsigned int num = _be.get_face_texcoords(texCoords); - for(unsigned int i = 0; i < num ; ++i) + for(size_t i = 0; i < num ; ++i) { texMap[texCoords[i]] = i; } @@ -303,7 +303,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec } // vertex data (point, normals, texcoords) - for (i=0, nV=_be.n_vertices(); i - PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT & t) + explicit PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT & t) { //assign the connectivity and standard properties this->assign(t, true); diff --git a/src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh b/src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh index 2040be05..21d1654c 100644 --- a/src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh +++ b/src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh @@ -97,7 +97,7 @@ class TriMesh_ArrayKernelT public: TriMesh_ArrayKernelT() {} template - TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT & t) + explicit TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT & t) { //assign the connectivity and standard properties this->assign(t,true); diff --git a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh index 5d1c3c65..43c02982 100644 --- a/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh +++ b/src/OpenMesh/Tools/Decimater/ModProgMeshT.hh @@ -90,7 +90,7 @@ public: { /// Initializing constructor copies appropriate handles from /// collapse information \c _ci. - Info( const CollapseInfo& _ci ) + explicit Info( const CollapseInfo& _ci ) : v0(_ci.v0), v1(_ci.v1), vl(_ci.vl),vr(_ci.vr) {} @@ -108,7 +108,7 @@ public: public: /// Constructor - ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true) + explicit ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true) { Base::mesh().add_property( idx_ ); } diff --git a/src/OpenMesh/Tools/Smoother/LaplaceSmootherT_impl.hh b/src/OpenMesh/Tools/Smoother/LaplaceSmootherT_impl.hh index 780ff09f..8e53e912 100644 --- a/src/OpenMesh/Tools/Smoother/LaplaceSmootherT_impl.hh +++ b/src/OpenMesh/Tools/Smoother/LaplaceSmootherT_impl.hh @@ -134,7 +134,6 @@ compute_weights(LaplaceWeighting _weighting) typename Mesh::EdgeIter e_it, e_end(Base::mesh_.edges_end()); typename Mesh::HalfedgeHandle heh0, heh1, heh2; typename Mesh::VertexHandle v0, v1; - const typename Mesh::Point *p0, *p1, *p2; typename Mesh::Normal d0, d1; typename Mesh::Scalar weight, lb(-1.0), ub(1.0); @@ -171,7 +170,9 @@ compute_weights(LaplaceWeighting _weighting) case CotWeighting: { for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it) - { + { + const typename Mesh::Point *p0, *p1, *p2; + weight = 0.0; heh0 = Base::mesh_.halfedge_handle(*e_it, 0); diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CompositeLoopT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/CompositeLoopT.hh index 624760a1..f8266fd2 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CompositeLoopT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CompositeLoopT.hh @@ -82,7 +82,7 @@ public: public: CompositeLoopT() : Inherited() {}; - CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {}; + explicit CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {}; ~CompositeLoopT() {} public: diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CompositeSqrt3T.hh b/src/OpenMesh/Tools/Subdivider/Uniform/CompositeSqrt3T.hh index ed1030e2..bcc72002 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CompositeSqrt3T.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CompositeSqrt3T.hh @@ -82,7 +82,7 @@ public: public: CompositeSqrt3T() : Inherited() {}; - CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {}; + explicit CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {}; ~CompositeSqrt3T() {} public: diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh index 1c92502e..f1d113b8 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh @@ -106,7 +106,7 @@ public: { init_weights(); } - LoopT( mesh_t& _m ) : parent_t(_m), _1over8( 1.0/8.0 ), _3over8( 3.0/8.0 ) + explicit LoopT( mesh_t& _m ) : parent_t(_m), _1over8( 1.0/8.0 ), _3over8( 3.0/8.0 ) { init_weights(); } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh index c437e1e9..a9927f93 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh @@ -107,7 +107,7 @@ public: { init_weights(); } - ModifiedButterflyT( mesh_t& _m) : parent_t(_m) + explicit ModifiedButterflyT( mesh_t& _m) : parent_t(_m) { init_weights(); } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh index 70dca4db..6330797e 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh @@ -119,7 +119,7 @@ public: InterpolatingSqrt3LGT(void) : parent_t() { init_weights(); } - InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m) + explicit InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m) { init_weights(); } virtual ~InterpolatingSqrt3LGT() {} diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh index aacb2083..9e793184 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh @@ -112,7 +112,7 @@ public: Sqrt3T(void) : parent_t(), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) ) { init_weights(); } - Sqrt3T(MeshType &_m) : parent_t(_m), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) ) + explicit Sqrt3T(MeshType &_m) : parent_t(_m), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) ) { init_weights(); } virtual ~Sqrt3T() {}