CCLib  Version: 19 Apr 2014
CloudCompare core library
 All Classes Functions Variables Typedefs Enumerations Enumerator
Static Public Member Functions | List of all members
CCLib::ManualSegmentationTools Class Reference

Manual segmentation algorithms (inside/outside a polyline, etc.) More...

#include <ManualSegmentationTools.h>

Inheritance diagram for CCLib::ManualSegmentationTools:
Inheritance graph
[legend]
Collaboration diagram for CCLib::ManualSegmentationTools:
Collaboration graph
[legend]

Static Public Member Functions

static ReferenceCloudsegment (GenericIndexedCloudPersist *aCloud, const Polyline *poly, bool keepInside, const float *viewMat=0)
 Extracts the points that fall inside/outside of a 2D polyline once projected on the screen. More...
 
static ReferenceCloudsegment (GenericIndexedCloudPersist *aCloud, ScalarType minDist, ScalarType maxDist)
 Extracts the points which associated scalar value fall inside a specified interval. More...
 
static bool isPointInsidePoly (const CCVector2 &P, const GenericIndexedCloud *polyVertices)
 Tests if a point is inside a polygon (2D) More...
 
static bool isPointInsidePoly (const CCVector2 &P, const std::vector< CCVector2 > &polyVertices)
 Tests if a point is inside a polygon (2D) More...
 
static GenericIndexedMeshsegmentMesh (GenericIndexedMesh *theMesh, ReferenceCloud *pointsIndexes, bool pointsWillBeInside, GenericProgressCallback *progressCb=0, GenericIndexedCloud *destCloud=0, unsigned indexShift=0)
 Segments a mesh knowing which vertices should be kept or not. More...
 

Detailed Description

Manual segmentation algorithms (inside/outside a polyline, etc.)

Member Function Documentation

static bool CCLib::ManualSegmentationTools::isPointInsidePoly ( const CCVector2 P,
const GenericIndexedCloud polyVertices 
)
static

Tests if a point is inside a polygon (2D)

Parameters
Pa 2D point
polyVerticespolygon vertices (considered as ordered 2D poyline vertices)
Returns
true if P is inside poly
static bool CCLib::ManualSegmentationTools::isPointInsidePoly ( const CCVector2 P,
const std::vector< CCVector2 > &  polyVertices 
)
static

Tests if a point is inside a polygon (2D)

Parameters
Pa 2D point
polyVerticespolygon vertices (considered as ordered 2D poyline vertices)
Returns
true if P is inside poly
static ReferenceCloud* CCLib::ManualSegmentationTools::segment ( GenericIndexedCloudPersist aCloud,
const Polyline poly,
bool  keepInside,
const float *  viewMat = 0 
)
static

Extracts the points that fall inside/outside of a 2D polyline once projected on the screen.

The camera parameters of the screen must be transmitted to this method, as well as the polyline (generally drawn on the screen by a user) expressed in the screen coordinates.

Parameters
aCloudthe cloud to segment
polythe polyline
keepInsideif true (resp. false), the points falling inside (resp. outside) the polyline will be extracted
viewMatthe optional 4x4 visualization matrix (OpenGL style)
Returns
a cloud structure containing references to the extracted points (references to - no duplication)
static ReferenceCloud* CCLib::ManualSegmentationTools::segment ( GenericIndexedCloudPersist aCloud,
ScalarType  minDist,
ScalarType  maxDist 
)
static

Extracts the points which associated scalar value fall inside a specified interval.

All the points with an associated scalar value comprised between minDist and maxDist will be extracted. Warning: be sure to activate an OUTPUT scalar field on the input cloud

Parameters
aCloudthe cloud to segment
minDistthe lower boundary
maxDistthe upper boundary
Returns
a new cloud structure containing the extracted points (references to - no duplication)
static GenericIndexedMesh* CCLib::ManualSegmentationTools::segmentMesh ( GenericIndexedMesh theMesh,
ReferenceCloud pointsIndexes,
bool  pointsWillBeInside,
GenericProgressCallback progressCb = 0,
GenericIndexedCloud destCloud = 0,
unsigned  indexShift = 0 
)
static

Segments a mesh knowing which vertices should be kept or not.

This method takes as input a set of vertex indexes and creates a new mesh composed either of the triangles that have exactly those vertices as summits (pointsWillBeInside=true), or all the triangles from which none of the vertices is part of this subset (pointsWillBeInside=false). There is no re-triangulation on the border.

Parameters
theMesha mesh
pointsIndexesthe vertices indexes as a set of references
pointsWillBeInsidespecifies if the points corresponding to the input indexes should be the new mesh vertices, or the opposite
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
destCloudoptionnaly, a cloud object can be specified to be associated to the new created mesh object, instead of the cloud associated to the ReferenceCloud "pointsIndexes"
indexShiftoptionnaly, a shift can be added to all vertex indexes of the new mesh
Returns
a new mesh structure, or 0 if something went wrong

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