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
55#ifndef vtkButtonWidget_h
56#define vtkButtonWidget_h
57
58#include "vtkAbstractWidget.h"
59#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
60#include "vtkInteractionWidgetsModule.h" // For export macro
61#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
62
63VTK_ABI_NAMESPACE_BEGIN
65
66class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
67{
68public:
73
75
79 void PrintSelf(ostream& os, vtkIndent indent) override;
81
88 {
89 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
90 }
91
96 {
97 return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
98 }
99
104
112 void SetEnabled(int) override;
113
114protected:
116 ~vtkButtonWidget() override = default;
117
118 // These are the events that are handled
122
123 // Manage the state of the widget
126 {
127 Start = 0,
129 Selecting
130 };
131#if !defined(VTK_LEGACY_REMOVE)
132 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
134#endif
135
136private:
137 vtkButtonWidget(const vtkButtonWidget&) = delete;
138 void operator=(const vtkButtonWidget&) = delete;
139};
140
141VTK_ABI_NAMESPACE_END
142#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 *)
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
void SetEnabled(int) override
The method for activating and deactivating this widget.
static vtkButtonWidget * New()
Instantiate the class.
static void MoveAction(vtkAbstractWidget *)
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static void EndSelectAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition vtkIndent.h:38
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)