VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkPoints;
29 class vtkCellArray;
30 class vtkPolyData;
32 class vtkActor2D;
33 class vtkCoordinate;
34 class vtkProperty2D;
35 class vtkPropCollection;
36 class vtkWindow;
37 class vtkViewport;
38 class vtkTransform;
39 class vtkTransformFilter;
40 class vtkTextProperty;
41 class vtkTextMapper;
42 class vtkTextActor;
43 
44 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCenteredSliderRepresentation
46 {
47 public:
52 
54 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
69  vtkCoordinate* GetPoint1Coordinate();
70 
79  vtkCoordinate* GetPoint2Coordinate();
80 
82 
86  void SetTitleText(const char*) override;
87  const char* GetTitleText() override;
89 
91 
94  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
95  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
97 
99 
103  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
105 
107 
110  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
112 
114 
119  void PlaceWidget(double bounds[6]) override;
120  void BuildRepresentation() override;
121  void StartWidgetInteraction(double eventPos[2]) override;
122  int ComputeInteractionState(int X, int Y, int modify = 0) override;
123  void WidgetInteraction(double eventPos[2]) override;
124  void Highlight(int) override;
126 
128 
131  void GetActors(vtkPropCollection* propCollections) override;
132  void ReleaseGraphicsResources(vtkWindow* window) override;
133  int RenderOverlay(vtkViewport*) override;
134  int RenderOpaqueGeometry(vtkViewport*) override;
136 
137 protected:
140 
141  // Positioning the widget
144 
145  // Determine the parameter t along the slider
146  virtual double ComputePickPosition(double x, double y);
147 
148  // Define the geometry. It is constructed in canaonical position
149  // along the x-axis and then rotated into position.
152 
159 
166 
169 
172 
173  // build the tube geometry
174  void BuildTube();
175 
176 private:
177  // how many points along the tube
178  int ArcCount;
179  double ArcStart;
180  double ArcEnd;
181  double ButtonSize;
182  double TubeSize;
183 
185  void operator=(const vtkCenteredSliderRepresentation&) = delete;
186 };
187 
188 VTK_ABI_NAMESPACE_END
189 #endif
virtual void PlaceWidget(double 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:46
virtual void StartWidgetInteraction(double eventPos[2])
a actor that draws 2D data
Definition: vtkActor2D.h:35
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
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:41
An actor that displays text.
Definition: vtkTextActor.h:48
a simple class to control print indentation
Definition: vtkIndent.h:28
int RenderOverlay(vtkViewport *viewport) override
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])
virtual void Highlight(int highlightOn)
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
abstract class defines the representation for a vtkSliderWidget
object to represent cell connectivity
Definition: vtkCellArray.h:177
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
provide the representation for a vtkCenteredSliderWidget
transform points and associated normals and vectors
virtual const char * GetTitleText()
represent surface properties of a 2D image
Definition: vtkProperty2D.h:30
#define VTK_MARSHALAUTO
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:30