Fixed warnings

This commit is contained in:
Robert Osfield
2014-01-23 19:55:37 +00:00
parent d8482ef1ba
commit 4886a8941d
7 changed files with 71 additions and 64 deletions

View File

@@ -28,15 +28,15 @@ WriterCompareTriangle::operator()(const std::pair<Triangle, int> & t1,
}
void
WriterCompareTriangle::setMaxMin(unsigned int & nbVerticesX,
unsigned int & nbVerticesY,
unsigned int & nbVerticesZ) const
WriterCompareTriangle::setMaxMin(int & nbVerticesX,
int & nbVerticesY,
int & nbVerticesZ) const
{
static const unsigned int min = 1;
static const unsigned int max = 5; // Number of blocks used to divide the scene (arbitrary but seems ok)
nbVerticesX = osg::clampBetween<unsigned int>(nbVerticesX, min, max);
nbVerticesY = osg::clampBetween<unsigned int>(nbVerticesY, min, max);
nbVerticesZ = osg::clampBetween<unsigned int>(nbVerticesZ, min, max);
static const int min = 1;
static const int max = 5; // Number of blocks used to divide the scene (arbitrary but seems ok)
nbVerticesX = osg::clampBetween<int>(nbVerticesX, min, max);
nbVerticesY = osg::clampBetween<int>(nbVerticesY, min, max);
nbVerticesZ = osg::clampBetween<int>(nbVerticesZ, min, max);
}
void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sceneBox)
@@ -45,9 +45,9 @@ void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sc
static const float k = 1.3f; // Arbitrary constant multiplier for density computation ("simulates" non-uniform point distributions)
// Computes "density" of points, and thus the number of blocks to divide the mesh into
unsigned int nbVerticesX = static_cast<unsigned int>( (nbVertices * k) / (length.z() * length.y()) );
unsigned int nbVerticesY = static_cast<unsigned int>( (nbVertices * k) / (length.z() * length.x()) );
unsigned int nbVerticesZ = static_cast<unsigned int>( (nbVertices * k) / (length.x() * length.y()) );
int nbVerticesX = static_cast<int>( (nbVertices * k) / (length.z() * length.y()) );
int nbVerticesY = static_cast<int>( (nbVertices * k) / (length.z() * length.x()) );
int nbVerticesZ = static_cast<int>( (nbVertices * k) / (length.x() * length.y()) );
setMaxMin (nbVerticesX, nbVerticesY, nbVerticesZ); // This function prevent from cutting the scene in too many blocs
@@ -63,9 +63,9 @@ void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sc
boxList.reserve(nbVerticesX * nbVerticesY * nbVerticesZ);
short yinc = 1;
short xinc = 1;
unsigned int y = 0;
unsigned int x = 0;
for (unsigned int z = 0; z < nbVerticesZ; ++z)
int y = 0;
int x = 0;
for (int z = 0; z < nbVerticesZ; ++z)
{
while (x < nbVerticesX && x >= 0)
{