VTK  9.2.6
vtkPointHandleRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointHandleRepresentation2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkPointHandleRepresentation2D_h
34 #define vtkPointHandleRepresentation2D_h
35 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
38 
39 class vtkProperty2D;
40 class vtkActor2D;
41 class vtkCoordinate;
43 class vtkPolyData;
44 class vtkGlyph2D;
45 class vtkPoints;
47 class vtkPointPlacer;
48 
49 class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
50 {
51 public:
56 
58 
62  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
68 
73  void SetCursorShape(vtkPolyData* cursorShape);
74  vtkPolyData* GetCursorShape();
76 
82  void SetDisplayPosition(double xyz[3]) override;
83 
85 
88  void SetProperty(vtkProperty2D*);
89  void SetSelectedProperty(vtkProperty2D*);
90  vtkGetObjectMacro(Property, vtkProperty2D);
91  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
93 
95 
100  double* GetBounds() VTK_SIZEHINT(6) override;
101  void BuildRepresentation() override;
102  void StartWidgetInteraction(double eventPos[2]) override;
103  void WidgetInteraction(double eventPos[2]) override;
104  int ComputeInteractionState(int X, int Y, int modify = 0) override;
106 
108 
111  void ShallowCopy(vtkProp* prop) override;
112  void DeepCopy(vtkProp* prop) override;
113  void GetActors2D(vtkPropCollection*) override;
114  void ReleaseGraphicsResources(vtkWindow*) override;
115  int RenderOverlay(vtkViewport* viewport) override;
117 
118  void Highlight(int highlight) override;
119 
126  void SetPointPlacer(vtkPointPlacer*) override;
127 
134  void SetVisibility(vtkTypeBool visible) override;
135 
136 protected:
138  ~vtkPointHandleRepresentation2D() override;
139 
140  // Render the cursor
141  vtkActor2D* Actor;
142  vtkCoordinate* MapperCoordinate;
144  vtkGlyph2D* Glypher;
145  vtkPolyData* CursorShape;
146  vtkPolyData* FocalData;
147  vtkPoints* FocalPoint;
148 
149  // Support picking
150  double LastPickPosition[3];
151  double LastEventPosition[2];
152 
153  // Methods to manipulate the cursor
154  void Translate(const double* eventPos) override;
155  void Scale(const double eventPos[2]);
156 
157  // Properties used to control the appearance of selected objects and
158  // the manipulator in general.
159  vtkProperty2D* Property;
160  vtkProperty2D* SelectedProperty;
161  void CreateDefaultProperties();
162 
163  // The size of the hot spot.
164  int WaitingForMotion;
165  int WaitCount;
166 
167 private:
168  vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&) = delete;
169  void operator=(const vtkPointHandleRepresentation2D&) = delete;
170 };
171 
172 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:42
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:55
a actor that draws 2D data
Definition: vtkActor2D.h:45
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
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:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
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:79
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
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. ...
virtual void SetDisplayPosition(double pos[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:39