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;
44  bool Configure(vtkPVXMLElement* child, vtkSMProxyLocator* locator) override;
45 
46 private:
48  const vtkSMVRControlOrientationStyleProxy&) = delete; // Not implemented
49  void operator=(const vtkSMVRControlOrientationStyleProxy&) = delete; // Not implemented
50 
51  bool Enabled;
52  bool InitialOrientationRecorded;
53  double Normal[4];
54  bool FirstUpdate;
55  double OriginalNormal[3];
56  bool DeferredUpdate;
57 
58  vtkNew<vtkMatrix4x4> InitialInvertedPose;
59  vtkNew<vtkMatrix4x4> TrackerMatrix;
60  vtkNew<vtkMatrix4x4> TransformMatrix;
61  vtkNew<vtkMatrix4x4> ModelTransformMatrix;
62  vtkNew<vtkMatrix4x4> InverseModelTransformMatrix;
63 };
64 
65 #endif // vtkSMVRControlOrientationStyleProxy_h
the base class for all interactor styles
virtual void HandleButton(const vtkVREvent &event)
virtual bool Configure(vtkPVXMLElement *child, vtkSMProxyLocator *)
Load state for the style from XML.
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
virtual vtkPVXMLElement * SaveConfiguration()
Save state to xml.
static vtkSMVRInteractorStyleProxy * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual bool Update()
Update() called to update all the remote vtkObjects and perhaps even to render.