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 =========================================================================*/
58 #ifndef vtkButtonWidget_h
59 #define vtkButtonWidget_h
60 
61 #include "vtkInteractionWidgetsModule.h" // For export macro
62 #include "vtkAbstractWidget.h"
63 
65 
66 
67 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget
68 {
69 public:
73  static vtkButtonWidget *New();
74 
76 
80  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
89  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
90 
95  {return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);}
96 
100  void CreateDefaultRepresentation() override;
101 
109  void SetEnabled(int) override;
110 
111 protected:
112  vtkButtonWidget();
113  ~vtkButtonWidget() override {}
114 
115  // These are the events that are handled
116  static void SelectAction(vtkAbstractWidget*);
117  static void MoveAction(vtkAbstractWidget*);
118  static void EndSelectAction(vtkAbstractWidget*);
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
vtkButtonWidget::~vtkButtonWidget
~vtkButtonWidget() override
Definition: vtkButtonWidget.h:113
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkButtonWidget::GetSliderRepresentation
vtkButtonRepresentation * GetSliderRepresentation()
Return the representation as a vtkButtonRepresentation.
Definition: vtkButtonWidget.h:94
vtkButtonWidget::SetRepresentation
void SetRepresentation(vtkButtonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkButtonWidget.h:88
vtkButtonRepresentation
abstract class defines the representation for a vtkButtonWidget
Definition: vtkButtonRepresentation.h:45
vtkButtonWidget
activate an n-state button
Definition: vtkButtonWidget.h:67
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:63
vtkButtonWidget::WidgetState
int WidgetState
Definition: vtkButtonWidget.h:121
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkButtonWidget::_WidgetState
_WidgetState
Definition: vtkButtonWidget.h:122
vtkButtonWidget::Hovering
Definition: vtkButtonWidget.h:125