VTK  9.4.20250203
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
30VTK_ABI_NAMESPACE_BEGIN
31
33
34class VTKWEBCORE_EXPORT vtkRemoteInteractionAdapter : public vtkObject
35{
36public:
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.
74 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
76
77protected:
80
81private:
83 void operator=(const vtkRemoteInteractionAdapter&) = delete;
84
85 double DevicePixelRatio = 1.0;
86 double DevicePixelRatioTolerance = 1e-5;
87 vtkRenderWindowInteractor* Interactor = nullptr;
88};
89
90VTK_ABI_NAMESPACE_END
91#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Map vtk-js interaction events to native VTK events.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInteractor(vtkRenderWindowInteractor *iren)
static bool ProcessEvent(vtkRenderWindowInteractor *iren, const std::string &event, double devicePixelRatio=1.0, double devicePixelRatioTolerance=1e-5)
Static version of ProcessEvent(const std::string&)
bool ProcessEvent(const std::string &event)
Apply the vtk-js event to the internal RenderWindowInteractor.
~vtkRemoteInteractionAdapter() override
static vtkRemoteInteractionAdapter * New()
platform-independent render window interaction including picking and frame rate control.