VTK  9.3.20240918
vtkVRMenuWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkVRMenuWidget_h
12#define vtkVRMenuWidget_h
13
14#include "vtkAbstractWidget.h"
15#include "vtkRenderingVRModule.h" // For export macro
16#include <deque> // for ivar
17
18VTK_ABI_NAMESPACE_BEGIN
19class vtkEventData;
21
22class VTKRENDERINGVR_EXPORT vtkVRMenuWidget : public vtkAbstractWidget
23{
24public:
29
31
35 void PrintSelf(ostream& os, vtkIndent indent) override;
37
44
49
51
54 vtkGetMacro(WidgetState, int);
56
57 // Manage the state of the widget
59 {
60 Start = 0,
61 Active
62 };
63
65
68 void PushFrontMenuItem(const char* name, const char* text, vtkCommand* cmd);
69 void RenameMenuItem(const char* name, const char* text);
70 void RemoveMenuItem(const char* name);
73
74 void Show(vtkEventData* ed);
76
77protected:
79 ~vtkVRMenuWidget() override;
80
82
83 class InternalElement;
84 std::deque<InternalElement*> Menus;
85
86 // These are the callbacks for this widget
90
92 static void EventCallback(
93 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
94
99
100private:
101 vtkVRMenuWidget(const vtkVRMenuWidget&) = delete;
102 void operator=(const vtkVRMenuWidget&) = delete;
103};
104VTK_ABI_NAMESPACE_END
105#endif
define the API for widget / widget representation
supports function callbacks
superclass for callback/observer methods
Definition vtkCommand.h:384
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Widget representation for vtkVRMenuWidget Implementation of the popup panel representation for the vt...
3D widget to display a menu in VR
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 *)
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 *)