Commit 0007a309 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Fixed bugs reported by reviewers.

parent 48be4c4e
......@@ -87,7 +87,7 @@ void vlAppendFilter::Execute()
vlFloatPoints *newPts;
vlPointData *pd;
vlIdList ptIds(MAX_CELL_SIZE), newPtIds(MAX_CELL_SIZE);
int i, j;
int i;
vlDataSet *ds;
int ptId, cellId;
......@@ -145,8 +145,8 @@ void vlAppendFilter::Execute()
for (cellId=0; cellId < numCells; cellId++)
{
ds->GetCellPoints(cellId,ptIds);
for (j=0; j < ptIds.GetNumberOfIds(); j++)
newPtIds.SetId(j,ptIds.GetId(i)+ptOffset);
for (i=0; i < ptIds.GetNumberOfIds(); i++)
newPtIds.SetId(i,ptIds.GetId(i)+ptOffset);
this->InsertNextCell(ds->GetCellType(cellId),newPtIds);
}
}
......
......@@ -210,7 +210,7 @@ void vlBooleanStructuredPoints::Append(vlStructuredPoints *sp)
for (k = 0; k < this->SampleDimensions[2]; k++)
{
in_z = dest_bounds[4] + k*this->AspectRatio[2];
in_k = (in_z - in_bounds[4])/in_aspect[2];
in_k = int ((float)(in_z - in_bounds[4])/in_aspect[2]);
if ((in_k >= 0)&&(in_k < in_dimensions[2]))
{
in_kval = in_k*in_dimensions[0]*in_dimensions[1];
......@@ -218,7 +218,7 @@ void vlBooleanStructuredPoints::Append(vlStructuredPoints *sp)
for (j = 0; j < this->SampleDimensions[1]; j++)
{
in_y = dest_bounds[2] + j*this->AspectRatio[1];
in_j = (in_y - in_bounds[2])/in_aspect[1];
in_j = (int) ((float)(in_y - in_bounds[2])/in_aspect[1]);
if ((in_j >= 0)&&(in_j < in_dimensions[1]))
{
in_jval = in_j*in_dimensions[0];
......@@ -226,7 +226,7 @@ void vlBooleanStructuredPoints::Append(vlStructuredPoints *sp)
for (i = 0; i < this->SampleDimensions[0]; i++)
{
in_x = dest_bounds[0] + i*this->AspectRatio[0];
in_i = (in_x - in_bounds[0])/in_aspect[0];
in_i = (int) ((float)(in_x - in_bounds[0])/in_aspect[0]);
if ((in_i >= 0)&&(in_i < in_dimensions[0]))
{
if (inScalars->GetScalar(in_kval+in_jval+in_i))
......
......@@ -35,7 +35,7 @@ void vlExtractGeometry::Execute()
vlPointData *pd;
float *x;
float r2=this->Radius*this->Radius;
vlFloatPoints *newPoints;
vlFloatPoints *newPts;
vlIdList newCellPts(MAX_CELL_SIZE);
vlDebugMacro(<< "Extracting geometry in sphere");
......@@ -48,6 +48,7 @@ void vlExtractGeometry::Execute()
pointMap = new vlIdList(numPts); // maps old point ids into new
for (i=0; i < numPts; i++) pointMap->SetId(i,-1);
newPts = new vlFloatPoints(numPts/4,numPts);
pd = this->Input->GetPointData();
this->PointData.CopyAllocate(pd);
......@@ -56,7 +57,7 @@ void vlExtractGeometry::Execute()
x = this->Input->GetPoint(ptId);
if ( math.Distance2BetweenPoints(x,this->Center) <= r2 )
{
newId = newPoints->InsertNextPoint(x);
newId = newPts->InsertNextPoint(x);
pointMap->SetId(ptId,newId);
this->PointData.CopyData(pd,ptId,newId);
}
......@@ -88,7 +89,7 @@ void vlExtractGeometry::Execute()
//
delete pointMap;
this->SetPoints(newPoints);
this->SetPoints(newPts);
this->Squeeze();
}
......
......@@ -131,8 +131,10 @@ void vlImplicitModeller::Execute()
// compute dimensional bounds in data set
for (i=0; i<3; i++)
{
min[i] = (adjBounds[2*i] - this->Origin[i]) / this->AspectRatio[i];
max[i] = (adjBounds[2*i+1] - this->Origin[i]) / this->AspectRatio[i];
min[i] = (int) ((float)(adjBounds[2*i] - this->Origin[i]) /
this->AspectRatio[i]);
max[i] = (int) ((float)(adjBounds[2*i+1] - this->Origin[i]) /
this->AspectRatio[i]);
if (min[i] < 0) min[i] = 0;
if (max[i] >= this->SampleDimensions[i]) max[i] = this->SampleDimensions[i] - 1;
}
......
......@@ -157,7 +157,7 @@ void vlGaussianSplatter::Execute()
vlDebugMacro(<< "Vertex #" << ptId);
for (i=0; i<3; i++)
loc[i] = (P[i] - this->Origin[i]) / this->AspectRatio[i];
loc[i] = (int) ((float)(P[i] - this->Origin[i]) / this->AspectRatio[i]);
//
// For each of the eight corners of the cell, need to evaluate sample
// function and then begin recursive distribution
......
......@@ -51,6 +51,12 @@ void vlTextureMapToBox::Execute()
//
// Allocate texture data
//
if ( (numPts=this->Input->GetNumberOfPoints()) < 1 )
{
vlErrorMacro(<<"No points to texture!");
return;
}
newTCoords = new vlFloatTCoords(numPts,3);
if ( this->AutomaticBoxGeneration )
......
......@@ -137,8 +137,10 @@ void vlVoxelModeller::Execute()
// compute dimensional bounds in data set
for (i=0; i<3; i++)
{
min[i] = (adjBounds[2*i] - this->Origin[i]) / this->AspectRatio[i];
max[i] = (adjBounds[2*i+1] - this->Origin[i]) / this->AspectRatio[i];
min[i] = (int) ((float)(adjBounds[2*i] - this->Origin[i]) /
this->AspectRatio[i]);
max[i] = (int) ((float)(adjBounds[2*i+1] - this->Origin[i]) /
this->AspectRatio[i]);
if (min[i] < 0) min[i] = 0;
if (max[i] >= this->SampleDimensions[i]) max[i] = this->SampleDimensions[i] - 1;
}
......
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