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 =========================================================================*/
61 #ifndef vtkButtonWidget_h
62 #define vtkButtonWidget_h
63 
64 #include "vtkAbstractWidget.h"
65 #include "vtkInteractionWidgetsModule.h" // For export macro
66 
68 
69 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
70 {
71 public:
75  static vtkButtonWidget* New();
76 
78 
82  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
91  {
92  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
93  }
94 
99  {
100  return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);
101  }
102 
107 
115  void SetEnabled(int) override;
116 
117 protected:
119  ~vtkButtonWidget() override {}
120 
121  // These are the events that are handled
125 
126  // Manage the state of the widget
129  {
130  Start = 0,
132  Selecting
133  };
134 
135 private:
136  vtkButtonWidget(const vtkButtonWidget&) = delete;
137  void operator=(const vtkButtonWidget&) = delete;
138 };
139 
140 #endif
vtkButtonWidget::~vtkButtonWidget
~vtkButtonWidget() override
Definition: vtkButtonWidget.h:119
vtkAbstractWidget.h
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:60
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:175
vtkButtonWidget::GetSliderRepresentation
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
Definition: vtkButtonWidget.h:98
vtkButtonWidget::SetRepresentation
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkButtonWidget.h:90
vtkButtonWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkButtonRepresentation
abstract class defines the representation for a vtkButtonWidget
Definition: vtkButtonRepresentation.h:48
vtkButtonWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkButtonWidget
activate an n-state button
Definition: vtkButtonWidget.h:70
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:66
vtkButtonWidget::WidgetState
int WidgetState
Definition: vtkButtonWidget.h:127
vtkButtonWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkButtonWidget::_WidgetState
_WidgetState
Definition: vtkButtonWidget.h:129
vtkButtonWidget::Hovering
@ Hovering
Definition: vtkButtonWidget.h:131
vtkButtonWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkButtonWidget::SetEnabled
void SetEnabled(int) override
The method for activating and deactivating this widget.
vtkButtonWidget::vtkButtonWidget
vtkButtonWidget()
vtkButtonWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkButtonWidget::New
static vtkButtonWidget * New()
Instantiate the class.