vtkSMVRControlOrientationStyleProxy.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
12 #ifndef vtkSMVRControlOrientationStyleProxy_h
13 #define vtkSMVRControlOrientationStyleProxy_h
14 
15 #include "vtkNew.h"
16 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
18 
19 class vtkMatrix4x4;
20 
21 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRControlOrientationStyleProxy
23 {
24 public:
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
29  int GetControlledPropertySize() override { return 3; }
30 
31  // Overridden to defer expensive calculations and update vtk objects
32  bool Update() override;
33 
34  void SetDeferredUpdate(bool deferred);
35  bool GetDeferredUpdate();
36 
37 protected:
39  ~vtkSMVRControlOrientationStyleProxy() override = default;
40 
41  void HandleButton(const vtkVREvent& event) override;
42  void HandleTracker(const vtkVREvent& event) override;
43 
45 
48  void SaveProxyProperties(vtkPVXMLElement* xml) override;
49  bool LoadProxyProperties(vtkPVXMLElement* xml, vtkSMProxyLocator* locator) override;
51 
52 private:
54  const vtkSMVRControlOrientationStyleProxy&) = delete; // Not implemented
55  void operator=(const vtkSMVRControlOrientationStyleProxy&) = delete; // Not implemented
56 
57  bool Enabled;
58  bool InitialOrientationRecorded;
59  double Normal[4];
60  bool FirstUpdate;
61  double OriginalNormal[3];
62  bool DeferredUpdate;
63 
64  vtkNew<vtkMatrix4x4> InitialInvertedPose;
65  vtkNew<vtkMatrix4x4> TrackerMatrix;
66  vtkNew<vtkMatrix4x4> TransformMatrix;
67  vtkNew<vtkMatrix4x4> ModelTransformMatrix;
68  vtkNew<vtkMatrix4x4> InverseModelTransformMatrix;
69 };
70 
71 #endif // vtkSMVRControlOrientationStyleProxy_h
the base class for all interactor styles
virtual void HandleButton(const vtkVREvent &event)
an interaction style to control a normalized (unit) 3D vector
Normal
virtual void HandleTracker(const vtkVREvent &event)
is used to locate proxies referred to in state xmls while loading state files.
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSMVRInteractorStyleProxy * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual void SaveProxyProperties(vtkPVXMLElement *xml)
Load/Save custom properties from the interactor style in the .pvvr file Can be overriden to use a cus...
virtual bool LoadProxyProperties(vtkPVXMLElement *xml, vtkSMProxyLocator *locator)
Load/Save custom properties from the interactor style in the .pvvr file Can be overriden to use a cus...
virtual bool Update()
Update() called to update all the remote vtkObjects and perhaps even to render.