23 #include "vtkPolyData.h"
24 #include "vtkSphereSource.h"
31 sphereSource->SetCenter(0, 0, 0);
32 sphereSource->SetRadius(5.0);
33 sphereSource->SetThetaResolution(10);
34 sphereSource->SetPhiResolution(10);
35 sphereSource->Update();
37 vtkPolyData *polys = sphereSource->GetOutput();
38 surface->SetVtkPolyData(polys);
39 sphereSource->Delete();
42 MITK_TEST_OUTPUT(<<
"Testing mitk::SurfaceToSurfaceFilter::SetInput() and ::GetNumberOfInputs() : ");
43 filter->SetInput(surface);
54 "Test if number of outputs == number of inputs");
60 outputSurface = filter->GetOutput();
61 MITK_TEST_CONDITION(outputSurface->GetSizeOfPolyDataSeries() == surface->GetSizeOfPolyDataSeries(),
62 "Test if number of PolyDatas in PolyDataSeries of output == number of PolyDatas of input");
67 std::vector<vtkPolyData *> polydatas;
68 for (
unsigned int i = 0; i < 5; ++i)
71 sphereSource->SetCenter(0, i, 0);
72 sphereSource->SetRadius(5.0 + i);
73 sphereSource->SetThetaResolution(10);
74 sphereSource->SetPhiResolution(10);
75 sphereSource->Update();
77 vtkPolyData *poly = sphereSource->GetOutput();
79 s->SetVtkPolyData(poly);
80 s2sFilter->SetInput(i, s);
81 polydatas.push_back(s2sFilter->GetOutput(i)->GetVtkPolyData());
82 sphereSource->Delete();
86 for (
unsigned int i = 0; i < 5; ++i)
89 "Test if pointers are still equal");
93 s2sFilter->CreateOutputsForAllInputs();
94 for (
unsigned int i = 0; i < 5; ++i)
96 MITK_TEST_CONDITION(s2sFilter->GetOutput(i)->GetVtkPolyData() != polydatas.at(i),
"Test if pointers are not equal");
Class for storing surfaces (vtkPolyData).
int mitkSurfaceToSurfaceFilterTest(int, char *[])
#define MITK_TEST_FOR_EXCEPTION(EXCEPTIONCLASS, STATEMENT)
Simplified version of MITK_TEST_FOR_EXCEPTION_BEGIN / END for a single statement. ...
#define MITK_TEST_OUTPUT(x)
Output some text.
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
#define MITK_TEST_CONDITION(COND, MSG)
#define MITK_ASSERT_EQUAL(EXPECTED, ACTUAL, MSG)
Testing macro to test if two objects are equal.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.