Commit bc14b529 authored by Chris Harris's avatar Chris Harris
Browse files

COMP: Update to new VTK API

parent 876ce5a1
......@@ -53,7 +53,7 @@ void vtkImplicitPolyDataDistance::SetInput(vtkPolyData* input)
triangleFilter->PassVertsOff();
triangleFilter->PassLinesOff();
triangleFilter->SetInput( input );
triangleFilter->SetInputData( input );
triangleFilter->Update();
this->Input = triangleFilter->GetOutput();
......@@ -83,7 +83,6 @@ unsigned long vtkImplicitPolyDataDistance::GetMTime()
if ( this->Input != NULL )
{
this->Input->Update();
InputMTime = this->Input->GetMTime();
mTime = (InputMTime > mTime ? InputMTime : mTime);
}
......
......@@ -696,8 +696,8 @@ vtkCellArray* vtkIntersectionPolyDataFilter::Impl
vtkSmartPointer< vtkDelaunay2D > del2D =
vtkSmartPointer< vtkDelaunay2D >::New();
del2D->SetInput(pd);
del2D->SetSource(pd);
del2D->SetInputData(pd);
del2D->SetSourceData(pd);
del2D->SetTolerance(0.0);
del2D->SetAlpha(0.0);
del2D->SetOffset(10);
......@@ -1099,11 +1099,9 @@ int vtkIntersectionPolyDataFilter::RequestData(vtkInformation* vtkNotUsed
// Set up new poly data for the inputs to build cells and links.
vtkSmartPointer< vtkPolyData > mesh0 = vtkSmartPointer< vtkPolyData >::New();
mesh0->DeepCopy(input0);
mesh0->SetSource(NULL);
vtkSmartPointer< vtkPolyData > mesh1 = vtkSmartPointer< vtkPolyData >::New();
mesh1->DeepCopy(input1);
mesh1->SetSource(NULL);
// Find the triangle-triangle intersections between mesh0 and mesh1
vtkSmartPointer< vtkOBBTree > obbTree0 = vtkSmartPointer< vtkOBBTree >::New();
......
......@@ -430,10 +430,7 @@ unsigned long vtkBSplineTransform::GetMTime()
result = vtkWarpTransform::GetMTime();
if (this->Coefficients)
{
this->Coefficients->UpdateInformation();
mtime = this->Coefficients->GetPipelineMTime();
result = ( mtime > result ? mtime : result );
//this->Coefficients->UpdateInformation();
mtime = this->Coefficients->GetMTime();
result = ( mtime > result ? mtime : result );
......@@ -817,8 +814,7 @@ void vtkBSplineTransform::InternalUpdate()
{
return;
}
grid->UpdateInformation();
//grid->UpdateInformation();
if (grid->GetNumberOfScalarComponents() != 3)
{
......@@ -841,8 +837,8 @@ void vtkBSplineTransform::InternalUpdate()
break;
}
grid->SetUpdateExtent(grid->GetWholeExtent());
grid->Update();
//grid->SetUpdateExtent(grid->GetWholeExtent());
//grid->Update();
this->GridPointer = grid->GetScalarPointer();
grid->GetSpacing(this->GridSpacing);
......
......@@ -90,8 +90,8 @@ int vtkImageBSplineCoefficients::RequestData(
}
// Allocate the output data
outData->SetExtent(outData->GetWholeExtent());
outData->AllocateScalars();
outData->SetExtent(outInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
outData->AllocateScalars(outInfo);
if (outData->GetScalarType() != VTK_FLOAT &&
outData->GetScalarType() != VTK_DOUBLE)
......
......@@ -123,9 +123,15 @@ vtkIdTypeArray *vtkImageHistogram::GetHistogram()
}
//----------------------------------------------------------------------------
void vtkImageHistogram::SetStencil(vtkImageStencilData *stencil)
void vtkImageHistogram::SetStencilData(vtkImageStencilData *stencil)
{
this->SetInput(1, stencil);
this->SetInputData(1, stencil);
}
//----------------------------------------------------------------------------
void vtkImageHistogram::SetStencilConnection(vtkAlgorithmOutput* algOutput)
{
this->SetInputConnection(1, algOutput);
}
//----------------------------------------------------------------------------
......@@ -674,7 +680,7 @@ int vtkImageHistogram::RequestData(
int updateExtent[6];
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
updateExtent);
this->AllocateOutputData(outData, updateExtent);
this->AllocateOutputData(outData, outInfo, updateExtent);
}
}
}
......
......@@ -100,9 +100,13 @@ public:
// Description:
// Use a stencil to compute the histogram for just a part of the image.
void SetStencil(vtkImageStencilData *stencil);
void SetStencilData(vtkImageStencilData *stencil);
vtkImageStencilData *GetStencil();
// Description:
// Equivalent to SetInputConnection(1, algOutput).
void SetStencilConnection(vtkAlgorithmOutput* algOutput);
// Description:
// If this is On, then a histogram image will be produced as the output.
// Regardless of this setting, the histogram is always available as a
......
......@@ -289,7 +289,7 @@ int vtkConvexHull2D::RequestData(vtkInformation *vtkNotUsed(request),
this->OutputTransform->Translate(centre);
this->OutputTransform->Scale(this->ScaleFactor, this->ScaleFactor, this->ScaleFactor);
this->OutputTransform->Translate(-centre[0], -centre[1], -centre[2]);
this->OutputTransformFilter->SetInput(hullPolyData);
this->OutputTransformFilter->SetInputData(hullPolyData);
this->OutputTransformFilter->Update();
hullPolyData = this->OutputTransformFilter->GetOutput();
......
......@@ -206,7 +206,7 @@ int vtkGraphAnnotationLayersFilter::RequestData(vtkInformation *vtkNotUsed(reque
vtkSmartPointer<vtkPolyData> hullPolyData =
vtkSmartPointer<vtkPolyData>::New();
hullPolyData->SetPoints(hullPoints);
ConvexHullFilter->SetInput(hullPolyData);
ConvexHullFilter->SetInputData(hullPolyData);
ConvexHullFilter->Update();
hullPolyData->ShallowCopy(ConvexHullFilter->GetOutput());
......@@ -261,14 +261,14 @@ int vtkGraphAnnotationLayersFilter::RequestData(vtkInformation *vtkNotUsed(reque
hullPolyData->GetCellData()->AddArray(hullCentreVertex);
hullCentreVertex->Delete();
this->HullAppend->AddInput(hullPolyData);
this->HullAppend->AddInputData(hullPolyData);
if (this->ConvexHullFilter->GetOutline())
{
vtkSmartPointer<vtkPolyData> outlinePolyData =
vtkSmartPointer<vtkPolyData>::New();
outlinePolyData->ShallowCopy(ConvexHullFilter->GetOutput(1));
this->OutlineAppend->AddInput(outlinePolyData);
this->OutlineAppend->AddInputData(outlinePolyData);
}
} // Next selection node.
} // Next annotation.
......
......@@ -31,6 +31,10 @@
#include "vtkTimerLog.h"
#include "vtkGarbageCollector.h"
#include "vtkTemplateAliasMacro.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include <math.h>
......@@ -974,7 +978,9 @@ void vtkOpenGLImageSliceMapper::Render(vtkRenderer *ren, vtkImageSlice *prop)
vtkImageData *input = this->GetInput();
input->GetSpacing(this->DataSpacing);
input->GetOrigin(this->DataOrigin);
input->GetWholeExtent(this->DataWholeExtent);
vtkInformation *inputInfo = this->GetInputInformation(0, 0);
inputInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
this->DataWholeExtent);
// OpenGL matrices are column-order, not row-order like VTK
vtkMatrix4x4 *matrix = this->GetDataToWorldMatrix();
......
......@@ -83,7 +83,7 @@ vtkBrokenLineWidget::vtkBrokenLineWidget()
this->HandleGeometry[i]->SetThetaResolution( 16 );
this->HandleGeometry[i]->SetPhiResolution( 8 );
vtkPolyDataMapper* handleMapper = vtkPolyDataMapper::New();
handleMapper->SetInput( this->HandleGeometry[i]->GetOutput() );
handleMapper->SetInputConnection(this->HandleGeometry[i]->GetOutputPort() );
this->Handle[i] = vtkActor::New();
this->Handle[i]->SetMapper( handleMapper );
handleMapper->Delete();
......@@ -1147,7 +1147,7 @@ void vtkBrokenLineWidget::SetNumberOfHandles( int npts )
this->HandleGeometry[i]->SetThetaResolution( 16 );
this->HandleGeometry[i]->SetPhiResolution( 8 );
vtkPolyDataMapper* handleMapper = vtkPolyDataMapper::New();
handleMapper->SetInput( this->HandleGeometry[i]->GetOutput() );
handleMapper->SetInputConnection( this->HandleGeometry[i]->GetOutputPort() );
this->Handle[i] = vtkActor::New();
this->Handle[i]->SetMapper( handleMapper );
handleMapper->Delete();
......
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