VTK  9.0.2
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 "vtkCoordinate.h" // For vtkViewportCoordinateMacro
40 #include "vtkInteractionWidgetsModule.h" // For export macro
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 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderRepresentation : public vtkSliderRepresentation
60 {
61 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
84 
94 
96 
100  void SetTitleText(const char*) override;
101  const char* GetTitleText() override;
103 
105 
108  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
109  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
111 
113 
117  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
119 
121 
124  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
126 
128 
133  void PlaceWidget(double bounds[6]) override;
134  void BuildRepresentation() override;
135  void StartWidgetInteraction(double eventPos[2]) override;
136  int ComputeInteractionState(int X, int Y, int modify = 0) override;
137  void WidgetInteraction(double eventPos[2]) override;
138  void Highlight(int) override;
140 
142 
145  void GetActors(vtkPropCollection*) override;
147  int RenderOverlay(vtkViewport*) override;
150 
151 protected:
154 
155  // Positioning the widget
158 
159  // Determine the parameter t along the slider
160  virtual double ComputePickPosition(double x, double y);
161 
162  // Define the geometry. It is constructed in canaonical position
163  // along the x-axis and then rotated into position.
166 
173 
180 
183 
186 
187  // build the tube geometry
188  void BuildTube();
189 
190 private:
191  // how many points along the tube
192  int ArcCount;
193  double ArcStart;
194  double ArcEnd;
195  double ButtonSize;
196  double TubeSize;
197 
199  void operator=(const vtkCenteredSliderRepresentation&) = delete;
200 };
201 
202 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
object to represent cell connectivity
Definition: vtkCellArray.h:180
provide the representation for a vtkCenteredSliderWidget
void WidgetInteraction(double eventPos[2]) override
void BuildRepresentation() override
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
int RenderOverlay(vtkViewport *) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Highlight(int) override
void StartWidgetInteraction(double eventPos[2]) override
virtual double ComputePickPosition(double x, double y)
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
const char * GetTitleText() override
void GetActors(vtkPropCollection *) override
Methods supporting the rendering process.
static vtkCenteredSliderRepresentation * New()
Instantiate the class.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
int ComputeInteractionState(int X, int Y, int modify=0) override
void SetTitleText(const char *) override
Specify the label text for this widget.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
abstract class defines the representation for a vtkSliderWidget
An actor that displays text.
Definition: vtkTextActor.h:51
2D text annotation
Definition: vtkTextMapper.h:48
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38