21 class mitkPlanarPolygonTestClass
27 MITK_TEST_CONDITION(planarPolygon->GetMinimumNumberOfControlPoints() == 3,
"Minimum number of control points");
30 MITK_TEST_CONDITION(planarPolygon->GetMaximumNumberOfControlPoints() == 1000,
"Maximum number of control points");
36 planarPolygon->PlaceFigure(p0);
42 planarPolygon->SetControlPoint(1, p1);
48 planarPolygon->AddControlPoint(p2);
54 planarPolygon->AddControlPoint(p3);
57 MITK_TEST_CONDITION(planarPolygon->GetNumberOfControlPoints() == 4,
"Number of control points after placement");
60 MITK_TEST_CONDITION(planarPolygon->IsClosed(),
"planar polygon should not be closed, yet, right?");
62 planarPolygon->SetClosed(
true);
64 MITK_TEST_CONDITION(planarPolygon->IsClosed(),
"planar polygon should be closed after function call, right?");
68 auto iter = polyLine0.begin();
69 MITK_TEST_CONDITION(planarPolygon->GetPolyLinesSize() == 1,
"Number of polylines after placement");
75 MITK_TEST_CONDITION(((pp0 == p0) && (pp1 == p1)) || ((pp0 == p1) && (pp1 == p0)),
"Correct polyline 1");
78 planarPolygon->EvaluateFeatures();
79 MITK_TEST_CONDITION(planarPolygon->GetNumberOfFeatures() == 2,
"Number of measurement features");
82 double length0 = 4 * 50.0;
85 double length1 = 50.0 * 50.0;
91 unsigned int initialNumberOfControlPoints = planarPolygon->GetNumberOfControlPoints();
96 planarPolygon->AddControlPoint(pnt);
98 MITK_TEST_CONDITION(planarPolygon->GetNumberOfControlPoints() == initialNumberOfControlPoints + 1,
99 "A new control-point shall be added");
100 MITK_TEST_CONDITION(planarPolygon->GetControlPoint(planarPolygon->GetNumberOfControlPoints() - 1) == pnt,
101 "Control-point shall be added at the end.");
103 planarPolygon->RemoveControlPoint(3);
104 MITK_TEST_CONDITION(planarPolygon->GetNumberOfControlPoints() == initialNumberOfControlPoints,
105 "A control-point has been removed");
106 MITK_TEST_CONDITION(planarPolygon->GetControlPoint(3) == pnt,
"It shall be possible to remove any control-point.");
108 planarPolygon->RemoveControlPoint(0);
109 planarPolygon->RemoveControlPoint(0);
110 planarPolygon->RemoveControlPoint(0);
112 "Control-points cannot be removed if only three points remain.");
117 planarPolygon->AddControlPoint(pnt1, 0);
118 MITK_TEST_CONDITION(planarPolygon->GetNumberOfControlPoints() == 4,
"A control-point has been added");
120 "It shall be possible to insert a control-point at any position.");
136 planeGeometry->InitializeStandardPlane(100.0, 100.0);
141 planarPolygon->SetPlaneGeometry(planeGeometry);
147 mitkPlanarPolygonTestClass::TestPlanarPolygonPlacement(planarPolygon);
149 mitkPlanarPolygonTestClass::TestPlanarPolygonEditing(planarPolygon);
int mitkPlanarPolygonTest(int, char *[])
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_CONDITION(COND, MSG)
MITKCORE_EXPORT const ScalarType eps