24 #include <vtkDebugLeaks.h>
25 #include <vtkPoints.h>
26 #include <vtkSmartPointer.h>
27 #include <vtkUnstructuredGrid.h>
29 class mitkUnstructuredGridToUnstructuredGridFilterTestSuite :
public mitk::TestFixture
31 CPPUNIT_TEST_SUITE(mitkUnstructuredGridToUnstructuredGridFilterTestSuite);
33 vtkDebugLeaks::SetExitError(0);
35 MITK_TEST(testUnstructuredGridToUnstructuredGridFilterInitialization);
38 MITK_TEST(testUnstructuredGridGeneration);
39 CPPUNIT_TEST_SUITE_END();
55 for (
int i = 0; i < 3; i++)
57 for (
int j = 0; j < 3; j++)
59 for (
int k = 0; k < 3; k++)
66 points->InsertNextPoint(point[0], point[1], point[2]);
67 points2->InsertNextPoint(point[0] + 5, point[1] + 5, point[2] + 5);
72 vtkGrid->SetPoints(points);
73 vtkGrid2->SetPoints(points2);
74 m_UnstructuredGrid->SetVtkUnstructuredGrid(vtkGrid);
75 m_2ndUnstructuredGrid->SetVtkUnstructuredGrid(vtkGrid2);
78 void testUnstructuredGridToUnstructuredGridFilterInitialization()
82 CPPUNIT_ASSERT_MESSAGE(
"Testing instantiation of test object", testFilter.IsNotNull());
89 testFilter->SetInput(m_UnstructuredGrid);
90 CPPUNIT_ASSERT_MESSAGE(
"Testing set / get input!", testFilter->GetInput() == m_UnstructuredGrid);
93 void testMultipleInputs()
97 testFilter->SetInput(0, m_UnstructuredGrid);
98 testFilter->SetInput(1, m_2ndUnstructuredGrid);
99 CPPUNIT_ASSERT_MESSAGE(
"Testing first input!", testFilter->GetInput(0) == m_UnstructuredGrid);
100 CPPUNIT_ASSERT_MESSAGE(
"Testing second input!", testFilter->GetInput(1) == m_2ndUnstructuredGrid);
103 void testUnstructuredGridGeneration()
107 testFilter->SetInput(m_UnstructuredGrid);
108 testFilter->Update();
109 CPPUNIT_ASSERT_MESSAGE(
"Testing unstructured grid generation!", testFilter->GetOutput() != NULL);
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
Test fixture for parameterized tests.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.