From e75a70774d2c2fea4a1e2ad9fd3d9ae1130d6f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 7 Nov 2016 14:30:14 +0100 Subject: [PATCH] Next bunch of warning fixes --- src/OpenMesh/Tools/Decimater/ModHausdorffT.cc | 2 +- .../Tools/Subdivider/Adaptive/Composite/RulesT.cc | 10 +++++----- 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 | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc index 44dd1709..3701a461 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc @@ -89,7 +89,7 @@ distPointTriangleSquared( const Point& _p, if (d < FLT_MIN && d > -FLT_MIN) { return -1.0; } - const double invD = 1.0 / d; + const Scalar invD = static_cast(1.0) / d; // these are not needed for every point, should still perform // better with many points against one triangle diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc index 2ff22979..23364fc8 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc @@ -229,17 +229,17 @@ Tvv3::raise(typename M::FaceHandle& _fh, state_t _target_state) MOBJ(vh1).set_state(_target_state); MOBJ(vh1).set_not_final(); - MOBJ(vh0).set_position(_target_state, MOBJ(vh0).position(_target_state - 1) * 3.0); + MOBJ(vh0).set_position(_target_state, MOBJ(vh0).position(_target_state - 1) * static_cast(3.0)); MOBJ(vh0).set_state(_target_state); MOBJ(vh0).set_not_final(); // set display position and attributes for old vertices - Base::mesh_.set_point(vh2, (Base::mesh_.point(vh3) * 2.0 + Base::mesh_.point(vh0)) / 3.0); + Base::mesh_.set_point(vh2, (Base::mesh_.point(vh3) * static_cast(2.0) + Base::mesh_.point(vh0)) / static_cast(3.0) ); MOBJ(vh2).set_position(_target_state, zero_point); MOBJ(vh2).set_state(_target_state); MOBJ(vh2).set_not_final(); - MOBJ(vh3).set_position(_target_state, MOBJ(vh3).position(_target_state - 1) * 3.0); + MOBJ(vh3).set_position(_target_state, MOBJ(vh3).position(_target_state - 1) * static_cast(3.0) ); MOBJ(vh3).set_state(_target_state); MOBJ(vh3).set_not_final(); @@ -326,7 +326,7 @@ void Tvv3::raise(typename M::VertexHandle& _vh, state_t _target_state) { this->update(_vh, _target_state); // multiply old position by 3 - MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 3.0); + MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * static_cast(3.0) ); MOBJ(_vh).inc_state(); @@ -2004,7 +2004,7 @@ EdEc::raise(typename M::EdgeHandle& _eh, state_t _target_state) // choose coefficient c c = Base::coeff(); - position *= (1.0 - c); + position *= (static_cast(1.0) - c); position += MOBJ(_eh).position(_target_state - 1) * c; diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc index ad2f4ab8..712ddb51 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 /= static_cast(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 947cda81..167c9895 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() * static_cast(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() * static_cast(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)) / static_cast(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 36535e94..ea767d5a 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 *= static_cast(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 *= static_cast(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 bc80453c..19f7812f 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh @@ -390,7 +390,7 @@ private: // geometry helper { pos = _m.point(a_0); pos += _m.point(a_1); - pos *= static_cast(9.0/16.0); + pos *= static_cast(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 *= static_cast(-1.0/16.0); + tpos *= static_cast(-1.0/16.0); pos += tpos; } else