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);
93  bool Configure(vtkPVXMLElement* child, vtkSMProxyLocator* locator) override;
94 
95  // Read the python file located on the filesystem at "path" into "contents"
96  bool ReadPythonFile(const char* path, std::string& contents);
97 
98  char* FileName;
99 
100 private:
102  const vtkSMVRPythonInteractorStyleProxy&) = delete; // Not implemented.
103  void operator=(const vtkSMVRPythonInteractorStyleProxy&) = delete; // Not implemented.
104 
105  class Internal;
106  Internal* Internals;
107 };
108 
109 #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.
virtual bool Configure(vtkPVXMLElement *child, vtkSMProxyLocator *)
Load state for the style from XML.
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
virtual vtkPVXMLElement * SaveConfiguration()
Save state to xml.
static vtkSMVRInteractorStyleProxy * New()
vtkSMProxyInternals * Internals
Definition: vtkSMProxy.h:1024
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.