Fixed VS2015 warnings

This commit is contained in:
Jan Möbius
2016-11-07 14:12:29 +01:00
parent bb75d7029f
commit 85e183ae05
4 changed files with 10 additions and 10 deletions

View File

@@ -346,7 +346,7 @@ CatmullClarkT<MeshType,RealType>::update_vertex( MeshType& _m, const VertexHandl
for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr) for ( ve_itr = _m.ve_iter( _vh); ve_itr.is_valid(); ++ve_itr)
if ( _m.is_boundary( *ve_itr)) if ( _m.is_boundary( *ve_itr))
pos += _m.property( ep_pos_, *ve_itr); pos += _m.property( ep_pos_, *ve_itr);
pos /= 3.0; pos /= static_cast<MeshType::Point::value_type>(3.0);
} }
else // inner vertex else // inner vertex
{ {

View File

@@ -116,7 +116,7 @@ void CompositeT<MeshType,RealType>::Tvv3()
// set new positions for vertices // set new positions for vertices
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
for (j = 0; j < n_vertices; ++j) { 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<MeshType::Point::value_type>(3.0) );
++v_it; ++v_it;
} }
@@ -180,7 +180,7 @@ void CompositeT<MeshType,RealType>::Tvv4()
// set new positions for vertices // set new positions for vertices
v_it = mesh_.vertices_begin(); v_it = mesh_.vertices_begin();
for (j = 0; j < n_vertices; ++j) { 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<MeshType::Point::value_type>(4.0) );
++v_it; ++v_it;
} }
@@ -1250,7 +1250,7 @@ CompositeT<MeshType,RealType>::split_edge(HalfedgeHandle _heh)
vh2(mesh_.from_vertex_handle(_heh)); vh2(mesh_.from_vertex_handle(_heh));
// Calculate and Insert Midpoint of Edge // 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<MeshType::Point::value_type>(2.0) );
// Re-Set Handles // Re-Set Handles
heh2 = mesh_.opposite_halfedge_handle(_heh); heh2 = mesh_.opposite_halfedge_handle(_heh);

View File

@@ -326,7 +326,7 @@ private: // topological modifiers
typename mesh_t::VertexHandle vh1(_m.to_vertex_handle(heh)); typename mesh_t::VertexHandle vh1(_m.to_vertex_handle(heh));
typename mesh_t::Point midP(_m.point(_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 += _m.point(_m.to_vertex_handle(opp_heh));
midP *= 0.5; midP *= static_cast<mesh_t::Point::value_type>(0.5);
// new vertex // new vertex
vh = _m.new_vertex( midP ); vh = _m.new_vertex( midP );
@@ -394,7 +394,7 @@ private: // geometry helper
// boundary edge: just average vertex positions // boundary edge: just average vertex positions
if (_m.is_boundary(_eh) ) if (_m.is_boundary(_eh) )
{ {
pos *= 0.5; pos *= static_cast<MeshType::Point::value_type>(0.5);
} }
else // inner edge: add neighbouring Vertices to sum else // inner edge: add neighbouring Vertices to sum
{ {

View File

@@ -150,7 +150,7 @@ public:
{ {
weights[K].resize(K+1); weights[K].resize(K+1);
// s(j) = ( 1/4 + cos(2*pi*j/K) + 1/2 * cos(4*pi*j/K) )/K // 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<real_t>(1.0)/real_t(K);
real_t sum = 0; real_t sum = 0;
for(unsigned int j=0; j<K; ++j) for(unsigned int j=0; j<K; ++j)
{ {
@@ -390,7 +390,7 @@ private: // geometry helper
{ {
pos = _m.point(a_0); pos = _m.point(a_0);
pos += _m.point(a_1); pos += _m.point(a_1);
pos *= 9.0/16; pos *= static_cast<mesh_t::Point::value_type>(9.0/16.0);
typename mesh_t::Point tpos; typename mesh_t::Point tpos;
if(_m.is_boundary(heh)) 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.next_halfedge_handle(opp_heh)));
tpos += _m.point(_m.to_vertex_handle(_m.opposite_halfedge_handle(_m.prev_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<mesh_t::Point::value_type>(-1.0/16.0);
pos += tpos; pos += tpos;
} }
else else
@@ -506,7 +506,7 @@ private: // geometry helper
} }
else //at least one endpoint is [irregular and not in boundary] else //at least one endpoint is [irregular and not in boundary]
{ {
double normFactor = 0.0; typename mesh_t::Point::value_type normFactor = static_cast<typename mesh_t::Point::value_type>(0.0);
if(valence_a_0!=6 && !_m.is_boundary(a_0)) if(valence_a_0!=6 && !_m.is_boundary(a_0))
{ {