ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvConstrainedPolyLineWidget.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 #ifndef CV_CONSTRAINED_POLYLINE_WIDGET_H
9 #define CV_CONSTRAINED_POLYLINE_WIDGET_H
10 
11 #include <vtkPolyLineWidget.h>
12 
13 class vtkCallbackCommand;
14 
30 class cvConstrainedPolyLineWidget : public vtkPolyLineWidget {
31 public:
34 
40  void SetInteractor(vtkRenderWindowInteractor* iren) override;
41 
48  void SetEnabled(int enabling) override;
49 
50 protected:
53 
69  static void ProcessKeyEvents(vtkObject* object,
70  unsigned long event,
71  void* clientdata,
72  void* calldata);
73 
74  vtkCallbackCommand* KeyEventCallbackCommand;
75 
76 private:
78  void operator=(const cvConstrainedPolyLineWidget&) = delete;
79 };
80 
81 #endif // CV_CONSTRAINED_POLYLINE_WIDGET_H
MouseEvent event
PolyLine Widget with XYZ constraints (100% consistent with ParaView)
void SetEnabled(int enabling) override
Override SetEnabled to register our custom keyboard handler.
vtkCallbackCommand * KeyEventCallbackCommand
static void ProcessKeyEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
Keyboard event handling - directly copied from ParaView vtkPolyLineWidget::ProcessKeyEvents.
static cvConstrainedPolyLineWidget * New()
void SetInteractor(vtkRenderWindowInteractor *iren) override
Override SetInteractor to register keyboard event observers.
vtkTypeMacro(cvConstrainedPolyLineWidget, vtkPolyLineWidget)