Commit 51f4f263 authored by Jan Möbius's avatar Jan Möbius

Fixed more warnings

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@933 fdac6126-5c0c-442c-9429-916003d36597
parent cb731fb0
...@@ -500,7 +500,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode) ...@@ -500,7 +500,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; strip_it!=strip_last; ++strip_it) for (; strip_it!=strip_last; ++strip_it)
{ {
glDrawElements(GL_TRIANGLE_STRIP, glDrawElements(GL_TRIANGLE_STRIP,
strip_it->size(), GL_UNSIGNED_INT, &(*strip_it)[0] ); static_cast<GLsizei>(strip_it->size()), GL_UNSIGNED_INT, &(*strip_it)[0] );
} }
glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_VERTEX_ARRAY);
...@@ -554,7 +554,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode) ...@@ -554,7 +554,7 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glColorPointer(3, GL_UNSIGNED_BYTE, 0, mesh_.vertex_colors()); glColorPointer(3, GL_UNSIGNED_BYTE, 0, mesh_.vertex_colors());
} }
glDrawArrays( GL_POINTS, 0, mesh_.n_vertices() ); glDrawArrays( GL_POINTS, 0, static_cast<GLsizei>(mesh_.n_vertices()) );
glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_COLOR_ARRAY);
} }
......
...@@ -121,16 +121,16 @@ merge(const NormalConeT& _cone) ...@@ -121,16 +121,16 @@ merge(const NormalConeT& _cone)
{ {
Scalar dotp = (center_normal_ | _cone.center_normal_); Scalar dotp = (center_normal_ | _cone.center_normal_);
if (fabs(dotp) < 0.99999) if (fabs(dotp) < 0.99999f)
{ {
// new angle // new angle
Scalar centerAngle = acos(dotp); Scalar centerAngle = acos(dotp);
Scalar minAngle = std::min(-angle(), centerAngle - _cone.angle()); Scalar minAngle = std::min(-angle(), centerAngle - _cone.angle());
Scalar maxAngle = std::max( angle(), centerAngle + _cone.angle()); Scalar maxAngle = std::max( angle(), centerAngle + _cone.angle());
angle_ = (maxAngle - minAngle) * 0.5; angle_ = (maxAngle - minAngle) * Scalar(0.5f);
// axis by SLERP // axis by SLERP
Scalar axisAngle = 0.5*(minAngle + maxAngle); Scalar axisAngle = Scalar(0.5f) * (minAngle + maxAngle);
center_normal_ = ((center_normal_ * sin(centerAngle-axisAngle) center_normal_ = ((center_normal_ * sin(centerAngle-axisAngle)
+ _cone.center_normal_ * sin(axisAngle)) + _cone.center_normal_ * sin(axisAngle))
/ sin(centerAngle)); / sin(centerAngle));
...@@ -138,12 +138,12 @@ merge(const NormalConeT& _cone) ...@@ -138,12 +138,12 @@ merge(const NormalConeT& _cone)
else else
{ {
// axes point in same direction // axes point in same direction
if (dotp > 0.0) if (dotp > 0.0f)
angle_ = std::max(angle_, _cone.angle_); angle_ = std::max(angle_, _cone.angle_);
// axes point in opposite directions // axes point in opposite directions
else else
angle_ = 2.0 * M_PI; angle_ = Scalar(2.0f * M_PI);
} }
} }
......
...@@ -94,7 +94,7 @@ distPointTriangleSquared( const Point& _p, ...@@ -94,7 +94,7 @@ distPointTriangleSquared( const Point& _p,
Point v0p = _p - _v0; Point v0p = _p - _v0;
Point t = v0p % n; Point t = v0p % n;
double s01, s02, s12; typename Point::value_type s01, s02, s12;
const double a = (t | v0v2) * -invD; const double a = (t | v0v2) * -invD;
const double b = (t | v0v1) * invD; const double b = (t | v0v1) * invD;
......
...@@ -125,7 +125,7 @@ class ModRoundnessT : public ModBaseT<MeshT> ...@@ -125,7 +125,7 @@ class ModRoundnessT : public ModBaseT<MeshT>
typename Mesh::FaceHandle fhC, fhB; typename Mesh::FaceHandle fhC, fhB;
Vec3f B,C; Vec3f B,C;
if ( min_r_ < 0.0 ) // continues mode if ( min_r_ < 0.0f ) // continues mode
{ {
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(*voh_it))); C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(*voh_it)));
fhC = Base::mesh().face_handle( *voh_it ); fhC = Base::mesh().face_handle( *voh_it );
...@@ -196,17 +196,17 @@ public: // specific methods ...@@ -196,17 +196,17 @@ public: // specific methods
Vec3f A,B,C; Vec3f A,B,C;
A = Vec3f( 0, 0, 0); A = Vec3f( 0.0f, 0.0f, 0.0f);
B = Vec3f( 2*cos(_angle), 0, 0); B = Vec3f( 2.0f * cos(_angle), 0.0f, 0.0f);
C = Vec3f( cos(_angle), sin(_angle), 0); C = Vec3f( cos(_angle), sin(_angle), 0.0f);
double r1 = roundness(A,B,C); double r1 = roundness(A,B,C);
_angle = float(0.5 * ( M_PI - _angle )); _angle = float(0.5 * ( M_PI - _angle ));
A = Vec3f( 0, 0, 0); A = Vec3f( 0.0f, 0.0f, 0.0f);
B = Vec3f( 2*cos(_angle), 0, 0); B = Vec3f( 2.0f*cos(_angle), 0.0f, 0.0f);
C = Vec3f( cos(_angle), sin(_angle), 0); C = Vec3f( cos(_angle), sin(_angle), 0.0f);
double r2 = roundness(A,B,C); double r2 = roundness(A,B,C);
......
...@@ -75,7 +75,7 @@ StripifierT<Mesh>:: ...@@ -75,7 +75,7 @@ StripifierT<Mesh>::
} }
template <class Mesh> template <class Mesh>
unsigned int size_t
StripifierT<Mesh>:: StripifierT<Mesh>::
stripify() stripify()
{ {
...@@ -107,7 +107,7 @@ build_strips() ...@@ -107,7 +107,7 @@ build_strips()
{ {
Strip experiments[3]; Strip experiments[3];
typename Mesh::HalfedgeHandle h[3]; typename Mesh::HalfedgeHandle h[3];
unsigned int best_idx, best_length, length; size_t best_length,length , best_idx;
FaceHandles faces[3]; FaceHandles faces[3];
typename FaceHandles::iterator fh_it, fh_end; typename FaceHandles::iterator fh_it, fh_end;
typename Mesh::FaceIter f_it, f_end=mesh_.faces_end(); typename Mesh::FaceIter f_it, f_end=mesh_.faces_end();
...@@ -148,8 +148,9 @@ build_strips() ...@@ -148,8 +148,9 @@ build_strips()
// build 3 strips, take best one // build 3 strips, take best one
best_length = best_idx = 0; best_length = 0;
for (unsigned int i=0; i<3; ++i) best_idx = 0;
for (size_t i=0; i<3; ++i)
{ {
build_strip(h[i], experiments[i], faces[i]); build_strip(h[i], experiments[i], faces[i]);
if ((length = experiments[i].size()) > best_length) if ((length = experiments[i].size()) > best_length)
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
~StripifierT(); ~StripifierT();
/// Compute triangle strips, returns number of strips /// Compute triangle strips, returns number of strips
unsigned int stripify(); size_t stripify();
/// delete all strips /// delete all strips
void clear() { Strips().swap(strips_); } void clear() { Strips().swap(strips_); }
......
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