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

Function TestConcatenate

Modules/ContourModel/Testing/mitkContourModelTest.cpp:219–252  ·  view source on GitHub ↗

Test concatenating two contours

Source from the content-addressed store, hash-verified

217
218// Test concatenating two contours
219static void TestConcatenate()
220{
221 mitk::ContourModel::Pointer contour = mitk::ContourModel::New();
222
223 mitk::Point3D p;
224 p[0] = p[1] = p[2] = 0;
225
226 contour->AddVertex(p);
227
228 mitk::Point3D p2;
229 p2[0] = p2[1] = p2[2] = 1;
230
231 contour->AddVertex(p2);
232
233 mitk::ContourModel::Pointer contour2 = mitk::ContourModel::New();
234
235 mitk::Point3D p3;
236 p3[0] = -2;
237 p3[1] = 10;
238 p3[2] = 0;
239
240 contour2->AddVertex(p3);
241
242 mitk::Point3D p4;
243 p4[0] = -3;
244 p4[1] = 6;
245 p4[2] = -5;
246
247 contour2->AddVertex(p4);
248
249 contour->Concatenate(contour2);
250
251 MITK_TEST_CONDITION(contour->GetNumberOfVertices() == 4, "two contours were concatenated");
252}
253
254// Try to select a vertex at position (within a epsilon of course) where no vertex is.
255// So the selected verted member should be null.

Callers 1

mitkContourModelTestFunction · 0.85

Calls 4

GetNumberOfVerticesMethod · 0.80
NewFunction · 0.50
AddVertexMethod · 0.45
ConcatenateMethod · 0.45

Tested by

no test coverage detected