VTK  9.7.1
vtkButtonWidget.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
49 #ifndef vtkButtonWidget_h
50 #define vtkButtonWidget_h
51 
52 #include "vtkAbstractWidget.h"
53 #include "vtkInteractionWidgetsModule.h" // For export macro
54 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
55 
56 VTK_ABI_NAMESPACE_BEGIN
58 
59 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkButtonWidget : public vtkAbstractWidget
60 {
61 public:
65  static vtkButtonWidget* New();
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
81  {
82  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
83  }
84 
89  {
90  return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
91  }
92 
96  void CreateDefaultRepresentation() override;
97 
105  void SetEnabled(int) override;
106 
107 protected:
108  vtkButtonWidget();
109  ~vtkButtonWidget() override = default;
110 
111  // These are the events that are handled
112  static void SelectAction(vtkAbstractWidget*);
113  static void MoveAction(vtkAbstractWidget*);
114  static void EndSelectAction(vtkAbstractWidget*);
115 
116  // Manage the state of the widget
119  {
120  Start = 0,
122  Selecting
123  };
124 
125 private:
126  vtkButtonWidget(const vtkButtonWidget&) = delete;
127  void operator=(const vtkButtonWidget&) = delete;
128 };
129 
130 VTK_ABI_NAMESPACE_END
131 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
activate an n-state button
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkButtonRepresentation * GetButtonRepresentation()
Return the representation as a vtkButtonRepresentation.
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract class defines the representation for a vtkButtonWidget
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...