VTK
vtkCenteredSliderRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCenteredSliderRepresentation.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 =========================================================================*/
15 
16 /*-------------------------------------------------------------------------
17  Copyright 2008 Sandia Corporation.
18  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19  the U.S. Government retains certain rights in this software.
20 -------------------------------------------------------------------------*/
21 
36 #ifndef vtkCenteredSliderRepresentation_h
37 #define vtkCenteredSliderRepresentation_h
38 
39 #include "vtkInteractionWidgetsModule.h" // For export macro
41 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
42 
43 class vtkPoints;
44 class vtkCellArray;
45 class vtkPolyData;
47 class vtkActor2D;
48 class vtkCoordinate;
49 class vtkProperty2D;
50 class vtkPropCollection;
51 class vtkWindow;
52 class vtkViewport;
53 class vtkTransform;
55 class vtkTextProperty;
56 class vtkTextMapper;
57 class vtkTextActor;
58 
59 
60 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderRepresentation : public vtkSliderRepresentation
61 {
62 public:
67 
69 
74  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
76 
85  vtkCoordinate *GetPoint1Coordinate();
86 
95  vtkCoordinate *GetPoint2Coordinate();
96 
98 
102  void SetTitleText(const char*) VTK_OVERRIDE;
103  const char* GetTitleText() VTK_OVERRIDE;
105 
107 
110  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
111  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
113 
115 
119  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
121 
123 
126  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
128 
130 
135  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
136  void BuildRepresentation() VTK_OVERRIDE;
137  void StartWidgetInteraction(double eventPos[2]) VTK_OVERRIDE;
138  int ComputeInteractionState(int X, int Y, int modify=0) VTK_OVERRIDE;
139  void WidgetInteraction(double eventPos[2]) VTK_OVERRIDE;
140  void Highlight(int) VTK_OVERRIDE;
142 
144 
147  void GetActors(vtkPropCollection*) VTK_OVERRIDE;
148  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
149  int RenderOverlay(vtkViewport*) VTK_OVERRIDE;
150  int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
152 
153 protected:
155  ~vtkCenteredSliderRepresentation() VTK_OVERRIDE;
156 
157  // Positioning the widget
158  vtkCoordinate *Point1Coordinate;
159  vtkCoordinate *Point2Coordinate;
160 
161  // Determine the parameter t along the slider
162  virtual double ComputePickPosition(double x, double y);
163 
164  // Define the geometry. It is constructed in canaonical position
165  // along the x-axis and then rotated into position.
166  vtkTransform *XForm;
167  vtkPoints *Points;
168 
169  vtkCellArray *SliderCells;
170  vtkPolyData *Slider;
172  vtkPolyDataMapper2D *SliderMapper;
173  vtkActor2D *SliderActor;
174  vtkProperty2D *SliderProperty;
175 
176  vtkCellArray *TubeCells;
177  vtkPolyData *Tube;
179  vtkPolyDataMapper2D *TubeMapper;
180  vtkActor2D *TubeActor;
181  vtkProperty2D *TubeProperty;
182 
183  vtkTextProperty *LabelProperty;
184  vtkTextActor *LabelActor;
185 
186  vtkProperty2D *SelectedProperty;
187  int HighlightState;
188 
189  // build the tube geometry
190  void BuildTube();
191 
192 private:
193 
194  // how many points along the tube
195  int ArcCount;
196  double ArcStart;
197  double ArcEnd;
198  double ButtonSize;
199  double TubeSize;
200 
202  (const vtkCenteredSliderRepresentation&) VTK_DELETE_FUNCTION;
203  void operator=(const vtkCenteredSliderRepresentation&) VTK_DELETE_FUNCTION;
204 };
205 
206 #endif
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void SetTitleText(const char *)
Specify the label text for this widget.
2D text annotation
Definition: vtkTextMapper.h:47
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
An actor that displays text.
Definition: vtkTextActor.h:50
a simple class to control print indentation
Definition: vtkIndent.h:33
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
abstract class defines the representation for a vtkSliderWidget
object to represent cell connectivity
Definition: vtkCellArray.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
provide the representation for a vtkCenteredSliderWidget
virtual const char * GetTitleText()
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:33