![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Selection algebra operations. More...
#include <cvSelectionAlgebra.h>


Public Types | |
| enum class | Operation { UNION , INTERSECTION , DIFFERENCE , SYMMETRIC_DIFF , COMPLEMENT } |
| Algebra operations Using enum class to avoid macro conflicts (e.g., DIFFERENCE may be defined as a macro on Windows) Note: Q_ENUM requires QObject to be fully defined before the enum Note: DIFFERENCE macro protection is handled at file scope (top of file) More... | |
Signals | |
| void | operationComplete (const cvSelectionData &result) |
| Emitted when operation is complete. More... | |
| void | progressChanged (int percentage) |
| Emitted when filtering progress changes. More... | |
| void | filteringComplete (const cvSelectionData &result) |
| Emitted when filtering is complete. More... | |
Public Member Functions | |
| cvSelectionAlgebra (QObject *parent=nullptr) | |
Static Public Member Functions | |
| static cvSelectionData | unionOf (const cvSelectionData &a, const cvSelectionData &b) |
| Compute union of two selections. More... | |
| static cvSelectionData | intersectionOf (const cvSelectionData &a, const cvSelectionData &b) |
| Compute intersection of two selections. More... | |
| static cvSelectionData | differenceOf (const cvSelectionData &a, const cvSelectionData &b) |
| Compute difference of two selections. More... | |
| static cvSelectionData | symmetricDifferenceOf (const cvSelectionData &a, const cvSelectionData &b) |
| Compute symmetric difference of two selections. More... | |
| static cvSelectionData | complementOf (vtkPolyData *polyData, const cvSelectionData &input) |
| Compute complement of a selection. More... | |
| static cvSelectionData | performOperation (Operation op, const cvSelectionData &a, const cvSelectionData &b, vtkPolyData *polyData=nullptr) |
| Perform algebra operation on two selections. More... | |
| static cvSelectionData | growSelection (vtkPolyData *polyData, const cvSelectionData &input, int layers=1, bool removeSeed=false, bool removeIntermediateLayers=false) |
| Grow selection by adding neighbors. More... | |
| static cvSelectionData | shrinkSelection (vtkPolyData *polyData, const cvSelectionData &input, int iterations=1) |
| Shrink selection by removing boundary elements. More... | |
| static cvSelectionData | expandSelection (vtkPolyData *polyData, const cvSelectionData &input, int layers, bool removeSeed=false, bool removeIntermediateLayers=false) |
| Expand selection (ParaView-compatible) More... | |
| static cvSelectionData | extractBoundary (vtkPolyData *polyData, const cvSelectionData &input) |
| Extract boundary elements of selection. More... | |
| static bool | areCompatible (const cvSelectionData &a, const cvSelectionData &b) |
| Validate that two selections are compatible for operations. More... | |
| static cvSelectionData | growPointSelection (vtkPolyData *polyData, const cvSelectionData &input, int layers=1, bool removeSeed=false, bool removeIntermediateLayers=false) |
| Grow point selection by adding neighbor points. More... | |
| static cvSelectionData | shrinkPointSelection (vtkPolyData *polyData, const cvSelectionData &input, int iterations=1) |
| Shrink point selection by removing boundary points. More... | |
Selection algebra operations.
Provides set-theoretic operations on selections:
Based on ParaView's selection algebra functionality.
Definition at line 46 of file cvSelectionAlgebra.h.
|
strong |
Algebra operations Using enum class to avoid macro conflicts (e.g., DIFFERENCE may be defined as a macro on Windows) Note: Q_ENUM requires QObject to be fully defined before the enum Note: DIFFERENCE macro protection is handled at file scope (top of file)
| Enumerator | |
|---|---|
| UNION | |
| INTERSECTION | |
| DIFFERENCE | |
| SYMMETRIC_DIFF | |
| COMPLEMENT | |
Definition at line 57 of file cvSelectionAlgebra.h.
|
explicit |
Definition at line 32 of file cvSelectionAlgebra.cpp.
References CVLog::PrintVerbose().
|
static |
Validate that two selections are compatible for operations.
Definition at line 405 of file cvSelectionAlgebra.cpp.
References a, cvSelectionData::fieldAssociation(), and cvSelectionData::isEmpty().
Referenced by differenceOf(), intersectionOf(), symmetricDifferenceOf(), and unionOf().
|
static |
Compute complement of a selection.
| polyData | The mesh data (to determine total element count) |
| input | Input selection |
Definition at line 165 of file cvSelectionAlgebra.cpp.
References cvSelectionData::count(), CVLog::Error(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), cvSelectionData::POINTS, CVLog::Print(), and qSetFromVector().
Referenced by performOperation().
|
static |
Compute difference of two selections.
| a | First selection |
| b | Second selection |
Definition at line 92 of file cvSelectionAlgebra.cpp.
References a, areCompatible(), cvSelectionData::count(), CVLog::Error(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::Print(), qSetFromVector(), qVectorFromSet(), and result.
Referenced by performOperation().
|
static |
Expand selection (ParaView-compatible)
| polyData | The mesh data |
| input | Input selection |
| layers | Number of layers to expand (positive = grow, negative = shrink) |
| removeSeed | If true, removes the original seed elements |
| removeIntermediateLayers | If true, keeps only the outermost layer |
This is the ParaView-compatible API matching vtkSMSelectionHelper::ExpandSelection
Definition at line 462 of file cvSelectionAlgebra.cpp.
References cvSelectionData::fieldAssociation(), cvSelectionData::hasActorInfo(), cvSelectionData::ids(), cvSelectionData::isEmpty(), cvSelectionData::POINTS, cvSelectionData::primaryActor(), cvSelectionData::primaryPolyData(), CVLog::PrintVerbose(), cvSelectionData::setActorInfo(), and CVLog::Warning().
Referenced by cvViewSelectionManager::expandSelection().
|
static |
Extract boundary elements of selection.
| polyData | The mesh data |
| input | Input selection (must be CELLS) |
Definition at line 370 of file cvSelectionAlgebra.cpp.
References cvSelectionData::CELLS, cvSelectionData::count(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::PrintVerbose(), qSetFromVector(), and CVLog::Warning().
|
signal |
Emitted when filtering is complete.
|
static |
Grow point selection by adding neighbor points.
| polyData | The mesh data |
| input | Input selection (must be POINTS) |
| layers | Number of growth layers |
| removeSeed | If true, removes the original seed points |
| removeIntermediateLayers | If true, keeps only outermost layer |
Point neighbors are determined by shared cells.
Definition at line 739 of file cvSelectionAlgebra.cpp.
References cvSelectionData::count(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), cvSelectionData::POINTS, CVLog::PrintVerbose(), qSetFromVector(), and CVLog::Warning().
|
static |
Grow selection by adding neighbors.
| polyData | The mesh data |
| input | Input selection (must be CELLS) |
| layers | Number of growth layers (negative for shrink) |
| removeSeed | If true, removes the original seed cells (ParaView-aligned) |
| removeIntermediateLayers | If true, keeps only outermost layer (ParaView-aligned) |
Reference: vtkPVRenderViewSettings::GrowSelectionRemoveSeed vtkPVRenderViewSettings::GrowSelectionRemoveIntermediateLayers
Definition at line 240 of file cvSelectionAlgebra.cpp.
References cvSelectionData::CELLS, cvSelectionData::count(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::PrintVerbose(), qSetFromVector(), and CVLog::Warning().
|
static |
Compute intersection of two selections.
| a | First selection |
| b | Second selection |
Definition at line 63 of file cvSelectionAlgebra.cpp.
References a, areCompatible(), cvSelectionData::count(), CVLog::Error(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::Print(), qSetFromVector(), qVectorFromSet(), and result.
Referenced by performOperation().
|
signal |
Emitted when operation is complete.
|
static |
Perform algebra operation on two selections.
| op | Operation to perform |
| a | First selection |
| b | Second selection (not used for COMPLEMENT) |
| polyData | Mesh data (required for COMPLEMENT) |
Definition at line 211 of file cvSelectionAlgebra.cpp.
References a, COMPLEMENT, complementOf(), DIFFERENCE, differenceOf(), CVLog::Error(), INTERSECTION, intersectionOf(), SYMMETRIC_DIFF, symmetricDifferenceOf(), UNION, and unionOf().
Referenced by cvViewSelectionManager::performAlgebraOperation().
|
signal |
Emitted when filtering progress changes.
|
static |
Shrink point selection by removing boundary points.
| polyData | The mesh data |
| input | Input selection (must be POINTS) |
| iterations | Number of shrink iterations |
Definition at line 831 of file cvSelectionAlgebra.cpp.
References cvSelectionData::count(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), cvSelectionData::POINTS, CVLog::PrintVerbose(), qSetFromVector(), and CVLog::Warning().
|
static |
Shrink selection by removing boundary elements.
| polyData | The mesh data |
| input | Input selection (must be CELLS) |
| iterations | Number of shrink iterations |
Definition at line 320 of file cvSelectionAlgebra.cpp.
References cvSelectionData::CELLS, cvSelectionData::count(), cvSelectionData::fieldAssociation(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::PrintVerbose(), qSetFromVector(), and CVLog::Warning().
|
static |
Compute symmetric difference of two selections.
| a | First selection |
| b | Second selection |
Definition at line 124 of file cvSelectionAlgebra.cpp.
References a, areCompatible(), cvSelectionData::count(), CVLog::Error(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::Print(), qSetFromVector(), qVectorFromSet(), and result.
Referenced by performOperation().
|
static |
Compute union of two selections.
| a | First selection |
| b | Second selection |
Definition at line 37 of file cvSelectionAlgebra.cpp.
References a, areCompatible(), cvSelectionData::count(), CVLog::Error(), cvSelectionData::ids(), cvSelectionData::isEmpty(), CVLog::Print(), qSetFromVector(), qVectorFromSet(), and result.
Referenced by performOperation().