Commit fc131831 authored by Will Schroeder's avatar Will Schroeder Committed by Kitware Robot
Browse files

Merge topic 'Remote-PointCloud-Filters'

4689eea1 Addressing remote repository access
4684c71d Extended static point locator API to support querying buckets for points
a68d44ff

 Remote module for point cloud processing
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1137
parents dc4a99a6 4689eea1
......@@ -462,6 +462,18 @@ public:
return this->Map + this->Offsets[bucketNum];
}
// Given a bucket number, return the point ids in that bucket.
void GetIds(vtkIdType bucketNum, vtkIdList *bList)
{
const LocatorTuple<TIds> *ids = this->GetIds(bucketNum);
vtkIdType numIds = this->GetNumberOfIds(bucketNum);
bList->SetNumberOfIds(numIds);
for (int i=0; i < numIds; i++)
{
bList->SetId(i,ids[i].PtId);
}
}
// Templated implementations of the locator
vtkIdType FindClosestPoint(const double x[3]);
vtkIdType FindClosestPointWithinRadius(double radius, const double x[3],
......@@ -1569,6 +1581,51 @@ GenerateRepresentation(int level, vtkPolyData *pd)
}
}
//-----------------------------------------------------------------------------
// Given a position x, return the id of the point closest to it.
vtkIdType vtkStaticPointLocator::
GetNumberOfPointsInBucket(vtkIdType bNum)
{
this->BuildLocator(); // will subdivide if modified; otherwise returns
if ( !this->Buckets )
{
return 0;
}
if ( this->LargeIds )
{
return static_cast<BucketList<vtkIdType>*>(this->Buckets)->
GetNumberOfIds(bNum);
}
else
{
return static_cast<BucketList<int>*>(this->Buckets)->
GetNumberOfIds(bNum);
}
}
//-----------------------------------------------------------------------------
// Given a position x, return the id of the point closest to it.
void vtkStaticPointLocator::
GetBucketIds(vtkIdType bNum, vtkIdList *bList)
{
this->BuildLocator(); // will subdivide if modified; otherwise returns
if ( !this->Buckets )
{
bList->Reset();
return;
}
if ( this->LargeIds )
{
return static_cast<BucketList<vtkIdType>*>(this->Buckets)->GetIds(bNum,bList);
}
else
{
return static_cast<BucketList<int>*>(this->Buckets)->GetIds(bNum,bList);
}
}
//-----------------------------------------------------------------------------
void vtkStaticPointLocator::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -131,6 +131,18 @@ public:
virtual void BuildLocator();
virtual void GenerateRepresentation(int level, vtkPolyData *pd);
// Description:
// Given a bucket number bNum between 0 <= bNum < this->GetNumberOfBuckets(),
// return the number of points found in the bucket.
vtkIdType GetNumberOfPointsInBucket(vtkIdType bNum);
// Description:
// Given a bucket number bNum between 0 <= bNum < this->GetNumberOfBuckets(),
// return a list of point ids contained within the bucket. The user must
// provide an instance of vtkIdList to contain the result.
void GetBucketIds(vtkIdType bNum, vtkIdList *bList);
protected:
vtkStaticPointLocator();
virtual ~vtkStaticPointLocator();
......
#
# vtkPointCloud - specialized filters for processing point clouds
# GIT_REPOSITORY git@gitlab.kitware.com:vtk/point-cloud.git
vtk_fetch_module(vtkPointCloud
"Point Cloud processing in VTK"
GIT_REPOSITORY https://gitlab.kitware.com/vtk/point-cloud.git
GIT_TAG master
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment