VTK
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 "vtkInteractionWidgetsModule.h" // For export macro
59 #include "vtkAbstractWidget.h"
60 
62 
63 
64 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
65 {
66 public:
70  static vtkButtonWidget *New();
71 
73 
77  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
86  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
87 
92  {return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);}
93 
97  void CreateDefaultRepresentation() override;
98 
106  void SetEnabled(int) override;
107 
108 protected:
109  vtkButtonWidget();
110  ~vtkButtonWidget() override {}
111 
112  // These are the events that are handled
113  static void SelectAction(vtkAbstractWidget*);
114  static void MoveAction(vtkAbstractWidget*);
115  static void EndSelectAction(vtkAbstractWidget*);
116 
117  // Manage the state of the widget
120  {
121  Start=0,
123  Selecting
124  };
125 
126 private:
127  vtkButtonWidget(const vtkButtonWidget&) = delete;
128  void operator=(const vtkButtonWidget&) = delete;
129 };
130 
131 #endif
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
activate an n-state button
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class defines the representation for a vtkButtonWidget
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
~vtkButtonWidget() override