Commit 87363b3f authored by Bill Lorensen's avatar Bill Lorensen

ENH: replaced TABS with SPACES.

parent c63515a2
......@@ -108,7 +108,7 @@ public:
// the third value is =0. Return non-zero if something was successfully
// picked.
virtual int Pick(float selectionX, float selectionY, float selectionZ,
vtkRenderer *renderer) = 0;
vtkRenderer *renderer) = 0;
// Description: Perform pick operation with selection point
// provided. Normally the first two values for the selection point
......
......@@ -385,16 +385,16 @@ float *vtkActor::GetBounds()
for (i = 0; i < 8; i++)
{
for (n = 0; n < 3; n++)
{
if (bbox[i*3+n] < this->Bounds[n*2])
{
this->Bounds[n*2] = bbox[i*3+n];
}
if (bbox[i*3+n] > this->Bounds[n*2+1])
{
this->Bounds[n*2+1] = bbox[i*3+n];
}
}
{
if (bbox[i*3+n] < this->Bounds[n*2])
{
this->Bounds[n*2] = bbox[i*3+n];
}
if (bbox[i*3+n] > this->Bounds[n*2+1])
{
this->Bounds[n*2+1] = bbox[i*3+n];
}
}
}
this->BoundsMTime.Modified();
}
......
......@@ -239,8 +239,8 @@ public:
// to create text of different size-factor is usually =1 but you can
// adjust the font size by making factor larger or smaller.
static int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper,
int *size, float factor,
int &stringWidth, int &stringHeight);
int *size, float factor,
int &stringWidth, int &stringHeight);
// Description:
// Shallow copy of an axis actor. Overloads the virtual vtkProp method.
......
......@@ -334,8 +334,8 @@ void vtkCamera::Dolly(double amount)
double d = this->Distance/amount;
this->SetPosition(this->FocalPoint[0] - d*this->DirectionOfProjection[0],
this->FocalPoint[1] - d*this->DirectionOfProjection[1],
this->FocalPoint[2] - d*this->DirectionOfProjection[2]);
this->FocalPoint[1] - d*this->DirectionOfProjection[1],
this->FocalPoint[2] - d*this->DirectionOfProjection[2]);
}
//----------------------------------------------------------------------------
......@@ -675,7 +675,7 @@ void vtkCamera::SetViewShear(double d[3])
// Compute the perspective transform matrix. This is used in converting
// between view and world coordinates.
void vtkCamera::ComputePerspectiveTransform(double aspect,
double nearz, double farz)
double nearz, double farz)
{
this->PerspectiveTransform->Identity();
......@@ -695,8 +695,8 @@ void vtkCamera::ComputePerspectiveTransform(double aspect,
double ymax = (this->WindowCenter[1]+1.0)*height;
this->PerspectiveTransform->Ortho(xmin,xmax,ymin,ymax,
this->ClippingRange[0],
this->ClippingRange[1]);
this->ClippingRange[0],
this->ClippingRange[1]);
}
else
{
......@@ -712,8 +712,8 @@ void vtkCamera::ComputePerspectiveTransform(double aspect,
double ymax = (this->WindowCenter[1]+1.0)*height;
this->PerspectiveTransform->Frustum(xmin, xmax, ymin, ymax,
this->ClippingRange[0],
this->ClippingRange[1]);
this->ClippingRange[0],
this->ClippingRange[1]);
}
if (this->Stereo)
......@@ -723,19 +723,19 @@ void vtkCamera::ComputePerspectiveTransform(double aspect,
if (this->LeftEye)
{
this->PerspectiveTransform->Stereo(-this->EyeAngle/2,
this->Distance);
this->Distance);
}
else
{
this->PerspectiveTransform->Stereo(+this->EyeAngle/2,
this->Distance);
this->Distance);
}
}
if (this->ViewShear[0] != 0.0 || this->ViewShear[1] != 0.0) {
this->PerspectiveTransform->Shear(this->ViewShear[0],
this->ViewShear[1],
this->ViewShear[2]*this->Distance);
this->ViewShear[1],
this->ViewShear[2]*this->Distance);
}
}
......@@ -743,8 +743,8 @@ void vtkCamera::ComputePerspectiveTransform(double aspect,
//----------------------------------------------------------------------------
// Return the perspective transform matrix. See ComputePerspectiveTransform.
vtkMatrix4x4 *vtkCamera::GetPerspectiveTransformMatrix(double aspect,
double nearz,
double farz)
double nearz,
double farz)
{
this->ComputePerspectiveTransform(aspect, nearz, farz);
......@@ -755,8 +755,8 @@ vtkMatrix4x4 *vtkCamera::GetPerspectiveTransformMatrix(double aspect,
//----------------------------------------------------------------------------
// Return the perspective transform matrix. See ComputePerspectiveTransform.
vtkMatrix4x4 *vtkCamera::GetCompositePerspectiveTransformMatrix(double aspect,
double nearz,
double farz)
double nearz,
double farz)
{
// turn off stereo, the CompositePerspectiveTransformMatrix is used for
// picking, not for rendering.
......@@ -765,8 +765,8 @@ vtkMatrix4x4 *vtkCamera::GetCompositePerspectiveTransformMatrix(double aspect,
this->Transform->Identity();
this->Transform->Concatenate(this->GetPerspectiveTransformMatrix(aspect,
nearz,
farz));
nearz,
farz));
this->Transform->Concatenate(this->GetViewTransformMatrix());
this->Stereo = stereo;
......@@ -795,8 +795,8 @@ void vtkCamera::ComputeViewPlaneNormal()
this->ViewPlaneNormal[2] = 1.0;
// transform the VPN to world coordinates using inverse of view transform
this->ViewTransform->GetLinearInverse()->TransformNormal(
this->ViewPlaneNormal,
this->ViewPlaneNormal);
this->ViewPlaneNormal,
this->ViewPlaneNormal);
}
else
{
......@@ -836,7 +836,7 @@ void vtkCamera::GetFrustumPlanes(float aspect, float planes[24])
// get the composite perspective matrix
vtkMatrix4x4::DeepCopy(*matrix,
this->GetCompositePerspectiveTransformMatrix(aspect,-1,+1));
this->GetCompositePerspectiveTransformMatrix(aspect,-1,+1));
// transpose the matrix for use with normals
vtkMatrix4x4::Transpose(*matrix,*matrix);
......@@ -847,8 +847,8 @@ void vtkCamera::GetFrustumPlanes(float aspect, float planes[24])
vtkMatrix4x4::MultiplyPoint(*matrix,normals[i],normals[i]);
f = 1.0/sqrt(normals[i][0]*normals[i][0] +
normals[i][1]*normals[i][1] +
normals[i][2]*normals[i][2]);
normals[i][1]*normals[i][1] +
normals[i][2]*normals[i][2]);
planes[4*i + 0] = normals[i][0]*f;
planes[4*i + 1] = normals[i][1]*f;
......
......@@ -292,8 +292,8 @@ class VTK_RENDERING_EXPORT vtkCamera : public vtkObject
// Z-buffer values that map to the near and far clipping planes.
// The viewport coordinates are in the range ([-1,+1],[-1,+1],[nearz,farz]).
vtkMatrix4x4 *GetPerspectiveTransformMatrix(double aspect,
double nearz,
double farz);
double nearz,
double farz);
// Description:
// Return the concatenation of the ViewTransform and the
......@@ -303,8 +303,8 @@ class VTK_RENDERING_EXPORT vtkCamera : public vtkObject
// Z-buffer values that map to the near and far clipping planes.
// The viewport coordinates are in the range ([-1,+1],[-1,+1],[nearz,farz]).
vtkMatrix4x4 *GetCompositePerspectiveTransformMatrix(double aspect,
double nearz,
double farz);
double nearz,
double farz);
// Description:
// This method causes the camera to set up whatever is required for
......@@ -382,7 +382,7 @@ protected:
void ComputeViewTransform();
void ComputePerspectiveTransform(double aspect, double nearz, double farz);
void ComputeCompositePerspectiveTransform(double aspect,
double nearz, double farz);
double nearz, double farz);
void ComputeCameraLightTransform();
double WindowCenter[2];
......
......@@ -65,7 +65,7 @@ public:
// Description:
// This is called outside the render loop by vtkRenderer
virtual float Cull( vtkRenderer *ren, vtkProp **propList,
int& listLength, int& initialized )=0;
int& listLength, int& initialized )=0;
protected:
vtkCuller() {};
......
......@@ -159,8 +159,8 @@ int vtkEncodedGradientEstimator::GetEncodedNormalIndex( int xyzIndex )
}
int vtkEncodedGradientEstimator::GetEncodedNormalIndex( int xIndex,
int yIndex,
int zIndex )
int yIndex,
int zIndex )
{
int ystep, zstep;
......@@ -219,27 +219,27 @@ void vtkEncodedGradientEstimator::Update( )
// If we previously have allocated space for the encoded normals,
// and this space is no longer the right size, delete it
if ( this->EncodedNormalsSize[0] != scalarInputSize[0] ||
this->EncodedNormalsSize[1] != scalarInputSize[1] ||
this->EncodedNormalsSize[2] != scalarInputSize[2] )
this->EncodedNormalsSize[1] != scalarInputSize[1] ||
this->EncodedNormalsSize[2] != scalarInputSize[2] )
{
if ( this->EncodedNormals )
{
delete [] this->EncodedNormals;
this->EncodedNormals = NULL;
}
{
delete [] this->EncodedNormals;
this->EncodedNormals = NULL;
}
if ( this->GradientMagnitudes )
{
delete [] this->GradientMagnitudes;
this->GradientMagnitudes = NULL;
}
{
delete [] this->GradientMagnitudes;
this->GradientMagnitudes = NULL;
}
}
// Allocate space for the encoded normals if necessary
if ( !this->EncodedNormals )
{
this->EncodedNormals = new unsigned short[ scalarInputSize[0] *
scalarInputSize[1] *
scalarInputSize[2] ];
scalarInputSize[1] *
scalarInputSize[2] ];
this->EncodedNormalsSize[0] = scalarInputSize[0];
this->EncodedNormalsSize[1] = scalarInputSize[1];
this->EncodedNormalsSize[2] = scalarInputSize[2];
......@@ -248,8 +248,8 @@ void vtkEncodedGradientEstimator::Update( )
if ( !this->GradientMagnitudes && this->ComputeGradientMagnitudes )
{
this->GradientMagnitudes = new unsigned char[ scalarInputSize[0] *
scalarInputSize[1] *
scalarInputSize[2] ];
scalarInputSize[1] *
scalarInputSize[2] ];
}
// Copy info that multi threaded function will need into temp variables
......@@ -257,7 +257,7 @@ void vtkEncodedGradientEstimator::Update( )
memcpy( this->InputAspect, scalarInputAspect, 3 * sizeof(float) );
if ( this->CylinderClip &&
(this->InputSize[0] == this->InputSize[1]) )
(this->InputSize[0] == this->InputSize[1]) )
{
this->UseCylinderClip = 1;
this->ComputeCircleLimits( this->InputSize[0] );
......
......@@ -73,9 +73,9 @@ vtkEncodedGradientShader::vtkEncodedGradientShader()
this->ShadingTableVolume[j] = NULL;
this->ShadingTableSize[j] = 0;
for ( i = 0; i < 6; i++ )
{
this->ShadingTable[j][i] = NULL;
}
{
this->ShadingTable[j][i] = NULL;
}
}
this->ZeroNormalDiffuseIntensity = 0.0;
......@@ -91,9 +91,9 @@ vtkEncodedGradientShader::~vtkEncodedGradientShader()
for ( i=0; i<6; i++ )
{
if ( this->ShadingTable[j][i] )
{
delete [] this->ShadingTable[j][i];
}
{
delete [] this->ShadingTable[j][i];
}
}
}
}
......@@ -225,8 +225,8 @@ float *vtkEncodedGradientShader::GetBlueSpecularShadingTable( vtkVolume *vol )
}
void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
vtkVolume *vol,
vtkEncodedGradientEstimator *gradest)
vtkVolume *vol,
vtkEncodedGradientEstimator *gradest)
{
float lightDirection[3], material[4], lightColor[3];
float lightPosition[3], lightFocalPoint[3];
......@@ -258,10 +258,10 @@ void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
for ( index = 0; index < VTK_MAX_SHADING_TABLES; index++ )
{
if ( this->ShadingTableVolume[index] == NULL )
{
this->ShadingTableVolume[index] = vol;
break;
}
{
this->ShadingTableVolume[index] = vol;
break;
}
}
}
if ( index == VTK_MAX_SHADING_TABLES )
......@@ -299,9 +299,9 @@ void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
viewDirection[2] = cameraFocalPoint[2] - cameraPosition[2];
mag = sqrt( (double)(
viewDirection[0] * viewDirection[0] +
viewDirection[1] * viewDirection[1] +
viewDirection[2] * viewDirection[2] ) );
viewDirection[0] * viewDirection[0] +
viewDirection[1] * viewDirection[1] +
viewDirection[2] * viewDirection[2] ) );
if ( mag )
{
......@@ -349,8 +349,8 @@ void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
lightDirection[2] = lightFocalPoint[2] - lightPosition[2];
norm = sqrt( (double) ( lightDirection[0] * lightDirection[0] +
lightDirection[1] * lightDirection[1] +
lightDirection[2] * lightDirection[2] ) );
lightDirection[1] * lightDirection[1] +
lightDirection[2] * lightDirection[2] ) );
lightDirection[0] /= -norm;
lightDirection[1] /= -norm;
......@@ -364,9 +364,9 @@ void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
// Build / Add to the shading table
this->BuildShadingTable( index, lightDirection, lightColor,
lightIntensity, viewDirection,
material, ren->GetTwoSidedLighting(),
gradest, update_flag );
lightIntensity, viewDirection,
material, ren->GetTwoSidedLighting(),
gradest, update_flag );
update_flag = 1;
}
......@@ -388,14 +388,14 @@ void vtkEncodedGradientShader::UpdateShadingTable( vtkRenderer *ren,
// be handled. There is one shading table per volume, and the index
// value indicates which index table is to be updated
void vtkEncodedGradientShader::BuildShadingTable( int index,
float lightDirection[3],
float lightColor[3],
float lightIntensity,
float viewDirection[3],
float material[4],
int twoSided,
vtkEncodedGradientEstimator *gradest,
int updateFlag )
float lightDirection[3],
float lightColor[3],
float lightIntensity,
float viewDirection[3],
float material[4],
int twoSided,
vtkEncodedGradientEstimator *gradest,
int updateFlag )
{
float lx, ly, lz;
float n_dot_l;
......@@ -445,9 +445,9 @@ void vtkEncodedGradientShader::BuildShadingTable( int index,
for ( i=0; i<6; i++ )
{
if ( this->ShadingTable[index][i] )
{
delete [] this->ShadingTable[index][i];
}
{
delete [] this->ShadingTable[index][i];
}
this->ShadingTable[index][i] = new float[norm_size];
}
this->ShadingTableSize[index] = norm_size;
......@@ -468,20 +468,20 @@ void vtkEncodedGradientShader::BuildShadingTable( int index,
{
// If we have a zero normal, treat it specially
if ( ( *(nptr+0) == 0.0 ) &&
( *(nptr+1) == 0.0 ) &&
( *(nptr+2) == 0.0 ) )
( *(nptr+1) == 0.0 ) &&
( *(nptr+2) == 0.0 ) )
{
// If we are not updating, initial everything to 0.0
if ( !updateFlag )
{
*(sdr_ptr) = 0.0;
*(sdg_ptr) = 0.0;
*(sdb_ptr) = 0.0;
{
*(sdr_ptr) = 0.0;
*(sdg_ptr) = 0.0;
*(sdb_ptr) = 0.0;
*(ssr_ptr) = 0.0;
*(ssg_ptr) = 0.0;
*(ssb_ptr) = 0.0;
}
*(ssr_ptr) = 0.0;
*(ssg_ptr) = 0.0;
*(ssb_ptr) = 0.0;
}
// Now add in ambient
*(sdr_ptr) += Ka * lightColor[0];
......@@ -490,12 +490,12 @@ void vtkEncodedGradientShader::BuildShadingTable( int index,
// Add in diffuse
*(sdr_ptr) +=
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[0]);
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[0]);
*(sdg_ptr) +=
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[1]);
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[1]);
*(sdb_ptr) +=
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[2]);
(Kd_intensity * this->ZeroNormalDiffuseIntensity * lightColor[2]);
// Add in specular
*(ssr_ptr) += this->ZeroNormalSpecularIntensity * lightColor[0];
*(ssg_ptr) += this->ZeroNormalSpecularIntensity * lightColor[1];
......@@ -514,53 +514,53 @@ void vtkEncodedGradientShader::BuildShadingTable( int index,
// Flip the normal if two sided lighting is on and the normal
// is pointing away from the viewer
if ( twoSided )
{
// The dot product between the normal and the view vector
// used for two sided lighting
n_dot_v = (*(nptr+0) * viewDirection[0] +
*(nptr+1) * viewDirection[1] +
*(nptr+2) * viewDirection[2]);
if ( n_dot_v > 0.0 )
{
n_dot_l = -n_dot_l;
n_dot_h = -n_dot_h;
}
}
{
// The dot product between the normal and the view vector
// used for two sided lighting
n_dot_v = (*(nptr+0) * viewDirection[0] +
*(nptr+1) * viewDirection[1] +
*(nptr+2) * viewDirection[2]);
if ( n_dot_v > 0.0 )
{
n_dot_l = -n_dot_l;
n_dot_h = -n_dot_h;
}
}
// If we are updating, then begin by adding in ambient
if ( updateFlag )
{
*(sdr_ptr) += Ka * lightColor[0];
*(sdg_ptr) += Ka * lightColor[1];
*(sdb_ptr) += Ka * lightColor[2];
}
{
*(sdr_ptr) += Ka * lightColor[0];
*(sdg_ptr) += Ka * lightColor[1];
*(sdb_ptr) += Ka * lightColor[2];
}
// Otherwise begin by setting the value to the ambient contribution
else
{
*(sdr_ptr) = Ka * lightColor[0];
*(sdg_ptr) = Ka * lightColor[1];
*(sdb_ptr) = Ka * lightColor[2];
*(ssr_ptr) = 0.0;
*(ssg_ptr) = 0.0;
*(ssb_ptr) = 0.0;
}
{
*(sdr_ptr) = Ka * lightColor[0];
*(sdg_ptr) = Ka * lightColor[1];
*(sdb_ptr) = Ka * lightColor[2];
*(ssr_ptr) = 0.0;
*(ssg_ptr) = 0.0;
*(ssb_ptr) = 0.0;
}
// If there is some diffuse contribution, add it in
if ( n_dot_l > 0 )
{
*(sdr_ptr) += (Kd_intensity * n_dot_l * lightColor[0]);
*(sdg_ptr) += (Kd_intensity * n_dot_l * lightColor[1]);
*(sdb_ptr) += (Kd_intensity * n_dot_l * lightColor[2]);
if ( n_dot_h > 0.001 )
{
specular_value = Ks_intensity * pow( (double)n_dot_h, (double)Es );
*(ssr_ptr) += specular_value * lightColor[0];
*(ssg_ptr) += specular_value * lightColor[1];
*(ssb_ptr) += specular_value * lightColor[2];
}
}
{
*(sdr_ptr) += (Kd_intensity * n_dot_l * lightColor[0]);
*(sdg_ptr) += (Kd_intensity * n_dot_l * lightColor[1]);
*(sdb_ptr) += (Kd_intensity * n_dot_l * lightColor[2]);
if ( n_dot_h > 0.001 )
{
specular_value = Ks_intensity * pow( (double)n_dot_h, (double)Es );
*(ssr_ptr) += specular_value * lightColor[0];
*(ssg_ptr) += specular_value * lightColor[1];
*(ssb_ptr) += specular_value * lightColor[2];
}
}
}
// Increment all the pointers
......
......@@ -86,7 +86,7 @@ public:
// Description:
// Cause the shading table to be updated
void UpdateShadingTable( vtkRenderer *ren, vtkVolume *vol,
vtkEncodedGradientEstimator *gradest);
vtkEncodedGradientEstimator *gradest);
// Description:
// Get the red/green/blue shading table.
......@@ -115,14 +115,14 @@ protected:
// table per volume, and the index value indicated which index table
// should be used. It is computed in the UpdateShadingTable method.
void BuildShadingTable( int index,
float lightDirection[3],
float lightColor[3],
float lightIntensity,
float viewDirection[3],
float material[4],
int twoSided,
vtkEncodedGradientEstimator *gradest,
int updateFlag );
float lightDirection[3],
float lightColor[3],
float lightIntensity,
float viewDirection[3],
float material[4],
int twoSided,
vtkEncodedGradientEstimator *gradest,
int updateFlag );
// The six shading tables (r diffuse ,g diffuse ,b diffuse,
// r specular, g specular, b specular ) - with an entry for each
......
......@@ -76,7 +76,7 @@ vtkFiniteDifferenceGradientEstimator* vtkFiniteDifferenceGradientEstimator::New(
template <class T>
static void ComputeGradients(
vtkFiniteDifferenceGradientEstimator *estimator, T *data_ptr,
int thread_id, int thread_count )
int thread_id, int thread_count )
{
int xstep, ystep, zstep;
int x, y, z;
......@@ -138,9 +138,9 @@ static void ComputeGradients(
y_start = bounds[2];
y_limit = bounds[3]+1;
z_start = (int)(( (float)thread_id / (float)thread_count ) *
(float)(bounds[5]-bounds[4]+1) ) + bounds[4];
(float)(bounds[5]-bounds[4]+1) ) + bounds[4];
z_limit = (int)(( (float)(thread_id + 1) / (float)thread_count ) *
(float)(bounds[5]-bounds[4]+1) ) + bounds[4];
(float)(bounds[5]-bounds[4]+1) ) + bounds[4];
}
else
{
......@@ -149,9 +149,9 @@ static void ComputeGradients(
y_start = 0;
y_limit = size[1];
z_start = (int)(( (float)thread_id / (float)thread_count ) *
size[2] );
size[2] );
z_limit = (int)(( (float)(thread_id + 1) / (float)thread_count ) *
size[2] );
size[2] );
}
// Do final error checking on limits - make sure they are all within bounds
......@@ -178,15 +178,15 @@ static void ComputeGradients(
for ( y = y_start; y < y_limit; y++ )
{
if ( useClip )
{
xlow = ((clip[2*y])>x_start)?(clip[2*y]):(x_start);
xhigh = ((clip[2*y+1]+1)<x_limit)?(clip[2*y+1]+1):(x_limit);
}
{
xlow = ((clip[2*y])>x_start)?(clip[2*y]):(x_start);
xhigh = ((clip[2*y+1]+1)<x_limit)?(clip[2*y+1]+1):(x_limit);
}
else
{
xlow = x_start;
xhigh = x_limit;
}
{
xlow = x_start;
xhigh = x_limit;
}
offset = z * size[0] * size[1] + y * size[0] + xlow;
// Set some pointers
......@@ -195,15 +195,15 @@ static void ComputeGradients(
gptr = estimator->GradientMagnitudes + offset;
for ( x = xlow; x < xhigh; x++ )
{
{
// Use a central difference method if possible,
// otherwise use a forward or backward difference if
// we are on the edge