MCPcopy Create free account
hub / github.com/MITK/MITK / TestSetVertices

Function TestSetVertices

Modules/ContourModel/Testing/mitkContourModelTest.cpp:358–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358static void TestSetVertices()
359{
360 mitk::ContourModel::Pointer contour = mitk::ContourModel::New();
361
362 mitk::Point3D p;
363 p[0] = p[1] = p[2] = 0;
364
365 contour->AddVertex(p);
366
367 mitk::Point3D newCoordinates;
368
369 newCoordinates[0] = newCoordinates[1] = newCoordinates[2] = 1;
370
371 contour->SetVertexAt(0, newCoordinates);
372
373 MITK_TEST_CONDITION(mitk::Equal(contour->GetVertexAt(0)->Coordinates, newCoordinates), "set coordinates");
374
375 mitk::ContourModel::Pointer contour2 = mitk::ContourModel::New();
376
377 mitk::Point3D p3;
378 p3[0] = -2;
379 p3[1] = 10;
380 p3[2] = 0;
381
382 contour2->AddVertex(p3);
383
384 mitk::Point3D p4;
385 p4[0] = -3;
386 p4[1] = 6;
387 p4[2] = -5;
388
389 contour2->AddVertex(p4);
390
391 contour->AddVertex(p);
392 contour->SetVertexAt(1, contour2->GetVertexAt(1), 0);
393
394 MITK_TEST_CONDITION(
395 mitk::Equal(contour->GetVertexAt(1)->Coordinates, contour2->GetVertexAt(1)->Coordinates), "Use setter and getter combination");
396}
397
398static void TestContourModelAPI()
399{

Callers 1

mitkContourModelTestFunction · 0.85

Calls 5

NewFunction · 0.50
EqualFunction · 0.50
AddVertexMethod · 0.45
SetVertexAtMethod · 0.45
GetVertexAtMethod · 0.45

Tested by

no test coverage detected