The clone method of the PointSet is not working properly. The cloned points does not match the original points if the index are not in line.
It is also possible to access points that have not been set without any warning or notice.
An example:
mitk::PointSet::Pointer pointSet = mitk::PointSet::New(); mitk::Point3D pointA, pointB, pointC; pointA.Fill(1); pointB.Fill(2); pointC.Fill(3); pointSet->SetPoint(1,pointA); pointSet->SetPoint(2,pointB); pointSet->SetPoint(3,pointC); pointSet->Update(); MITK_INFO<< pointSet->GetPoint(0); // Should not be possible MITK_INFO<< pointSet->GetPoint(1); MITK_INFO<< pointSet->GetPoint(2); MITK_INFO<< pointSet->GetPoint(3); mitk::PointSet::Pointer pointSet2 = pointSet->Clone(); MITK_INFO<< pointSet2->GetPoint(0); // Point is now in PointSet MITK_INFO<< pointSet2->GetPoint(1); MITK_INFO<< pointSet2->GetPoint(2); MITK_INFO<< pointSet2->GetPoint(3); // Point is no longer in PointSet
returns
[0, 0, 0]
[1, 1, 1]
[2, 2, 2]
[3, 3, 3]
[0, 0, 0]
[1, 1, 1]
[2, 2, 2]
[0, 0, 0]