VTK  9.0.1
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);
68  vtkPolyData* GetCursorShape();
70 
76  void SetDisplayPosition(double xyz[3]) override;
77 
79 
82  void SetProperty(vtkProperty2D*);
83  void SetSelectedProperty(vtkProperty2D*);
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:
132  ~vtkPointHandleRepresentation2D() override;
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkPointPlacer
Abstract interface to translate 2D display positions to world coordinates.
Definition: vtkPointPlacer.h:49
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkGlyph2D
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:36
vtkHandleRepresentation.h
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkHandleRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkPointHandleRepresentation2D
represent the position of a point in display coordinates
Definition: vtkPointHandleRepresentation2D.h:43
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkHandleRepresentation::Translate
virtual void Translate(const double *p1, const double *p2)
Translates world position by vector p1p2 projected on the constraint axis if any.
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkHandleRepresentation::SetDisplayPosition
virtual void SetDisplayPosition(double pos[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41