Move a vertex by a translation vector
| 83 | |
| 84 | // Move a vertex by a translation vector |
| 85 | static void TestMoveSelectedVertex() |
| 86 | { |
| 87 | mitk::ContourModel::Pointer contour = mitk::ContourModel::New(); |
| 88 | |
| 89 | mitk::Point3D p; |
| 90 | p[0] = p[1] = p[2] = 0; |
| 91 | |
| 92 | contour->AddVertex(p); |
| 93 | |
| 94 | // Same point is used here so the epsilon can be chosen very small |
| 95 | contour->SelectVertexAt(p, 0.01); |
| 96 | |
| 97 | mitk::Vector3D v; |
| 98 | v[0] = 1; |
| 99 | v[1] = 3; |
| 100 | v[2] = -1; |
| 101 | |
| 102 | contour->ShiftSelectedVertex(v); |
| 103 | |
| 104 | const mitk::ContourModel::VertexType *vertex = contour->GetSelectedVertex(); |
| 105 | |
| 106 | bool correctlyMoved = false; |
| 107 | |
| 108 | correctlyMoved = |
| 109 | (vertex->Coordinates)[0] == (v[0]) && (vertex->Coordinates)[1] == (v[1]) && (vertex->Coordinates)[2] == (v[2]); |
| 110 | |
| 111 | MITK_TEST_CONDITION(correctlyMoved, "Vertex has been moved"); |
| 112 | } |
| 113 | |
| 114 | // Test to move the whole contour |
| 115 | /* |
no test coverage detected