| 433 | } |
| 434 | |
| 435 | static void TestClear() |
| 436 | { |
| 437 | mitk::ContourModel::Pointer contour = mitk::ContourModel::New(); |
| 438 | contour->Expand(3); |
| 439 | |
| 440 | contour->Expand(3); |
| 441 | mitk::Point3D p; |
| 442 | p[0] = p[1] = p[2] = 0; |
| 443 | contour->AddVertex(p); |
| 444 | p[0] = p[1] = p[2] = 1; |
| 445 | contour->AddVertex(p, mitk::TimeStepType(1)); |
| 446 | p[0] = p[1] = p[2] = 2; |
| 447 | contour->AddVertex(p, mitk::TimeStepType(2)); |
| 448 | |
| 449 | contour->Clear(1); |
| 450 | |
| 451 | MITK_TEST_CONDITION(contour->GetTimeSteps() == 3, "Check time step count stays 3."); |
| 452 | MITK_TEST_CONDITION(!contour->IsEmpty(0), "Check time step 0 is not empty."); |
| 453 | MITK_TEST_CONDITION(contour->IsEmpty(1), "Check time step 1 is empty."); |
| 454 | MITK_TEST_CONDITION(!contour->IsEmpty(2), "Check time step 2 is not empty."); |
| 455 | MITK_TEST_CONDITION(contour->GetVertexAt(0, 2)->Coordinates == p, "compare if vertex at t == 2 is still the same"); |
| 456 | |
| 457 | contour->Clear(); |
| 458 | MITK_TEST_CONDITION(contour->GetTimeSteps() == 1, "Check time step count stays 1."); |
| 459 | MITK_TEST_CONDITION(contour->IsEmpty(0), "Check time step 0 is empty."); |
| 460 | } |
| 461 | |
| 462 | int mitkContourModelTest(int /*argc*/, char * /*argv*/ []) |
| 463 | { |
no test coverage detected