VTK  9.5.2
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
20
21#ifndef vtkRemoteInteractionAdapter_h
22#define vtkRemoteInteractionAdapter_h
23
24#include "vtkObject.h"
25#include "vtkWebCoreModule.h" // for exports
26
27VTK_ABI_NAMESPACE_BEGIN
28
30
31class VTKWEBCORE_EXPORT vtkRemoteInteractionAdapter : public vtkObject
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
43 bool ProcessEvent(const std::string& event);
44
49 static bool ProcessEvent(vtkRenderWindowInteractor* iren, const std::string& event,
50 double devicePixelRatio = 1.0, double devicePixelRatioTolerance = 1e-5);
51
53 // Get/Set the ratio between physical (onscreen) pixel and logical (rendered image)
54 vtkSetMacro(DevicePixelRatio, double);
55 vtkGetMacro(DevicePixelRatio, double);
57
59
64 vtkSetMacro(DevicePixelRatioTolerance, double);
65 vtkGetMacro(DevicePixelRatioTolerance, double);
67
69 // Get/Set the Interactor to apply the event to.
71 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
73
74protected:
77
78private:
80 void operator=(const vtkRemoteInteractionAdapter&) = delete;
81
82 double DevicePixelRatio = 1.0;
83 double DevicePixelRatioTolerance = 1e-5;
84 vtkRenderWindowInteractor* Interactor = nullptr;
85};
86
87VTK_ABI_NAMESPACE_END
88#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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.