VTK  9.2.6
vtkVRPanelRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkVRPanelRepresentation.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
26
27#ifndef vtkVRPanelRepresentation_h
28#define vtkVRPanelRepresentation_h
29
30#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
31#include "vtkRenderingVRModule.h" // For export macro
33
34#include <string> // for ivar
35
36class vtkTextActor3D;
37
38class VTKRENDERINGVR_EXPORT vtkVRPanelRepresentation : public vtkWidgetRepresentation
39{
40public:
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.
63#if !defined(VTK_LEGACY_REMOVE)
64 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
66#endif
67
69
72 void BuildRepresentation() override;
73 void PlaceWidget(double bounds[6]) override;
75 unsigned long event, void* calldata) override;
77 unsigned long event, void* calldata) override;
79 unsigned long event, void* calldata, int modify = 0) override;
81 unsigned long event, void* calldata) override;
83
84 // Place the widget with a few more options
85 // This method allows you to place the panel
86 // and provides more options so that you can get
87 // the exact positioning you want.
88 // Bounds are the bounds that you want the panel to
89 // fit within. For World coordinates they should be in
90 // world coordinates. For all others they should be in
91 // physical meters relative to the HMD or controller origin.
92 // The normal is the direction the planel should face.
93 // The coordinate system for the controller is X right
94 // Y up and Z towards the handle. Upvec specifies the
95 // vector to use as up for the panel. Note that upvec
96 // has priority over normal, if they are not orthogonal
97 // normal will be modified to be orthogonal to upvec.
98 // Scale is the physical scale from the RenderWindow
99 // and is used to position/scale the panel correctly.
100 //
101 // Note that you should set the Text on the panel
102 // before calling this method as the positioning
103 // and scaling is done based on the current text.
104 //
105 // All vectors will be normalized prior to use.
107 const double* bounds, const double* normal, const double* upvec, double scale);
108
110
118
120
123 void SetText(const char* str);
125
126 // allow access to the underlying text actor
127 // so that properties can be set
128 vtkGetObjectMacro(TextActor, vtkTextActor3D);
129
130 // Set the coordinate system to use for this prop
135
137
140 vtkSetMacro(AllowAdjustment, bool);
141 vtkGetMacro(AllowAdjustment, bool);
142 vtkBooleanMacro(AllowAdjustment, bool);
144
145protected:
148
149 // Keep track of event positions
153
154 double LastScale;
155
157
158 void UpdatePose(double* p1, double* d1, double* p2, double* d2);
159
161
169
171
172 // The text
174 std::string Text;
175
176private:
178 void operator=(const vtkVRPanelRepresentation&) = delete;
179};
180
181#endif
define the API for widget / widget representation
a simple class to control print indentation
Definition vtkIndent.h:34
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition vtkRenderer.h:67
An actor that displays text.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
void PlaceWidget(double bounds[6]) override
void PlaceWidgetExtended(const double *bounds, const double *normal, const double *upvec, double scale)
void ComputeMatrix(vtkRenderer *ren)
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void SetCoordinateSystemToRightController()
~vtkVRPanelRepresentation() override
static vtkVRPanelRepresentation * New()
Instantiate the class.
void UpdatePose(double *p1, double *d1, double *p2, double *d2)
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
void StartComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
InteractionStateType _InteractionState
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void SetCoordinateSystemToLeftController()
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 vtkVRPanelWidget.
void EndComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)