VTK  9.0.3
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 =========================================================================*/
77 #ifndef vtkCenteredSliderWidget_h
78 #define vtkCenteredSliderWidget_h
79 
80 #include "vtkAbstractWidget.h"
81 #include "vtkInteractionWidgetsModule.h" // For export macro
82 
84 
85 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget
86 {
87 public:
92 
94 
98  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
107  {
108  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
109  }
110 
115  {
116  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
117  }
118 
123 
127  double GetValue() { return this->Value; }
128 
129 protected:
132 
133  // These are the events that are handled
138 
139  // Manage the state of the widget
142  {
143  Start = 0,
144  Sliding
145  };
146 
147  int TimerId;
149  double StartTime;
150  double Value;
151 
152 private:
154  void operator=(const vtkCenteredSliderWidget&) = delete;
155 };
156 
157 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
set a value by manipulating a slider
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
static vtkCenteredSliderWidget * New()
Instantiate the class.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
double GetValue()
Get the value fo this widget.
static void MoveAction(vtkAbstractWidget *)
static void TimerAction(vtkAbstractWidget *)
static void EndSelectAction(vtkAbstractWidget *)
static void SelectAction(vtkAbstractWidget *)
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract class defines the representation for a vtkSliderWidget
abstract class defines interface between the widget and widget representation classes