VTK  9.3.1
vtkCenteredSliderRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4 
19 #ifndef vtkCenteredSliderRepresentation_h
20 #define vtkCenteredSliderRepresentation_h
21 
22 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
23 #include "vtkInteractionWidgetsModule.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkPoints;
28 class vtkCellArray;
29 class vtkPolyData;
31 class vtkActor2D;
32 class vtkCoordinate;
33 class vtkProperty2D;
34 class vtkPropCollection;
35 class vtkWindow;
36 class vtkViewport;
37 class vtkTransform;
39 class vtkTextProperty;
40 class vtkTextMapper;
41 class vtkTextActor;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderRepresentation : public vtkSliderRepresentation
44 {
45 public:
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
67  vtkCoordinate* GetPoint1Coordinate();
68 
77  vtkCoordinate* GetPoint2Coordinate();
78 
80 
84  void SetTitleText(const char*) override;
85  const char* GetTitleText() override;
87 
89 
92  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
93  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
95 
97 
101  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
103 
105 
108  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
110 
112 
117  void PlaceWidget(double bounds[6]) override;
118  void BuildRepresentation() override;
119  void StartWidgetInteraction(double eventPos[2]) override;
120  int ComputeInteractionState(int X, int Y, int modify = 0) override;
121  void WidgetInteraction(double eventPos[2]) override;
122  void Highlight(int) override;
124 
126 
129  void GetActors(vtkPropCollection* propCollections) override;
130  void ReleaseGraphicsResources(vtkWindow* window) override;
131  int RenderOverlay(vtkViewport*) override;
132  int RenderOpaqueGeometry(vtkViewport*) override;
134 
135 protected:
138 
139  // Positioning the widget
142 
143  // Determine the parameter t along the slider
144  virtual double ComputePickPosition(double x, double y);
145 
146  // Define the geometry. It is constructed in canaonical position
147  // along the x-axis and then rotated into position.
150 
157 
164 
167 
170 
171  // build the tube geometry
172  void BuildTube();
173 
174 private:
175  // how many points along the tube
176  int ArcCount;
177  double ArcStart;
178  double ArcEnd;
179  double ButtonSize;
180  double TubeSize;
181 
183  void operator=(const vtkCenteredSliderRepresentation&) = delete;
184 };
185 
186 VTK_ABI_NAMESPACE_END
187 #endif
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:44
virtual void StartWidgetInteraction(double eventPos[2])
a actor that draws 2D data
Definition: vtkActor2D.h:34
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
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.
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
2D text annotation
Definition: vtkTextMapper.h:39
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
An actor that displays text.
Definition: vtkTextActor.h:45
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
abstract class defines the representation for a vtkSliderWidget
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:175
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
provide the representation for a vtkCenteredSliderWidget
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual const char * GetTitleText()
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
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:28