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
27VTK_ABI_NAMESPACE_BEGIN
28class vtkProperty2D;
29class vtkActor2D;
30class vtkCoordinate;
32class vtkPolyData;
33class vtkGlyph2D;
34class vtkPoints;
36class vtkPointPlacer;
37
38class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
39{
40public:
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
125protected:
128
129 // Render the cursor
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
156private:
158 void operator=(const vtkPointHandleRepresentation2D&) = delete;
159};
160
161VTK_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
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.
vtkPolyData * GetCursorShape()
Specify the cursor shape with an instance of vtkPolyData.
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.
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:43
represent surface properties of a 2D image
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)