VTK  9.3.0
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
54 #include "vtkInteractionWidgetsModule.h" // For export macro
55 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
56 
57 VTK_ABI_NAMESPACE_BEGIN
59 
60 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
61 {
62 public:
66  static vtkButtonWidget* New();
67 
69 
73  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
82  {
83  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
84  }
85 
90  {
91  return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
92  }
93 
97  void CreateDefaultRepresentation() override;
98 
106  void SetEnabled(int) override;
107 
108 protected:
110  ~vtkButtonWidget() override = default;
111 
112  // These are the events that are handled
116 
117  // Manage the state of the widget
120  {
121  Start = 0,
123  Selecting
124  };
125 #if !defined(VTK_LEGACY_REMOVE)
126  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
128 #endif
129 
130 private:
131  vtkButtonWidget(const vtkButtonWidget&) = delete;
132  void operator=(const vtkButtonWidget&) = delete;
133 };
134 
135 VTK_ABI_NAMESPACE_END
136 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
abstract class defines the representation for a vtkButtonWidget
activate an n-state button
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
~vtkButtonWidget() override=default
static void SelectAction(vtkAbstractWidget *)
void SetEnabled(int) override
The method for activating and deactivating this widget.
static void MoveAction(vtkAbstractWidget *)
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static vtkButtonWidget * New()
Instantiate the class.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition: vtkIndent.h:29
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)