From 87a6915729789cf840d60bb2c5651dade68b3549 Mon Sep 17 00:00:00 2001 From: Berk Geveci <berk.geveci@kitware.com> Date: Mon, 9 Jan 2012 16:31:48 -0500 Subject: [PATCH] COMP: Update testing code to new VTK API --- .../TestGraphWeightEuclideanDistanceFilter.cxx | 2 +- .../Testing/Cxx/TestLinearExtractor2D.cxx | 6 +++--- .../Testing/Cxx/TestLinearExtractor3D.cxx | 18 +++++++++--------- Graphics/Testing/Cxx/TestCenterOfMass.cxx | 2 +- .../Cxx/TestQuadRotationalExtrusion.cxx | 6 +++--- .../TestQuadRotationalExtrusionMultiBlock.cxx | 6 +++--- Hybrid/Testing/Cxx/TestBSplineWarp.cxx | 4 ++-- IO/Testing/Cxx/TestLSDynaReader.cxx | 2 +- IO/Testing/Cxx/TestLSDynaReaderSPH.cxx | 2 +- Infovis/Testing/Cxx/TestStringToNumeric.cxx | 2 +- Widgets/Testing/Cxx/TestBrokenLineWidget.cxx | 10 +++++----- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Filtering/Testing/Cxx/TestGraphWeightEuclideanDistanceFilter.cxx b/Filtering/Testing/Cxx/TestGraphWeightEuclideanDistanceFilter.cxx index 83a9b335229..bdb8980e3a4 100644 --- a/Filtering/Testing/Cxx/TestGraphWeightEuclideanDistanceFilter.cxx +++ b/Filtering/Testing/Cxx/TestGraphWeightEuclideanDistanceFilter.cxx @@ -39,7 +39,7 @@ int TestGraphWeightEuclideanDistanceFilter(int, char *[]) vtkSmartPointer<vtkGraphWeightEuclideanDistanceFilter> weightFilter = vtkSmartPointer<vtkGraphWeightEuclideanDistanceFilter>::New(); - weightFilter->SetInputConnection(g->GetProducerPort()); + weightFilter->SetInputData(g); weightFilter->Update(); vtkFloatArray* weights = vtkFloatArray::SafeDownCast(weightFilter->GetOutput()->GetEdgeData()->GetArray("Weights")); diff --git a/Filtering/Testing/Cxx/TestLinearExtractor2D.cxx b/Filtering/Testing/Cxx/TestLinearExtractor2D.cxx index 0c5a2909907..351b93cf0e5 100644 --- a/Filtering/Testing/Cxx/TestLinearExtractor2D.cxx +++ b/Filtering/Testing/Cxx/TestLinearExtractor2D.cxx @@ -101,7 +101,7 @@ static int CheckExtractedUGrid( vtkExtractSelection* extract, << ".vtk"; vtkSmartPointer<vtkUnstructuredGridWriter> writer = vtkSmartPointer<vtkUnstructuredGridWriter>::New(); writer->SetFileName( fileNameSS.str().c_str() ); - writer->SetInput( ugrid ); + writer->SetInputData( ugrid ); writer->Write(); cerr << "Wrote file " << fileNameSS.str() @@ -136,7 +136,7 @@ int TestLinearExtractor2D( int argc, char * argv [] ) // Create selection along one line segment vtkSmartPointer<vtkLinearExtractor> le = vtkSmartPointer<vtkLinearExtractor>::New(); - le->SetInput( mesh ); + le->SetInputData( mesh ); le->SetStartPoint( 35.84, .0, .0 ); le->SetEndPoint( 36.9, .03, .0 ); le->IncludeVerticesOff(); @@ -144,7 +144,7 @@ int TestLinearExtractor2D( int argc, char * argv [] ) // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> es = vtkSmartPointer<vtkExtractSelection>::New(); - es->SetInput( 0, mesh ); + es->SetInputData( 0, mesh ); es->SetInputConnection( 1, le->GetOutputPort() ); es->Update(); diff --git a/Filtering/Testing/Cxx/TestLinearExtractor3D.cxx b/Filtering/Testing/Cxx/TestLinearExtractor3D.cxx index 9291db47cdd..2b948d544b8 100644 --- a/Filtering/Testing/Cxx/TestLinearExtractor3D.cxx +++ b/Filtering/Testing/Cxx/TestLinearExtractor3D.cxx @@ -107,7 +107,7 @@ static int CheckExtractedUGrid( vtkExtractSelection* extract, << ".vtk"; vtkSmartPointer<vtkUnstructuredGridWriter> writer = vtkSmartPointer<vtkUnstructuredGridWriter>::New(); writer->SetFileName( fileNameSS.str().c_str() ); - writer->SetInput( ugrid ); + writer->SetInputData( ugrid ); writer->Write(); cerr << "Wrote file " << fileNameSS.str() @@ -142,7 +142,7 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Create selection along one line segment vtkSmartPointer<vtkLinearExtractor> le0 = vtkSmartPointer<vtkLinearExtractor>::New(); - le0->SetInput( mesh ); + le0->SetInputData( mesh ); le0->SetStartPoint( .0, .0, .0 ); le0->SetEndPoint( .23, .04, .04 ); le0->IncludeVerticesOff(); @@ -150,7 +150,7 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> es0 = vtkSmartPointer<vtkExtractSelection>::New(); - es0->SetInput( 0, mesh ); + es0->SetInputData( 0, mesh ); es0->SetInputConnection( 1, le0->GetOutputPort() ); es0->Update(); @@ -162,7 +162,7 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Create selection along one line segment vtkSmartPointer<vtkLinearExtractor> le1 = vtkSmartPointer<vtkLinearExtractor>::New(); - le1->SetInput( mesh ); + le1->SetInputData( mesh ); le1->SetStartPoint( .0, .0, .0 ); le1->SetEndPoint( .23, .0, .0 ); le1->IncludeVerticesOff(); @@ -170,7 +170,7 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> es1 = vtkSmartPointer<vtkExtractSelection>::New(); - es1->SetInput( 0, mesh ); + es1->SetInputData( 0, mesh ); es1->SetInputConnection( 1, le1->GetOutputPort() ); es1->Update(); @@ -188,14 +188,14 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Create selection along this broken line vtkSmartPointer<vtkLinearExtractor> le2 = vtkSmartPointer<vtkLinearExtractor>::New(); - le2->SetInput( mesh ); + le2->SetInputData( mesh ); le2->SetPoints( points2 ); le2->IncludeVerticesOff(); le2->SetVertexEliminationTolerance( 1.e-12 ); // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> es2 = vtkSmartPointer<vtkExtractSelection>::New(); - es2->SetInput( 0, mesh ); + es2->SetInputData( 0, mesh ); es2->SetInputConnection( 1, le2->GetOutputPort() ); es2->Update(); @@ -213,14 +213,14 @@ int TestLinearExtractor3D( int argc, char * argv [] ) // Create selection along this broken line vtkSmartPointer<vtkLinearExtractor> le3 = vtkSmartPointer<vtkLinearExtractor>::New(); - le3->SetInput( mesh ); + le3->SetInputData( mesh ); le3->SetPoints( points3 ); le3->IncludeVerticesOff(); le3->SetVertexEliminationTolerance( 1.e-12 ); // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> es3 = vtkSmartPointer<vtkExtractSelection>::New(); - es3->SetInput( 0, mesh ); + es3->SetInputData( 0, mesh ); es3->SetInputConnection( 1, le3->GetOutputPort() ); es3->Update(); diff --git a/Graphics/Testing/Cxx/TestCenterOfMass.cxx b/Graphics/Testing/Cxx/TestCenterOfMass.cxx index f3d1c93bfbd..25c62121a82 100644 --- a/Graphics/Testing/Cxx/TestCenterOfMass.cxx +++ b/Graphics/Testing/Cxx/TestCenterOfMass.cxx @@ -55,7 +55,7 @@ int TestCenterOfMass(int, char*[]) // Compute the center of mass vtkSmartPointer<vtkCenterOfMass> centerOfMassFilter = vtkSmartPointer<vtkCenterOfMass>::New(); - centerOfMassFilter->SetInputConnection(polydata->GetProducerPort()); + centerOfMassFilter->SetInputData(polydata); // Test unweighted { diff --git a/Graphics/Testing/Cxx/TestQuadRotationalExtrusion.cxx b/Graphics/Testing/Cxx/TestQuadRotationalExtrusion.cxx index 7d9d667154e..2c5539cc056 100644 --- a/Graphics/Testing/Cxx/TestQuadRotationalExtrusion.cxx +++ b/Graphics/Testing/Cxx/TestQuadRotationalExtrusion.cxx @@ -59,7 +59,7 @@ int TestQuadRotationalExtrusion( int argc, char * argv [] ) // Create 3/4 of a cylinder by rotational extrusion vtkNew<vtkQuadRotationalExtrusionFilter> lineSweeper; lineSweeper->SetResolution( 20 ); - lineSweeper->SetInput( lineMB.GetPointer() ); + lineSweeper->SetInputData( lineMB.GetPointer() ); lineSweeper->SetDefaultAngle( 270 ); lineSweeper->Update(); @@ -69,7 +69,7 @@ int TestQuadRotationalExtrusion( int argc, char * argv [] ) // Create normals for smooth rendering vtkNew<vtkPolyDataNormals> normals; - normals->SetInput( cyl ); + normals->SetInputData( cyl ); // Create mapper for surface representation vtkNew<vtkPolyDataMapper> cylMapper; @@ -79,7 +79,7 @@ int TestQuadRotationalExtrusion( int argc, char * argv [] ) // Create mapper for wireframe representation vtkNew<vtkPolyDataMapper> cylMapperW; - cylMapperW->SetInput( cyl ); + cylMapperW->SetInputData( cyl ); cylMapperW->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 ); cylMapperW->SetResolveCoincidentTopologyToPolygonOffset(); diff --git a/Graphics/Testing/Cxx/TestQuadRotationalExtrusionMultiBlock.cxx b/Graphics/Testing/Cxx/TestQuadRotationalExtrusionMultiBlock.cxx index 63556a4c68d..7873ec14679 100644 --- a/Graphics/Testing/Cxx/TestQuadRotationalExtrusionMultiBlock.cxx +++ b/Graphics/Testing/Cxx/TestQuadRotationalExtrusionMultiBlock.cxx @@ -59,7 +59,7 @@ int TestQuadRotationalExtrusionMultiBlock( int argc, char * argv [] ) // Create 3/4 of a cylinder by rotational extrusion vtkNew<vtkQuadRotationalExtrusionFilter> sweeper; sweeper->SetResolution( 18 ); - sweeper->SetInput( inMesh.GetPointer() ); + sweeper->SetInputData( inMesh.GetPointer() ); sweeper->SetAxisToX(); sweeper->SetDefaultAngle( 270 ); sweeper->AddPerBlockAngle( 1, 90. ); @@ -94,7 +94,7 @@ int TestQuadRotationalExtrusionMultiBlock( int argc, char * argv [] ) // Create mapper for wireframe representation of block 0 vtkNew<vtkPolyDataMapper> outBlockMapper0; - outBlockMapper0->SetInput( outMesh0 ); + outBlockMapper0->SetInputData( outMesh0 ); outBlockMapper0->SetResolveCoincidentTopologyPolygonOffsetParameters( 1., 1 ); outBlockMapper0->SetResolveCoincidentTopologyToPolygonOffset(); @@ -109,7 +109,7 @@ int TestQuadRotationalExtrusionMultiBlock( int argc, char * argv [] ) // Create mapper for wireframe representation of block 1 vtkNew<vtkPolyDataMapper> outBlockMapper1; - outBlockMapper1->SetInput( outMesh1 ); + outBlockMapper1->SetInputData( outMesh1 ); outBlockMapper1->SetResolveCoincidentTopologyPolygonOffsetParameters( 1., 1 ); outBlockMapper1->SetResolveCoincidentTopologyToPolygonOffset(); diff --git a/Hybrid/Testing/Cxx/TestBSplineWarp.cxx b/Hybrid/Testing/Cxx/TestBSplineWarp.cxx index 462f59b4960..7c698f31033 100644 --- a/Hybrid/Testing/Cxx/TestBSplineWarp.cxx +++ b/Hybrid/Testing/Cxx/TestBSplineWarp.cxx @@ -82,8 +82,8 @@ int TestBSplineWarp(int argc, char *argv[]) vtkSmartPointer<vtkImageBlend> blend = vtkSmartPointer<vtkImageBlend>::New(); - blend->AddInput(map1->GetOutput()); - blend->AddInput(map2->GetOutput()); + blend->AddInputConnection(map1->GetOutputPort()); + blend->AddInputConnection(map2->GetOutputPort()); // next, create a ThinPlateSpline transform, which // will then be used to create the B-spline transform diff --git a/IO/Testing/Cxx/TestLSDynaReader.cxx b/IO/Testing/Cxx/TestLSDynaReader.cxx index 6279193a7bb..bb166ba57a3 100644 --- a/IO/Testing/Cxx/TestLSDynaReader.cxx +++ b/IO/Testing/Cxx/TestLSDynaReader.cxx @@ -50,7 +50,7 @@ int TestLSDynaReader( int argc, char *argv[] ) // Create a mapper. vtkNew<vtkPolyDataMapper> mapper; - mapper->SetInput(geom1->GetOutput()); + mapper->SetInputConnection(geom1->GetOutputPort()); mapper->SetScalarModeToUsePointFieldData(); // Create the actor. diff --git a/IO/Testing/Cxx/TestLSDynaReaderSPH.cxx b/IO/Testing/Cxx/TestLSDynaReaderSPH.cxx index 1ababc3230f..5694582612a 100644 --- a/IO/Testing/Cxx/TestLSDynaReaderSPH.cxx +++ b/IO/Testing/Cxx/TestLSDynaReaderSPH.cxx @@ -50,7 +50,7 @@ int TestLSDynaReaderSPH( int argc, char *argv[] ) // Create a mapper. vtkNew<vtkPolyDataMapper> mapper; - mapper->SetInput(geom1->GetOutput()); + mapper->SetInputConnection(geom1->GetOutputPort()); mapper->SetScalarModeToUsePointFieldData(); // Create the actor. diff --git a/Infovis/Testing/Cxx/TestStringToNumeric.cxx b/Infovis/Testing/Cxx/TestStringToNumeric.cxx index d48cfdb5b88..d304fd3a7c2 100644 --- a/Infovis/Testing/Cxx/TestStringToNumeric.cxx +++ b/Infovis/Testing/Cxx/TestStringToNumeric.cxx @@ -150,7 +150,7 @@ int WhitespaceAndEmptyCellsTest() numeric->SetDefaultIntegerValue(defaultIntValue); numeric->SetDefaultDoubleValue(vtkMath::Nan()); numeric->SetTrimWhitespacePriorToNumericConversion(true); - numeric->SetInput(inputTable.GetPointer()); + numeric->SetInputData(inputTable.GetPointer()); numeric->Update(); vtkTable* table = vtkTable::SafeDownCast(numeric->GetOutput()); table->Dump(); diff --git a/Widgets/Testing/Cxx/TestBrokenLineWidget.cxx b/Widgets/Testing/Cxx/TestBrokenLineWidget.cxx index 290ba3ea09f..b5a8fcf72ce 100644 --- a/Widgets/Testing/Cxx/TestBrokenLineWidget.cxx +++ b/Widgets/Testing/Cxx/TestBrokenLineWidget.cxx @@ -45,7 +45,7 @@ public: this->Extractor->Update(); vtkMultiBlockDataSet* outMB = vtkMultiBlockDataSet::SafeDownCast( this->Extractor->GetOutput() ); vtkUnstructuredGrid* selection = vtkUnstructuredGrid::SafeDownCast( outMB->GetBlock( 0 ) ); - this->Mapper->SetInput( selection ); + this->Mapper->SetInputData( selection ); // Update cardinality of selection vtksys_ios::ostringstream txt; @@ -137,7 +137,7 @@ int TestBrokenLineWidget( int argc, char *argv[] ) vtkSmartPointer<vtkPolyData> linePD = vtkSmartPointer<vtkPolyData>::New(); line->GetPolyData( linePD ); vtkSmartPointer<vtkPolyDataMapper> lineMapper = vtkSmartPointer<vtkPolyDataMapper>::New(); - lineMapper->SetInput( linePD ); + lineMapper->SetInputData( linePD ); vtkSmartPointer<vtkActor> lineActor = vtkSmartPointer<vtkActor>::New(); lineActor->SetMapper( lineMapper ); lineActor->GetProperty()->SetColor( 1., 0., 0. ); @@ -146,14 +146,14 @@ int TestBrokenLineWidget( int argc, char *argv[] ) // Create selection along broken line defined by list of points vtkSmartPointer<vtkLinearExtractor> selector = vtkSmartPointer<vtkLinearExtractor>::New(); - selector->SetInput( meshMB ); + selector->SetInputData( meshMB ); selector->SetPoints( points ); selector->IncludeVerticesOff(); selector->SetVertexEliminationTolerance( 1.e-12 ); // Extract selection from mesh vtkSmartPointer<vtkExtractSelection> extractor = vtkSmartPointer<vtkExtractSelection>::New(); - extractor->SetInput( 0, meshMB ); + extractor->SetInputData( 0, meshMB ); extractor->SetInputConnection( 1, selector->GetOutputPort() ); extractor->Update(); vtkMultiBlockDataSet* outMB = vtkMultiBlockDataSet::SafeDownCast( extractor->GetOutput() ); @@ -161,7 +161,7 @@ int TestBrokenLineWidget( int argc, char *argv[] ) // Create selection actor vtkSmartPointer<vtkDataSetMapper> selMapper = vtkSmartPointer<vtkDataSetMapper>::New(); - selMapper->SetInput( selection ); + selMapper->SetInputData( selection ); vtkSmartPointer<vtkActor> selActor = vtkSmartPointer<vtkActor>::New(); selActor->SetMapper( selMapper ); selActor->GetProperty()->SetColor( 0., 0., 0. ); -- GitLab