ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvRenderViewSelectionReaction.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 
27 // clang-format off
28 // Qt - must be included before other headers for MOC to work correctly
29 #include <QtGlobal>
30 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
31 #include <QAction>
32 #include <QCursor>
33 #include <QObject>
34 #include <QPointer>
35 #include <QShortcut>
36 #include <QTimer>
37 #else
38 #include <QtWidgets/QAction>
39 #include <QtGui/QCursor>
40 #include <QtCore/QObject>
41 #include <QtCore/QPointer>
42 #include <QtWidgets/QShortcut>
43 #include <QtCore/QTimer>
44 #endif
45 // clang-format on
46 
47 #include "cvSelectionData.h"
48 #include "cvSelectionData.h" // Contains SelectionMode, SelectionModifier enums
49 #include "qPCL.h"
50 
51 // VTK
52 #include <vtkSmartPointer.h>
53 #include <vtkWeakPointer.h>
54 
55 // Forward declarations
56 class QActionGroup;
60 class vtkObject;
61 class vtkRenderWindowInteractor;
62 class vtkRenderer;
63 class vtkInteractorStyle;
64 class vtkIntArray;
65 class vtkPolyData;
66 
67 namespace PclUtils {
68 class PCLVis;
69 }
70 
90  Q_OBJECT
91 
92 public:
95 
102  cvRenderViewSelectionReaction(QAction* parentAction,
103  SelectionMode mode,
104  QActionGroup* modifierGroup = nullptr);
105 
106  ~cvRenderViewSelectionReaction() override;
107 
111  QAction* parentAction() const { return m_parentAction; }
112 
116  SelectionMode mode() const { return m_mode; }
117 
124  void setVisualizer(ecvGenericVisualizer3D* viewer);
125 
129  ecvGenericVisualizer3D* getVisualizer() const { return m_viewer; }
130 
134  bool isActive() const;
135 
143  return ActiveReaction;
144  }
145 
152  static void endActiveSelection();
153 
154  //-------------------------------------------------------------------------
155  // Public event handlers (called by VTK callbacks)
156  //-------------------------------------------------------------------------
157 
162  void handleSelectionChanged(vtkObject* caller,
163  unsigned long eventId,
164  void* callData);
165 
169  Q_INVOKABLE void handleMouseMove();
170 
174  Q_INVOKABLE void handleLeftButtonPress();
175 
179  Q_INVOKABLE void handleLeftButtonRelease();
180 
184  Q_INVOKABLE void handleWheelRotate();
185 
189  Q_INVOKABLE void handleRightButtonPressed();
190 
194  Q_INVOKABLE void handleRightButtonRelease();
195 
196 protected:
198 
207  void vtkOnSelectionChanged(vtkObject* caller,
208  unsigned long eventId,
209  void* callData);
210  void vtkOnMouseMove(vtkObject* caller,
211  unsigned long eventId,
212  void* callData);
213  void vtkOnLeftButtonPress(vtkObject* caller,
214  unsigned long eventId,
215  void* callData);
216  void vtkOnLeftButtonRelease(vtkObject* caller,
217  unsigned long eventId,
218  void* callData);
219  void vtkOnWheelRotate(vtkObject* caller,
220  unsigned long eventId,
221  void* callData);
222  void vtkOnRightButtonPressed(vtkObject* caller,
223  unsigned long eventId,
224  void* callData);
225  void vtkOnRightButtonRelease(vtkObject* caller,
226  unsigned long eventId,
227  void* callData);
228  void vtkOnMiddleButtonPressed(vtkObject* caller,
229  unsigned long eventId,
230  void* callData);
231  void vtkOnMiddleButtonRelease(vtkObject* caller,
232  unsigned long eventId,
233  void* callData);
235 
236 signals:
241  void selectionFinished(const cvSelectionData& selectionData);
242 
247  void selectedCustomBox(int xmin, int ymin, int xmax, int ymax);
248  void selectedCustomBox(const int region[4]);
249 
254  void selectedCustomPolygon(vtkIntArray* polygon);
255 
259  void zoomToBoxCompleted(int xmin, int ymin, int xmax, int ymax);
260 
261 public slots:
270  virtual void actionTriggered(bool val);
271 
280  virtual void updateEnableState();
281 
282 protected slots:
296  virtual void beginSelection();
297 
310  virtual void endSelection();
311 
317  virtual void onMouseStop();
318 
324  virtual void clearSelectionCache();
325 
326 protected:
338  virtual void selectionChanged(vtkObject* caller,
339  unsigned long eventId,
340  void* callData);
341 
347  virtual void onMouseMove();
348 
352  virtual void onLeftButtonPress();
353 
359  virtual void onLeftButtonRelease();
360 
366  virtual void onWheelRotate();
367 
371  virtual void onRightButtonPressed();
372 
376  virtual void onRightButtonRelease();
377 
381  virtual void onMiddleButtonPressed();
382 
387  virtual void onMiddleButtonRelease();
388 
394  virtual void preSelection();
395 
401  virtual void fastPreSelection();
402 
408  virtual void updateTooltip();
409 
418  virtual int getSelectionModifier();
419 
427  virtual bool isCompatible(SelectionMode mode);
428 
434  virtual void cleanupObservers();
435 
439  void uncheckSelectionModifiers();
440 
441  //-------------------------------------------------------------------------
442  // Selection execution methods
443  //-------------------------------------------------------------------------
444 
450  void selectCellsOnSurface(int region[4], int selectionModifier);
451 
457  void selectPointsOnSurface(int region[4], int selectionModifier);
458 
464  void selectFrustumCells(int region[4], int selectionModifier);
465 
471  void selectFrustumPoints(int region[4], int selectionModifier);
472 
481  void finalizeSelection(const cvSelectionData& newSelection,
482  int selectionModifier,
483  const QString& description);
484 
490  void selectPolygonCells(vtkIntArray* polygon, int selectionModifier);
491 
497  void selectPolygonPoints(vtkIntArray* polygon, int selectionModifier);
498 
504  void selectBlock(int region[4], int selectionModifier);
505 
506  //-------------------------------------------------------------------------
507  // Internal helpers
508  //-------------------------------------------------------------------------
509 
513  PclUtils::PCLVis* getPCLVis() const;
514 
518  cvSelectionPipeline* getSelectionPipeline() const;
519 
523  cvSelectionHighlighter* getSelectionHighlighter() const;
524 
528  bool isSelectingCells() const;
529 
533  bool isInteractiveMode() const;
534 
538  bool isTooltipMode() const;
539 
543  void setCursor(const QCursor& cursor);
544 
548  void unsetCursor();
549 
553  void storeCurrentStyle();
554 
558  void restoreStyle();
559 
563  void setupInteractorStyle();
564 
568  void setupObservers();
569 
577  void addCameraMovementObservers(int startIndex);
578 
585  void setRubberBand3DStyle(bool renderOnMouseMove);
586 
590  void showInstructionDialog();
591 
592 private:
593  // Qt objects
594  QPointer<QAction> m_parentAction;
595  QPointer<QActionGroup> m_modifierGroup;
596 
597  // Selection mode
598  SelectionMode m_mode;
599 
600  // Visualizer reference (not owned)
601  ecvGenericVisualizer3D* m_viewer = nullptr;
602 
603  // VTK objects
604  vtkRenderWindowInteractor* m_interactor = nullptr;
605  vtkRenderer* m_renderer = nullptr;
606  vtkSmartPointer<vtkInteractorStyle> m_previousStyle;
607  vtkSmartPointer<vtkInteractorStyle> m_selectionStyle;
608 
609  // Previous render view mode (for restoration)
610  int m_previousRenderViewMode = -1;
611 
612  // Event observer IDs for interactor events (increased to 8 for pan/zoom)
613  unsigned long m_observerIds[8] = {0, 0, 0, 0, 0, 0, 0, 0};
614  vtkWeakPointer<vtkObject> m_observedObject;
615 
616  // Separate observer ID for selection style (SelectionChangedEvent)
617  unsigned long m_styleObserverId = 0;
618 
619  // Cursor
620  QCursor m_zoomCursor;
621 
622  // Mouse move state (for tooltip timing)
623  QTimer m_mouseMovingTimer;
624  bool m_mouseMoving = false;
625  int m_mousePosition[2] = {0, 0};
626 
627  // Zoom box tracking (for zoomToBoxCompleted signal)
628  int m_zoomStartPosition[2] = {0, 0};
629  bool m_zoomTracking = false;
630 
631  // Pre-selection state
632  bool m_disablePreSelection = false;
633 
634  // Tooltip state
635  QString m_plainTooltipText;
636  QShortcut* m_copyTooltipShortcut = nullptr;
637 
638  // Current highlight state (for interactive modes)
639  vtkIdType m_hoveredId = -1;
640  vtkPolyData* m_currentPolyData = nullptr;
641 
642  // Current selection data
643  cvSelectionData m_currentSelection;
644 
645  // Static: only one reaction can be active at a time
646  // Reference: pqRenderViewSelectionReaction::ActiveReaction
647  static QPointer<cvRenderViewSelectionReaction> ActiveReaction;
648 
649  // Tooltip display wait time (ms)
650  static const int TOOLTIP_WAITING_TIME = 400;
651 };
cvViewSelectionManager::getHighlighter
cvSelectionHighlighter * getHighlighter()
Get the shared highlighter.
Definition: cvViewSelectionManager.h:238
cvViewSelectionManager::currentSelection
const cvSelectionData & currentSelection() const
Get the current selection data (VTK-independent)
Definition: cvViewSelectionManager.cpp:356
cvRenderViewSelectionReaction::selectionChanged
virtual void selectionChanged(vtkObject *caller, unsigned long eventId, void *callData)
Callback for selection changed event from VTK.
Definition: cvRenderViewSelectionReaction.cpp:638
SelectionModifier::SELECTION_SUBTRACTION
@ SELECTION_SUBTRACTION
Subtract from selection (Shift)
cvRenderViewSelectionReaction::getPCLVis
PclUtils::PCLVis * getPCLVis() const
Get the PCLVis instance.
Definition: cvRenderViewSelectionReaction.cpp:1676
cvRenderViewSelectionReaction::cvRenderViewSelectionReaction
cvRenderViewSelectionReaction(QAction *parentAction, SelectionMode mode, QActionGroup *modifierGroup=nullptr)
Constructor.
Definition: cvRenderViewSelectionReaction.cpp:86
cvRenderViewSelectionReaction::showInstructionDialog
void showInstructionDialog()
Show instruction dialog for interactive modes.
Definition: cvRenderViewSelectionReaction.cpp:1978
cvRenderViewSelectionReaction::onMiddleButtonPressed
virtual void onMiddleButtonPressed()
Handle middle button press (disable pre-selection during pan)
Definition: cvRenderViewSelectionReaction.cpp:958
x
normal_z x
Definition: my_point_types.h:165
cvRenderViewSelectionReaction::~cvRenderViewSelectionReaction
~cvRenderViewSelectionReaction() override
Definition: cvRenderViewSelectionReaction.cpp:177
SelectionMode::SELECT_FRUSTUM_POINTS
@ SELECT_FRUSTUM_POINTS
Select points in frustum.
cvRenderViewSelectionReaction::finalizeSelection
void finalizeSelection(const cvSelectionData &newSelection, int selectionModifier, const QString &description)
Unified selection finalization (ParaView-style) Combines new selection with existing,...
Definition: cvRenderViewSelectionReaction.cpp:1556
cvRenderViewSelectionReaction::parentAction
QAction * parentAction() const
Get the parent action.
Definition: cvRenderViewSelectionReaction.h:111
cvSelectionData::hasActorInfo
bool hasActorInfo() const
Check if actor information is available.
Definition: cvSelectionData.h:253
cvRenderViewSelectionReaction::selectPolygonCells
void selectPolygonCells(vtkIntArray *polygon, int selectionModifier)
Select cells in polygon.
Definition: cvRenderViewSelectionReaction.cpp:1624
cvViewSelectionManager::growSelection
void growSelection()
Grow the current selection by one layer.
Definition: cvViewSelectionManager.cpp:188
cvRenderViewSelectionReaction::updateTooltip
virtual void updateTooltip()
Update tooltip display.
Definition: cvRenderViewSelectionReaction.cpp:1058
SelectionModifier
SelectionModifier
Selection modifiers for combining selections.
Definition: cvSelectionData.h:80
cvSelectionPipeline::invalidateCachedSelection
void invalidateCachedSelection()
Clear selection cache and invalidate cached buffers.
Definition: cvSelectionPipeline.cpp:491
cvSelectionHighlighter::highlightSelection
bool highlightSelection(const vtkSmartPointer< vtkIdTypeArray > &selection, int fieldAssociation, HighlightMode mode=SELECTED)
Highlight selected elements (automatically gets polyData from visualizer)
Definition: cvSelectionHighlighter.cpp:268
cvSelectionPipeline::selectCellsInPolygon
cvSelectionData selectCellsInPolygon(vtkIntArray *polygon)
Select cells in polygon region.
Definition: cvSelectionPipeline.cpp:942
SelectionMode::SELECT_SURFACE_CELLS_POLYGON
@ SELECT_SURFACE_CELLS_POLYGON
Select cells on surface (polygon)
cvRenderViewSelectionReaction::selectFrustumPoints
void selectFrustumPoints(int region[4], int selectionModifier)
Select points in frustum.
Definition: cvRenderViewSelectionReaction.cpp:1545
CVLog::PrintVerbose
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
cvRenderViewSelectionReaction::onRightButtonRelease
virtual void onRightButtonRelease()
Handle right button release (re-enable pre-selection)
Definition: cvRenderViewSelectionReaction.cpp:944
cvSelectionPipeline::PixelSelectionInfo::valid
bool valid
Definition: cvSelectionPipeline.h:290
PclUtils::PCLVis::getCurrentRenderer
vtkRenderer * getCurrentRenderer(int viewport=0)
Definition: PCLVis.cpp:2924
signals
#define signals
Definition: PythonPlugin.cpp:26
cvRenderViewSelectionReaction.h
Simplified selection reaction class aligned with ParaView architecture.
cvRenderViewSelectionReaction::isInteractiveMode
bool isInteractiveMode() const
Check if this is an interactive selection mode.
Definition: cvRenderViewSelectionReaction.cpp:1715
cvSelectionHighlighter::SELECTED
@ SELECTED
Definition: cvSelectionHighlighter.h:120
ecvDisplayTools.h
cvSelectionHighlighter::clearHoverHighlight
void clearHoverHighlight()
Clear only hover highlight (keep selected/preselected)
Definition: cvSelectionHighlighter.cpp:452
PclUtils::PCLVis::getSourceObject
ccHObject * getSourceObject(const std::string &viewID) const
Get the source object for a given viewID.
Definition: PCLVis.cpp:2425
cvRenderViewSelectionReaction::vtkOnMiddleButtonRelease
void vtkOnMiddleButtonRelease(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:314
CVLog.h
SelectionMode::SELECT_SURFACE_POINTDATA_INTERACTIVELY
@ SELECT_SURFACE_POINTDATA_INTERACTIVELY
Hover highlight point data.
cvRenderViewSelectionReaction::getSelectionModifier
virtual int getSelectionModifier()
Get the selection modifier from keyboard state.
Definition: cvRenderViewSelectionReaction.cpp:1353
cvViewSelectionManager::shrinkSelection
void shrinkSelection()
Shrink the current selection by one layer.
Definition: cvViewSelectionManager.cpp:194
vtkSmartPointer
Definition: WidgetMap.h:20
PclUtils
Definition: CustomContextItem.cpp:18
cvRenderViewSelectionReaction::isSelectingCells
bool isSelectingCells() const
Check if currently selecting cells (vs points)
Definition: cvRenderViewSelectionReaction.cpp:1698
cvRenderViewSelectionReaction::uncheckSelectionModifiers
void uncheckSelectionModifiers()
Uncheck selection modifier buttons.
Definition: cvRenderViewSelectionReaction.cpp:1464
cvRenderViewSelectionReaction::getSelectionHighlighter
cvSelectionHighlighter * getSelectionHighlighter() const
Get the selection highlighter.
Definition: cvRenderViewSelectionReaction.cpp:1691
SelectionMode::SELECT_SURFACE_CELLS_INTERACTIVELY
@ SELECT_SURFACE_CELLS_INTERACTIVELY
SelectionMode::SHRINK_SELECTION
@ SHRINK_SELECTION
Shrink selection by one layer.
cvRenderViewSelectionReaction::isCompatible
virtual bool isCompatible(SelectionMode mode)
Check if this selection is compatible with another mode.
Definition: cvRenderViewSelectionReaction.cpp:1402
cvRenderViewSelectionReaction::selectBlock
void selectBlock(int region[4], int selectionModifier)
Select blocks.
Definition: cvRenderViewSelectionReaction.cpp:1666
cvRenderViewSelectionReaction::vtkOnLeftButtonRelease
void vtkOnLeftButtonRelease(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:284
SelectionMode::SELECT_SURFACE_CELLDATA_INTERACTIVELY
@ SELECT_SURFACE_CELLDATA_INTERACTIVELY
Hover highlight cell data.
cvSelectionPipeline::promptUser
static bool promptUser(const QString &settingsKey, const QString &title, const QString &message, QWidget *parent=nullptr)
Shows instruction dialog if not disabled by user (ParaView-style)
Definition: cvSelectionPipeline.cpp:1289
cvRenderViewSelectionReaction::onLeftButtonRelease
virtual void onLeftButtonRelease()
Handle left button release (for interactive selection)
Definition: cvRenderViewSelectionReaction.cpp:851
cvRenderViewSelectionReaction::handleRightButtonRelease
Q_INVOKABLE void handleRightButtonRelease()
Handle right button release (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:257
cvRenderViewSelectionReaction::vtkOnSelectionChanged
void vtkOnSelectionChanged(vtkObject *caller, unsigned long eventId, void *callData)
VTK callback functions for observer pattern.
Definition: cvRenderViewSelectionReaction.cpp:266
cvRenderViewSelectionReaction::unsetCursor
void unsetCursor()
Restore default cursor.
Definition: cvRenderViewSelectionReaction.cpp:1742
cvViewSelectionManager::hasSelection
bool hasSelection() const
Check if there is a current selection.
Definition: cvViewSelectionManager.cpp:510
cvRenderViewSelectionReaction::clearSelectionCache
virtual void clearSelectionCache()
Clear selection cache when data changes.
Definition: cvRenderViewSelectionReaction.cpp:623
cloudViewer::utility::filesystem::Copy
bool Copy(const std::string &from, const std::string &to, bool include_parent_dir=false, const std::string &extname="")
Copy a file or directory.
Definition: FileSystem.cpp:249
result
core::Tensor result
Definition: VtkUtils.cpp:76
cvRenderViewSelectionReaction::onMouseMove
virtual void onMouseMove()
Handle mouse move events (for interactive selection)
Definition: cvRenderViewSelectionReaction.cpp:789
QtCompatRegExpOption::CaseInsensitive
constexpr QRegularExpression::PatternOption CaseInsensitive
Definition: QtCompat.h:174
SelectionModifier::SELECTION_ADDITION
@ SELECTION_ADDITION
Add to selection (Ctrl)
cvRenderViewSelectionReaction::mode
SelectionMode mode() const
Get the selection mode.
Definition: cvRenderViewSelectionReaction.h:116
cvRenderViewSelectionReaction::handleLeftButtonRelease
Q_INVOKABLE void handleLeftButtonRelease()
Handle left button release (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:247
ecvDisplayTools::GetCurrentScreen
static QWidget * GetCurrentScreen()
Definition: ecvDisplayTools.h:666
qPCL.h
slots
#define slots
Definition: PythonPlugin.cpp:25
cvSelectionPipeline::CombineOperation
CombineOperation
Selection combination methods (ParaView-style)
Definition: cvSelectionPipeline.h:389
size
int size
Definition: FileIOFactory.cpp:130
cvRenderViewSelectionReaction::setupObservers
void setupObservers()
Set up event observers for this selection mode.
Definition: cvRenderViewSelectionReaction.cpp:1888
cvRenderViewSelectionReaction::getSelectionPipeline
cvSelectionPipeline * getSelectionPipeline() const
Get the selection pipeline.
Definition: cvRenderViewSelectionReaction.cpp:1684
cvRenderViewSelectionReaction::isActive
bool isActive() const
Check if this reaction's selection is currently active.
Definition: cvRenderViewSelectionReaction.cpp:221
SelectionMode::ZOOM_TO_BOX
@ ZOOM_TO_BOX
Zoom to box region.
y
normal_z y
Definition: my_point_types.h:168
cvRenderViewSelectionReaction::restoreStyle
void restoreStyle()
Restore previous interactor style.
Definition: cvRenderViewSelectionReaction.cpp:1783
PclUtils::PCLVis::isPointPickingEnabled
bool isPointPickingEnabled()
Definition: PCLVis.h:667
cvSelectionPipeline::PixelSelectionInfo
Fast Pre-Selection API (ParaView-aligned)
Definition: cvSelectionPipeline.h:289
SelectionMode::SELECT_SURFACE_CELLS
@ SELECT_SURFACE_CELLS
Select cells on surface (rectangle)
cvRenderViewSelectionReaction::handleRightButtonPressed
Q_INVOKABLE void handleRightButtonPressed()
Handle right button press (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:253
cvSelectionHighlighter::highlightElement
bool highlightElement(vtkPolyData *polyData, vtkIdType elementId, int fieldAssociation)
Highlight a single element (for hover preview)
Definition: cvSelectionHighlighter.cpp:394
PclUtils::PCLVis::getIdByActor
std::string getIdByActor(vtkProp *actor)
Definition: PCLVis.cpp:3079
cvRenderViewSelectionReaction::vtkOnRightButtonPressed
void vtkOnRightButtonPressed(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:296
cvSelectionData::isEmpty
bool isEmpty() const
Check if selection is empty.
Definition: cvSelectionData.cpp:114
SelectionModifier::SELECTION_DEFAULT
@ SELECTION_DEFAULT
Replace selection (default)
cvRenderViewSelectionReaction::selectCellsOnSurface
void selectCellsOnSurface(int region[4], int selectionModifier)
Select cells on surface.
Definition: cvRenderViewSelectionReaction.cpp:1477
cvSelectionPipeline::getPixelSelectionInfo
PixelSelectionInfo getPixelSelectionInfo(int x, int y, bool selectCells)
Get complete pixel selection information at a screen position.
Definition: cvSelectionPipeline.cpp:394
cvRenderViewSelectionReaction::addCameraMovementObservers
void addCameraMovementObservers(int startIndex)
Add camera movement observers for cache invalidation.
Definition: cvRenderViewSelectionReaction.cpp:1951
MainWindow
Definition: MainWindow.h:117
SelectionMode::HOVER_POINTS_TOOLTIP
@ HOVER_POINTS_TOOLTIP
Show point data tooltip on hover (read-only)
cvSelectionHighlighter::clearHighlights
void clearHighlights()
Clear all highlights.
Definition: cvSelectionHighlighter.cpp:430
cvSelectionPipeline::exitSelectionMode
void exitSelectionMode()
Exit selection mode and release cached buffers.
Definition: cvSelectionPipeline.cpp:473
cvViewSelectionManager.h
PclUtils::PCLVis::getRenderWindowInteractor
vtkSmartPointer< vtkRenderWindowInteractor > getRenderWindowInteractor()
Get a pointer to the current interactor style used.
Definition: PCLVis.h:148
cvSelectionPipeline
Selection pipeline abstraction layer.
Definition: cvSelectionPipeline.h:53
cvRenderViewSelectionReaction::setCursor
void setCursor(const QCursor &cursor)
Set cursor on the view.
Definition: cvRenderViewSelectionReaction.cpp:1734
cvViewSelectionManager
Central manager for all selection operations in the view.
Definition: cvViewSelectionManager.h:52
ecvGenericVisualizer3D
Generic visualizer 3D interface.
Definition: ecvGenericVisualizer3D.h:15
cvSelectionData::primaryActor
vtkActor * primaryActor() const
Get the primary (front-most) actor.
Definition: cvSelectionData.cpp:181
cvSelectionPipeline::combineSelections
static cvSelectionData combineSelections(const cvSelectionData &sel1, const cvSelectionData &sel2, CombineOperation operation)
Combine two selections.
Definition: cvSelectionPipeline.cpp:983
cvRenderViewSelectionReaction::preSelection
virtual void preSelection()
Perform pre-selection highlighting.
Definition: cvRenderViewSelectionReaction.cpp:977
cvViewSelectionManager::getPipeline
cvSelectionPipeline * getPipeline()
Get the selection pipeline.
Definition: cvViewSelectionManager.h:214
cvRenderViewSelectionReaction::storeCurrentStyle
void storeCurrentStyle()
Store current interactor style.
Definition: cvRenderViewSelectionReaction.cpp:1751
cvRenderViewSelectionReaction::setRubberBand3DStyle
void setRubberBand3DStyle(bool renderOnMouseMove)
Set vtkInteractorStyleRubberBand3D as the interactor style.
Definition: cvRenderViewSelectionReaction.cpp:1805
cvSelectionPipeline::PixelSelectionInfo::polyData
vtkPolyData * polyData
Definition: cvSelectionPipeline.h:293
cvRenderViewSelectionReaction::setVisualizer
void setVisualizer(ecvGenericVisualizer3D *viewer)
Set the visualizer for selection operations.
Definition: cvRenderViewSelectionReaction.cpp:193
cvRenderViewSelectionReaction::activeReaction
static cvRenderViewSelectionReaction * activeReaction()
Get the currently active reaction (static)
Definition: cvRenderViewSelectionReaction.h:142
cvRenderViewSelectionReaction::endActiveSelection
static void endActiveSelection()
Force end any active selection.
Definition: cvRenderViewSelectionReaction.cpp:226
SelectionModifier::SELECTION_TOGGLE
@ SELECTION_TOGGLE
Toggle selection (Ctrl+Shift)
points
int points
Definition: FileIOFactory.cpp:144
cvRenderViewSelectionReaction::onLeftButtonPress
virtual void onLeftButtonPress()
Handle left button press (for zoom tracking)
Definition: cvRenderViewSelectionReaction.cpp:829
SelectionMode::SELECT_BLOCKS
@ SELECT_BLOCKS
Select blocks (rectangle)
cvRenderViewSelectionReaction::onMiddleButtonRelease
virtual void onMiddleButtonRelease()
Handle middle button release (re-enable pre-selection, invalidate cache)
Definition: cvRenderViewSelectionReaction.cpp:964
cvRenderViewSelectionReaction::zoomToBoxCompleted
void zoomToBoxCompleted(int xmin, int ymin, int xmax, int ymax)
Emitted when zoom to box is completed.
cvRenderViewSelectionReaction::handleWheelRotate
Q_INVOKABLE void handleWheelRotate()
Handle wheel rotation (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:251
cvSelectionPipeline::PixelSelectionInfo::attributeID
vtkIdType attributeID
Definition: cvSelectionPipeline.h:291
cvRenderViewSelectionReaction::onWheelRotate
virtual void onWheelRotate()
Handle wheel rotation events.
Definition: cvRenderViewSelectionReaction.cpp:922
cvRenderViewSelectionReaction::SelectionModifier
::SelectionModifier SelectionModifier
Definition: cvRenderViewSelectionReaction.h:94
cvRenderViewSelectionReaction::updateEnableState
virtual void updateEnableState()
Updates the enabled state of the action.
Definition: cvRenderViewSelectionReaction.cpp:349
cvRenderViewSelectionReaction
cvRenderViewSelectionReaction handles all selection modes in a single class
Definition: cvRenderViewSelectionReaction.h:89
SelectionMode::SELECT_CUSTOM_POLYGON
@ SELECT_CUSTOM_POLYGON
Custom polygon selection (signal only)
cvViewSelectionManager::clearSelection
void clearSelection()
Clear all selections.
Definition: cvViewSelectionManager.cpp:175
cvRenderViewSelectionReaction::vtkOnWheelRotate
void vtkOnWheelRotate(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:290
cvRenderViewSelectionReaction::onMouseStop
virtual void onMouseStop()
Handle mouse stop event (for tooltip display)
Definition: cvRenderViewSelectionReaction.cpp:615
PCLVis.h
cvSelectionData
Encapsulates selection data without exposing VTK types.
Definition: cvSelectionData.h:136
SelectionMode::HOVER_CELLS_TOOLTIP
@ HOVER_CELLS_TOOLTIP
Show cell data tooltip on hover (read-only)
cvRenderViewSelectionReaction::beginSelection
virtual void beginSelection()
Starts the selection mode.
Definition: cvRenderViewSelectionReaction.cpp:404
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
QPCL_ENGINE_LIB_API
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
cvRenderViewSelectionReaction::selectionFinished
void selectionFinished(const cvSelectionData &selectionData)
Emitted when selection is finished.
cvSelectionPipeline::selectCellsOnSurface
cvSelectionData selectCellsOnSurface(const int region[4])
High-level selection API (ParaView-style)
Definition: cvSelectionPipeline.cpp:923
cvRenderViewSelectionReaction::vtkOnLeftButtonPress
void vtkOnLeftButtonPress(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:278
cvSelectionHighlighter.h
SelectionMode::SELECT_FRUSTUM_CELLS
@ SELECT_FRUSTUM_CELLS
Select cells in frustum.
cvViewSelectionManager::selectionChanged
void selectionChanged()
Emitted when the selection has changed (legacy - for backward compatibility)
cvRenderViewSelectionReaction::handleSelectionChanged
void handleSelectionChanged(vtkObject *caller, unsigned long eventId, void *callData)
Handle selection changed event from VTK (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:236
SelectionMode
SelectionMode
Selection modes matching ParaView's SelectionMode enum.
Definition: cvSelectionData.h:36
polygon
boost::geometry::model::polygon< point_xy > polygon
Definition: TreeIso.cpp:37
cvRenderViewSelectionReaction::SelectionMode
::SelectionMode SelectionMode
Definition: cvRenderViewSelectionReaction.h:93
cvViewSelectionManager::canShrinkSelection
bool canShrinkSelection() const
Check if the selection can be shrunk.
Definition: cvViewSelectionManager.h:368
cvRenderViewSelectionReaction::onRightButtonPressed
virtual void onRightButtonPressed()
Handle right button press (disable pre-selection)
Definition: cvRenderViewSelectionReaction.cpp:937
SelectionMode::SELECT_FRUSTUM_BLOCKS
@ SELECT_FRUSTUM_BLOCKS
Select blocks in frustum.
cvViewSelectionManager::instance
static cvViewSelectionManager * instance()
Get the singleton instance.
Definition: cvViewSelectionManager.cpp:38
cvRenderViewSelectionReaction::selectedCustomPolygon
void selectedCustomPolygon(vtkIntArray *polygon)
Emitted for custom polygon selection.
cvRenderViewSelectionReaction::vtkOnMouseMove
void vtkOnMouseMove(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:272
cvRenderViewSelectionReaction::endSelection
virtual void endSelection()
Ends the selection mode.
Definition: cvRenderViewSelectionReaction.cpp:518
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
SelectionMode::SELECT_SURFACE_POINTS_INTERACTIVELY
@ SELECT_SURFACE_POINTS_INTERACTIVELY
cvRenderViewSelectionReaction::isTooltipMode
bool isTooltipMode() const
Check if this is a tooltip mode.
Definition: cvRenderViewSelectionReaction.cpp:1728
cvSelectionData.h
cvSelectionHighlighter::setHighlightsVisible
void setHighlightsVisible(bool visible)
Set visibility of all highlight actors.
Definition: cvSelectionHighlighter.cpp:460
cvViewSelectionManager::setCurrentSelection
void setCurrentSelection(const cvSelectionData &selectionData, bool resetLayers=true)
Set the current selection data.
Definition: cvViewSelectionManager.cpp:370
cvRenderViewSelectionReaction::selectFrustumCells
void selectFrustumCells(int region[4], int selectionModifier)
Select cells in frustum.
Definition: cvRenderViewSelectionReaction.cpp:1537
cvRenderViewSelectionReaction::handleLeftButtonPress
Q_INVOKABLE void handleLeftButtonPress()
Handle left button press (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:243
cvRenderViewSelectionReaction::vtkOnMiddleButtonPressed
void vtkOnMiddleButtonPressed(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:308
SelectionMode::CLEAR_SELECTION
@ CLEAR_SELECTION
Clear current selection.
cvRenderViewSelectionReaction::setupInteractorStyle
void setupInteractorStyle()
Set up interactor style for this selection mode.
Definition: cvRenderViewSelectionReaction.cpp:1821
cvRenderViewSelectionReaction::fastPreSelection
virtual void fastPreSelection()
Perform fast pre-selection using cached buffers.
Definition: cvRenderViewSelectionReaction.cpp:1048
cvRenderViewSelectionReaction::handleMouseMove
Q_INVOKABLE void handleMouseMove()
Handle mouse move event (public for callback access)
Definition: cvRenderViewSelectionReaction.cpp:241
cvRenderViewSelectionReaction::getVisualizer
ecvGenericVisualizer3D * getVisualizer() const
Get the current visualizer.
Definition: cvRenderViewSelectionReaction.h:129
PclUtils::PCLVis
Definition: PCLVis.h:80
SelectionMode::SELECT_SURFACE_POINTS_POLYGON
@ SELECT_SURFACE_POINTS_POLYGON
Select points on surface (polygon)
SelectionMode::SELECT_SURFACE_POINTS
@ SELECT_SURFACE_POINTS
Select points on surface (rectangle)
cvSelectionPipeline::selectPointsOnSurface
cvSelectionData selectPointsOnSurface(const int region[4])
Select points on surface in a rectangular region.
Definition: cvSelectionPipeline.cpp:932
cvRenderViewSelectionReaction::vtkOnRightButtonRelease
void vtkOnRightButtonRelease(vtkObject *caller, unsigned long eventId, void *callData)
Definition: cvRenderViewSelectionReaction.cpp:302
SelectionMode::GROW_SELECTION
@ GROW_SELECTION
Expand selection by one layer.
PclUtils::PCLVis::setPointPickingEnabled
void setPointPickingEnabled(bool state)
Definition: PCLVis.h:668
cvViewSelectionManager::setSourceObject
void setSourceObject(ccHObject *obj)
Set the source object for selection operations.
Definition: cvViewSelectionManager.cpp:631
cvSelectionHighlighter
Helper class for highlighting selected elements in the visualizer.
Definition: cvSelectionHighlighter.h:101
cvRenderViewSelectionReaction::actionTriggered
virtual void actionTriggered(bool val)
Called when the action is triggered.
Definition: cvRenderViewSelectionReaction.cpp:324
cvRenderViewSelectionReaction::selectPointsOnSurface
void selectPointsOnSurface(int region[4], int selectionModifier)
Select points on surface.
Definition: cvRenderViewSelectionReaction.cpp:1507
cvRenderViewSelectionReaction::selectPolygonPoints
void selectPolygonPoints(vtkIntArray *polygon, int selectionModifier)
Select points in polygon.
Definition: cvRenderViewSelectionReaction.cpp:1645
cvSelectionPipeline::selectPointsInPolygon
cvSelectionData selectPointsInPolygon(vtkIntArray *polygon)
Select points in polygon region.
Definition: cvSelectionPipeline.cpp:961
name
std::string name
Definition: FileIOFactory.cpp:129
cvRenderViewSelectionReaction::cleanupObservers
virtual void cleanupObservers()
Clean up event observers.
Definition: cvRenderViewSelectionReaction.cpp:1438
cvSelectionPipeline.h