VTK  9.0.3
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 =========================================================================*/
27 #ifndef vtkPointHandleRepresentation2D_h
28 #define vtkPointHandleRepresentation2D_h
29 
31 #include "vtkInteractionWidgetsModule.h" // For export macro
32 
33 class vtkProperty2D;
34 class vtkActor2D;
35 class vtkCoordinate;
37 class vtkPolyData;
38 class vtkGlyph2D;
39 class vtkPoints;
41 class vtkPointPlacer;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
44 {
45 public:
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
62 
67  void SetCursorShape(vtkPolyData* cursorShape);
70 
76  void SetDisplayPosition(double xyz[3]) override;
77 
79 
84  vtkGetObjectMacro(Property, vtkProperty2D);
85  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
87 
89 
94  double* GetBounds() VTK_SIZEHINT(6) override;
95  void BuildRepresentation() override;
96  void StartWidgetInteraction(double eventPos[2]) override;
97  void WidgetInteraction(double eventPos[2]) override;
98  int ComputeInteractionState(int X, int Y, int modify = 0) override;
100 
102 
105  void ShallowCopy(vtkProp* prop) override;
106  void DeepCopy(vtkProp* prop) override;
107  void GetActors2D(vtkPropCollection*) override;
108  void ReleaseGraphicsResources(vtkWindow*) override;
109  int RenderOverlay(vtkViewport* viewport) override;
111 
112  void Highlight(int highlight) override;
113 
120  void SetPointPlacer(vtkPointPlacer*) override;
121 
128  void SetVisibility(vtkTypeBool visible) override;
129 
130 protected:
133 
134  // Render the cursor
135  vtkActor2D* Actor;
136  vtkCoordinate* MapperCoordinate;
138  vtkGlyph2D* Glypher;
139  vtkPolyData* CursorShape;
140  vtkPolyData* FocalData;
141  vtkPoints* FocalPoint;
142 
143  // Support picking
144  double LastPickPosition[3];
145  double LastEventPosition[2];
146 
147  // Methods to manipulate the cursor
148  virtual void Translate(const double* eventPos) override;
149  void Scale(const double eventPos[2]);
150 
151  // Properties used to control the appearance of selected objects and
152  // the manipulator in general.
153  vtkProperty2D* Property;
154  vtkProperty2D* SelectedProperty;
155  void CreateDefaultProperties();
156 
157  // The size of the hot spot.
158  int WaitingForMotion;
159  int WaitCount;
160 
161 private:
163  void operator=(const vtkPointHandleRepresentation2D&) = delete;
164 };
165 
166 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:37
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:34
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
Methods invoked by print to print information about the object including superclasses.
void SetSelectedProperty(vtkProperty2D *)
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:34
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:85
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:54
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)