VTK  9.3.1
vtkPointHandleRepresentation2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkPointHandleRepresentation2D_h
22 #define vtkPointHandleRepresentation2D_h
23 
25 #include "vtkInteractionWidgetsModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkProperty2D;
29 class vtkActor2D;
30 class vtkCoordinate;
32 class vtkPolyData;
33 class vtkGlyph2D;
34 class vtkPoints;
36 class vtkPointPlacer;
37 
38 class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
39 {
40 public:
45 
47 
51  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
57 
62  void SetCursorShape(vtkPolyData* cursorShape);
63  vtkPolyData* GetCursorShape();
65 
71  void SetDisplayPosition(double xyz[3]) override;
72 
74 
77  void SetProperty(vtkProperty2D*);
78  void SetSelectedProperty(vtkProperty2D*);
79  vtkGetObjectMacro(Property, vtkProperty2D);
80  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
82 
84 
89  double* GetBounds() VTK_SIZEHINT(6) override;
90  void BuildRepresentation() override;
91  void StartWidgetInteraction(double eventPos[2]) override;
92  void WidgetInteraction(double eventPos[2]) override;
93  int ComputeInteractionState(int X, int Y, int modify = 0) override;
95 
97 
100  void ShallowCopy(vtkProp* prop) override;
101  void DeepCopy(vtkProp* prop) override;
102  void GetActors2D(vtkPropCollection*) override;
103  void ReleaseGraphicsResources(vtkWindow*) override;
104  int RenderOverlay(vtkViewport* viewport) override;
106 
107  void Highlight(int highlight) override;
108 
115  void SetPointPlacer(vtkPointPlacer*) override;
116 
123  void SetVisibility(vtkTypeBool visible) override;
124 
125 protected:
127  ~vtkPointHandleRepresentation2D() override;
128 
129  // Render the cursor
130  vtkActor2D* Actor;
131  vtkCoordinate* MapperCoordinate;
133  vtkGlyph2D* Glypher;
134  vtkPolyData* CursorShape;
135  vtkPolyData* FocalData;
136  vtkPoints* FocalPoint;
137 
138  // Support picking
139  double LastPickPosition[3];
140  double LastEventPosition[2];
141 
142  // Methods to manipulate the cursor
143  void Translate(const double* eventPos) override;
144  void Scale(const double eventPos[2]);
145 
146  // Properties used to control the appearance of selected objects and
147  // the manipulator in general.
148  vtkProperty2D* Property;
149  vtkProperty2D* SelectedProperty;
150  void CreateDefaultProperties();
151 
152  // The size of the hot spot.
153  int WaitingForMotion;
154  int WaitCount;
155 
156 private:
157  vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&) = delete;
158  void operator=(const vtkPointHandleRepresentation2D&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:31
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
Superclass for algorithms that produce only polydata as output.
virtual void SetDisplayPosition(double pos[2])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
a simple class to control print indentation
Definition: vtkIndent.h:28
Abstract interface to translate 2D display positions to world coordinates.
represent the position of a point in display coordinates
#define VTK_SIZEHINT(...)
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Translate(const double *p1, const double *p2)
Translates world position by vector p1p2 projected on the constraint axis if any. ...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28