VTK  9.0.20201019
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 =========================================================================*/
29 #ifndef vtkSliderRepresentation2D_h
30 #define vtkSliderRepresentation2D_h
31 
32 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 class vtkPoints;
37 class vtkCellArray;
38 class vtkPolyData;
40 class vtkActor2D;
41 class vtkCoordinate;
42 class vtkProperty2D;
43 class vtkPropCollection;
44 class vtkWindow;
45 class vtkViewport;
46 class vtkTransform;
48 class vtkTextProperty;
49 class vtkTextMapper;
50 class vtkTextActor;
51 
52 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
53 {
54 public:
59 
61 
65  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
76  vtkCoordinate* GetPoint1Coordinate();
77 
86  vtkCoordinate* GetPoint2Coordinate();
87 
89 
93  void SetTitleText(const char*) override;
94  const char* GetTitleText() override;
96 
98 
102  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
104 
106 
109  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
110  vtkGetObjectMacro(CapProperty, vtkProperty2D);
112 
114 
118  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
120 
122 
125  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
126  vtkGetObjectMacro(TitleProperty, vtkTextProperty);
128 
130 
135  void PlaceWidget(double bounds[6]) override;
136  void BuildRepresentation() override;
137  void StartWidgetInteraction(double eventPos[2]) override;
138  void WidgetInteraction(double newEventPos[2]) override;
139  void Highlight(int) override;
141 
143 
146  void GetActors2D(vtkPropCollection*) override;
147  void ReleaseGraphicsResources(vtkWindow*) override;
148  int RenderOverlay(vtkViewport*) override;
149  int RenderOpaqueGeometry(vtkViewport*) override;
151 
152 protected:
154  ~vtkSliderRepresentation2D() override;
155 
156  // Positioning the widget
159 
160  // Determine the parameter t along the slider
161  virtual double ComputePickPosition(double eventPos[2]);
162 
163  // Define the geometry. It is constructed in canaonical position
164  // along the x-axis and then rotated into position.
167 
174 
181 
188 
192 
196 
198 
199  // internal variables used for computation
200  double X;
201 
202 private:
204  void operator=(const vtkSliderRepresentation2D&) = delete;
205 };
206 
207 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:135
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkSliderRepresentation2D::TubeActor
vtkActor2D * TubeActor
Definition: vtkSliderRepresentation2D.h:179
vtkSliderRepresentation2D::LabelProperty
vtkTextProperty * LabelProperty
Definition: vtkSliderRepresentation2D.h:189
vtkSliderRepresentation2D::Cap
vtkPolyData * Cap
Definition: vtkSliderRepresentation2D.h:183
vtkSliderRepresentation2D::LabelActor
vtkActor2D * LabelActor
Definition: vtkSliderRepresentation2D.h:191
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkSliderRepresentation2D::Point1Coordinate
vtkCoordinate * Point1Coordinate
Definition: vtkSliderRepresentation2D.h:157
vtkSliderRepresentation2D::SliderXForm
vtkTransformPolyDataFilter * SliderXForm
Definition: vtkSliderRepresentation2D.h:170
vtkSliderRepresentation2D::SelectedProperty
vtkProperty2D * SelectedProperty
Definition: vtkSliderRepresentation2D.h:197
vtkSliderRepresentation2D::TubeXForm
vtkTransformPolyDataFilter * TubeXForm
Definition: vtkSliderRepresentation2D.h:177
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkWidgetRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
Definition: vtkWidgetRepresentation.h:211
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
vtkSliderRepresentation2D::TitleProperty
vtkTextProperty * TitleProperty
Definition: vtkSliderRepresentation2D.h:193
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkSliderRepresentation::SetTitleText
virtual void SetTitleText(const char *)
Specify the label text for this widget.
Definition: vtkSliderRepresentation.h:135
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:213
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkSliderRepresentation2D::Tube
vtkPolyData * Tube
Definition: vtkSliderRepresentation2D.h:176
vtkSliderRepresentation2D::CapXForm
vtkTransformPolyDataFilter * CapXForm
Definition: vtkSliderRepresentation2D.h:184
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkSliderRepresentation2D::TubeProperty
vtkProperty2D * TubeProperty
Definition: vtkSliderRepresentation2D.h:180
vtkSliderRepresentation2D::Points
vtkPoints * Points
Definition: vtkSliderRepresentation2D.h:166
vtkSliderRepresentation2D
provide the representation for a vtkSliderWidget with a 3D skin
Definition: vtkSliderRepresentation2D.h:52
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkSliderRepresentation2D::XForm
vtkTransform * XForm
Definition: vtkSliderRepresentation2D.h:165
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkSliderRepresentation2D::TitleMapper
vtkTextMapper * TitleMapper
Definition: vtkSliderRepresentation2D.h:194
vtkSliderRepresentation2D::SliderCells
vtkCellArray * SliderCells
Definition: vtkSliderRepresentation2D.h:168
vtkSliderRepresentation2D::SliderMapper
vtkPolyDataMapper2D * SliderMapper
Definition: vtkSliderRepresentation2D.h:171
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:45
vtkSliderRepresentation2D::Point2Coordinate
vtkCoordinate * Point2Coordinate
Definition: vtkSliderRepresentation2D.h:158
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkCoordinate.h
vtkSliderRepresentation2D::X
double X
Definition: vtkSliderRepresentation2D.h:200
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkSliderRepresentation2D::CapProperty
vtkProperty2D * CapProperty
Definition: vtkSliderRepresentation2D.h:187
vtkSliderRepresentation2D::TubeCells
vtkCellArray * TubeCells
Definition: vtkSliderRepresentation2D.h:175
vtkWidgetRepresentation::PlaceWidget
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkSliderRepresentation2D::CapCells
vtkCellArray * CapCells
Definition: vtkSliderRepresentation2D.h:182
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkSliderRepresentation.h
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:214
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:215
vtkSliderRepresentation2D::Slider
vtkPolyData * Slider
Definition: vtkSliderRepresentation2D.h:169
vtkSliderRepresentation::GetTitleText
virtual const char * GetTitleText()
Definition: vtkSliderRepresentation.h:136
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkSliderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkWidgetRepresentation::Highlight
virtual void Highlight(int vtkNotUsed(highlightOn))
Definition: vtkWidgetRepresentation.h:140
vtkSliderRepresentation2D::CapMapper
vtkPolyDataMapper2D * CapMapper
Definition: vtkSliderRepresentation2D.h:185
vtkSliderRepresentation
abstract class defines the representation for a vtkSliderWidget
Definition: vtkSliderRepresentation.h:44
vtkSliderRepresentation2D::LabelMapper
vtkTextMapper * LabelMapper
Definition: vtkSliderRepresentation2D.h:190
vtkSliderRepresentation2D::TitleActor
vtkActor2D * TitleActor
Definition: vtkSliderRepresentation2D.h:195
vtkSliderRepresentation2D::TubeMapper
vtkPolyDataMapper2D * TubeMapper
Definition: vtkSliderRepresentation2D.h:178
vtkSliderRepresentation2D::SliderProperty
vtkProperty2D * SliderProperty
Definition: vtkSliderRepresentation2D.h:173
vtkSliderRepresentation2D::CapActor
vtkActor2D * CapActor
Definition: vtkSliderRepresentation2D.h:186
vtkSliderRepresentation2D::SliderActor
vtkActor2D * SliderActor
Definition: vtkSliderRepresentation2D.h:172