Commit 796665fa authored by Lisa Avila's avatar Lisa Avila

changes to move API to double

parent bf874891
......@@ -63,13 +63,13 @@ public:
// Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax )
// These planes are defined in volume coordinates - spacing and origin are
// considered.
vtkSetVector6Macro( CroppingRegionPlanes, float );
vtkGetVectorMacro( CroppingRegionPlanes, float, 6 );
vtkSetVector6Macro( CroppingRegionPlanes, double );
vtkGetVectorMacro( CroppingRegionPlanes, double, 6 );
// Description:
// Get the cropping region planes in voxels. Only valid during the
// rendering process
vtkGetVectorMacro( VoxelCroppingRegionPlanes, float, 6 );
vtkGetVectorMacro( VoxelCroppingRegionPlanes, double, 6 );
// Description:
// Set the flags for the cropping regions. The clipping planes divide the
......@@ -125,8 +125,8 @@ protected:
// Cropping variables, and a method for converting the world
// coordinate cropping region planes to voxel coordinates
int Cropping;
float CroppingRegionPlanes[6];
float VoxelCroppingRegionPlanes[6];
double CroppingRegionPlanes[6];
double VoxelCroppingRegionPlanes[6];
int CroppingRegionFlags;
void ConvertCroppingRegionPlanesToVoxels();
......
......@@ -18,7 +18,7 @@
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
vtkCxxRevisionMacro(vtkVolumeProperty, "1.39");
vtkCxxRevisionMacro(vtkVolumeProperty, "1.40");
vtkStandardNewMacro(vtkVolumeProperty);
// Construct a new vtkVolumeProperty with default values
......@@ -288,7 +288,7 @@ vtkPiecewiseFunction *vtkVolumeProperty::GetScalarOpacity( int index )
return this->ScalarOpacity[index];
}
void vtkVolumeProperty::SetScalarOpacityUnitDistance( int index, float distance )
void vtkVolumeProperty::SetScalarOpacityUnitDistance( int index, double distance )
{
if ( index < 0 || index > 3 )
{
......@@ -303,7 +303,7 @@ void vtkVolumeProperty::SetScalarOpacityUnitDistance( int index, float distance
}
}
float vtkVolumeProperty::GetScalarOpacityUnitDistance( int index )
double vtkVolumeProperty::GetScalarOpacityUnitDistance( int index )
{
if ( index < 0 || index > 3 )
{
......@@ -409,7 +409,7 @@ int vtkVolumeProperty::GetDisableGradientOpacity( int index )
return this->DisableGradientOpacity[index];
}
void vtkVolumeProperty::SetComponentWeight(int index, float value)
void vtkVolumeProperty::SetComponentWeight(int index, double value)
{
if (index < 0 || index >= VTK_MAX_VRCOMP)
{
......@@ -426,7 +426,7 @@ void vtkVolumeProperty::SetComponentWeight(int index, float value)
this->Modified();
}
float vtkVolumeProperty::GetComponentWeight(int index)
double vtkVolumeProperty::GetComponentWeight(int index)
{
if (index < 0 || index >= VTK_MAX_VRCOMP)
{
......@@ -469,7 +469,7 @@ int vtkVolumeProperty::GetShade( int index )
return this->Shade[index];
}
void vtkVolumeProperty::SetAmbient( int index, float value )
void vtkVolumeProperty::SetAmbient( int index, double value )
{
if ( this->Ambient[index] != value )
{
......@@ -478,12 +478,12 @@ void vtkVolumeProperty::SetAmbient( int index, float value )
}
}
float vtkVolumeProperty::GetAmbient( int index )
double vtkVolumeProperty::GetAmbient( int index )
{
return this->Ambient[index];
}
void vtkVolumeProperty::SetDiffuse( int index, float value )
void vtkVolumeProperty::SetDiffuse( int index, double value )
{
if ( this->Diffuse[index] != value )
{
......@@ -492,12 +492,12 @@ void vtkVolumeProperty::SetDiffuse( int index, float value )
}
}
float vtkVolumeProperty::GetDiffuse( int index )
double vtkVolumeProperty::GetDiffuse( int index )
{
return this->Diffuse[index];
}
void vtkVolumeProperty::SetSpecular( int index, float value )
void vtkVolumeProperty::SetSpecular( int index, double value )
{
if ( this->Specular[index] != value )
{
......@@ -506,12 +506,12 @@ void vtkVolumeProperty::SetSpecular( int index, float value )
}
}
float vtkVolumeProperty::GetSpecular( int index )
double vtkVolumeProperty::GetSpecular( int index )
{
return this->Specular[index];
}
void vtkVolumeProperty::SetSpecularPower( int index, float value )
void vtkVolumeProperty::SetSpecularPower( int index, double value )
{
if ( this->SpecularPower[index] != value )
{
......@@ -520,7 +520,7 @@ void vtkVolumeProperty::SetSpecularPower( int index, float value )
}
}
float vtkVolumeProperty::GetSpecularPower( int index )
double vtkVolumeProperty::GetSpecularPower( int index )
{
return this->SpecularPower[index];
}
......
......@@ -80,8 +80,8 @@ public:
// Description:
// Set/Get the scalar component weights
virtual void SetComponentWeight(int index, float value);
virtual float GetComponentWeight(int index);
virtual void SetComponentWeight(int index, double value);
virtual double GetComponentWeight(int index);
// Description:
// Set the interpolation type for sampling a volume.
......@@ -151,11 +151,11 @@ public:
// is defined. By default this is 1.0, meaning that over a distance of
// 1.0 units, a given opacity (from the transfer function) is accumulated.
// This is adjusted for the actual sampling distance during rendering.
void SetScalarOpacityUnitDistance( int index, float distance );
void SetScalarOpacityUnitDistance( float distance )
void SetScalarOpacityUnitDistance( int index, double distance );
void SetScalarOpacityUnitDistance( double distance )
{this->SetScalarOpacityUnitDistance( 0, distance );}
float GetScalarOpacityUnitDistance( int index );
float GetScalarOpacityUnitDistance()
double GetScalarOpacityUnitDistance( int index );
double GetScalarOpacityUnitDistance()
{return this->GetScalarOpacityUnitDistance(0);}
......@@ -222,31 +222,31 @@ public:
// Description:
// Set/Get the ambient lighting coefficient.
void SetAmbient( int index, float value );
void SetAmbient( float value ) {this->SetAmbient( 0, value );}
float GetAmbient( int index );
float GetAmbient() {return this->GetAmbient(0);}
void SetAmbient( int index, double value );
void SetAmbient( double value ) {this->SetAmbient( 0, value );}
double GetAmbient( int index );
double GetAmbient() {return this->GetAmbient(0);}
// Description:
// Set/Get the diffuse lighting coefficient.
void SetDiffuse( int index, float value );
void SetDiffuse( float value ) {this->SetDiffuse( 0, value );}
float GetDiffuse( int index );
float GetDiffuse() {return this->GetDiffuse(0);}
void SetDiffuse( int index, double value );
void SetDiffuse( double value ) {this->SetDiffuse( 0, value );}
double GetDiffuse( int index );
double GetDiffuse() {return this->GetDiffuse(0);}
// Description:
// Set/Get the specular lighting coefficient.
void SetSpecular( int index, float value );
void SetSpecular( float value ) {this->SetSpecular( 0, value );}
float GetSpecular( int index );
float GetSpecular() {return this->GetSpecular(0);}
void SetSpecular( int index, double value );
void SetSpecular( double value ) {this->SetSpecular( 0, value );}
double GetSpecular( int index );
double GetSpecular() {return this->GetSpecular(0);}
// Description:
// Set/Get the specular power.
void SetSpecularPower( int index, float value );
void SetSpecularPower( float value ) {this->SetSpecularPower( 0, value );}
float GetSpecularPower( int index );
float GetSpecularPower() {return this->GetSpecularPower(0);}
void SetSpecularPower( int index, double value );
void SetSpecularPower( double value ) {this->SetSpecularPower( 0, value );}
double GetSpecularPower( int index );
double GetSpecularPower() {return this->GetSpecularPower(0);}
//BTX
// Description:
......@@ -291,7 +291,7 @@ protected:
~vtkVolumeProperty();
int IndependentComponents;
float ComponentWeight[VTK_MAX_VRCOMP];
double ComponentWeight[VTK_MAX_VRCOMP];
int InterpolationType;
......@@ -305,7 +305,7 @@ protected:
vtkPiecewiseFunction *ScalarOpacity[VTK_MAX_VRCOMP];
vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
float ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
vtkPiecewiseFunction *GradientOpacity[VTK_MAX_VRCOMP];
vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
......@@ -313,10 +313,10 @@ protected:
int DisableGradientOpacity[VTK_MAX_VRCOMP];
int Shade[VTK_MAX_VRCOMP];
float Ambient[VTK_MAX_VRCOMP];
float Diffuse[VTK_MAX_VRCOMP];
float Specular[VTK_MAX_VRCOMP];
float SpecularPower[VTK_MAX_VRCOMP];
double Ambient[VTK_MAX_VRCOMP];
double Diffuse[VTK_MAX_VRCOMP];
double Specular[VTK_MAX_VRCOMP];
double SpecularPower[VTK_MAX_VRCOMP];
virtual void CreateDefaultGradientOpacity(int index);
......
......@@ -34,7 +34,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkVolumeRayCastMapper, "1.101");
vtkCxxRevisionMacro(vtkVolumeRayCastMapper, "1.102");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -365,7 +365,7 @@ void vtkVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume *vol )
int *renWinSize = ren->GetRenderWindow()->GetSize();
// Save this so that we can restore it if the image is cancelled
float oldImageSampleDistance = this->ImageSampleDistance;
double oldImageSampleDistance = this->ImageSampleDistance;
// If we are automatically adjusting the size to achieve a desired frame
// rate, then do that adjustment here. Base the new image sample distance
......@@ -419,17 +419,17 @@ void vtkVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume *vol )
// turn this->ImageOrigin into (x1,y1) in window (not viewport!)
// coordinates.
x1 = static_cast<int> (
viewport[0] * static_cast<float>(renWinSize[0]) +
static_cast<float>(this->ImageOrigin[0]) * this->ImageSampleDistance );
viewport[0] * static_cast<double>(renWinSize[0]) +
static_cast<double>(this->ImageOrigin[0]) * this->ImageSampleDistance );
y1 = static_cast<int> (
viewport[1] * static_cast<float>(renWinSize[1]) +
static_cast<float>(this->ImageOrigin[1]) * this->ImageSampleDistance);
viewport[1] * static_cast<double>(renWinSize[1]) +
static_cast<double>(this->ImageOrigin[1]) * this->ImageSampleDistance);
// compute z buffer size
this->ZBufferSize[0] = static_cast<int>(
static_cast<float>(this->ImageInUseSize[0]) * this->ImageSampleDistance);
static_cast<double>(this->ImageInUseSize[0]) * this->ImageSampleDistance);
this->ZBufferSize[1] = static_cast<int>(
static_cast<float>(this->ImageInUseSize[1]) * this->ImageSampleDistance);
static_cast<double>(this->ImageInUseSize[1]) * this->ImageSampleDistance);
// Use the size to compute (x2,y2) in window coordinates
x2 = x1 + this->ZBufferSize[0] - 1;
......@@ -437,9 +437,9 @@ void vtkVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume *vol )
// This is the z buffer origin (in viewport coordinates)
this->ZBufferOrigin[0] = static_cast<int>(
static_cast<float>(this->ImageOrigin[0]) * this->ImageSampleDistance);
static_cast<double>(this->ImageOrigin[0]) * this->ImageSampleDistance);
this->ZBufferOrigin[1] = static_cast<int>(
static_cast<float>(this->ImageOrigin[1]) * this->ImageSampleDistance);
static_cast<double>(this->ImageOrigin[1]) * this->ImageSampleDistance);
// Capture the z buffer
this->ZBuffer = ren->GetRenderWindow()->GetZbufferData(x1,y1,x2,y2);
......
......@@ -92,8 +92,8 @@ public:
// used for sampling ray casting methods. Methods that compute
// a ray value by stepping cell-by-cell are not affected by this
// value.
vtkSetMacro( SampleDistance, float );
vtkGetMacro( SampleDistance, float );
vtkSetMacro( SampleDistance, double );
vtkGetMacro( SampleDistance, double );
// Description:
// Get / Set the volume ray cast function. This is used to process
......@@ -114,20 +114,20 @@ public:
// Sampling distance in the XY image dimensions. Default value of 1 meaning
// 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. If
// set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels.
vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( ImageSampleDistance, float );
vtkSetClampMacro( ImageSampleDistance, double, 0.1f, 100.0f );
vtkGetMacro( ImageSampleDistance, double );
// Description:
// This is the minimum image sample distance allow when the image
// sample distance is being automatically adjusted
vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( MinimumImageSampleDistance, float );
vtkSetClampMacro( MinimumImageSampleDistance, double, 0.1f, 100.0f );
vtkGetMacro( MinimumImageSampleDistance, double );
// Description:
// This is the maximum image sample distance allow when the image
// sample distance is being automatically adjusted
vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( MaximumImageSampleDistance, float );
vtkSetClampMacro( MaximumImageSampleDistance, double, 0.1f, 100.0f );
vtkGetMacro( MaximumImageSampleDistance, double );
// Description:
// If AutoAdjustSampleDistances is on, the the ImageSampleDistance
......@@ -190,13 +190,13 @@ protected:
vtkEncodedGradientShader *GradientShader;
// The distance between sample points along the ray
float SampleDistance;
float ImageSampleDistance;
float MinimumImageSampleDistance;
float MaximumImageSampleDistance;
double SampleDistance;
double ImageSampleDistance;
double MinimumImageSampleDistance;
double MaximumImageSampleDistance;
int AutoAdjustSampleDistances;
float WorldSampleDistance;
double WorldSampleDistance;
int ScalarDataType;
void *ScalarDataPointer;
......
......@@ -59,7 +59,7 @@ void vtkVolumeTextureMapper2D_TraverseVolume( T *data_ptr,
int shade;
float tmpval;
int cropping, croppingFlags;
float *croppingBounds;
double *croppingBounds;
int flag[3], tmpFlag, index;
int clipLow = 0, clipHigh = 0;
vtkRenderWindow *renWin = me->GetRenderWindow();
......@@ -466,7 +466,7 @@ void vtkVolumeTextureMapper2D_TraverseVolume( T *data_ptr,
}
vtkCxxRevisionMacro(vtkVolumeTextureMapper2D, "1.55");
vtkCxxRevisionMacro(vtkVolumeTextureMapper2D, "1.56");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......
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