19 CPPUNIT_TEST_SUITE(mitkLineTestSuite);
25 CPPUNIT_TEST_SUITE_END();
39 itk::Point<double, 2> p;
44 itk::Vector<double, 2> direction;
59 void Line_Instantiation()
63 CPPUNIT_ASSERT(myLineDouble.
GetPoint1()[0] == 0);
64 CPPUNIT_ASSERT(myLineFloat.
GetPoint1()[0] == 0);
67 void Line_TestPoints()
74 CPPUNIT_ASSERT_MESSAGE(
"Test if point 1 was set correctly.",
mitk::Equal(m_Line.
GetPoint1(), point1));
75 CPPUNIT_ASSERT_MESSAGE(
"Test if point 2 was set correctly.",
mitk::Equal(m_Line.
GetPoint2(), point2));
78 void Line_TestParallel()
93 CPPUNIT_ASSERT_MESSAGE(
"Test if lines are parallel.", m_Line.
IsParallel(parallelLine));
103 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (point[0])", m_2DLine.
GetPoint()[0] == 1);
104 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (point[1])", m_2DLine.
GetPoint()[1] == 2);
105 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (direction[0])", m_2DLine.
GetDirection()[0] == 0);
106 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (direction[1])", m_2DLine.
GetDirection()[1] == 1);
111 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[0])", m_3DLine.
GetPoint()[0] == 0);
112 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[1])", m_3DLine.
GetPoint()[1] == 1);
113 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[2])", m_3DLine.
GetPoint()[2] == 2);
114 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (direction[0])", m_3DLine.
GetDirection()[0] == 4);
115 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (direction[1])", m_3DLine.
GetDirection()[1] == 5);
116 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (direction[2])", m_3DLine.
GetDirection()[2] == 6);
void SetPoint2(const itk::Point< TCoordRep, NPointDimension > &point2)
Set/change end point of the line.
bool IsParallel(const Line< TCoordRep, NPointDimension > &line) const
Test if a lines is parallel to this line.
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
void SetDirection(const itk::Vector< TCoordRep, NPointDimension > &direction)
Set the direction vector of the line.
void SetPoint(const itk::Point< TCoordRep, NPointDimension > &point1)
Set/change start point of the line.
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
const itk::Point< TCoordRep, NPointDimension > & GetPoint() const
Get start point of the line.
const itk::Point< TCoordRep, NPointDimension > & GetPoint1() const
Get start point of the line.
const itk::Vector< TCoordRep, NPointDimension > & GetDirection() const
Get the direction vector of the line.
Test fixture for parameterized tests.
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.
itk::Point< TCoordRep, NPointDimension > GetPoint2() const
Get end point of the line.
void SetPoint1(const itk::Point< TCoordRep, NPointDimension > &point1)
Set/change start point of the line.