10 #include <vtkSmartPointer.h>
12 #include <QKeySequence>
25 class vtkHardwareSelector;
26 class vtkRenderWindowInteractor;
63 QWidget* parent =
nullptr,
98 void setEnabled(
bool enabled,
bool setFocus =
false);
130 double px,
double py,
double pz,
double nx,
double ny,
double nz);
139 void getCellNormal(vtkDataSet* dataset,
144 QPointer<ecvModalShortcut> m_shortcut;
145 QPointer<QWidget> m_contextWidget;
146 vtkRenderWindowInteractor* m_interactor =
nullptr;
147 vtkRenderer* m_renderer =
nullptr;
160 struct SelectionCache {
165 double normal[3] = {0, 0, 1};
cvPointPickingHelper is a helper class for supporting keyboard shortcut-based point picking in measur...
bool isEnabled() const
Check if shortcut is enabled.
~cvPointPickingHelper() override
@ Coordinates
Pick point coordinates only.
@ Normal
Pick normal only.
@ CoordinatesAndNormal
Pick both coordinates and normal.
bool pickOnPoint() const
Returns whether picking snaps to mesh points.
void setEnabled(bool enabled, bool setFocus=false)
Enable or disable the shortcut.
void setContextWidget(QWidget *widget)
Set the context widget for the shortcut.
cvPointPickingHelper(const QKeySequence &keySequence, bool pickOnPoint, QWidget *parent=nullptr, PickOption pickOpt=Coordinates)
Constructor.
void setInteractor(vtkRenderWindowInteractor *interactor)
Set the VTK interactor for picking.
PickOption getPickOption() const
Returns the pick option.
void setRenderer(vtkRenderer *renderer)
Set the VTK renderer for picking.
void clearSelectionCache()
Clear the selection cache (ParaView-style optimization) Call this when the scene changes to invalidat...
void pickNormal(double px, double py, double pz, double nx, double ny, double nz)
Emitted when a point and normal are picked.
void pick(double x, double y, double z)
Emitted when a point is picked.