![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Manual segmentation algorithms (inside/outside a polyline, etc.) More...
#include <ManualSegmentationTools.h>


Classes | |
| struct | MeshCutterParams |
| Input/output parameters for the segmentMeshWithAAPlane method. More... | |
Static Public Member Functions | |
| static ReferenceCloud * | segment (GenericIndexedCloudPersist *aCloud, const Polyline *poly, bool keepInside, const float *viewMat=nullptr) |
| static ReferenceCloud * | segment (GenericIndexedCloudPersist *cloud, ScalarType minDist, ScalarType maxDist, bool outside=false) |
| static ReferenceCloud * | segment (GenericIndexedCloudPersist *cloud, std::vector< ScalarType > values, bool outside=false) |
| 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 *mesh, ReferenceCloud *selectedVertexIndexes, bool useSelectedVertices, GenericProgressCallback *progressCb=nullptr, GenericIndexedCloud *destCloud=nullptr, unsigned indexShift=0, std::vector< int > *triangleIndexMap=nullptr) |
| 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.)
Definition at line 24 of file ManualSegmentationTools.h.
|
static |
Tests if a point is inside a polygon (2D)
| P | a 2D point |
| polyVertices | polygon vertices (considered as ordered 2D poyline vertices) |
Definition at line 61 of file ManualSegmentationTools.cpp.
References cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericCloud::size(), Vector2Tpl< Type >::x, Tuple3Tpl< Type >::x, Vector2Tpl< Type >::y, and Tuple3Tpl< Type >::y.
Referenced by cloudViewer::Delaunay2dMesh::removeOuterTriangles(), ccGraphicalSegmentationTool::segment(), and segment().
|
static |
Tests if a point is inside a polygon (2D)
| P | a 2D point |
| polyVertices | polygon vertices (considered as ordered 2D poyline vertices) |
Definition at line 90 of file ManualSegmentationTools.cpp.
References Vector2Tpl< Type >::x, and Vector2Tpl< Type >::y.
|
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.
| 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) |
Definition at line 22 of file ManualSegmentationTools.cpp.
References cloudViewer::ReferenceCloud::addPointIndex(), count, cloudViewer::GenericIndexedCloud::getPoint(), isPointInsidePoly(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::x, and Tuple3Tpl< Type >::y.
|
static |
Selects the points which associated scalar value fall inside or outside a specified interval
| cloud | the cloud to segment |
| minDist | the lower boundary |
| maxDist | the upper boundary |
| outside | whether to select the points inside or outside |
Definition at line 115 of file ManualSegmentationTools.cpp.
References cloudViewer::ReferenceCloud::addPointIndex(), dist(), cloudViewer::GenericCloud::getPointScalarValue(), and cloudViewer::GenericCloud::size().
|
static |
Selects the points which associated scalar value fall inside or outside a specified interval
| cloud | the cloud to segment |
| values | scalar values |
| outside | whether to select the points inside or outside |
Definition at line 145 of file ManualSegmentationTools.cpp.
References abs(), cloudViewer::ReferenceCloud::addPointIndex(), dist(), EPSILON_VALUE, cloudViewer::GenericCloud::getPointScalarValue(), and cloudViewer::GenericCloud::size().
|
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:
\warning No re-triangulation on the border will occur.
\param mesh a mesh
\param selectedVertexIndexes the indexes of selected vertices
\param useSelectedVertices 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 |
| triangleIndexMap | optionally, a vector can be filled to record the new indexes of the triangles in the destination mesh (or -1 if they are discarded) |
Definition at line 182 of file ManualSegmentationTools.cpp.
References cloudViewer::SimpleMesh::addTriangle(), cloudViewer::SimpleMesh::capacity(), cloudViewer::ReferenceCloud::getAssociatedCloud(), cloudViewer::GenericIndexedMesh::getNextTriangleVertIndexes(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::VerticesIndexes::i, cloudViewer::NormalizedProgress::oneStep(), cloudViewer::GenericMesh::placeIteratorAtBeginning(), cloudViewer::SimpleMesh::reserve(), cloudViewer::SimpleMesh::resize(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), cloudViewer::ReferenceCloud::size(), cloudViewer::SimpleMesh::size(), size, cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::textCanBeEdited(), and cloudViewer::GenericProgressCallback::update().
|
static |
Definition at line 887 of file ManualSegmentationTools.cpp.
References abs(), AddTriangle(), cloudViewer::ManualSegmentationTools::MeshCutterParams::bbMax, cloudViewer::ManualSegmentationTools::MeshCutterParams::bbMin, c_origIndexFlag, c_realIndexMask, c_srcIndexFlag, cloudViewer::SimpleMesh::clear(), ComputeEdgePoint(), cloudViewer::ManualSegmentationTools::MeshCutterParams::epsilon, error(), Vector3Tpl< double >::fromArray(), cloudViewer::ManualSegmentationTools::MeshCutterParams::generateOutsideMesh, cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ImportSourceVertices(), cloudViewer::ManualSegmentationTools::MeshCutterParams::insideMesh, MergeOldTriangles(), cloudViewer::ManualSegmentationTools::MeshCutterParams::origTriIndexesMapInside, cloudViewer::ManualSegmentationTools::MeshCutterParams::origTriIndexesMapOutside, cloudViewer::ManualSegmentationTools::MeshCutterParams::outsideMesh, cloudViewer::PointCloudTpl< T >::reset(), cloudViewer::SimpleMesh::resize(), cloudViewer::PointCloud::resize(), s_edgePoint, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), cloudViewer::SimpleMesh::size(), size, std::swap(), cloudViewer::ManualSegmentationTools::MeshCutterParams::trackOrigIndexes, cloudViewer::CCMiscTools::TriBoxOverlapd(), Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ccCropTool::Crop().
|
static |
Definition at line 634 of file ManualSegmentationTools.cpp.
References abs(), AddTriangle(), c_origIndexFlag, c_realIndexMask, ComputeEdgePoint(), cloudViewer::ManualSegmentationTools::MeshCutterParams::epsilon, error(), Vector3Tpl< double >::fromArray(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, cloudViewer::ManualSegmentationTools::MeshCutterParams::insideMesh, MergeOldTriangles(), cloudViewer::ManualSegmentationTools::MeshCutterParams::outsideMesh, cloudViewer::ManualSegmentationTools::MeshCutterParams::planeCoord, cloudViewer::ManualSegmentationTools::MeshCutterParams::planeOrthoDim, s_edgePoint, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), and Tuple3Tpl< Type >::u.