VTK  9.2.6
vtkVRMenuWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkVRMenuWidget.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=========================================================================*/
22
23#ifndef vtkVRMenuWidget_h
24#define vtkVRMenuWidget_h
25
26#include "vtkAbstractWidget.h"
27#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
28#include "vtkRenderingVRModule.h" // For export macro
29#include <deque> // for ivar
30
31class vtkEventData;
33
34class VTKRENDERINGVR_EXPORT vtkVRMenuWidget : public vtkAbstractWidget
35{
36public:
41
43
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
56
61
63
66 vtkGetMacro(WidgetState, int);
68
69 // Manage the state of the widget
71 {
72 Start = 0,
74 };
75#if !defined(VTK_LEGACY_REMOVE)
76 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
78#endif
79
81
84 void PushFrontMenuItem(const char* name, const char* text, vtkCommand* cmd);
85 void RenameMenuItem(const char* name, const char* text);
86 void RemoveMenuItem(const char* name);
89
90 void Show(vtkEventData* ed);
92
93protected:
95 ~vtkVRMenuWidget() override;
96
98
99 class InternalElement;
100 std::deque<InternalElement*> Menus;
101
102 // These are the callbacks for this widget
106
108 static void EventCallback(
109 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
110
115
116private:
117 vtkVRMenuWidget(const vtkVRMenuWidget&) = delete;
118 void operator=(const vtkVRMenuWidget&) = delete;
119};
120#endif
supports function callbacks
superclass for callback/observer methods
Definition vtkCommand.h:395
a simple class to control print indentation
Definition vtkIndent.h:40
Widget representation for vtkVRMenuWidget Implementation of the popup panel representation for the vt...
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
static void Update(vtkAbstractWidget *)
Update callback to check for the hovered prop.
void SetRepresentation(vtkVRMenuRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static void MoveAction(vtkAbstractWidget *)
static void SelectMenuAction(vtkAbstractWidget *)
WidgetStateType _WidgetState
void RemoveMenuItem(const char *name)
Methods to add/remove items to the menu, called by the menu widget.
~vtkVRMenuWidget() override
vtkCallbackCommand * EventCommand
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject methods.
std::deque< InternalElement * > Menus
void RenameMenuItem(const char *name, const char *text)
Methods to add/remove items to the menu, called by the menu widget.
static vtkVRMenuWidget * New()
Instantiate the object.
void ShowSubMenu(vtkVRMenuWidget *)
void PushFrontMenuItem(const char *name, const char *text, vtkCommand *cmd)
Methods to add/remove items to the menu, called by the menu widget.
static void EventCallback(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
void RemoveAllMenuItems()
Methods to add/remove items to the menu, called by the menu widget.
void Show(vtkEventData *ed)
static void StartMenuAction(vtkAbstractWidget *)
#define VTK_DEPRECATED_IN_9_2_0(reason)