VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkProperty2D;
30 class vtkActor2D;
31 class vtkCoordinate;
33 class vtkPolyData;
34 class vtkGlyph2D;
35 class vtkPoints;
37 class vtkPointPlacer;
38 
39 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkPointHandleRepresentation2D
41 {
42 public:
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
59 
64  void SetCursorShape(vtkPolyData* cursorShape);
65  vtkPolyData* GetCursorShape();
67 
73  void SetDisplayPosition(double xyz[3]) override;
74 
76 
79  void SetProperty(vtkProperty2D*);
80  void SetSelectedProperty(vtkProperty2D*);
81  vtkGetObjectMacro(Property, vtkProperty2D);
82  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
84 
86 
91  double* GetBounds() VTK_SIZEHINT(6) override;
92  void BuildRepresentation() override;
93  void StartWidgetInteraction(double eventPos[2]) override;
94  void WidgetInteraction(double eventPos[2]) override;
95  int ComputeInteractionState(int X, int Y, int modify = 0) override;
97 
99 
102  void ShallowCopy(vtkProp* prop) override;
103  void DeepCopy(vtkProp* prop) override;
104  void GetActors2D(vtkPropCollection*) override;
105  void ReleaseGraphicsResources(vtkWindow*) override;
106  int RenderOverlay(vtkViewport* viewport) override;
108 
109  void Highlight(int highlight) override;
110 
117  void SetPointPlacer(vtkPointPlacer*) override;
118 
125  void SetVisibility(vtkTypeBool visible) override;
126 
127 protected:
129  ~vtkPointHandleRepresentation2D() override;
130 
131  // Render the cursor
132  vtkActor2D* Actor;
133  vtkCoordinate* MapperCoordinate;
135  vtkGlyph2D* Glypher;
136  vtkPolyData* CursorShape;
137  vtkPolyData* FocalData;
138  vtkPoints* FocalPoint;
139 
140  // Support picking
141  double LastPickPosition[3];
142  double LastEventPosition[2];
143 
144  // Methods to manipulate the cursor
145  void Translate(const double* eventPos) override;
146  void Scale(const double eventPos[2]);
147 
148  // Properties used to control the appearance of selected objects and
149  // the manipulator in general.
150  vtkProperty2D* Property;
151  vtkProperty2D* SelectedProperty;
152  void CreateDefaultProperties();
153 
154  // The size of the hot spot.
155  int WaitingForMotion;
156  int WaitCount;
157 
158 private:
159  vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&) = delete;
160  void operator=(const vtkPointHandleRepresentation2D&) = delete;
161 };
162 
163 VTK_ABI_NAMESPACE_END
164 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:32
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:35
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
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:41
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:69
represent surface properties of a 2D image
Definition: vtkProperty2D.h:30
#define VTK_MARSHALAUTO
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:30