qCC version 2.13.alpha (Qt) - 31 May 2022
Main CloudCompare application (GUI & command line)
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
ccEnvelopeExtractor Class Reference

Envelope extractor (with debug GUI) More...

#include <ccEnvelopeExtractor.h>

Public Types

enum  EnvelopeType { LOWER , UPPER , FULL }
 Envelope type.
 

Static Public Member Functions

static ccPolyline * ExtractFlatEnvelope (CCCoreLib::GenericIndexedCloudPersist *points, bool allowMultiPass, PointCoordinateType maxEdgeLength=0, const PointCoordinateType *preferredNormDim=nullptr, const PointCoordinateType *preferredUpDir=nullptr, EnvelopeType envelopeType=FULL, std::vector< unsigned > *originalPointIndexes=nullptr, bool enableVisualDebugMode=false, double maxAngleDeg=0.0)
 Extracts a unique closed (2D) envelope polyline of a point cloud. More...
 
static bool ExtractFlatEnvelope (CCCoreLib::GenericIndexedCloudPersist *points, bool allowMultiPass, PointCoordinateType maxEdgeLength, std::vector< ccPolyline * > &parts, EnvelopeType envelopeType=FULL, bool allowSplitting=true, const PointCoordinateType *preferredNormDim=nullptr, const PointCoordinateType *preferredUpDir=nullptr, bool enableVisualDebugMode=false)
 Extracts one or several parts of the (2D) envelope polyline of a point cloud. More...
 

Static Protected Member Functions

static bool ExtractConcaveHull2D (std::vector< CCCoreLib::PointProjectionTools::IndexedCCVector2 > &points, std::list< CCCoreLib::PointProjectionTools::IndexedCCVector2 * > &hullPoints, EnvelopeType envelopeType, bool allowMultiPass, PointCoordinateType maxSquareLength=0, bool enableVisualDebugMode=false, double maxAngleDeg=90.0)
 Determines the 'concave' hull of a set of points. More...
 

Detailed Description

Envelope extractor (with debug GUI)

Member Function Documentation

◆ ExtractConcaveHull2D()

bool ccEnvelopeExtractor::ExtractConcaveHull2D ( std::vector< CCCoreLib::PointProjectionTools::IndexedCCVector2 > &  points,
std::list< CCCoreLib::PointProjectionTools::IndexedCCVector2 * > &  hullPoints,
EnvelopeType  envelopeType,
bool  allowMultiPass,
PointCoordinateType  maxSquareLength = 0,
bool  enableVisualDebugMode = false,
double  maxAngleDeg = 90.0 
)
staticprotected

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).

Note
Almost the same method as CCCoreLib::PointProjectionTools::ExtractConcaveHull2D but with partial envelope support and visual debug mode.
Parameters
pointsinput set of points
hullPointsoutput points (on the convex hull)
envelopeTypetype of envelope (above / below / full)
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxSquareLengthmaximum square length (ignored if <= 0, in which case the method simply returns the convex hull!)
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
maxAngleDegmax angle between segments (angle between 0 and 180, in degrees)
Returns
success

◆ ExtractFlatEnvelope() [1/2]

bool ccEnvelopeExtractor::ExtractFlatEnvelope ( CCCoreLib::GenericIndexedCloudPersist *  points,
bool  allowMultiPass,
PointCoordinateType  maxEdgeLength,
std::vector< ccPolyline * > &  parts,
EnvelopeType  envelopeType = FULL,
bool  allowSplitting = true,
const PointCoordinateType *  preferredNormDim = nullptr,
const PointCoordinateType *  preferredUpDir = nullptr,
bool  enableVisualDebugMode = false 
)
static

Extracts one or several parts of the (2D) envelope polyline of a point cloud.

Projects the cloud on its best fitting LS plane first.

Warning
output polylines set (parts) may be empty if all the vertices are too far from each other!
Parameters
pointspoint cloud
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxEdgeLengthmax edge length (ignored if 0, in which case the envelope is the convex hull)
[out]partsoutput polyline parts
envelopeTypeenvelope type (FULL by default)
allowSplittingwhether the polyline can be split or not
preferredNormDimto specifiy a preferred (normal) direction for the polyline extraction
preferredUpDirto specifiy a preferred up direction for the polyline extraction (preferredNormDim must be defined as well and must be normal to this 'up' direction)
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
Returns
success

◆ ExtractFlatEnvelope() [2/2]

ccPolyline * ccEnvelopeExtractor::ExtractFlatEnvelope ( CCCoreLib::GenericIndexedCloudPersist *  points,
bool  allowMultiPass,
PointCoordinateType  maxEdgeLength = 0,
const PointCoordinateType *  preferredNormDim = nullptr,
const PointCoordinateType *  preferredUpDir = nullptr,
EnvelopeType  envelopeType = FULL,
std::vector< unsigned > *  originalPointIndexes = nullptr,
bool  enableVisualDebugMode = false,
double  maxAngleDeg = 0.0 
)
static

Extracts a unique closed (2D) envelope polyline of a point cloud.

Projects the cloud on its best fitting LS plane first.

Parameters
pointspoint cloud
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxEdgeLengthmax edge length (ignored if 0, in which case the envelope is the convex hull)
preferredNormDimto specifiy a preferred (normal) direction for the polyline extraction
preferredUpDirto specifiy a preferred up direction for the polyline extraction (preferredNormDim must be defined as well and must be normal to this 'up' direction)
envelopeTypeto specify a type of envelope (you should define a 'up' direction to get proper lower and upper envelope)
[out]originalPointIndexesto get the indexes (relatively to the input cloud) of the output polyline vertices
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
maxAngleDegmax angle between segments (angle between 0 and 180, in degrees)
Returns
envelope polyline (or 0 if an error occurred)

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