ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvSelectionBase.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vector>
11 
12 #include "qPCL.h"
13 
14 // Forward declarations
16 class vtkPolyData;
17 class vtkActor;
18 class vtkDataSet;
19 class cvSelectionData;
21 
22 namespace PclUtils {
23 class PCLVis;
24 }
25 
45 public:
46  cvSelectionBase() : m_viewer(nullptr) {}
47  virtual ~cvSelectionBase() = default;
48 
56  virtual void setVisualizer(ecvGenericVisualizer3D* viewer) {
57  m_viewer = viewer;
58  }
59 
64  ecvGenericVisualizer3D* getVisualizer() const { return m_viewer; }
65 
66 protected:
76  PclUtils::PCLVis* getPCLVis() const;
77 
82  bool hasValidPCLVis() const;
83 
89  vtkDataSet* getDataFromActor(vtkActor* actor);
90 
95  QList<vtkActor*> getDataActors() const;
96 
105  std::vector<vtkPolyData*> getAllPolyDataFromVisualizer();
106 
124  virtual vtkPolyData* getPolyDataForSelection(
125  const cvSelectionData* selectionData = nullptr);
126 
127 protected:
130 };
cvSelectionBase::getDataFromActor
vtkDataSet * getDataFromActor(vtkActor *actor)
Get data object from a specific actor (ParaView-style)
Definition: cvSelectionBase.cpp:49
cvSelectionBase::cvSelectionBase
cvSelectionBase()
Definition: cvSelectionBase.h:46
cvSelectionData::hasActorInfo
bool hasActorInfo() const
Check if actor information is available.
Definition: cvSelectionData.h:253
data
GraphType data
Definition: graph_cut.cc:138
CVLog::PrintVerbose
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
PclUtils::PCLVis::getCurrentRenderer
vtkRenderer * getCurrentRenderer(int viewport=0)
Definition: PCLVis.cpp:2924
cvSelectionBase::setVisualizer
virtual void setVisualizer(ecvGenericVisualizer3D *viewer)
Set the visualizer instance.
Definition: cvSelectionBase.h:56
CVLog.h
PclUtils
Definition: CustomContextItem.cpp:18
cvSelectionBase::getPCLVis
PclUtils::PCLVis * getPCLVis() const
Get PCLVis instance (for VTK-specific operations)
Definition: cvSelectionBase.cpp:33
cvSelectionBase::getPolyDataForSelection
virtual vtkPolyData * getPolyDataForSelection(const cvSelectionData *selectionData=nullptr)
Get polyData using ParaView-style priority (centralized method)
Definition: cvSelectionBase.cpp:72
qPCL.h
cvSelectionBase.h
cvViewSelectionManager.h
cvViewSelectionManager::getPolyData
vtkPolyData * getPolyData() const
Get the underlying polyData for selection operations.
Definition: cvViewSelectionManager.cpp:538
cvViewSelectionManager
Central manager for all selection operations in the view.
Definition: cvViewSelectionManager.h:52
ecvGenericVisualizer3D
Generic visualizer 3D interface.
Definition: ecvGenericVisualizer3D.h:15
cvSelectionBase::getAllPolyDataFromVisualizer
std::vector< vtkPolyData * > getAllPolyDataFromVisualizer()
Get all polyData from the visualizer.
Definition: cvSelectionBase.cpp:154
cvSelectionBase::hasValidPCLVis
bool hasValidPCLVis() const
Check if visualizer is valid and is PCLVis.
Definition: cvSelectionBase.cpp:41
cvSelectionBase::getDataActors
QList< vtkActor * > getDataActors() const
Get all visible data actors from visualizer.
Definition: cvSelectionBase.cpp:117
PCLVis.h
cvSelectionData
Encapsulates selection data without exposing VTK types.
Definition: cvSelectionData.h:136
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
cvSelectionBase
Lightweight base class for all selection-related components.
Definition: cvSelectionBase.h:44
QPCL_ENGINE_LIB_API
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
cvSelectionBase::getVisualizer
ecvGenericVisualizer3D * getVisualizer() const
Get the visualizer instance.
Definition: cvSelectionBase.h:64
cvViewSelectionManager::instance
static cvViewSelectionManager * instance()
Get the singleton instance.
Definition: cvViewSelectionManager.cpp:38
cvSelectionBase::m_viewer
ecvGenericVisualizer3D * m_viewer
Visualizer instance (abstract interface)
Definition: cvSelectionBase.h:129
PclUtils::PCLVis
Definition: PCLVis.h:80
cvSelectionData::primaryPolyData
vtkPolyData * primaryPolyData() const
Get the primary (front-most) polyData.
Definition: cvSelectionData.cpp:186