Commit e75a7077 authored by Jan Möbius's avatar Jan Möbius

Next bunch of warning fixes

parent 85e183ae
Pipeline #3520 failed with stage
in 7 minutes and 15 seconds
......@@ -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<Scalar>(1.0) / d;
// these are not needed for every point, should still perform
// better with many points against one triangle
......
......@@ -229,17 +229,17 @@ Tvv3<M>::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<typename M::Point::value_type>(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<typename M::Point::value_type>(2.0) + Base::mesh_.point(vh0)) / static_cast<typename M::Point::value_type>(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<typename M::Point::value_type>(3.0) );
MOBJ(vh3).set_state(_target_state);
MOBJ(vh3).set_not_final();
......@@ -326,7 +326,7 @@ void Tvv3<M>::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<typename M::Point::value_type>(3.0) );
MOBJ(_vh).inc_state();
......@@ -2004,7 +2004,7 @@ EdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
// choose coefficient c
c = Base::coeff();
position *= (1.0 - c);
position *= (static_cast<M:Scalar>(1.0) - c);
position += MOBJ(_eh).position(_target_state - 1) * c;
......
......@@ -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)
if ( _m.is_boundary( *ve_itr))
pos += _m.property( ep_pos_, *ve_itr);
pos /= static_cast<MeshType::Point::value_type>(3.0);
pos /= static_cast<typename MeshType::Point::value_type>(3.0);
}
else // inner vertex
{
......
......@@ -116,7 +116,7 @@ void CompositeT<MeshType,RealType>::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<MeshType::Point::value_type>(3.0) );
mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * static_cast<typename MeshType::Point::value_type>(3.0) );
++v_it;
}
......@@ -180,7 +180,7 @@ void CompositeT<MeshType,RealType>::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<MeshType::Point::value_type>(4.0) );
mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * static_cast<typename MeshType::Point::value_type>(4.0) );
++v_it;
}
......@@ -1250,7 +1250,7 @@ CompositeT<MeshType,RealType>::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<MeshType::Point::value_type>(2.0) );
vh = mesh_.add_vertex((mesh_.point(vh2) + mesh_.point(vh1)) / static_cast<typename MeshType::Point::value_type>(2.0) );
// Re-Set Handles
heh2 = mesh_.opposite_halfedge_handle(_heh);
......
......@@ -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<mesh_t::Point::value_type>(0.5);
midP *= static_cast<typename mesh_t::Point::value_type>(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<MeshType::Point::value_type>(0.5);
pos *= static_cast<typename MeshType::Point::value_type>(0.5);
}
else // inner edge: add neighbouring Vertices to sum
{
......
......@@ -390,7 +390,7 @@ private: // geometry helper
{
pos = _m.point(a_0);
pos += _m.point(a_1);
pos *= static_cast<mesh_t::Point::value_type>(9.0/16.0);
pos *= static_cast<typename mesh_t::Point::value_type>(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<mesh_t::Point::value_type>(-1.0/16.0);
tpos *= static_cast<typename mesh_t::Point::value_type>(-1.0/16.0);
pos += tpos;
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment