VTK  9.3.0
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);
65 
71  void SetDisplayPosition(double xyz[3]) override;
72 
74 
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:
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:
158  void operator=(const vtkPointHandleRepresentation2D&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:35
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:69
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:32
abstract class for representing widget handles
virtual void Translate(const double *p1, const double *p2)
Translates world position by vector p1p2 projected on the constraint axis if any.
a simple class to control print indentation
Definition: vtkIndent.h:29
represent the position of a point in display coordinates
void SetDisplayPosition(double xyz[3]) override
Set/Get the position of the point in display coordinates.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void SetSelectedProperty(vtkProperty2D *)
Set/Get the handle properties when unselected and selected.
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape with an instance of vtkPolyData.
void SetProperty(vtkProperty2D *)
Set/Get the handle properties when unselected and selected.
double * GetBounds() override
Subclasses of vtkPointHandleRepresentation2D must implement these methods.
vtkPolyData * GetCursorShape()
Specify the cursor shape with an instance of vtkPolyData.
static vtkPointHandleRepresentation2D * New()
Instantiate this class.
Abstract interface to translate 2D display positions to world coordinates.
represent and manipulate 3D points
Definition: vtkPoints.h:29
Superclass for algorithms that produce only polydata as output.
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
represent surface properties of a 2D image
Definition: vtkProperty2D.h:30
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:28
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)