VTK  9.0.1
vtkOpenVRControlsHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkOpenVRControlsHelper.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
24 #ifndef vtkOpenVRControlsHelper_h
25 #define vtkOpenVRControlsHelper_h
26 
27 #include "vtkEventData.h" // for enums
28 #include "vtkNew.h" // for iVar
29 #include "vtkProp.h"
30 #include "vtkRenderingOpenVRModule.h" // For export macro
31 #include "vtkStdString.h" // needed for vtkStdString iVar.
32 #include "vtkWeakPointer.h" // needed for vtkWeakPointer iVar.
33 
34 class vtkActor;
35 class vtkProperty;
36 class vtkPolyData;
37 class vtkPolyDataMapper;
38 class vtkCellArray;
39 class vtkPoints;
40 class vtkTextActor3D;
41 class vtkTransform;
42 
43 class vtkLineSource;
44 class vtkPolyDataMapper;
45 class vtkRenderer;
46 class vtkCallbackCommand;
47 
48 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRControlsHelper : public vtkProp
49 {
50 public:
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65  {
66  Back = -1,
67  Front = 1
68  };
69 
70  enum DrawSides
71  {
72  Left = -1,
73  Right = 1
74  };
75 
77 
83 
85 
93 
95 
98  void SetText(vtkStdString str);
100 
101  void SetTooltipInfo(const char* s, int buttonSide, int drawSide, const char* txt)
102  {
103  if (!s || !txt)
104  {
105  return;
106  }
107  this->ComponentName = vtkStdString(s);
108  this->DrawSide = drawSide;
109  this->ButtonSide = buttonSide;
110  this->SetText(vtkStdString(txt));
111  }
112 
113  void SetEnabled(bool enabled);
114  vtkGetMacro(Enabled, bool);
115  vtkBooleanMacro(Enabled, bool);
116 
118 
119  virtual void SetRenderer(vtkRenderer* ren);
121 
122 protected:
125 
126  double FrameSize[2];
127 
128  // The text
131 
132  // The line
136 
138 
139  // Tooltip parameters
141  int DrawSide; // Left/Right
142  int ButtonSide; // Front/Back
143 
144  bool Enabled;
145 
146  double ControlPositionLC[3];
147 
148  // The renderer in which this widget is placed
150 
152  unsigned long ObserverTag;
153  static void MoveEvent(vtkObject* object, unsigned long event, void* clientdata, void* calldata);
154 
156 
158  double LastPhysicalTranslation[3];
159  double LastEventPosition[3];
160  double LastEventOrientation[4];
163 
164 private:
166  void operator=(const vtkOpenVRControlsHelper&) = delete;
167 };
168 
169 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
supports function callbacks
object to represent cell connectivity
Definition: vtkCellArray.h:180
a simple class to control print indentation
Definition: vtkIndent.h:34
create a line defined by two end points
Definition: vtkLineSource.h:61
abstract base class for most VTK objects
Definition: vtkObject.h:54
Tooltip helper explaining controls Helper class to draw one tooltip per button around the controller.
void SetText(vtkStdString str)
Set Tooltip text (used by TextActor)
vtkCallbackCommand * MoveCallbackCommand
void BuildRepresentation()
Methods to interface with the vtkOpenVRPanelWidget.
vtkNew< vtkTransform > TempTransform
void SetTooltipInfo(const char *s, int buttonSide, int drawSide, const char *txt)
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
virtual vtkRenderer * GetRenderer()
static vtkOpenVRControlsHelper * New()
Instantiate the class.
virtual void SetRenderer(vtkRenderer *ren)
void SetDevice(vtkEventDataDevice val)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
void SetEnabled(bool enabled)
vtkWeakPointer< vtkRenderer > Renderer
~vtkOpenVRControlsHelper() override
static void MoveEvent(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
represent and manipulate 3D points
Definition: vtkPoints.h:34
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
represent surface properties of a geometric object
Definition: vtkProperty.h:62
abstract specification for renderers
Definition: vtkRenderer.h:59
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:35
An actor that displays text.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ enabled
Definition: vtkX3D.h:265
int vtkTypeBool
Definition: vtkABI.h:69
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:26