VTK  9.5.20250812
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
88#ifndef vtkButtonWidget_h
89#define vtkButtonWidget_h
90
91#include "vtkAbstractWidget.h"
92#include "vtkInteractionWidgetsModule.h" // For export macro
93#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
94
95VTK_ABI_NAMESPACE_BEGIN
97
98class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkButtonWidget : public vtkAbstractWidget
99{
100public:
105
107
111 void PrintSelf(ostream& os, vtkIndent indent) override;
113
120 {
121 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
122 }
123
128 {
129 return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
130 }
131
136
144 void SetEnabled(int) override;
145
146protected:
148 ~vtkButtonWidget() override = default;
149
150 // These are the events that are handled
154
155 // Manage the state of the widget
158 {
159 Start = 0,
161 Selecting
162 };
163
164private:
165 vtkButtonWidget(const vtkButtonWidget&) = delete;
166 void operator=(const vtkButtonWidget&) = delete;
167};
168
169VTK_ABI_NAMESPACE_END
170#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
vtkButtonRepresentation * GetButtonRepresentation()
Return the representation as a vtkButtonRepresentation.
static void SelectAction(vtkAbstractWidget *)
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:108
abstract class defines interface between the widget and widget representation classes
#define VTK_MARSHALAUTO