Commit e857c159 authored by Ken Martin's avatar Ken Martin

some float issues

parent afa8f288
......@@ -19,7 +19,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImplicitBoolean, "1.34");
vtkCxxRevisionMacro(vtkImplicitBoolean, "1.35");
vtkStandardNewMacro(vtkImplicitBoolean);
// Construct with union operation.
......@@ -79,6 +79,10 @@ double vtkImplicitBoolean::EvaluateFunction(double x[3])
double v;
vtkImplicitFunction *f;
if (this->FunctionList->GetNumberOfItems() == 0)
{
return value;
}
if ( this->OperationType == VTK_UNION )
{ //take minimum value
......@@ -148,6 +152,12 @@ void vtkImplicitBoolean::EvaluateGradient(double x[3], double g[3])
double v;
vtkImplicitFunction *f;
if (this->FunctionList->GetNumberOfItems() == 0)
{
g[0] = 0; g[1] = 0; g[2] = 0;
return;
}
if ( this->OperationType == VTK_UNION )
{ //take minimum value
for (value = VTK_DOUBLE_MAX, this->FunctionList->InitTraversal();
......
......@@ -20,7 +20,7 @@
#include "vtkPointData.h"
#include "vtkVoxel.h"
vtkCxxRevisionMacro(vtkImplicitVolume, "1.30");
vtkCxxRevisionMacro(vtkImplicitVolume, "1.31");
vtkStandardNewMacro(vtkImplicitVolume);
vtkCxxSetObjectMacro(vtkImplicitVolume,Volume,vtkImageData);
......@@ -29,7 +29,7 @@ vtkCxxSetObjectMacro(vtkImplicitVolume,Volume,vtkImageData);
vtkImplicitVolume::vtkImplicitVolume()
{
this->Volume = NULL;
this->OutValue = -VTK_DOUBLE_MAX;
this->OutValue = -VTK_FLOAT_MAX;
this->OutGradient[0] = 0.0;
this->OutGradient[1] = 0.0;
......
......@@ -19,7 +19,7 @@
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkImageDataStreamer, "1.29");
vtkCxxRevisionMacro(vtkImageDataStreamer, "1.30");
vtkStandardNewMacro(vtkImageDataStreamer);
vtkCxxSetObjectMacro(vtkImageDataStreamer,ExtentTranslator,vtkExtentTranslator);
......@@ -111,7 +111,7 @@ void vtkImageDataStreamer::UpdateData(vtkDataObject *vtkNotUsed(out))
input->UpdateData();
// copy the resulting data into the output buffer
output->CopyAndCastFrom(input, translator->GetExtent());
this->UpdateProgress((float)piece/(this->NumberOfStreamDivisions - 1.0));
this->UpdateProgress((float)(piece+1.0)/(float)this->NumberOfStreamDivisions);
}
}
......
......@@ -31,7 +31,7 @@
#include <limits.h>
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(vtkOpenGLImageMapper, "1.56");
vtkCxxRevisionMacro(vtkOpenGLImageMapper, "1.57");
vtkStandardNewMacro(vtkOpenGLImageMapper);
#endif
......@@ -96,7 +96,7 @@ inline int vtkPadToFour(int n)
template <class T>
void vtkOpenGLImageMapperRender(vtkOpenGLImageMapper *self, vtkImageData *data,
T *dataPtr, float shift, float scale,
T *dataPtr, double shift, double scale,
int *actorPos, int *actorPos2, int front, int *vsize)
{
int inMin0 = self->DisplayExtent[0];
......@@ -140,7 +140,7 @@ void vtkOpenGLImageMapperRender(vtkOpenGLImageMapper *self, vtkImageData *data,
}
unsigned char *ptr = newPtr;
float val;
double val;
unsigned char tmp;
while (--j >= 0)
......@@ -220,7 +220,7 @@ void vtkOpenGLImageMapperRender(vtkOpenGLImageMapper *self, vtkImageData *data,
template <class T>
void vtkOpenGLImageMapperRenderShort(vtkOpenGLImageMapper *self, vtkImageData *data,
T *dataPtr, float shift, float scale,
T *dataPtr, double shift, double scale,
int *actorPos, int *actorPos2, int front,
int *vsize)
{
......@@ -506,7 +506,7 @@ void vtkOpenGLImageMapper::RenderData(vtkViewport* viewport,
vtkImageData *data, vtkActor2D *actor)
{
void *ptr0;
float shift, scale;
double shift, scale;
vtkWindow* window = (vtkWindow *) viewport->GetVTKWindow();
if (!window)
......
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