ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::PointProjectionTools Class Reference

#include <PointProjectionTools.h>

Inheritance diagram for cloudViewer::PointProjectionTools:
Collaboration diagram for cloudViewer::PointProjectionTools:

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)
 Applys 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)
 Applys a geometrical transformation to a single point. 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. More...
 

Static Public Attributes

static constexpr int IGNORE_MAX_EDGE_LENGTH = 0
 

Detailed Description

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

Definition at line 34 of file PointProjectionTools.h.

Member Function Documentation

◆ applyTransformation() [1/2]

◆ applyTransformation() [2/2]

◆ computeTriangulation()

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

Applys a geometrical transformation to a single point.

Parameters
Pthe point
transthe geometrical transformation
Returns
the "transformed" point 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 (0 = ignored)
dimprojection dimension (for axis-aligned meshes)
errorStrerror (if any) [optional]
Returns
a mesh

Definition at line 275 of file PointProjectionTools.cpp.

References cloudViewer::Delaunay2dMesh::buildMesh(), count, cloudViewer::DELAUNAY_2D_AXIS_ALIGNED, cloudViewer::DELAUNAY_2D_BEST_LS_PLANE, cloudViewer::Neighbourhood::DO_NOT_DUPLICATE_VERTICES, cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::Delaunay2dMesh::linkMeshWith(), cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::Delaunay2dMesh::removeTrianglesWithEdgesLongerThan(), cloudViewer::GenericCloud::size(), cloudViewer::Delaunay2dMesh::size(), cloudViewer::Neighbourhood::triangulateOnPlane(), type, Tuple3Tpl< Type >::u, cloudViewer::Delaunay2dMesh::USE_ALL_POINTS, Tuple3Tpl< Type >::x, and X.

Referenced by ccRasterizeTool::generateMesh(), CommandRasterize::process(), and CommandVolume25D::process().

◆ 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

Definition at line 87 of file PointProjectionTools.cpp.

References cloudViewer::PointCloudTpl< T >::addPoint(), count, cloudViewer::DegreesToRadians(), cloudViewer::GenericCloud::getNextPoint(), cloudViewer::NormalizedProgress::oneStep(), cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::PointCloudTpl< T >::reserve(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), Tuple3Tpl< Type >::u, and cloudViewer::GenericProgressCallback::update().

◆ 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

Definition at line 25 of file PointProjectionTools.cpp.

References cloudViewer::PointCloudTpl< T >::addPoint(), count, cloudViewer::GenericCloud::getBoundingBox(), cloudViewer::GenericCloud::getNextPoint(), cloudViewer::NormalizedProgress::oneStep(), cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::PointCloudTpl< T >::reserve(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), Tuple3Tpl< Type >::u, and cloudViewer::GenericProgressCallback::update().

◆ 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

at least one of the new segments must be smaller than the initial one!

Definition at line 564 of file PointProjectionTools.cpp.

References extractConvexHull2D(), FindNearestCandidate(), cloudViewer::PointProjectionTools::IndexedCCVector2::index, Edge::itA, max(), min(), Edge::nearestPointIndex, POINT_FROZEN, POINT_NOT_USED, POINT_USED, points, segmentIntersect(), Vector2Tpl< Type >::x, and Vector2Tpl< Type >::y.

Referenced by contourPoly(), and contourPoly2().

◆ 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

Definition at line 355 of file PointProjectionTools.cpp.

References cross(), LexicographicSort(), ParallelSort, and points.

Referenced by ccContourExtractor::ExtractConcaveHull2D(), and extractConcaveHull2D().

◆ segmentIntersect()

bool PointProjectionTools::segmentIntersect ( const CCVector2 A,
const CCVector2 B,
const CCVector2 C,
const CCVector2 D 
)
static

Returns true if the AB and CD segments intersect each other.

Definition at line 422 of file PointProjectionTools.cpp.

References abs(), Vector2Tpl< Type >::cross(), Vector2Tpl< Type >::dot(), and Vector2Tpl< Type >::norm().

Referenced by extractConcaveHull2D().

Member Data Documentation

◆ IGNORE_MAX_EDGE_LENGTH

constexpr int cloudViewer::PointProjectionTools::IGNORE_MAX_EDGE_LENGTH = 0
staticconstexpr

Definition at line 36 of file PointProjectionTools.h.


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