vtkSMVRPythonInteractorStyleProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkSMVRPythonInteractorStyleProxy_h
11 #define vtkSMVRPythonInteractorStyleProxy_h
12 
13 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
15 
16 #include <string>
17 
18 class vtkPVXMLElement;
19 class vtkSmartPyObject;
22 class vtkSMProxy;
24 class vtkTransform;
25 struct vtkVREvent;
26 
27 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRPythonInteractorStyleProxy
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
40  vtkSetFilePathMacro(FileName);
41  vtkGetFilePathMacro(FileName);
43 
45 
48  void ReloadPythonFile();
50 
52 
55  void RecreateVTKObjects() override;
57 
66  void SetPythonObject(void* obj);
68 
70 
74  bool Update() override;
76 
78 
82  void UpdateVTKObjects() override;
84 
85 protected:
88  void HandleTracker(const vtkVREvent& event) override;
89  void HandleValuator(const vtkVREvent& event) override;
90  void HandleButton(const vtkVREvent& event) override;
91  void InvokeHandler(const char* mname, const vtkVREvent& event);
92 
93  // Read the python file located on the filesystem at "path" into "contents"
94  bool ReadPythonFile(const char* path, std::string& contents);
95 
97 
100  void SaveProxyProperties(vtkPVXMLElement* xml) override;
101  bool LoadProxyProperties(vtkPVXMLElement* xml, vtkSMProxyLocator* locator) override;
103 
104  char* FileName;
105 
106 private:
108  const vtkSMVRPythonInteractorStyleProxy&) = delete; // Not implemented.
109  void operator=(const vtkSMVRPythonInteractorStyleProxy&) = delete; // Not implemented.
110 
111  class Internal;
112  Internal* Internals;
113 };
114 
115 #endif // vtkSMVRPythonInteractorStyleProxy_h
the base class for all interactor styles
an interaction style allowing users to write custom python interactors
virtual void HandleButton(const vtkVREvent &event)
virtual void RecreateVTKObjects()
Recreate the VTK object for this proxy.
property representing a vector of integers
virtual void UpdateVTKObjects()
Update the VTK object on the server by pushing the values of all modified properties (un-modified pro...
implementation for View that includes render window and renderers.
property representing a vector of doubles
virtual void HandleTracker(const vtkVREvent &event)
virtual void HandleValuator(const vtkVREvent &event)
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
is used to locate proxies referred to in state xmls while loading state files.
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSMVRInteractorStyleProxy * New()
vtkSMProxyInternals * Internals
Definition: vtkSMProxy.h:1029
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.