| 272 | } |
| 273 | |
| 274 | static void TestInsertVertex() |
| 275 | { |
| 276 | mitk::ContourModel::Pointer contour = mitk::ContourModel::New(); |
| 277 | |
| 278 | mitk::Point3D p; |
| 279 | p[0] = p[1] = p[2] = 0; |
| 280 | |
| 281 | contour->AddVertex(p); |
| 282 | |
| 283 | mitk::Point3D p2; |
| 284 | p2[0] = p2[1] = p2[2] = 1; |
| 285 | |
| 286 | contour->AddVertex(p2); |
| 287 | |
| 288 | mitk::Point3D pointToInsert; |
| 289 | pointToInsert[0] = pointToInsert[1] = pointToInsert[2] = 10; |
| 290 | |
| 291 | contour->InsertVertexAtIndex(pointToInsert, 1); |
| 292 | |
| 293 | MITK_TEST_CONDITION(contour->GetNumberOfVertices() == 3, "test insert vertex"); |
| 294 | |
| 295 | MITK_TEST_CONDITION(contour->GetVertexAt(1)->Coordinates == pointToInsert, "compare inserted vertex"); |
| 296 | |
| 297 | mitk::Point3D outOfTimeBoundPoint; |
| 298 | outOfTimeBoundPoint[0] = outOfTimeBoundPoint[1] = outOfTimeBoundPoint[2] = 1; |
| 299 | |
| 300 | contour->InsertVertexAtIndex(outOfTimeBoundPoint, 4, false, mitk::TimeStepType(1)); |
| 301 | |
| 302 | MITK_TEST_CONDITION(contour->GetTimeSteps() == 1, "Insert a vertex to an unsupported time step has not changed geometry."); |
| 303 | MITK_TEST_CONDITION(contour->IsEmptyTimeStep(1), "Insert a vertex to an unsupported time step has not added an contour element."); |
| 304 | MITK_TEST_CONDITION(contour->GetNumberOfVertices(1) == -1, "Insert a vertex to an unsupported time step has not added an contour element."); |
| 305 | } |
| 306 | |
| 307 | // try to access an invalid timestep |
| 308 | static void TestInvalidTimeStep() |
no test coverage detected