VTK
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 "vtkRenderingOpenVRModule.h" // For export macro
27 #include "vtkAbstractWidget.h"
28 #include <deque> // for ivar
29 
30 class vtkEventData;
32 class vtkPropMap;
33 class vtkProp;
34 
35 
36 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRMenuWidget : public vtkAbstractWidget
37 {
38 public:
43 
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
58 
62  void CreateDefaultRepresentation() override;
63 
65 
68  vtkGetMacro( WidgetState, int );
70 
71  // Manage the state of the widget
72  enum _WidgetState {Start=0,Active};
73 
75 
78  void PushFrontMenuItem(const char *name, const char *text, vtkCommand *cmd);
79  void RenameMenuItem(const char *name, const char *text);
80  void RemoveMenuItem(const char *name);
83 
84  void Show(vtkEventData *ed);
86 
87 protected:
90 
92 
93  class InternalElement;
94  std::deque<InternalElement *> Menus;
95 
96  // These are the callbacks for this widget
100 
102  static void EventCallback(vtkObject* object,
103  unsigned long event,
104  void* clientdata,
105  void* calldata);
106 
110  static void Update(vtkAbstractWidget*);
111 
112 private:
113  vtkOpenVRMenuWidget(const vtkOpenVRMenuWidget&) = delete;
114  void operator=(const vtkOpenVRMenuWidget&) = delete;
115 };
116 #endif
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:371
vtkOpenVRMenuWidget::_WidgetState
_WidgetState
Definition: vtkOpenVRMenuWidget.h:72
vtkEventData
Definition: vtkEventData.h:64
vtkOpenVRMenuWidget::EventCallback
static void EventCallback(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkOpenVRMenuWidget::Menus
std::deque< InternalElement * > Menus
Definition: vtkOpenVRMenuWidget.h:93
vtkOpenVRMenuWidget::Update
static void Update(vtkAbstractWidget *)
Update callback to check for the hovered prop.
vtkOpenVRMenuWidget::EventCommand
vtkCallbackCommand * EventCommand
Definition: vtkOpenVRMenuWidget.h:101
vtkAbstractWidget.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkOpenVRMenuWidget::WidgetState
int WidgetState
Definition: vtkOpenVRMenuWidget.h:91
vtkOpenVRMenuWidget::StartMenuAction
static void StartMenuAction(vtkAbstractWidget *)
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkOpenVRMenuWidget::vtkOpenVRMenuWidget
vtkOpenVRMenuWidget()
vtkOpenVRMenuWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkOpenVRMenuWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkOpenVRMenuWidget::RemoveMenuItem
void RemoveMenuItem(const char *name)
vtkOpenVRMenuWidget::RemoveAllMenuItems
void RemoveAllMenuItems()
vtkOpenVRMenuWidget::SetRepresentation
void SetRepresentation(vtkOpenVRMenuRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkOpenVRMenuWidget::PushFrontMenuItem
void PushFrontMenuItem(const char *name, const char *text, vtkCommand *cmd)
Methods to add/remove items to the menu, called by the menu widget.
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:51
vtkOpenVRMenuWidget::ShowSubMenu
void ShowSubMenu(vtkOpenVRMenuWidget *)
vtkOpenVRMenuWidget::~vtkOpenVRMenuWidget
~vtkOpenVRMenuWidget() override
vtkOpenVRMenuWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenVRMenuWidget
3D widget to display a menu in VR
Definition: vtkOpenVRMenuWidget.h:37
vtkOpenVRMenuWidget::New
static vtkOpenVRMenuWidget * New()
Instantiate the object.
vtkOpenVRMenuWidget::RenameMenuItem
void RenameMenuItem(const char *name, const char *text)
vtkOpenVRMenuRepresentation
Widget representation for vtkOpenVRPanelWidget Implementation of the popup panel representation for t...
Definition: vtkOpenVRMenuRepresentation.h:44
vtkOpenVRMenuWidget::SelectMenuAction
static void SelectMenuAction(vtkAbstractWidget *)
vtkOpenVRMenuWidget::Show
void Show(vtkEventData *ed)