Fix conversion warnings

This commit is contained in:
Mark Roszko
2020-10-05 10:41:14 +00:00
committed by Ian McInerney
parent 12ecccd0f3
commit a28a0e14ba
17 changed files with 81 additions and 80 deletions
+7 -7
View File
@@ -231,10 +231,10 @@ struct DATA
return defaultColor;
IFSG_APPEARANCE app( true );
app.SetShininess( 0.05 );
app.SetSpecular( 0.04, 0.04, 0.04 );
app.SetAmbient( 0.1, 0.1, 0.1 );
app.SetDiffuse( 0.6,0.6, 0.6 );
app.SetShininess( 0.05f );
app.SetSpecular( 0.04f, 0.04f, 0.04f );
app.SetAmbient( 0.1f, 0.1f, 0.1f );
app.SetDiffuse( 0.6f, 0.6f, 0.6f );
defaultColor = app.GetRawPtr();
return defaultColor;
@@ -248,9 +248,9 @@ struct DATA
return item->second;
IFSG_APPEARANCE app( true );
app.SetShininess( 0.1 );
app.SetSpecular( 0.12, 0.12, 0.12 );
app.SetAmbient( 0.1, 0.1, 0.1 );
app.SetShininess( 0.1f );
app.SetSpecular( 0.12f, 0.12f, 0.12f );
app.SetAmbient( 0.1f, 0.1f, 0.1f );
app.SetDiffuse( colorObj->Red(), colorObj->Green(), colorObj->Blue() );
colors.insert( std::pair< Standard_Real, SGNODE* >( id, app.GetRawPtr() ) );
+24 -24
View File
@@ -40,23 +40,23 @@ static bool VDegenerate( glm::vec3* pts )
double dx, dy, dz;
dx = pts[1].x - pts[0].x;
dy = pts[1].y - pts[0].y;
dz = pts[1].z - pts[0].z;
dx = double{ pts[1].x } - pts[0].x;
dy = double{ pts[1].y } - pts[0].y;
dz = double{ pts[1].z } - pts[0].z;
if( ( dx*dx + dy*dy + dz*dz ) < LOWER_LIMIT )
return true;
dx = pts[2].x - pts[0].x;
dy = pts[2].y - pts[0].y;
dz = pts[2].z - pts[0].z;
dx = double{ pts[2].x } - pts[0].x;
dy = double{ pts[2].y } - pts[0].y;
dz = double{ pts[2].z } - pts[0].z;
if( ( dx*dx + dy*dy + dz*dz ) < LOWER_LIMIT )
return true;
dx = pts[2].x - pts[1].x;
dy = pts[2].y - pts[1].y;
dz = pts[2].z - pts[1].z;
dx = double{ pts[2].x } - pts[1].x;
dy = double{ pts[2].y } - pts[1].y;
dz = double{ pts[2].z } - pts[1].z;
if( ( dx*dx + dy*dy + dz*dz ) < LOWER_LIMIT )
return true;
@@ -118,28 +118,28 @@ static float VCalcCosAngle( const WRLVEC3F& p1, const WRLVEC3F& p2, const WRLVEC
float p13 = dx*dx + dy*dy + dz*dz;
l13 = sqrtf( p13 );
float dn = 2.0 * l12 * l13;
float dn = 2.0f * l12 * l13;
// place a limit to prevent calculations from blowing up
if( dn < LOWER_LIMIT )
{
if( (p12 + p13 - p23) < FLT_EPSILON )
return -1.0;
return -1.0f;
if( (p12 + p13 - p23) > FLT_EPSILON )
return 1.0;
return 1.0f;
return 0.0;
return 0.0f;
}
float cosAngle = (p12 + p13 - p23) / dn;
// check the domain; errors in the cosAngle calculation
// can result in domain errors
if( cosAngle > 1.0 )
cosAngle = 1.0;
else if( cosAngle < -1.0 )
cosAngle = -1.0;
if( cosAngle > 1.0f )
cosAngle = 1.0f;
else if( cosAngle < -1.0f )
cosAngle = -1.0f;
// note: we are guaranteed that acosf() is never negative
return cosAngle;
@@ -653,7 +653,7 @@ void FACET::CollectVertices( std::vector< std::list< FACET* > >& aFacetList )
// note: in principle this should never be invoked
if( (maxIdx + 1) >= (int)aFacetList.size() )
aFacetList.resize( maxIdx + 1 );
aFacetList.resize( static_cast<std::size_t>( maxIdx ) + 1 );
std::vector< int >::iterator sI = indices.begin();
std::vector< int >::iterator eI = indices.end();
@@ -729,8 +729,8 @@ SGNODE* SHAPE::CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrd
while( sF != eF )
{
tV = (*sF)->CalcFaceNormal();
tmi = (*sF)->GetMaxIndex();
tV = ( *sF )->CalcFaceNormal();
tmi = ( *sF )->GetMaxIndex();
if( tmi > maxIdx )
maxIdx = tmi;
@@ -753,8 +753,8 @@ SGNODE* SHAPE::CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrd
while( sF != eF )
{
(*sF)->Renormalize( tV );
(*sF)->CollectVertices( flist );
( *sF )->Renormalize( tV );
( *sF )->CollectVertices( flist );
++sF;
}
@@ -768,7 +768,7 @@ SGNODE* SHAPE::CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrd
while( sF != eF )
{
(*sF)->CalcVertexNormal( i, flist[i], aCreaseLimit );
( *sF )->CalcVertexNormal( static_cast<int>( i ), flist[i], aCreaseLimit );
++sF;
}
}
@@ -783,7 +783,7 @@ SGNODE* SHAPE::CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrd
while( sF != eF )
{
(*sF)->GetData( vertices, normals, colors, aVertexOrder );
( *sF )->GetData( vertices, normals, colors, aVertexOrder );
++sF;
}