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

Method SetPoints

Modules/AlgorithmsExt/src/mitkPointLocator.cpp:39–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void mitk::PointLocator::SetPoints(vtkPointSet *pointSet)
40{
41 if (pointSet == nullptr)
42 {
43 itkWarningMacro("Points are nullptr!");
44 return;
45 }
46 vtkPoints *points = pointSet->GetPoints();
47
48 if (m_VtkPoints)
49 {
50 if ((m_VtkPoints == points) && (m_VtkPoints->GetMTime() == points->GetMTime()))
51 {
52 return; // no need to recalculate search tree
53 }
54 }
55 m_VtkPoints = points;
56
57 size_t size = points->GetNumberOfPoints();
58 if (m_ANNDataPoints != nullptr)
59 delete[] m_ANNDataPoints;
60 m_ANNDataPoints = annAllocPts(size, m_ANNDimension);
61 m_IndexToPointIdContainer.clear();
62 m_IndexToPointIdContainer.resize(size);
63 for (vtkIdType i = 0; (unsigned)i < size; ++i)
64 {
65 double *currentPoint = points->GetPoint(i);
66 (m_ANNDataPoints[i])[0] = currentPoint[0];
67 (m_ANNDataPoints[i])[1] = currentPoint[1];
68 (m_ANNDataPoints[i])[2] = currentPoint[2];
69 m_IndexToPointIdContainer[i] = i;
70 }
71 InitANN();
72}
73
74void mitk::PointLocator::SetPoints(mitk::PointSet *points)
75{

Callers 1

UpdateVtkAnnotationMethod · 0.45

Calls 9

GetNumberOfPointsMethod · 0.80
ValueMethod · 0.80
GetMTimeMethod · 0.45
clearMethod · 0.45
GetPointMethod · 0.45
GetSizeMethod · 0.45
GetPointSetMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected