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 
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 vtkSMVRControlLocationStyleProxy&) = delete; // Not implemented
49  void operator=(const vtkSMVRControlLocationStyleProxy&) = delete; // Not implemented
50 
51  bool Enabled;
52  bool InitialPositionRecorded;
53  double Origin[4];
54  bool FirstUpdate;
55  double OriginalOrigin[3];
56  bool DeferredUpdate;
57 
58  vtkNew<vtkMatrix4x4> InitialInvertedPose;
59  vtkNew<vtkMatrix4x4> ModelTransformMatrix;
60  vtkNew<vtkMatrix4x4> InverseModelTransformMatrix;
61  vtkNew<vtkMatrix4x4> TrackerMatrix;
62  vtkNew<vtkMatrix4x4> TransformMatrix;
63 };
64 
65 #endif // vtkSMVRControlLocationStyleProxy_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 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
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.