Commit 32db2f5b authored by Francois Bertel's avatar Francois Bertel
Browse files

COMP:Fixed warnings.

parent 8aeb9fb5
......@@ -33,7 +33,7 @@
#include <assert.h>
vtkCxxRevisionMacro(vtkGeoAlignedImageSource, "1.7");
vtkCxxRevisionMacro(vtkGeoAlignedImageSource, "1.8");
vtkStandardNewMacro(vtkGeoAlignedImageSource);
vtkCxxSetObjectMacro(vtkGeoAlignedImageSource, Image, vtkImageData);
......@@ -317,16 +317,16 @@ void vtkGeoAlignedImageSource::CropImageForNode(vtkGeoImageNode* node, vtkImageD
image->GetExtent(wholeExt);
double origin[2];
double spacing[2];
spacing[0] = (this->LongitudeRange[1]-this->LongitudeRange[0])/(double)(ext[1]-ext[0]+1);
spacing[1] = (this->LatitudeRange[1]-this->LatitudeRange[0])/(double)(ext[3]-ext[2]+1);
origin[0] = this->LongitudeRange[0] - (double)(ext[0])*spacing[0];
origin[1] = this->LatitudeRange[0] - (double)(ext[2])*spacing[1];
spacing[0] = (this->LongitudeRange[1]-this->LongitudeRange[0])/static_cast<double>(ext[1]-ext[0]+1);
spacing[1] = (this->LatitudeRange[1]-this->LatitudeRange[0])/static_cast<double>(ext[3]-ext[2]+1);
origin[0] = this->LongitudeRange[0] - ext[0]*spacing[0];
origin[1] = this->LatitudeRange[0] - ext[2]*spacing[1];
// Compute the minimum extent that covers the terrain patch.
ext[0] = (int)(floor((node->GetLongitudeRange()[0]-origin[0])/spacing[0]));
ext[1] = (int)(ceil((node->GetLongitudeRange()[1]-origin[0])/spacing[0]));
ext[2] = (int)(floor((node->GetLatitudeRange()[0]-origin[1])/spacing[1]));
ext[3] = (int)(ceil((node->GetLatitudeRange()[1]-origin[1])/spacing[1]));
ext[0] = static_cast<int>(floor((node->GetLongitudeRange()[0]-origin[0])/spacing[0]));
ext[1] = static_cast<int>(ceil((node->GetLongitudeRange()[1]-origin[0])/spacing[0]));
ext[2] = static_cast<int>(floor((node->GetLatitudeRange()[0]-origin[1])/spacing[1]));
ext[3] = static_cast<int>(ceil((node->GetLatitudeRange()[1]-origin[1])/spacing[1]));
int dims[2];
dims[0] = this->PowerOfTwo(ext[1]-ext[0]+1);
......@@ -360,10 +360,10 @@ void vtkGeoAlignedImageSource::CropImageForNode(vtkGeoImageNode* node, vtkImageD
// Now set the longitude and latitude range based on the actual image size.
double lonRange[2];
double latRange[2];
lonRange[0] = origin[0] + ((double)(ext[0])*spacing[0]);
lonRange[1] = origin[0] + ((double)(ext[1]+1)*spacing[0]);
latRange[0] = origin[1] + ((double)(ext[2])*spacing[1]);
latRange[1] = origin[1] + ((double)(ext[3]+1)*spacing[1]);
lonRange[0] = origin[0] + ext[0]*spacing[0];
lonRange[1] = origin[0] + (ext[1]+1)*spacing[0];
latRange[0] = origin[1] + ext[2]*spacing[1];
latRange[1] = origin[1] + (ext[3]+1)*spacing[1];
cropped->SetOrigin(lonRange[0], latRange[0], 0);
cropped->SetSpacing(lonRange[1], latRange[1], 0);
//assert(lonRange[1] >= lonRange[0]);
......
......@@ -51,8 +51,8 @@ inline void vtkSleep(double duration)
Sleep((int)(1000*duration));
#elif defined(__FreeBSD__) || defined(__linux__) || defined(sgi)
struct timespec sleep_time, dummy;
sleep_time.tv_sec = (int)duration;
sleep_time.tv_nsec = (int)(1000000000*(duration-sleep_time.tv_sec));
sleep_time.tv_sec = static_cast<int>(duration);
sleep_time.tv_nsec = static_cast<int>(1000000000*(duration-sleep_time.tv_sec));
nanosleep(&sleep_time,&dummy);
#endif
}
......@@ -60,7 +60,7 @@ inline void vtkSleep(double duration)
VTK_THREAD_RETURN_TYPE vtkGeoSourceThreadStart(void* arg)
{
vtkGeoSource* self;
self = (vtkGeoSource*)(((vtkMultiThreader::ThreadInfo*)arg)->UserData);
self = static_cast<vtkGeoSource *>(static_cast<vtkMultiThreader::ThreadInfo *>(arg)->UserData);
self->WorkerThread();
return VTK_THREAD_RETURN_VALUE;
}
......@@ -71,7 +71,7 @@ public:
vtksys_stl::vector<int> ThreadIds;
};
vtkCxxRevisionMacro(vtkGeoSource, "1.1");
vtkCxxRevisionMacro(vtkGeoSource, "1.2");
vtkGeoSource::vtkGeoSource()
{
this->InputSet = vtkCollection::New();
......
......@@ -56,7 +56,7 @@
#include <vtksys/stl/utility>
vtkStandardNewMacro(vtkGeoTerrain);
vtkCxxRevisionMacro(vtkGeoTerrain, "1.7");
vtkCxxRevisionMacro(vtkGeoTerrain, "1.8");
vtkCxxSetObjectMacro(vtkGeoTerrain, GeoSource, vtkGeoSource);
//----------------------------------------------------------------------------
vtkGeoTerrain::vtkGeoTerrain()
......@@ -164,10 +164,8 @@ void vtkGeoTerrain::AddActors(
vtkSmartPointer<vtkExtractSelectedFrustum> extractor =
vtkSmartPointer<vtkExtractSelectedFrustum>::New();
extractor->SetFrustum(frustum);
double bounds[4];
double llbounds[4];
double range[2];
while (!s.empty())
{
vtkGeoTerrainNode* cur = s.top();
......
......@@ -29,7 +29,7 @@
#include "vtk_libproj4.h"
vtkStandardNewMacro(vtkGeoTransform);
vtkCxxRevisionMacro(vtkGeoTransform,"1.1");
vtkCxxRevisionMacro(vtkGeoTransform,"1.2");
vtkCxxSetObjectMacro(vtkGeoTransform, SourceProjection, vtkGeoProjection);
vtkCxxSetObjectMacro(vtkGeoTransform, DestinationProjection, vtkGeoProjection);
......@@ -109,7 +109,7 @@ void vtkGeoTransform::InternalTransformPoint( const float in[3], float out[3] )
ind[i] = in[i];
this->InternalTransformPoint( ind, oud );
for ( i = 0; i < 3; ++ i )
out[i] = (float) oud[i];
out[i] = static_cast<float>(oud[i]);
}
void vtkGeoTransform::InternalTransformPoint( const double in[3], double out[3] )
......@@ -132,7 +132,7 @@ void vtkGeoTransform::InternalTransformDerivative( const float in[3], float out[
this->InternalTransformDerivative( ind, oud, drd );
for ( i = 0; i < 3; ++ i )
{
out[i] = (float) oud[i];
out[i] = static_cast<float>(oud[i]);
for ( int j = 0; j < 3; ++ j )
{
derivative[i][j] = drd[i][j];
......
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