Fixed several conversion warnings

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@850 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-07-23 16:01:46 +00:00
parent c9c688949a
commit 11376f3c0d
9 changed files with 28 additions and 23 deletions

View File

@@ -237,8 +237,8 @@ size_t DecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
typename Mesh::HalfedgeHandle v0v1;
typename Mesh::VertexVertexIter vv_it;
typename Mesh::VertexFaceIter vf_it;
unsigned int nv = mesh_.n_vertices();
unsigned int nf = mesh_.n_faces();
size_t nv = mesh_.n_vertices();
size_t nf = mesh_.n_faces();
unsigned int n_collapses = 0;
typedef std::vector<typename Mesh::VertexHandle> Support;

View File

@@ -224,8 +224,8 @@ size_t McDecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
if ( (_nv == 0) && (_nf == 1) )
return decimate_constraints_only(1.0);
unsigned int nv = mesh_.n_vertices();
unsigned int nf = mesh_.n_faces();
size_t nv = mesh_.n_vertices();
size_t nf = mesh_.n_faces();
unsigned int n_collapses(0);

View File

@@ -119,21 +119,21 @@ size_t MixedDecimaterT<Mesh>::decimate_to_faces(const size_t _n_vertices,const
r_collapses = McDecimaterT<Mesh>::decimate_to_faces(n_vertices_mc, n_faces_mc);
} else {
const int samples = this->samples();
const size_t samples = this->samples();
// MinimalSample count for the McDecimater
const int min = 2;
const size_t min = 2;
// Maximal number of samples for the McDecimater
const int max = samples;
const size_t max = samples;
// Number of incremental steps
const int steps = 7;
const size_t steps = 7;
for ( int i = 0; i < steps; ++i ) {
for ( size_t i = 0; i < steps; ++i ) {
// Compute number of samples to be used
int samples = double( min) + double(i)/(double(steps)-1.0) * (max-2) ;
size_t samples = int (double( min) + double(i)/(double(steps)-1.0) * (max-2) ) ;
// We won't allow 1 here, as this is the last step in the incremental part
double decimaterLevel = (double(i + 1)) * _mc_factor / (double(steps) );

View File

@@ -147,7 +147,7 @@ public:
// the smaller the factor, the smaller max_deviation_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
float max_normal_deviation = (max_deviation_ * 180.0/M_PI) * _factor / this->error_tolerance_factor_;
double max_normal_deviation = (max_deviation_ * 180.0/M_PI) * _factor / this->error_tolerance_factor_;
set_max_normal_deviation(max_normal_deviation);
this->error_tolerance_factor_ = _factor;
}
@@ -157,15 +157,15 @@ public:
public:
/// get normal deviation
float max_normal_deviation() const { return max_deviation_ / M_PI * 180.0; }
double max_normal_deviation() const { return max_deviation_ / M_PI * 180.0; }
/** Set normal deviation
*
* Set the maximum angular deviation of the orignal normal and the new
* normal in degrees.
*/
void set_max_normal_deviation(float _f) {
max_deviation_ = _f / 180.0 * M_PI;
void set_max_normal_deviation(double _d) {
max_deviation_ = _d / 180.0 * M_PI;
min_cos_ = cos(max_deviation_);
}