本文整理汇总了C++中PointSet::GetPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ PointSet::GetPoint方法的具体用法?C++ PointSet::GetPoint怎么用?C++ PointSet::GetPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointSet
的用法示例。
在下文中一共展示了PointSet::GetPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sqrt
int mitk::PointSetDataInteractor::GetPointIndexByPosition(Point3D position, unsigned int time, float accuracy)
{
// iterate over point set and check if it contains a point close enough to the pointer to be selected
PointSet* points = dynamic_cast<PointSet*>(GetDataNode()->GetData());
int index = -1;
if (points == NULL)
{
return index;
}
if (points->GetPointSet(time) == nullptr)
return -1;
PointSet::PointsContainer* pointsContainer = points->GetPointSet(time)->GetPoints();
float minDistance = m_SelectionAccuracy;
if (accuracy != -1 )
minDistance = accuracy;
for (PointSet::PointsIterator it = pointsContainer->Begin(); it != pointsContainer->End(); it++)
{
float distance = sqrt(position.SquaredEuclideanDistanceTo(points->GetPoint(it->Index(), time)));
if (distance < minDistance) // if several points fall within the margin, choose the one with minimal distance to position
{
index = it->Index();
}
}
return index;
}
示例2: sqrt
int mitk::PointSetDataInteractor::GetPointIndexByPosition(Point3D position, int time)
{
// iterate over point set and check if it contains a point close enough to the pointer to be selected
PointSet* points = dynamic_cast<PointSet*>(GetDataNode()->GetData());
int index = -1;
if (points == NULL)
{
return index;
}
PointSet::PointsContainer* pointsContainer = points->GetPointSet(time)->GetPoints();
float minDistance = m_SelectionAccuracy;
for (PointSet::PointsIterator it = pointsContainer->Begin(); it != pointsContainer->End(); it++)
{
float distance = sqrt(position.SquaredEuclideanDistanceTo(points->GetPoint(it->Index(), time))); // TODO: support time!
if (distance < minDistance) // if several points fall within the margin, choose the one with minimal distance to position
{ // TODO: does this make sense, which unit is it?
index = it->Index();
}
}
return index;
}