vtkSMVRControlLocationStyleProxy.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
11 #ifndef vtkSMVRControlLocationStyleProxy_h
12 #define vtkSMVRControlLocationStyleProxy_h
13 
14 #include "vtkNew.h"
15 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
17 
18 class vtkTransform;
19 class vtkMatrix4x4;
20 
21 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRControlLocationStyleProxy
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  ~vtkSMVRControlLocationStyleProxy() override = default;
40 
42 
45  void SaveProxyProperties(vtkPVXMLElement* xml) override;
46  bool LoadProxyProperties(vtkPVXMLElement* xml, vtkSMProxyLocator* locator) override;
48 
49  void HandleButton(const vtkVREvent& event) override;
50  void HandleTracker(const vtkVREvent& event) override;
51 
52 private:
54  const vtkSMVRControlLocationStyleProxy&) = delete; // Not implemented
55  void operator=(const vtkSMVRControlLocationStyleProxy&) = delete; // Not implemented
56 
57  bool Enabled;
58  bool InitialPositionRecorded;
59  double Origin[4];
60  bool FirstUpdate;
61  double OriginalOrigin[3];
62  bool DeferredUpdate;
63 
64  vtkNew<vtkMatrix4x4> InitialInvertedPose;
65  vtkNew<vtkMatrix4x4> ModelTransformMatrix;
66  vtkNew<vtkMatrix4x4> InverseModelTransformMatrix;
67  vtkNew<vtkMatrix4x4> TrackerMatrix;
68  vtkNew<vtkMatrix4x4> TransformMatrix;
69 };
70 
71 #endif // vtkSMVRControlLocationStyleProxy_h
the base class for all interactor styles
virtual void HandleButton(const vtkVREvent &event)
an interaction style to control the position of a point with a tracker
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.