ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvSelectionData Class Reference

Encapsulates selection data without exposing VTK types. More...

#include <cvSelectionData.h>

Public Types

enum  FieldAssociation { CELLS = 0 , POINTS = 1 }
 Field association for selection. More...
 

Public Member Functions

 cvSelectionData ()
 Construct empty selection data. More...
 
 cvSelectionData (vtkIdTypeArray *vtkArray, int association)
 Construct from VTK selection array. More...
 
 cvSelectionData (const QVector< qint64 > &ids, FieldAssociation association)
 Construct from ID vector. More...
 
 cvSelectionData (const cvSelectionData &other)
 Copy constructor. More...
 
cvSelectionDataoperator= (const cvSelectionData &other)
 Assignment operator. More...
 
 ~cvSelectionData ()
 Destructor. More...
 
bool isEmpty () const
 Check if selection is empty. More...
 
int count () const
 Get number of selected items. More...
 
FieldAssociation fieldAssociation () const
 Get field association. More...
 
QVector< qint64 > ids () const
 Get selected IDs as a vector (copy) More...
 
vtkSmartPointer< vtkIdTypeArray > vtkArray () const
 Get the underlying VTK array (for internal use only) More...
 
void clear ()
 Clear the selection. More...
 
QString fieldTypeString () const
 Get human-readable field type string. More...
 
void addActorInfo (const cvActorSelectionInfo &info)
 Actor/Representation information (ParaView-style) More...
 
void setActorInfo (vtkActor *actor, vtkPolyData *polyData, double zValue=1.0)
 Set actor information (single actor case) More...
 
int actorCount () const
 Get number of actors in this selection. More...
 
bool hasActorInfo () const
 Check if actor information is available. More...
 
cvActorSelectionInfo actorInfo (int index=0) const
 Get actor info at index. More...
 
QVector< cvActorSelectionInfoactorInfos () const
 Get all actor infos. More...
 
vtkActor * primaryActor () const
 Get the primary (front-most) actor. More...
 
vtkPolyData * primaryPolyData () const
 Get the primary (front-most) polyData. More...
 
void clearActorInfo ()
 Clear actor information. More...
 

Detailed Description

Encapsulates selection data without exposing VTK types.

This class provides a VTK-independent interface for selection data, hiding the underlying vtkIdTypeArray implementation.

Following ParaView's design pattern, this class can now store information about multiple selected actors/representations along with their selection data.

Definition at line 136 of file cvSelectionData.h.

Member Enumeration Documentation

◆ FieldAssociation

Field association for selection.

Enumerator
CELLS 

Selection applies to cells.

POINTS 

Selection applies to points.

Definition at line 141 of file cvSelectionData.h.

Constructor & Destructor Documentation

◆ cvSelectionData() [1/4]

cvSelectionData::cvSelectionData ( )

Construct empty selection data.

Definition at line 19 of file cvSelectionData.cpp.

◆ cvSelectionData() [2/4]

cvSelectionData::cvSelectionData ( vtkIdTypeArray *  vtkArray,
int  association 
)

Construct from VTK selection array.

Parameters
vtkArrayThe VTK array (will be deep copied)
associationField association (0=cells, 1=points)

Definition at line 23 of file cvSelectionData.cpp.

References vtkArray().

◆ cvSelectionData() [3/4]

cvSelectionData::cvSelectionData ( const QVector< qint64 > &  ids,
FieldAssociation  association 
)

Construct from ID vector.

Parameters
idsVector of selected IDs
associationField association

Definition at line 45 of file cvSelectionData.cpp.

References ids().

◆ cvSelectionData() [4/4]

cvSelectionData::cvSelectionData ( const cvSelectionData other)

Copy constructor.

Definition at line 58 of file cvSelectionData.cpp.

◆ ~cvSelectionData()

cvSelectionData::~cvSelectionData ( )

Destructor.

Definition at line 109 of file cvSelectionData.cpp.

Member Function Documentation

◆ actorCount()

int cvSelectionData::actorCount ( ) const
inline

Get number of actors in this selection.

Returns
Number of actors (0 if no actor info stored)

Definition at line 248 of file cvSelectionData.h.

Referenced by cvSelectionPipeline::combineSelections().

◆ actorInfo()

cvActorSelectionInfo cvSelectionData::actorInfo ( int  index = 0) const

Get actor info at index.

Parameters
indexIndex in the list (0 = front-most)
Returns
Actor info, or empty struct if index out of range

Note: List is sorted by Z-value (front to back)

Definition at line 173 of file cvSelectionData.cpp.

Referenced by cvSelectionPipeline::combineSelections().

◆ actorInfos()

QVector<cvActorSelectionInfo> cvSelectionData::actorInfos ( ) const
inline

Get all actor infos.

Returns
Vector of actor infos, sorted by Z-value (front to back)

Definition at line 268 of file cvSelectionData.h.

◆ addActorInfo()

void cvSelectionData::addActorInfo ( const cvActorSelectionInfo info)

Actor/Representation information (ParaView-style)

These methods provide access to information about which actors/ representations were involved in the selection, similar to ParaView's selectedRepresentations collection.

Add actor information to the selection

Parameters
infoActor selection information

Use this when performing hardware selection or when you need to track which specific actor was selected.

Definition at line 148 of file cvSelectionData.cpp.

References a.

Referenced by cvGenericSelectionTool::createSelectionFromPick().

◆ clear()

void cvSelectionData::clear ( )

Clear the selection.

Definition at line 137 of file cvSelectionData.cpp.

Referenced by cvSelectionPropertiesWidget::clearSelection().

◆ clearActorInfo()

void cvSelectionData::clearActorInfo ( )

Clear actor information.

Definition at line 191 of file cvSelectionData.cpp.

◆ count()

◆ fieldAssociation()

◆ fieldTypeString()

QString cvSelectionData::fieldTypeString ( ) const

◆ hasActorInfo()

bool cvSelectionData::hasActorInfo ( ) const
inline

◆ ids()

◆ isEmpty()

bool cvSelectionData::isEmpty ( ) const

Check if selection is empty.

Definition at line 114 of file cvSelectionData.cpp.

Referenced by cvSelectionAnnotationManager::addAnnotation(), cvSelectionAlgebra::areCompatible(), cvSelectionExporter::batchExportToFiles(), cvSelectionFilter::combineAND(), cvSelectionFilter::combineOR(), cvSelectionPipeline::combineSelections(), cvSelectionAlgebra::complementOf(), cvSelectionAlgebra::differenceOf(), cvViewSelectionManager::expandSelection(), cvSelectionAlgebra::expandSelection(), cvSelectionExporter::exportFromSourceCloud(), cvSelectionExporter::exportFromSourceMesh(), cvSelectionExporter::exportNumbered(), cvSelectionExporter::exportToFile(), cvSelectionExporter::exportToMesh(), cvSelectionExporter::exportToPointCloud(), cvSelectionAlgebra::extractBoundary(), cvSelectionExporter::extractSelection(), cvSelectionFilter::filterByArea(), cvSelectionFilter::filterByAttributeComparison(), cvSelectionFilter::filterByAttributeRange(), cvSelectionFilter::filterByBoundingBox(), cvSelectionFilter::filterByDistanceFromPoint(), cvSelectionFilter::filterByNeighborCount(), cvSelectionFilter::filterByNormalAngle(), cvRenderViewSelectionReaction::finalizeSelection(), cvSelectionAlgebra::growPointSelection(), cvSelectionAlgebra::growSelection(), cvGenericSelectionTool::hardwareSelectInRegion(), cvSelectionHighlighter::highlightSelection(), cvSelectionAlgebra::intersectionOf(), cvSelectionFilter::invert(), cvSelectionToolController::onSelectionFinished(), cvSelectionAlgebra::shrinkPointSelection(), cvSelectionAlgebra::shrinkSelection(), cvSelectionAlgebra::symmetricDifferenceOf(), cvSelectionAlgebra::unionOf(), and cvSelectionPropertiesWidget::updateSelection().

◆ operator=()

cvSelectionData & cvSelectionData::operator= ( const cvSelectionData other)

Assignment operator.

Definition at line 81 of file cvSelectionData.cpp.

◆ primaryActor()

vtkActor * cvSelectionData::primaryActor ( ) const

Get the primary (front-most) actor.

Returns
Pointer to primary actor, or nullptr if not available

This is the actor closest to the camera (smallest Z value)

Definition at line 181 of file cvSelectionData.cpp.

Referenced by cvSelectionAlgebra::expandSelection(), and cvRenderViewSelectionReaction::finalizeSelection().

◆ primaryPolyData()

vtkPolyData * cvSelectionData::primaryPolyData ( ) const

Get the primary (front-most) polyData.

Returns
Pointer to primary polyData, or nullptr if not available

Definition at line 186 of file cvSelectionData.cpp.

Referenced by cvSelectionAlgebra::expandSelection(), cvSelectionBase::getPolyDataForSelection(), and cvGenericSelectionTool::getPolyDataForSelection().

◆ setActorInfo()

void cvSelectionData::setActorInfo ( vtkActor *  actor,
vtkPolyData *  polyData,
double  zValue = 1.0 
)

Set actor information (single actor case)

Parameters
actorThe selected actor
polyDataThe associated polyData
zValueOptional Z-buffer depth value

Definition at line 159 of file cvSelectionData.cpp.

References cvActorSelectionInfo::actor, cvActorSelectionInfo::polyData, and cvActorSelectionInfo::zValue.

Referenced by cvSelectionAlgebra::expandSelection().

◆ vtkArray()

vtkSmartPointer<vtkIdTypeArray> cvSelectionData::vtkArray ( ) const
inline

Get the underlying VTK array (for internal use only)

Returns
Smart pointer to VTK array

Definition at line 204 of file cvSelectionData.h.

Referenced by cvSelectionPipeline::combineSelections(), cvSelectionData(), cvSelectionExporter::extractSelection(), cvSelectionHighlighter::highlightSelection(), and cvViewSelectionManager::setCurrentSelection().


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