Manual segmentation algorithms (inside/outside a polyline, etc.)
More...
#include <ManualSegmentationTools.h>
|
static ReferenceCloud * | segment (GenericIndexedCloudPersist *aCloud, const Polyline *poly, bool keepInside, const float *viewMat=nullptr) |
| Extracts the points that fall inside/outside of a 2D polyline once projected on the screen. More...
|
|
static ReferenceCloud * | segmentReferenceCloud (ReferenceCloud *cloud, ScalarType minDist, ScalarType maxDist, bool outside) |
| Selects the points which associated scalar value fall inside or outside a specified interval. More...
|
|
static ReferenceCloud * | segment (GenericIndexedCloudPersist *cloud, ScalarType minDist, ScalarType maxDist, bool outside=false) |
| Selects the points which associated scalar value fall inside or outside 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 GenericIndexedMesh * | segmentMesh (GenericIndexedMesh *theMesh, ReferenceCloud *pointsIndexes, bool pointsWillBeInside, GenericProgressCallback *progressCb=nullptr, GenericIndexedCloud *destCloud=nullptr, unsigned indexShift=0) |
| Segments a mesh knowing which vertices should be kept or not. More...
|
|
static bool | segmentMeshWithAAPlane (GenericIndexedMesh *mesh, GenericIndexedCloudPersist *vertices, MeshCutterParams &ioParams, GenericProgressCallback *progressCb=nullptr) |
|
static bool | segmentMeshWithAABox (GenericIndexedMesh *mesh, GenericIndexedCloudPersist *vertices, MeshCutterParams &ioParams, GenericProgressCallback *progressCb=nullptr) |
|
Manual segmentation algorithms (inside/outside a polyline, etc.)
◆ isPointInsidePoly() [1/2]
Tests if a point is inside a polygon (2D)
- Parameters
-
P | a 2D point |
polyVertices | polygon vertices (considered as ordered 2D poyline vertices) |
- Returns
- true if P is inside poly
◆ isPointInsidePoly() [2/2]
bool ManualSegmentationTools::isPointInsidePoly |
( |
const CCVector2 & |
P, |
|
|
const std::vector< CCVector2 > & |
polyVertices |
|
) |
| |
|
static |
Tests if a point is inside a polygon (2D)
- Parameters
-
P | a 2D point |
polyVertices | polygon vertices (considered as ordered 2D poyline vertices) |
- Returns
- true if P is inside poly
◆ segment() [1/2]
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
-
aCloud | the cloud to segment |
poly | the polyline |
keepInside | if true (resp. false), the points falling inside (resp. outside) the polyline will be extracted |
viewMat | the optional 4x4 visualization matrix (OpenGL style) |
- Returns
- a cloud structure containing references to the extracted points (references to - no duplication)
◆ segment() [2/2]
Selects the points which associated scalar value fall inside or outside a specified interval.
- Warning
- : be sure to activate an OUTPUT scalar field on the input cloud
- Parameters
-
cloud | the cloud to segment |
minDist | the lower boundary |
maxDist | the upper boundary |
outside | whether to select the points inside or outside |
- Returns
- a new cloud structure containing the extracted points (references to - no duplication)
◆ segmentMesh()
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 points as vertices (pointsWillBeInside = true)
- or all the triangles for which no vertices are part of this subset (pointsWillBeInside = false).
- Warning
- No re-triangulation on the border will occur.
- Parameters
-
theMesh | a mesh |
pointsIndexes | the vertices indexes as a set of references |
pointsWillBeInside | specifies if the points corresponding to the input indexes should be the new mesh vertices, or the opposite |
progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
destCloud | optionally, a cloud object can be specified to be associated to the new created mesh object, instead of the cloud associated to the ReferenceCloud "pointsIndexes" |
indexShift | optionally, a shift can be added to all vertex indexes of the new mesh |
- Returns
- a new mesh structure, or 0 if something went wrong
◆ segmentReferenceCloud()
ReferenceCloud * ManualSegmentationTools::segmentReferenceCloud |
( |
ReferenceCloud * |
cloud, |
|
|
ScalarType |
minDist, |
|
|
ScalarType |
maxDist, |
|
|
bool |
outside |
|
) |
| |
|
static |
Selects the points which associated scalar value fall inside or outside a specified interval.
- Warning
- : be sure to activate an OUTPUT scalar field on the input cloud
- Parameters
-
cloud | the RefrenceCloud to segment |
minDist | the lower boundary |
maxDist | the upper boundary |
outside | whether to select the points inside or outside |
- Returns
- a new cloud structure containing the extracted points (references to - no duplication)
The documentation for this class was generated from the following files:
- ManualSegmentationTools.h
- ManualSegmentationTools.cpp