Commit 35cf6c00 authored by Will Schroeder's avatar Will Schroeder
Browse files

*** empty log message ***

parent b43b1ce7
......@@ -40,6 +40,7 @@ void vlShrinkFilter::Execute()
return;
}
this->Allocate(numCells);
newPts = new vlFloatPoints(numPts*8,numPts);
pd = this->Input->GetPointData();
this->PointData.CopyAllocate(pd,numPts*8,numPts);
......@@ -47,7 +48,7 @@ void vlShrinkFilter::Execute()
// Traverse all cells, obtaining node coordinates. Compute "center" of cell,
// then create new vertices shrunk towards center.
//
for (cellId=0; cellId < numCells; i++)
for (cellId=0; cellId < numCells; cellId++)
{
this->Input->GetCellPoints(cellId,ptIds);
......@@ -55,7 +56,7 @@ void vlShrinkFilter::Execute()
center[0] = center[1] = center[2] = 0.0;
for (i=0; i < ptIds.GetNumberOfIds(); i++)
{
p = this->Input->GetPoint(i);
p = this->Input->GetPoint(ptIds.GetId(i));
for (j=0; j < 3; j++) center[j] += p[j];
}
for (j=0; j<3; j++) center[j] /= ptIds.GetNumberOfIds();
......@@ -71,19 +72,16 @@ void vlShrinkFilter::Execute()
newId = newPts->InsertNextPoint(pt);
newPtIds.SetId(i,newId);
this->InsertNextCell(this->Input->GetCellType(cellId), newPtIds);
this->PointData.CopyData(pd, oldId, newId);
}
this->InsertNextCell(this->Input->GetCellType(cellId), newPtIds);
}
//
// Update ourselves
//
newPts->Squeeze();
this->SetPoints(newPts);
this->PointData.Squeeze();
this->Squeeze();
}
void vlShrinkFilter::PrintSelf(ostream& os, vlIndent indent)
......
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