VTK  9.1.0
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
33class vtkProperty2D;
34class vtkActor2D;
35class vtkCoordinate;
37class vtkPolyData;
38class vtkGlyph2D;
39class vtkPoints;
41class vtkPointPlacer;
42
43class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
44{
45public:
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
130protected:
133
134 // Render the cursor
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 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
161private:
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:40
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
Standard methods for instances of this class.
void SetSelectedProperty(vtkProperty2D *)
Set/Get the handle properties when unselected and selected.
vtkPolyData * GetCursorShape()
Specify the cursor shape with an instance of vtkPolyData.
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:86
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)