vtkSMVRTravelGrabExoSplitStyleProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkSMVRTravelGrabExoSplitStyleProxy_h
15 #define vtkSMVRTravelGrabExoSplitStyleProxy_h
16 
17 #include "vtkNew.h"
18 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
20 
21 class vtkCamera;
22 class vtkMatrix4x4;
26 struct vtkVREvent;
27 
28 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRTravelGrabExoSplitStyleProxy
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35  int GetControlledPropertySize() override { return 16; }
36 
37  // Overridden to defer expensive calculations and update vtk objects
38  bool Update() override;
39 
40 protected:
42  ~vtkSMVRTravelGrabExoSplitStyleProxy() override = default;
43 
44  void HandleButton(const vtkVREvent& event) override;
45  void HandleTracker(const vtkVREvent& event) override;
46 
47 private:
49  const vtkSMVRTravelGrabExoSplitStyleProxy&) = delete; // Not implemented
50  void operator=(const vtkSMVRTravelGrabExoSplitStyleProxy&) = delete; // Not implemented
51 
52  // mirrors the state of the button assigned the "Translate World" role,
53  // indicating whether or not we are currently translating
54  bool EnableTranslate;
55 
56  // mirrors the button assigned the "Rotate World" role, indicating
57  // whether or not we are currently rotating
58  bool EnableRotate;
59 
60  // Indicates whether we still need to capture the initial state after
61  // button press
62  bool IsInitialRecorded;
63 
64  // Saved on button down to capture the target property matrix and
65  // the inverse wand matrix
66  vtkNew<vtkMatrix4x4> InverseWandMatrix;
67  vtkNew<vtkMatrix4x4> SavedPropertyMatrix;
68 
69  // Some matrices used for other internal computations. Keep them
70  // here to avoid creating and destroying them on every event.
71  vtkNew<vtkMatrix4x4> TrackerMatrix;
72  vtkNew<vtkMatrix4x4> TransformMatrix;
73  vtkNew<vtkMatrix4x4> TranslateMatrix;
74  vtkNew<vtkMatrix4x4> TranslateToOrigin;
75  vtkNew<vtkMatrix4x4> TranslateBack;
76 
77  double CurrentTranslation[3];
78 };
79 
80 #endif // vtkSMVRTravelGrabExoSplitStyleProxy_h
the base class for all interactor styles
virtual void HandleButton(const vtkVREvent &event)
an interaction style to control a matrix
property representing a vector of integers
implementation for View that includes render window and renderers.
property representing a vector of doubles
virtual void HandleTracker(const vtkVREvent &event)
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSMVRInteractorStyleProxy * New()
virtual bool Update()
Update() called to update all the remote vtkObjects and perhaps even to render.