26 #include <vtkDebugLeaks.h>
30 CPPUNIT_TEST_SUITE(mitkPointSetDataInteractorTestSuite);
33 vtkDebugLeaks::SetExitError(0);
38 CPPUNIT_TEST_SUITE_END();
54 m_DataInteractor->LoadStateMachine(
"PointSet.xml");
56 m_DataInteractor->SetEventConfig(
"PointSetConfig.xml");
60 m_TestPointSetNode->SetData(m_TestPointSet);
62 m_DataInteractor->SetDataNode(m_TestPointSetNode);
68 m_TestPointSetNode->SetDataInteractor(NULL);
69 m_TestPointSetNode = NULL;
70 m_TestPointSet = NULL;
71 m_DataInteractor = NULL;
74 void AddPointInteraction()
77 std::string referencePointSetPath =
GetTestDataFilePath(
"InteractionTestData/ReferenceData/TestAddPoints.mps");
80 std::string interactionXmlPath =
GetTestDataFilePath(
"InteractionTestData/Interactions/TestAddPoints.xml");
85 refDN->SetData(referenceImage);
91 interactionTestHelper.AddNodeToStorage(m_TestPointSetNode);
92 interactionTestHelper.AddNodeToStorage(refDN);
95 interactionTestHelper.PlaybackInteraction();
102 CPPUNIT_ASSERT_MESSAGE(
"",
mitk::Equal(referencePointSet, m_TestPointSet, .001,
true,
false));
105 void RotatedPlanesInteraction()
108 std::string referencePointSetPath =
109 GetTestDataFilePath(
"InteractionTestData/ReferenceData/PointSetDataInteractor_PointsAdd2d3d.mps");
112 std::string interactionXmlPath =
113 GetTestDataFilePath(
"InteractionTestData/Interactions/PointSetDataInteractor_PointsAdd2d3d.xml");
118 refDN->SetData(referenceImage);
124 interactionTestHelper.AddNodeToStorage(m_TestPointSetNode);
125 interactionTestHelper.AddNodeToStorage(refDN);
128 interactionTestHelper.PlaybackInteraction();
135 CPPUNIT_ASSERT_MESSAGE(
"",
mitk::Equal(referencePointSet, m_TestPointSet, .001,
true,
false));
141 interactionTestHelper.AddNodeToStorage(node);
142 interactionTestHelper.PlaybackInteraction();
148 refPs->UpdateOutputInformation();
149 ps->UpdateOutputInformation();
165 void MoveDeletePointInteraction()
168 std::string referencePointSetPath =
172 std::string interactionXmlPath =
GetTestDataFilePath(
"InteractionTestData/Interactions/TestMoveRemovePoints.xml");
177 refDN->SetData(referenceImage);
183 interactionTestHelper.AddNodeToStorage(m_TestPointSetNode);
184 interactionTestHelper.AddNodeToStorage(refDN);
187 interactionTestHelper.PlaybackInteraction();
194 CPPUNIT_ASSERT_MESSAGE(
"",
mitk::Equal(referencePointSet, m_TestPointSet, .001,
true,
false));
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
bool LoadStateMachine(const std::string &filename, const us::Module *module=nullptr)
Loads XML resource.
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
Implementation of the PointSetInteractor.
Test fixture for parameterized tests.
#define MITK_ASSERT_EQUAL(EXPECTED, ACTUAL, MSG)
Testing macro to test if two objects are equal.
static mitk::PointSet::Pointer LoadPointSet(const std::string &path)
LoadPointSet Convenience method to load an arbitrary mitkPointSet.
Creates everything needed to load and playback interaction events.
virtual void SetDataNode(DataNode *dataNode)
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
static mitk::Image::Pointer LoadImage(const std::string &path)
LoadImage Convenience method to load an arbitrary mitkImage.
Class for nodes of the DataTree.
bool SetEventConfig(const std::string &filename, const us::Module *module=nullptr)
Loads a configuration from an XML resource.