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 
38 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
39 
40 class vtkPoints;
41 class vtkCellArray;
42 class vtkPolyData;
44 class vtkActor2D;
45 class vtkCoordinate;
46 class vtkProperty2D;
47 class vtkPropCollection;
48 class vtkWindow;
49 class vtkViewport;
50 class vtkTransform;
52 class vtkTextProperty;
53 class vtkTextMapper;
54 class vtkTextActor;
55 
56 
58 {
59 public:
62 
64 
66  void PrintSelf(ostream& os, vtkIndent indent);
68 
75  vtkCoordinate *GetPoint1Coordinate();
76 
83  vtkCoordinate *GetPoint2Coordinate();
84 
86 
88  virtual void SetTitleText(const char*);
89  virtual const char* GetTitleText();
91 
93 
95  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
97 
99 
100  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
101  vtkGetObjectMacro(CapProperty,vtkProperty2D);
103 
105 
107  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
109 
111 
112  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
113  vtkGetObjectMacro(TitleProperty,vtkTextProperty);
115 
117 
120  virtual void PlaceWidget(double bounds[6]);
121  virtual void BuildRepresentation();
122  virtual void StartWidgetInteraction(double eventPos[2]);
123  virtual void WidgetInteraction(double newEventPos[2]);
124  virtual void Highlight(int);
126 
128 
129  virtual void GetActors2D(vtkPropCollection*);
130  virtual void ReleaseGraphicsResources(vtkWindow*);
131  virtual int RenderOverlay(vtkViewport*);
132  virtual int RenderOpaqueGeometry(vtkViewport*);
134 
135 protected:
138 
139  // Positioning the widget
142 
143  // Determine the parameter t along the slider
144  virtual double ComputePickPosition(double eventPos[2]);
145 
146  // Define the geometry. It is constructed in canaonical position
147  // along the x-axis and then rotated into position.
150 
157 
164 
171 
175 
179 
181 
182  // internal variables used for computation
183  double X;
184 
185 private:
186  vtkSliderRepresentation2D(const vtkSliderRepresentation2D&); //Not implemented
187  void operator=(const vtkSliderRepresentation2D&); //Not implemented
188 };
189 
190 #endif