VTK
vtkSliderRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSliderRepresentation2D.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 =========================================================================*/
34 #ifndef __vtkSliderRepresentation2D_h
35 #define __vtkSliderRepresentation2D_h
36 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
40 
41 class vtkPoints;
42 class vtkCellArray;
43 class vtkPolyData;
45 class vtkActor2D;
46 class vtkCoordinate;
47 class vtkProperty2D;
48 class vtkPropCollection;
49 class vtkWindow;
50 class vtkViewport;
51 class vtkTransform;
53 class vtkTextProperty;
54 class vtkTextMapper;
55 class vtkTextActor;
56 
57 
58 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
59 {
60 public:
63 
65 
67  void PrintSelf(ostream& os, vtkIndent indent);
69 
76  vtkCoordinate *GetPoint1Coordinate();
77 
84  vtkCoordinate *GetPoint2Coordinate();
85 
87 
89  virtual void SetTitleText(const char*);
90  virtual const char* GetTitleText();
92 
94 
96  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
98 
100 
101  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
102  vtkGetObjectMacro(CapProperty,vtkProperty2D);
104 
106 
108  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
110 
112 
113  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
114  vtkGetObjectMacro(TitleProperty,vtkTextProperty);
116 
118 
121  virtual void PlaceWidget(double bounds[6]);
122  virtual void BuildRepresentation();
123  virtual void StartWidgetInteraction(double eventPos[2]);
124  virtual void WidgetInteraction(double newEventPos[2]);
125  virtual void Highlight(int);
127 
129 
130  virtual void GetActors2D(vtkPropCollection*);
131  virtual void ReleaseGraphicsResources(vtkWindow*);
132  virtual int RenderOverlay(vtkViewport*);
133  virtual int RenderOpaqueGeometry(vtkViewport*);
135 
136 protected:
139 
140  // Positioning the widget
143 
144  // Determine the parameter t along the slider
145  virtual double ComputePickPosition(double eventPos[2]);
146 
147  // Define the geometry. It is constructed in canaonical position
148  // along the x-axis and then rotated into position.
151 
158 
165 
172 
176 
180 
182 
183  // internal variables used for computation
184  double X;
185 
186 private:
187  vtkSliderRepresentation2D(const vtkSliderRepresentation2D&); //Not implemented
188  void operator=(const vtkSliderRepresentation2D&); //Not implemented
189 };
190 
191 #endif