VTK  9.3.20240418
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
60 #ifndef vtkPointHandleRepresentation2D_h
61 #define vtkPointHandleRepresentation2D_h
62 
64 #include "vtkInteractionWidgetsModule.h" // For export macro
65 
66 VTK_ABI_NAMESPACE_BEGIN
67 class vtkProperty2D;
68 class vtkActor2D;
69 class vtkCoordinate;
71 class vtkPolyData;
72 class vtkGlyph2D;
73 class vtkPoints;
75 class vtkPointPlacer;
76 
77 class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
78 {
79 public:
84 
86 
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
94 
96 
101  void SetCursorShape(vtkPolyData* cursorShape);
104 
110  void SetDisplayPosition(double xyz[3]) override;
111 
113 
118  vtkGetObjectMacro(Property, vtkProperty2D);
119  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
121 
123 
128  double* GetBounds() VTK_SIZEHINT(6) override;
129  void BuildRepresentation() override;
130  void StartWidgetInteraction(double eventPos[2]) override;
131  void WidgetInteraction(double eventPos[2]) override;
132  int ComputeInteractionState(int X, int Y, int modify = 0) override;
134 
136 
139  void ShallowCopy(vtkProp* prop) override;
140  void DeepCopy(vtkProp* prop) override;
141  void GetActors2D(vtkPropCollection*) override;
142  void ReleaseGraphicsResources(vtkWindow*) override;
143  int RenderOverlay(vtkViewport* viewport) override;
145 
146  void Highlight(int highlight) override;
147 
154  void SetPointPlacer(vtkPointPlacer*) override;
155 
162  void SetVisibility(vtkTypeBool visible) override;
163 
164 protected:
167 
168  // Render the cursor
169  vtkActor2D* Actor;
170  vtkCoordinate* MapperCoordinate;
172  vtkGlyph2D* Glypher;
173  vtkPolyData* CursorShape;
174  vtkPolyData* FocalData;
175  vtkPoints* FocalPoint;
176 
177  // Support picking
178  double LastPickPosition[3];
179  double LastEventPosition[2];
180 
181  // Methods to manipulate the cursor
182  void Translate(const double* eventPos) override;
183  void Scale(const double eventPos[2]);
184 
185  // Properties used to control the appearance of selected objects and
186  // the manipulator in general.
187  vtkProperty2D* Property;
188  vtkProperty2D* SelectedProperty;
189  void CreateDefaultProperties();
190 
191  // The size of the hot spot.
192  int WaitingForMotion;
193  int WaitCount;
194 
195 private:
197  void operator=(const vtkPointHandleRepresentation2D&) = delete;
198 };
199 
200 VTK_ABI_NAMESPACE_END
201 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:145
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:61
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:108
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:139
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:181
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:66
represent surface properties of a 2D image
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)