Commit 1b63b087 authored by Bill Lorensen's avatar Bill Lorensen Committed by Kitware Robot
Browse files

Merge topic 'ReebGraphValgrindDefects'

fbf9445c BUG: Flawed logic caused valgrind defects
parents fa1ebbc7 fbf9445c
......@@ -156,7 +156,7 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re
vtkDoubleArray *subField = vtkDoubleArray::New();
vtkPoints *subPointSet = vtkPoints::New();
vtkDoubleArray *subCoordinates = vtkDoubleArray::New();
std::vector<int> meshToSubMeshMap(inputMesh->GetNumberOfPoints());
std::vector<vtkIdType> meshToSubMeshMap(inputMesh->GetNumberOfPoints());
subCoordinates->SetNumberOfComponents(3);
subField->SetNumberOfComponents(1);
......@@ -186,7 +186,7 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re
vtkTriangle::SafeDownCast(inputMesh->GetCell(tId));
std::vector<int> vertices(3);
std::vector<vtkIdType> vertices(3);
std::vector<double *> points(3);
for(int k = 0; k < 3; k++)
......@@ -197,9 +197,8 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re
// add also its scalar value to the subField
points[k] = (double *) malloc(sizeof(double)*3);
inputMesh->GetPoint(vertices[k], points[k]);
subCoordinates->InsertNextTupleValue(points[k]);
meshToSubMeshMap[vertices[k]] =
subCoordinates->GetNumberOfTuples();
subCoordinates->InsertNextTupleValue(points[k]);
double scalarFieldValue =
scalarField->GetComponent(vertices[k], 0);
subField->InsertNextTupleValue(&scalarFieldValue);
......@@ -267,7 +266,7 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re
vtkContourFilter *contourFilter = vtkContourFilter::New();
contourFilter->SetNumberOfContours(1);
contourFilter->SetValue(i, minValue +
contourFilter->SetValue(0, minValue +
(i + 1.0)*(maxValue - minValue)/(((double)NumberOfSamples) + 1.0));
contourFilter->SetInput(subMesh);
contourFilter->Update();
......
......@@ -164,7 +164,7 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req
vtkDoubleArray *subField = vtkDoubleArray::New();
vtkPoints *subPointSet = vtkPoints::New();
vtkDoubleArray *subCoordinates = vtkDoubleArray::New();
std::vector<int> meshToSubMeshMap(inputMesh->GetNumberOfPoints());
std::vector<vtkIdType> meshToSubMeshMap(inputMesh->GetNumberOfPoints());
subCoordinates->SetNumberOfComponents(3);
subField->SetNumberOfComponents(1);
......@@ -195,7 +195,7 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req
vtkIdType tId = starTetList->GetId(j);
vtkTetra *t = vtkTetra::SafeDownCast(inputMesh->GetCell(tId));
int vertexId;
vtkIdType vertexId;
for(int k = 0; k < 4; k++)
{
......@@ -204,9 +204,8 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req
{
// add also its scalar value to the subField
inputMesh->GetPoint(vertexId, point);
subCoordinates->InsertNextTupleValue(point);
meshToSubMeshMap[vertexId] =
subCoordinates->GetNumberOfTuples();
subCoordinates->InsertNextTupleValue(point);
double scalarFieldValue =
scalarField->GetComponent(vertexId, 0);
subField->InsertNextTupleValue(&scalarFieldValue);
......@@ -271,7 +270,7 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req
{
contourFilter->SetNumberOfContours(1);
contourFilter->SetValue(i, minValue +
contourFilter->SetValue(0, minValue +
(i + 1.0)*(maxValue - minValue)
/(((double)NumberOfSamples) + 1.0));
contourFilter->SetInput(subMesh);
......
Supports Markdown
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