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 =========================================================================*/
74 #ifndef vtkCenteredSliderWidget_h
75 #define vtkCenteredSliderWidget_h
76 
77 #include "vtkInteractionWidgetsModule.h" // For export macro
78 #include "vtkAbstractWidget.h"
79 
81 
82 
83 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget
84 {
85 public:
89  static vtkCenteredSliderWidget *New();
90 
92 
96  void PrintSelf(ostream& os, vtkIndent indent) override;
98 
105  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
106 
111  {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);}
112 
116  void CreateDefaultRepresentation() override;
117 
121  double GetValue() { return this->Value; };
122 
123 protected:
126 
127  // These are the events that are handled
128  static void SelectAction(vtkAbstractWidget*);
129  static void EndSelectAction(vtkAbstractWidget*);
130  static void MoveAction(vtkAbstractWidget*);
131  static void TimerAction(vtkAbstractWidget*);
132 
133  // Manage the state of the widget
136  {
137  Start=0,
138  Sliding
139  };
140 
141  int TimerId;
143  double StartTime;
144  double Value;
145 
146 private:
148  void operator=(const vtkCenteredSliderWidget&) = delete;
149 };
150 
151 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
double GetValue()
Get the value fo this widget.
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:39
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...