VTK  9.0.2
vtkOpenVRPanelRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkImplicitPlaneRepresentation.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 =========================================================================*/
28 #ifndef vtkOpenVRPanelRepresentation_h
29 #define vtkOpenVRPanelRepresentation_h
30 
31 #include "vtkRenderingOpenVRModule.h" // For export macro
33 #include <string> // for ivar
34 
35 class vtkPicker;
36 class vtkTextActor3D;
37 
38 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRPanelRepresentation : public vtkWidgetRepresentation
39 {
40 public:
45 
47 
51  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
54  // Enums define the state of the representation relative to the mouse pointer
55  // position. Used by ComputeInteractionState() to communicate with the
56  // widget. Note that ComputeInteractionState() and several other methods
57  // must be implemented by subclasses.
59  {
60  Outside = 0,
61  Moving
62  };
63 
65 
68  void BuildRepresentation() override;
69  void PlaceWidget(double bounds[6]) override;
71  unsigned long event, void* calldata) override;
73  unsigned long event, void* calldata) override;
75  unsigned long event, void* calldata, int modify = 0) override;
77  unsigned long event, void* calldata) override;
79 
80  // Place the widget with a few more options
81  // This method allows you to place the panel
82  // and provides more options so that you can get
83  // the exact positioning you want.
84  // Bounds are the bounds that you want the panel to
85  // fit within. For World coordinates they should be in
86  // world coordinates. For all others they should be in
87  // physical meters relative to the HMD or controller origin.
88  // The normal is the direction the planel should face.
89  // The coordinate system for the controller is X right
90  // Y up and Z towards the handle. Upvec specifies the
91  // vector to use as up for the panel. Note that upvec
92  // has priority over normal, if they are not orthogonal
93  // normal will be modified to be orthogonal to upvec.
94  // Scale is the physical scale from the RenderWindow
95  // and is used to position/scale the panel correctly.
96  //
97  // Note that you should set the Text on the panel
98  // before calling this method as the positioning
99  // and scaling is done based on the current text.
100  //
101  // All vectors will be normalized prior to use.
103  const double* bounds, const double* normal, const double* upvec, double scale);
104 
106 
114 
116 
119  void SetText(const char* str);
121 
122  // allow access to the underlying text actor
123  // so that properties can be set
124  vtkGetObjectMacro(TextActor, vtkTextActor3D);
125 
126  // Set the coordinate system to use for this prop
131 
133 
136  vtkSetMacro(AllowAdjustment, bool);
137  vtkGetMacro(AllowAdjustment, bool);
138  vtkBooleanMacro(AllowAdjustment, bool);
140 
141 protected:
144 
145  // Keep track of event positions
146  double LastEventPosition[3];
147  double LastEventOrientation[4];
148  double StartEventOrientation[4];
149 
150  double LastScale;
151 
153 
154  void UpdatePose(double* p1, double* d1, double* p2, double* d2);
155 
157 
159  {
160  World = 0,
161  HMD = 1,
164  };
165 
167 
168  // The text
171 
172 private:
174  void operator=(const vtkOpenVRPanelRepresentation&) = delete;
175 };
176 
177 #endif
define the API for widget / widget representation
a simple class to control print indentation
Definition: vtkIndent.h:34
Widget representation for vtkOpenVRPanelWidget Implementation of the popup panel representation for t...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void PlaceWidgetExtended(const double *bounds, const double *normal, const double *upvec, double scale)
void UpdatePose(double *p1, double *d1, double *p2, double *d2)
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void PlaceWidget(double bounds[6]) override
void EndComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
~vtkOpenVRPanelRepresentation() override
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
void SetText(const char *str)
Set panel text.
int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata, int modify=0) override
void BuildRepresentation() override
Methods to interface with the vtkOpenVRPanelWidget.
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void ComputeMatrix(vtkRenderer *ren)
void StartComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
static vtkOpenVRPanelRepresentation * New()
Instantiate the class.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
void ComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:62
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:68
An actor that displays text.
abstract specification for Viewports
Definition: vtkViewport.h:45
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
@ scale
Definition: vtkX3D.h:235
@ string
Definition: vtkX3D.h:496
int vtkTypeBool
Definition: vtkABI.h:69