23 CPPUNIT_TEST_SUITE(mitkLineTestSuite);
29 CPPUNIT_TEST_SUITE_END();
43 itk::Point<double, 2> p;
48 itk::Vector<double, 2> direction;
63 void Line_Instantiation()
67 CPPUNIT_ASSERT(myLineDouble.
GetPoint1()[0] == 0);
68 CPPUNIT_ASSERT(myLineFloat.
GetPoint1()[0] == 0);
71 void Line_TestPoints()
78 CPPUNIT_ASSERT_MESSAGE(
"Test if point 1 was set correctly.",
mitk::Equal(m_Line.
GetPoint1(), point1));
79 CPPUNIT_ASSERT_MESSAGE(
"Test if point 2 was set correctly.",
mitk::Equal(m_Line.
GetPoint2(), point2));
82 void Line_TestParallel()
97 CPPUNIT_ASSERT_MESSAGE(
"Test if lines are parallel.", m_Line.
IsParallel(parallelLine));
107 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (point[0])", m_2DLine.
GetPoint()[0] == 1);
108 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (point[1])", m_2DLine.
GetPoint()[1] == 2);
109 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (direction[0])", m_2DLine.
GetDirection()[0] == 0);
110 CPPUNIT_ASSERT_MESSAGE(
"Testing 2D Line (direction[1])", m_2DLine.
GetDirection()[1] == 1);
115 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[0])", m_3DLine.
GetPoint()[0] == 0);
116 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[1])", m_3DLine.
GetPoint()[1] == 1);
117 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (point[2])", m_3DLine.
GetPoint()[2] == 2);
118 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (direction[0])", m_3DLine.
GetDirection()[0] == 4);
119 CPPUNIT_ASSERT_MESSAGE(
"Testing 3D Line (direction[1])", m_3DLine.
GetDirection()[1] == 5);
120 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.
const itk::Point< TCoordRep, NPointDimension > & GetPoint1() const
Get start point of the 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.
bool IsParallel(const Line< TCoordRep, NPointDimension > &line) const
Test if a lines is parallel to this line.
const itk::Vector< TCoordRep, NPointDimension > & GetDirection() const
Get the direction vector of the line.
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.
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.