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
46#ifndef vtkButtonWidget_h
47#define vtkButtonWidget_h
48
49#include "vtkAbstractWidget.h"
50#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
51#include "vtkInteractionWidgetsModule.h" // For export macro
52#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
53
54VTK_ABI_NAMESPACE_BEGIN
56
57class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
58{
59public:
64
66
70 void PrintSelf(ostream& os, vtkIndent indent) override;
72
79 {
80 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
81 }
82
87 {
88 return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
89 }
90
95
103 void SetEnabled(int) override;
104
105protected:
107 ~vtkButtonWidget() override = default;
108
109 // These are the events that are handled
113
114 // Manage the state of the widget
117 {
118 Start = 0,
120 Selecting
121 };
122#if !defined(VTK_LEGACY_REMOVE)
123 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
125#endif
126
127private:
128 vtkButtonWidget(const vtkButtonWidget&) = delete;
129 void operator=(const vtkButtonWidget&) = delete;
130};
131
132VTK_ABI_NAMESPACE_END
133#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:29
abstract class defines interface between the widget and widget representation classes
#define VTK_DEPRECATED_IN_9_2_0(reason)