VTK  9.0.1
vtkOpenVRMenuWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkOpenVRMenuWidget.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 =========================================================================*/
23 #ifndef vtkOpenVRMenuWidget_h
24 #define vtkOpenVRMenuWidget_h
25 
26 #include "vtkAbstractWidget.h"
27 #include "vtkRenderingOpenVRModule.h" // For export macro
28 #include <deque> // for ivar
29 
30 class vtkEventData;
32 class vtkPropMap;
33 class vtkProp;
34 
35 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRMenuWidget : public vtkAbstractWidget
36 {
37 public:
42 
44 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
57 
61  void CreateDefaultRepresentation() override;
62 
64 
67  vtkGetMacro(WidgetState, int);
69 
70  // Manage the state of the widget
72  {
73  Start = 0,
74  Active
75  };
76 
78 
81  void PushFrontMenuItem(const char* name, const char* text, vtkCommand* cmd);
82  void RenameMenuItem(const char* name, const char* text);
83  void RemoveMenuItem(const char* name);
86 
87  void Show(vtkEventData* ed);
89 
90 protected:
93 
95 
96  class InternalElement;
97  std::deque<InternalElement*> Menus;
98 
99  // These are the callbacks for this widget
103 
105  static void EventCallback(
106  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
107 
111  static void Update(vtkAbstractWidget*);
112 
113 private:
114  vtkOpenVRMenuWidget(const vtkOpenVRMenuWidget&) = delete;
115  void operator=(const vtkOpenVRMenuWidget&) = delete;
116 };
117 #endif
define the API for widget / widget representation
supports function callbacks
superclass for callback/observer methods
Definition: vtkCommand.h:378
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
Widget representation for vtkOpenVRPanelWidget Implementation of the popup panel representation for t...
3D widget to display a menu in VR
~vtkOpenVRMenuWidget() override
vtkCallbackCommand * EventCommand
void SetRepresentation(vtkOpenVRMenuRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void Show(vtkEventData *ed)
static void Update(vtkAbstractWidget *)
Update callback to check for the hovered prop.
static vtkOpenVRMenuWidget * New()
Instantiate the object.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
void RemoveMenuItem(const char *name)
static void SelectMenuAction(vtkAbstractWidget *)
static void MoveAction(vtkAbstractWidget *)
std::deque< InternalElement * > Menus
void PushFrontMenuItem(const char *name, const char *text, vtkCommand *cmd)
Methods to add/remove items to the menu, called by the menu widget.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RenameMenuItem(const char *name, const char *text)
static void EventCallback(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
static void StartMenuAction(vtkAbstractWidget *)
void ShowSubMenu(vtkOpenVRMenuWidget *)
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
@ name
Definition: vtkX3D.h:225