VTK  9.7.1
vtkRemoteInteractionAdapter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
24 #ifndef vtkRemoteInteractionAdapter_h
25 #define vtkRemoteInteractionAdapter_h
26 
27 #include "vtkObject.h"
28 #include "vtkWebCoreModule.h" // for exports
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 
33 
34 class VTKWEBCORE_EXPORT vtkRemoteInteractionAdapter : public vtkObject
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
46  bool ProcessEvent(const std::string& event);
47 
52  static bool ProcessEvent(vtkRenderWindowInteractor* iren, const std::string& event,
53  double devicePixelRatio = 1.0, double devicePixelRatioTolerance = 1e-5);
54 
56  // Get/Set the ratio between physical (onscreen) pixel and logical (rendered image)
57  vtkSetMacro(DevicePixelRatio, double);
58  vtkGetMacro(DevicePixelRatio, double);
60 
62 
67  vtkSetMacro(DevicePixelRatioTolerance, double);
68  vtkGetMacro(DevicePixelRatioTolerance, double);
70 
72  // Get/Set the Interactor to apply the event to.
73  void SetInteractor(vtkRenderWindowInteractor* iren);
74  vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
76 
77 protected:
79  ~vtkRemoteInteractionAdapter() override;
80 
81 private:
83  void operator=(const vtkRemoteInteractionAdapter&) = delete;
84 
85  static void physicalToLogicalPosition(const double physicalPosition[2], int (&logicalPosition)[2],
86  const double physicalSize[2], vtkRenderWindowInteractor* iren, double devicePixelRatio,
87  double devicePixelRatioTolerance);
88 
89  double DevicePixelRatio = 1.0;
90  double DevicePixelRatioTolerance = 1e-5;
91  vtkRenderWindowInteractor* Interactor = nullptr;
92 };
93 
94 VTK_ABI_NAMESPACE_END
95 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Map vtk-js interaction events to native VTK events.
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...