File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535using namespace mb_system ;
3636
3737vtkStandardNewMacro (DrawInteractorStyle);
38- vtkStandardNewMacro (MyHandleWidget);
39-
40-
41-
42- void MyHandleWidget::removeKeyObservers (vtkRenderWindowInteractor* interactor) {
43- interactor->RemoveObserver (this ->KeyEventCallbackCommand );
44- }
45-
4638
4739// ------------------------------------------------------------------------------
4840DrawInteractorStyle::DrawInteractorStyle ()
@@ -105,7 +97,6 @@ void DrawInteractorStyle::OnLeftButtonUp() {
10597 // Detach each widget from the Interactor before releasing memory
10698 for (auto &w : pinWidgets_) {
10799 w->EnabledOff ();
108- w->removeKeyObservers (Interactor);
109100 w->SetInteractor (nullptr );
110101 }
111102
@@ -120,7 +111,7 @@ void DrawInteractorStyle::OnLeftButtonUp() {
120111 std::copy (userPath_[pointIndex].begin (), userPath_[pointIndex].end (), point);
121112
122113 // Put a pin marker at selected point
123- auto pinWidget = vtkSmartPointer<MyHandleWidget >::New ();
114+ auto pinWidget = vtkSmartPointer<vtkHandleWidget >::New ();
124115 auto pin = vtkSmartPointer<vtkFixedSizeHandleRepresentation3D>::New ();
125116
126117 pin->SetWorldPosition (point); // C-style double array input
Original file line number Diff line number Diff line change @@ -21,18 +21,6 @@ class vtkUnsignedCharArray;
2121
2222namespace mb_system {
2323
24- /* **
25- Need this subclass to work around a vtkHandleWidget bug which
26- results in null ptr error when 'shift' is pressed
27- ** */
28- class MyHandleWidget : public vtkHandleWidget {
29- public:
30- static MyHandleWidget* New ();
31- vtkTypeMacro (MyHandleWidget, vtkHandleWidget);
32-
33- void removeKeyObservers (vtkRenderWindowInteractor* interactor);
34- };
35-
3624 class TopoDataItem ;
3725
3826 /* **
@@ -120,7 +108,7 @@ namespace mb_system {
120108 // / VTK rendering functions.)
121109 // / As class members, the individual vector elements
122110 // / will not be deallocated until the vectors are cleared.
123- std::vector<vtkSmartPointer<MyHandleWidget >> pinWidgets_;
111+ std::vector<vtkSmartPointer<vtkHandleWidget >> pinWidgets_;
124112 std::vector<vtkSmartPointer<vtkHandleRepresentation>> pinRepresentations_;
125113
126114
You can’t perform that action at this time.
0 commit comments