VTK  9.1.0
vtkButtonWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkButtonWidget.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
70#ifndef vtkButtonWidget_h
71#define vtkButtonWidget_h
72
73#include "vtkAbstractWidget.h"
74#include "vtkInteractionWidgetsModule.h" // For export macro
75
77
78class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
79{
80public:
85
87
91 void PrintSelf(ostream& os, vtkIndent indent) override;
93
100 {
101 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
102 }
103
108 {
109 return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
110 }
111
116
124 void SetEnabled(int) override;
125
126protected:
128 ~vtkButtonWidget() override = default;
129
130 // These are the events that are handled
134
135 // Manage the state of the widget
138 {
139 Start = 0,
141 Selecting
142 };
143
144private:
145 vtkButtonWidget(const vtkButtonWidget&) = delete;
146 void operator=(const vtkButtonWidget&) = delete;
147};
148
149#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:43
abstract class defines interface between the widget and widget representation classes