Commit a1617b1b authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed various warnings

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1208 fdac6126-5c0c-442c-9429-916003d36597
parent 38aa3924
...@@ -268,9 +268,9 @@ void SubdivideWidget::keyPressEvent( QKeyEvent *k ) ...@@ -268,9 +268,9 @@ void SubdivideWidget::keyPressEvent( QKeyEvent *k )
void SubdivideWidget::update() void SubdivideWidget::update()
{ {
unsigned int n_faces = viewer_widget_->mesh().n_faces(); size_t n_faces = viewer_widget_->mesh().n_faces();
unsigned int n_edges = viewer_widget_->mesh().n_edges(); size_t n_edges = viewer_widget_->mesh().n_edges();
unsigned int n_vertices = viewer_widget_->mesh().n_vertices(); size_t n_vertices = viewer_widget_->mesh().n_vertices();
QString message(""), temp; QString message(""), temp;
message.append(temp.setNum(n_faces)); message.append(temp.setNum(n_faces));
message.append(" Faces, "); message.append(" Faces, ");
......
...@@ -102,7 +102,7 @@ void ModAspectRatioT<MeshT>::initialize() { ...@@ -102,7 +102,7 @@ void ModAspectRatioT<MeshT>::initialize() {
typename Mesh::Point& p1 = mesh_.point(*(++fv_it)); typename Mesh::Point& p1 = mesh_.point(*(++fv_it));
typename Mesh::Point& p2 = mesh_.point(*(++fv_it)); typename Mesh::Point& p2 = mesh_.point(*(++fv_it));
mesh_.property(aspect_, *f_it) = 1.0 / aspectRatio(p0, p1, p2); mesh_.property(aspect_, *f_it) = static_cast<typename Mesh::Scalar>(1.0) / aspectRatio(p0, p1, p2);
} }
} }
...@@ -121,7 +121,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) { ...@@ -121,7 +121,7 @@ void ModAspectRatioT<MeshT>::preprocess_collapse(const CollapseInfo& _ci) {
typename Mesh::Point& p1 = mesh_.point(*(++fv_it)); typename Mesh::Point& p1 = mesh_.point(*(++fv_it));
typename Mesh::Point& p2 = mesh_.point(*(++fv_it)); typename Mesh::Point& p2 = mesh_.point(*(++fv_it));
mesh_.property(aspect_, fh) = 1.0 / aspectRatio(p0, p1, p2); mesh_.property(aspect_, fh) = static_cast<typename Mesh::Scalar>(1.0) / aspectRatio(p0, p1, p2);
} }
} }
} }
...@@ -157,7 +157,7 @@ float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) { ...@@ -157,7 +157,7 @@ float ModAspectRatioT<MeshT>::collapse_priority(const CollapseInfo& _ci) {
// aspect after // aspect after
if (!(v2 == _ci.v1 || v3 == _ci.v1)) if (!(v2 == _ci.v1 || v3 == _ci.v1))
if ((r1 = 1.0 / aspectRatio(*p1, *p2, *p3)) < r1_min) if ((r1 = static_cast<typename Mesh::Scalar>(1.0) / aspectRatio(*p1, *p2, *p3)) < r1_min)
r1_min = r1; r1_min = r1;
} }
} }
......
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
/// Set normal deviation ( 0 .. 360 ) /// Set normal deviation ( 0 .. 360 )
void set_normal_deviation(Scalar _s) { void set_normal_deviation(Scalar _s) {
normal_deviation_ = _s / 180.0 * M_PI; normal_deviation_ = _s / static_cast<Scalar>(180.0) * static_cast<Scalar>(M_PI);
} }
...@@ -207,7 +207,7 @@ public: ...@@ -207,7 +207,7 @@ public:
// the smaller the factor, the smaller normal_deviation_ gets // the smaller the factor, the smaller normal_deviation_ gets
// thus creating a stricter constraint // thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization // division by error_tolerance_factor_ is for normalization
Scalar normal_deviation = (normal_deviation_ * 180.0/M_PI) * _factor / this->error_tolerance_factor_; Scalar normal_deviation = (normal_deviation_ * static_cast<Scalar>(180.0)/static_cast<Scalar>(M_PI) ) * _factor / this->error_tolerance_factor_;
set_normal_deviation(normal_deviation); set_normal_deviation(normal_deviation);
this->error_tolerance_factor_ = _factor; this->error_tolerance_factor_ = _factor;
} }
......
...@@ -166,12 +166,12 @@ compute_new_positions_C1() ...@@ -166,12 +166,12 @@ compute_new_positions_C1()
for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) { for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
w = this->weight(Base::mesh_.edge_handle(*voh_it)); w = this->weight(Base::mesh_.edge_handle(*voh_it));
uu -= Base::mesh_.property(umbrellas_, Base::mesh_.to_vertex_handle(*voh_it)); uu -= Base::mesh_.property(umbrellas_, Base::mesh_.to_vertex_handle(*voh_it));
diag += (w * this->weight(Base::mesh_.to_vertex_handle(*voh_it)) + 1.0) * w; diag += (w * this->weight(Base::mesh_.to_vertex_handle(*voh_it)) + static_cast<typename Mesh::Scalar>(1.0) ) * w;
} }
uu *= this->weight(*v_it); uu *= this->weight(*v_it);
diag *= this->weight(*v_it); diag *= this->weight(*v_it);
uu += Base::mesh_.property(umbrellas_, *v_it); uu += Base::mesh_.property(umbrellas_, *v_it);
if (diag) uu *= 1.0/diag; if (diag) uu *= static_cast<typename Mesh::Scalar>(1.0) / diag;
// damping // damping
uu *= 0.25; uu *= 0.25;
......
...@@ -184,13 +184,13 @@ compute_weights(LaplaceWeighting _weighting) ...@@ -184,13 +184,13 @@ compute_weights(LaplaceWeighting _weighting)
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2)); p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize(); d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize(); d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) )))); weight += static_cast<typename Mesh::Scalar>(1.0) / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
heh2 = Base::mesh_.next_halfedge_handle(heh1); heh2 = Base::mesh_.next_halfedge_handle(heh1);
p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2)); p2 = &Base::mesh_.point(Base::mesh_.to_vertex_handle(heh2));
d0 = (*p0 - *p2); d0.normalize(); d0 = (*p0 - *p2); d0.normalize();
d1 = (*p1 - *p2); d1.normalize(); d1 = (*p1 - *p2); d1.normalize();
weight += 1.0 / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) )))); weight += static_cast<typename Mesh::Scalar>(1.0) / tan(acos(std::max(lb, std::min(ub, dot(d0,d1) ))));
Base::mesh_.property(edge_weights_, *e_it) = weight; Base::mesh_.property(edge_weights_, *e_it) = weight;
Base::mesh_.property(vertex_weights_, v0) += weight; Base::mesh_.property(vertex_weights_, v0) += weight;
...@@ -208,7 +208,7 @@ compute_weights(LaplaceWeighting _weighting) ...@@ -208,7 +208,7 @@ compute_weights(LaplaceWeighting _weighting)
{ {
weight = Base::mesh_.property(vertex_weights_, *v_it); weight = Base::mesh_.property(vertex_weights_, *v_it);
if (weight) if (weight)
Base::mesh_.property(vertex_weights_, *v_it) = 1.0 / weight; Base::mesh_.property(vertex_weights_, *v_it) = static_cast<typename Mesh::Scalar>(1.0) / weight;
} }
} }
......
Supports Markdown
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