CCCoreLib 31 May 2022
CloudCompare Core algorithms
Classes | Static Public Member Functions | Static Public Attributes | List of all members
CCCoreLib::PointProjectionTools Class Reference

Several point cloud re-projection algorithms ("developpee", translation, rotation, etc.) More...

#include <PointProjectionTools.h>

Inheritance diagram for CCCoreLib::PointProjectionTools:
Inheritance graph
[legend]
Collaboration diagram for CCCoreLib::PointProjectionTools:
Collaboration graph
[legend]

Classes

class  IndexedCCVector2
 Indexed 2D vector. More...
 
struct  Transformation
 A scaled geometrical transformation (scale + rotation + translation) More...
 

Static Public Member Functions

static PointClouddevelopCloudOnCylinder (GenericCloud *cloud, PointCoordinateType radius, unsigned char dim=2, CCVector3 *center=nullptr, GenericProgressCallback *progressCb=nullptr)
 Develops a cylinder-shaped point cloud around its main axis. More...
 
static PointClouddevelopCloudOnCone (GenericCloud *cloud, unsigned char dim, PointCoordinateType baseRadius, float alpha, const CCVector3 &center, GenericProgressCallback *progressCb=nullptr)
 Develops a cone-shaped point cloud around its main axis. More...
 
static PointCloudapplyTransformation (GenericCloud *cloud, Transformation &trans, GenericProgressCallback *progressCb=nullptr)
 Applies a geometrical transformation to a point cloud. More...
 
static PointCloudapplyTransformation (GenericIndexedCloud *cloud, Transformation &trans, GenericProgressCallback *progressCb=nullptr)
 Applies a geometrical transformation to an indexed point cloud. More...
 
static GenericIndexedMeshcomputeTriangulation (GenericIndexedCloudPersist *cloud, TRIANGULATION_TYPES type, PointCoordinateType maxEdgeLength, unsigned char dim, std::string &outputErrorStr)
 Computes a 2.5D Delaunay triangulation. More...
 
static bool extractConvexHull2D (std::vector< IndexedCCVector2 > &points, std::list< IndexedCCVector2 * > &hullPoints)
 Determines the convex hull of a set of points. More...
 
static bool extractConcaveHull2D (std::vector< IndexedCCVector2 > &points, std::list< IndexedCCVector2 * > &hullPoints, PointCoordinateType maxSquareLength=0)
 Determines the 'concave' hull of a set of points. More...
 
static bool segmentIntersect (const CCVector2 &A, const CCVector2 &B, const CCVector2 &C, const CCVector2 &D)
 Returns true if the AB and CD segments intersect each other.
 

Static Public Attributes

static constexpr int IGNORE_MAX_EDGE_LENGTH = 0
 

Detailed Description

Several point cloud re-projection algorithms ("developpee", translation, rotation, etc.)

Member Function Documentation

◆ applyTransformation() [1/2]

PointCloud * PointProjectionTools::applyTransformation ( GenericCloud cloud,
Transformation trans,
GenericProgressCallback progressCb = nullptr 
)
static

Applies a geometrical transformation to a point cloud.

Parameters
cloudthe point cloud to be "transformed"
transthe geometrical transformation
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the "transformed" cloud

◆ applyTransformation() [2/2]

PointCloud * PointProjectionTools::applyTransformation ( GenericIndexedCloud cloud,
Transformation trans,
GenericProgressCallback progressCb = nullptr 
)
static

Applies a geometrical transformation to an indexed point cloud.

Parameters
cloudthe point cloud to be "transformed"
transthe geometrical transformation
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the "transformed" cloud

◆ computeTriangulation()

GenericIndexedMesh * PointProjectionTools::computeTriangulation ( GenericIndexedCloudPersist cloud,
TRIANGULATION_TYPES  type,
PointCoordinateType  maxEdgeLength,
unsigned char  dim,
std::string &  outputErrorStr 
)
static

Computes a 2.5D Delaunay triangulation.

The triangulation can be either computed on the points projected in the XY plane (by default), or projected on the best least-square fitting plane. The triangulation is in 2D (in the plane) but the 3D points are connected, so it's a kind of 2.5D triangulation (that may present however several topological aberrations ;).

Parameters
clouda point cloud
typethe triangulation strategy
maxEdgeLengthmax edge length for output triangles (IGNORE_MAX_EDGE_LENGTH = ignored)
dimprojection dimension (for axis-aligned meshes)
outputErrorStrerror (if any)
Returns
a mesh

◆ developCloudOnCone()

PointCloud * PointProjectionTools::developCloudOnCone ( GenericCloud cloud,
unsigned char  dim,
PointCoordinateType  baseRadius,
float  alpha,
const CCVector3 center,
GenericProgressCallback progressCb = nullptr 
)
static

Develops a cone-shaped point cloud around its main axis.

Generates a "developpee" of a cone-shaped point cloud. WARNING: this method uses the cloud global iterator

Parameters
cloudthe point cloud to be developed
dimthe dimension along which the cone axis is aligned (X=0, Y=1, Z=2)
baseRadiusthe radius of the base of the cone
alphathe angle of the cone "opening"
centerthe 3D point corresponding to the intersection between the cone axis and its base
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the "developed" cloud

◆ developCloudOnCylinder()

PointCloud * PointProjectionTools::developCloudOnCylinder ( GenericCloud cloud,
PointCoordinateType  radius,
unsigned char  dim = 2,
CCVector3 center = nullptr,
GenericProgressCallback progressCb = nullptr 
)
static

Develops a cylinder-shaped point cloud around its main axis.

Generates a "developpee" of a cylinder-shaped point cloud. WARNING: this method uses the cloud global iterator

Parameters
cloudthe point cloud to be developed
radiusthe cylinder radius
dimthe dimension along which the cylinder axis is aligned (X=0, Y=1, Z=2)
centera 3D point (as a 3 values array) belonging to the cylinder axis
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
the "developed" cloud

◆ extractConcaveHull2D()

bool PointProjectionTools::extractConcaveHull2D ( std::vector< IndexedCCVector2 > &  points,
std::list< IndexedCCVector2 * > &  hullPoints,
PointCoordinateType  maxSquareLength = 0 
)
static

Determines the 'concave' hull of a set of points.

Inspired from JIN-SEO PARK AND SE-JONG OH, "A New Concave Hull Algorithm and Concaveness Measure for n-dimensional Datasets", 2012 Calls extractConvexHull2D (see associated warnings).

Parameters
pointsinput set of points
hullPointsoutput points (on the convex hull)
maxSquareLengthmaximum square length (ignored if <= 0, in which case the method simply returns the convex hull!)
Returns
success

◆ extractConvexHull2D()

bool PointProjectionTools::extractConvexHull2D ( std::vector< IndexedCCVector2 > &  points,
std::list< IndexedCCVector2 * > &  hullPoints 
)
static

Determines the convex hull of a set of points.

Returns a list of points on the convex hull in counter-clockwise order. Implementation of Andrew's monotone chain 2D convex hull algorithm. Asymptotic complexity: O(n log n). (retrieved from http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain) WARNING: the input 'points' set will be sorted!

Parameters
pointsinput set of points
hullPointsoutput points (on the convex hull)
Returns
success

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