SPH
Classes | Public Member Functions | List of all members
PointCloud Class Reference

Container of points with optimized search queries. More...

#include <PointCloud.h>

Inheritance diagram for PointCloud:
Noncopyable

Classes

class  Handle
 Identifies a point in the point cloud. More...
 

Public Member Functions

 PointCloud (const Float cellSize)
 
Handle push (const Vector &p)
 Adds a point into the cloud. More...
 
void push (ArrayView< const Vector > points)
 Adds a set of points into the cloud. More...
 
Vector point (const Handle &handle) const
 Returns the point corresponding to given handle. More...
 
Array< Vectorarray () const
 Returns all points in the cloud as array. More...
 
Size size () const
 Returns the number of points in the cloud. More...
 
Size getClosePointsCount (const Vector &center, const Float radius) const
 Returns the number of points within given distance from the center point. More...
 
void findClosePoints (const Vector &center, const Float radius, Array< Handle > &handles) const
 Returns point within given distance from the center point. More...
 
void findClosePoints (const Vector &center, const Float radius, Array< Vector > &neighs) const
 Returns point within given distance from the center point. More...
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

Container of points with optimized search queries.

Works similarly to HashMapFinder, but does not require rebuilding the structure when the set of points changes.

Definition at line 13 of file PointCloud.h.

Constructor & Destructor Documentation

◆ PointCloud()

PointCloud::PointCloud ( const Float  cellSize)
inlineexplicit

Definition at line 55 of file PointCloud.h.

Member Function Documentation

◆ array()

Array< Vector > PointCloud::array ( ) const

Returns all points in the cloud as array.

Definition at line 23 of file PointCloud.cpp.

◆ findClosePoints() [1/2]

void PointCloud::findClosePoints ( const Vector center,
const Float  radius,
Array< Handle > &  handles 
) const

Returns point within given distance from the center point.

Definition at line 45 of file PointCloud.cpp.

◆ findClosePoints() [2/2]

void PointCloud::findClosePoints ( const Vector center,
const Float  radius,
Array< Vector > &  neighs 
) const

Returns point within given distance from the center point.

Definition at line 52 of file PointCloud.cpp.

◆ getClosePointsCount()

Size PointCloud::getClosePointsCount ( const Vector center,
const Float  radius 
) const

Returns the number of points within given distance from the center point.

Definition at line 37 of file PointCloud.cpp.

◆ point()

Vector PointCloud::point ( const Handle handle) const

Returns the point corresponding to given handle.

Definition at line 19 of file PointCloud.cpp.

◆ push() [1/2]

void PointCloud::push ( ArrayView< const Vector points)

Adds a set of points into the cloud.

Definition at line 13 of file PointCloud.cpp.

◆ push() [2/2]

NAMESPACE_SPH_BEGIN PointCloud::Handle PointCloud::push ( const Vector p)

Adds a point into the cloud.

Returns
Handle that identifies the point within the cloud.

Definition at line 5 of file PointCloud.cpp.

◆ size()

Size PointCloud::size ( ) const

Returns the number of points in the cloud.

Definition at line 33 of file PointCloud.cpp.


The documentation for this class was generated from the following files: