From 85e183ae05f7d13689bdba8aaf5d2a4ac34595a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 7 Nov 2016 14:12:29 +0100 Subject: [PATCH] Fixed VS2015 warnings --- src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc | 2 +- .../Tools/Subdivider/Uniform/Composite/CompositeT.cc | 6 +++--- src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh | 4 ++-- .../Tools/Subdivider/Uniform/ModifiedButterFlyT.hh | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc index ec7a9682..ad2f4ab8 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc @@ -346,7 +346,7 @@ CatmullClarkT::update_vertex( MeshType& _m, const VertexHandl for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr) if ( _m.is_boundary( *ve_itr)) pos += _m.property( ep_pos_, *ve_itr); - pos /= 3.0; + pos /= static_cast(3.0); } else // inner vertex { diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc index 2258cf6e..947cda81 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc @@ -116,7 +116,7 @@ void CompositeT::Tvv3() // set new positions for vertices v_it = mesh_.vertices_begin(); for (j = 0; j < n_vertices; ++j) { - mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * 3.0); + mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * static_cast(3.0) ); ++v_it; } @@ -180,7 +180,7 @@ void CompositeT::Tvv4() // set new positions for vertices v_it = mesh_.vertices_begin(); for (j = 0; j < n_vertices; ++j) { - mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * 4.0); + mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * static_cast(4.0) ); ++v_it; } @@ -1250,7 +1250,7 @@ CompositeT::split_edge(HalfedgeHandle _heh) vh2(mesh_.from_vertex_handle(_heh)); // Calculate and Insert Midpoint of Edge - vh = mesh_.add_vertex((mesh_.point(vh2) + mesh_.point(vh1)) / 2.0); + vh = mesh_.add_vertex((mesh_.point(vh2) + mesh_.point(vh1)) / static_cast(2.0) ); // Re-Set Handles heh2 = mesh_.opposite_halfedge_handle(_heh); diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh index 7dddf622..36535e94 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh @@ -326,7 +326,7 @@ private: // topological modifiers typename mesh_t::VertexHandle vh1(_m.to_vertex_handle(heh)); typename mesh_t::Point midP(_m.point(_m.to_vertex_handle(heh))); midP += _m.point(_m.to_vertex_handle(opp_heh)); - midP *= 0.5; + midP *= static_cast(0.5); // new vertex vh = _m.new_vertex( midP ); @@ -394,7 +394,7 @@ private: // geometry helper // boundary edge: just average vertex positions if (_m.is_boundary(_eh) ) { - pos *= 0.5; + pos *= static_cast(0.5); } else // inner edge: add neighbouring Vertices to sum { diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh index 734b8e0f..bc80453c 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh @@ -150,7 +150,7 @@ public: { weights[K].resize(K+1); // s(j) = ( 1/4 + cos(2*pi*j/K) + 1/2 * cos(4*pi*j/K) )/K - real_t invK = 1.0/real_t(K); + real_t invK = static_cast(1.0)/real_t(K); real_t sum = 0; for(unsigned int j=0; j(9.0/16.0); typename mesh_t::Point tpos; if(_m.is_boundary(heh)) { @@ -403,7 +403,7 @@ private: // geometry helper tpos = _m.point(_m.to_vertex_handle(_m.next_halfedge_handle(opp_heh))); tpos += _m.point(_m.to_vertex_handle(_m.opposite_halfedge_handle(_m.prev_halfedge_handle(opp_heh)))); } - tpos *= -1.0/16; + tpos *= static_cast(-1.0/16.0); pos += tpos; } else @@ -506,7 +506,7 @@ private: // geometry helper } else //at least one endpoint is [irregular and not in boundary] { - double normFactor = 0.0; + typename mesh_t::Point::value_type normFactor = static_cast(0.0); if(valence_a_0!=6 && !_m.is_boundary(a_0)) {