COGS
Computer Graphics Structures library
cogs::PointCloudSelector Class Reference

API for selecting points from a point cloud by ray-casting. More...

Public Member Functions

 PointCloudSelector ()=default
 Default constructor.
 
 PointCloudSelector (std::shared_ptr< cogs::PointCloud > pointcloud)
 Prepares the selector to be used over the given point cloud. More...
 
void Initialize (std::shared_ptr< cogs::PointCloud > pointcloud)
 Initializes the selector over new point cloud, forgetting the reference and selected points of old one (if any). More...
 
size_t CountSelected () const
 Returns current number of selected points.
 
int32_t SelectPoint (const geom::Ray3 &ray)
 Selects a point of point cloud based on the ray intersection with it. More...
 
int32_t DeselectPoint (const geom::Ray3 &ray)
 Deselects a point of point cloud based on the ray intersection with it. More...
 
void SelectPoint (int32_t point_index)
 Internally selects the point with given index. More...
 
void DeselectPoint (int32_t point_index)
 Internally deselects the point with given index. More...
 
void SelectPointsAround (int32_t point_index, float selection_radius)
 Selects the points around the target point in a specified radius, including the target point. More...
 
void DeselectPointsAround (int32_t point_index, float deselection_radius)
 Deselects the points around the target point in a specified radius, including the target point. More...
 
void DeselectAllPoints ()
 Deselect all previously selected points.
 
const std::set< int32_t > & GetSelectedPoints () const
 Returns the list of all previously selected points. More...
 

Detailed Description

API for selecting points from a point cloud by ray-casting.

Constructor & Destructor Documentation

◆ PointCloudSelector()

cogs::PointCloudSelector::PointCloudSelector ( std::shared_ptr< cogs::PointCloud >  pointcloud)

Prepares the selector to be used over the given point cloud.

Parameters
pointcloudSelector will work with this point cloud.

Member Function Documentation

◆ DeselectPoint() [1/2]

int32_t cogs::PointCloudSelector::DeselectPoint ( const geom::Ray3 &  ray)

Deselects a point of point cloud based on the ray intersection with it.

Parameters
ray3D ray in the point cloud space.
selection_radiusWhen greater then zero, also points around the intersected point are deselected up to the distance.
Returns
Index of the intersected point, -1 if no point was intersected.

◆ DeselectPoint() [2/2]

void cogs::PointCloudSelector::DeselectPoint ( int32_t  point_index)

Internally deselects the point with given index.

Parameters
point_indexIndex of the point to deselect.

◆ DeselectPointsAround()

void cogs::PointCloudSelector::DeselectPointsAround ( int32_t  point_index,
float  deselection_radius 
)

Deselects the points around the target point in a specified radius, including the target point.

Parameters
point_indexIndex of the point to deselect.
selection_radiusMaximal distance from target point.

◆ GetSelectedPoints()

const std::set<int32_t>& cogs::PointCloudSelector::GetSelectedPoints ( ) const

Returns the list of all previously selected points.

Returns
Vector of selected points.

◆ Initialize()

void cogs::PointCloudSelector::Initialize ( std::shared_ptr< cogs::PointCloud >  pointcloud)

Initializes the selector over new point cloud, forgetting the reference and selected points of old one (if any).

Parameters
pointcloudSelector will work with this point cloud.

◆ SelectPoint() [1/2]

int32_t cogs::PointCloudSelector::SelectPoint ( const geom::Ray3 &  ray)

Selects a point of point cloud based on the ray intersection with it.

Parameters
ray3D ray in the point cloud space.
selection_radiusWhen greater then zero, also points around the intersected point are selected up to the distance.
Returns
Index of the intersected point, -1 if no point was intersected.

◆ SelectPoint() [2/2]

void cogs::PointCloudSelector::SelectPoint ( int32_t  point_index)

Internally selects the point with given index.

Parameters
point_indexIndex of the point to select.

◆ SelectPointsAround()

void cogs::PointCloudSelector::SelectPointsAround ( int32_t  point_index,
float  selection_radius 
)

Selects the points around the target point in a specified radius, including the target point.

Parameters
point_indexIndex of the point to select.
selection_radiusMaximal distance from target point.