VTK  9.0.1
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 =========================================================================*/
55 #ifndef vtkButtonWidget_h
56 #define vtkButtonWidget_h
57 
58 #include "vtkAbstractWidget.h"
59 #include "vtkInteractionWidgetsModule.h" // For export macro
60 
62 
63 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
64 {
65 public:
69  static vtkButtonWidget* New();
70 
72 
76  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
85  {
86  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
87  }
88 
93  {
94  return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
95  }
96 
101 
109  void SetEnabled(int) override;
110 
111 protected:
113  ~vtkButtonWidget() override {}
114 
115  // These are the events that are handled
119 
120  // Manage the state of the widget
123  {
124  Start = 0,
126  Selecting
127  };
128 
129 private:
130  vtkButtonWidget(const vtkButtonWidget&) = delete;
131  void operator=(const vtkButtonWidget&) = delete;
132 };
133 
134 #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.
static void SelectAction(vtkAbstractWidget *)
~vtkButtonWidget() override
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
Methods invoked by print to print information about the object including superclasses.
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
static void EndSelectAction(vtkAbstractWidget *)
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract class defines interface between the widget and widget representation classes