VTK
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 
30 #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 
65  void SetCursorShape(vtkPolyData *cursorShape);
66  vtkPolyData *GetCursorShape();
68 
74  void SetDisplayPosition(double xyz[3]) override;
75 
77 
80  void SetProperty(vtkProperty2D*);
81  void SetSelectedProperty(vtkProperty2D*);
82  vtkGetObjectMacro(Property,vtkProperty2D);
83  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
85 
87 
92  double *GetBounds() VTK_SIZEHINT(6) override;
93  void BuildRepresentation() override;
94  void StartWidgetInteraction(double eventPos[2]) override;
95  void WidgetInteraction(double eventPos[2]) override;
96  int ComputeInteractionState(int X, int Y, int modify=0) override;
98 
100 
103  void ShallowCopy(vtkProp *prop) override;
104  void DeepCopy(vtkProp *prop) override;
105  void GetActors2D(vtkPropCollection *) override;
106  void ReleaseGraphicsResources(vtkWindow *) override;
107  int RenderOverlay(vtkViewport *viewport) override;
109 
110  void Highlight(int highlight) override;
111 
118  void SetPointPlacer ( vtkPointPlacer * ) override;
119 
120 protected:
122  ~vtkPointHandleRepresentation2D() override;
123 
124  // Render the cursor
125  vtkActor2D *Actor;
126  vtkCoordinate *MapperCoordinate;
128  vtkGlyph2D *Glypher;
129  vtkPolyData *CursorShape;
130  vtkPolyData *FocalData;
131  vtkPoints *FocalPoint;
132 
133  // Support picking
134  double LastPickPosition[3];
135  double LastEventPosition[2];
136 
137  // Methods to manipulate the cursor
138  int ConstraintAxis;
139  void Translate(double eventPos[2]);
140  void Scale(double eventPos[2]);
141 
142  // Properties used to control the appearance of selected objects and
143  // the manipulator in general.
144  vtkProperty2D *Property;
145  vtkProperty2D *SelectedProperty;
146  void CreateDefaultProperties();
147 
148  // The size of the hot spot.
149  int DetermineConstraintAxis(int constraint, double eventPos[2]);
150  int WaitingForMotion;
151  int WaitCount;
152 
153 private:
155  void operator=(const vtkPointHandleRepresentation2D&) = delete;
156 };
157 
158 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:36
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
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:72
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
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:33