VTK
vtkCenteredSliderWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCenteredSliderWidget.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 =========================================================================*/
71 #ifndef vtkCenteredSliderWidget_h
72 #define vtkCenteredSliderWidget_h
73 
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 #include "vtkAbstractWidget.h"
76 
78 
79 
80 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget
81 {
82 public:
86  static vtkCenteredSliderWidget *New();
87 
89 
93  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
95 
102  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
103 
108  {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);}
109 
113  void CreateDefaultRepresentation() VTK_OVERRIDE;
114 
118  double GetValue() { return this->Value; };
119 
120 protected:
122  ~vtkCenteredSliderWidget() VTK_OVERRIDE {}
123 
124  // These are the events that are handled
125  static void SelectAction(vtkAbstractWidget*);
126  static void EndSelectAction(vtkAbstractWidget*);
127  static void MoveAction(vtkAbstractWidget*);
128  static void TimerAction(vtkAbstractWidget*);
129 
130  // Manage the state of the widget
133  {
134  Start=0,
135  Sliding
136  };
137 
138  int TimerId;
140  double StartTime;
141  double Value;
142 
143 private:
144  vtkCenteredSliderWidget(const vtkCenteredSliderWidget&) VTK_DELETE_FUNCTION;
145  void operator=(const vtkCenteredSliderWidget&) VTK_DELETE_FUNCTION;
146 };
147 
148 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
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
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
abstract class defines the representation for a vtkSliderWidget
define the API for widget / widget representation
set a value by manipulating a slider
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...