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...
 
cvSelectionData & operator= (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< cvActorSelectionInfo > actorInfos () 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.

Member Enumeration Documentation

◆ FieldAssociation

Field association for selection.

Enumerator
CELLS 

Selection applies to cells.

POINTS 

Selection applies to points.

Constructor & Destructor Documentation

◆ cvSelectionData() [1/4]

cvSelectionData::cvSelectionData ( )

Construct empty selection data.

◆ 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)

References vtkArray().

◆ cvSelectionData() [3/4]

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

Construct from ID vector.

Parameters
idsVector of selected IDs
associationField association

References ids().

◆ cvSelectionData() [4/4]

cvSelectionData::cvSelectionData ( const cvSelectionData &  other)

Copy constructor.

◆ ~cvSelectionData()

cvSelectionData::~cvSelectionData ( )

Destructor.

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)

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)

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)

◆ 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.

References a.

Referenced by cvGenericSelectionTool::createSelectionFromPick().

◆ clear()

void cvSelectionData::clear ( )

Clear the selection.

Referenced by cvSelectionPropertiesWidget::clearSelection().

◆ clearActorInfo()

void cvSelectionData::clearActorInfo ( )

Clear actor information.

◆ count()

◆ fieldAssociation()

◆ fieldTypeString()

QString cvSelectionData::fieldTypeString ( ) const

◆ hasActorInfo()

bool cvSelectionData::hasActorInfo ( ) const
inline

◆ ids()

◆ isEmpty()

bool cvSelectionData::isEmpty ( ) const

Check if selection is empty.

Referenced by cvSelectionAnnotationManager::addAnnotation(), cvSelectionAlgebra::areCompatible(), cvSelectionExporter::batchExportToFiles(), cvSelectionFilter::combineAND(), cvSelectionFilter::combineOR(), cvSelectionPipeline::combineSelections(), cvSelectionAlgebra::complementOf(), cvSelectionAlgebra::differenceOf(), cvSelectionAlgebra::expandSelection(), cvViewSelectionManager::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.

◆ 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)

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

Referenced by cvSelectionAlgebra::expandSelection(), cvGenericSelectionTool::getPolyDataForSelection(), and cvSelectionBase::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

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

Referenced by cvSelectionAlgebra::expandSelection().

◆ vtkArray()

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

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