ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
abstractwidgetobserver.cpp
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 
9 
10 #include <vtkInteractorObserver.h>
11 
12 namespace VtkUtils {
13 
15  : QObject(parent) {}
16 
18 
19 void AbstractWidgetObserver::attach(vtkInteractorObserver *widget) {
20  if (widget && widget != m_widget) {
21  m_widget = widget;
22 
23  // we only care about this specific event
24  m_widget->AddObserver(vtkCommand::EndInteractionEvent, this);
25  }
26 }
27 
28 } // namespace VtkUtils
void attach(vtkInteractorObserver *widget)