Check closeable contour
| 185 | |
| 186 | // Check closeable contour |
| 187 | static void TestIsclosed() |
| 188 | { |
| 189 | mitk::ContourModel::Pointer contour = mitk::ContourModel::New(); |
| 190 | |
| 191 | mitk::Point3D p; |
| 192 | p[0] = p[1] = p[2] = 0; |
| 193 | |
| 194 | contour->AddVertex(p); |
| 195 | |
| 196 | mitk::Point3D p2; |
| 197 | p2[0] = p2[1] = p2[2] = 1; |
| 198 | |
| 199 | contour->AddVertex(p2); |
| 200 | |
| 201 | contour->Close(); |
| 202 | |
| 203 | MITK_TEST_CONDITION(contour->IsClosed(), "closed contour"); |
| 204 | |
| 205 | // no vertices should be added to a closed contour |
| 206 | int oldNumberOfVertices = contour->GetNumberOfVertices(); |
| 207 | |
| 208 | mitk::Point3D p3; |
| 209 | p3[0] = p3[1] = p3[2] = 4; |
| 210 | |
| 211 | contour->AddVertex(p3); |
| 212 | |
| 213 | int newNumberOfVertices = contour->GetNumberOfVertices(); |
| 214 | |
| 215 | MITK_TEST_CONDITION(oldNumberOfVertices != newNumberOfVertices, "vertices added to closed contour"); |
| 216 | } |
| 217 | |
| 218 | // Test concatenating two contours |
| 219 | static void TestConcatenate() |
no test coverage detected