VTK: Interaction/Widgets/vtkPointHandleRepresentation2D.h Source File

| VTK 9.3.1

vtkPointHandleRepresentation2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkPointHandleRepresentation2D_h
31 #define vtkPointHandleRepresentation2D_h
32
33 #include "vtkHandleRepresentation.h"
34 #include "vtkInteractionWidgetsModule.h" // For export macro
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkProperty2D;
38 class vtkActor2D;
39 class vtkCoordinate;
40 class vtkPolyDataMapper2D;
41 class vtkPolyData;
42 class vtkGlyph2D;
43 class vtkPoints;
44 class vtkPolyDataAlgorithm;
45 class vtkPointPlacer;
46
47 class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation2D : public vtkHandleRepresentation
48 {
49 public:
53 static vtkPointHandleRepresentation2D* New();
54
56
59 vtkTypeMacro(vtkPointHandleRepresentation2D, vtkHandleRepresentation);
60 void PrintSelf(ostream& os, vtkIndent indent) override;
62
63 using vtkHandleRepresentation::Translate;
64
66
71 void SetCursorShape(vtkPolyData* cursorShape);
72 vtkPolyData* GetCursorShape();
74
80 void SetDisplayPosition(double xyz[3]) override;
81
83
86 void SetProperty(vtkProperty2D*);
87 void SetSelectedProperty(vtkProperty2D*);
88 vtkGetObjectMacro(Property, vtkProperty2D);
89 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
91
93
98 double* GetBounds() VTK_SIZEHINT(6) override;
99 void BuildRepresentation() override;
100 void StartWidgetInteraction(double eventPos[2]) override;
101 void WidgetInteraction(double eventPos[2]) override;
102 int ComputeInteractionState(int X, int Y, int modify = 0) override;
104
106
109 void ShallowCopy(vtkProp* prop) override;
110 void DeepCopy(vtkProp* prop) override;
111 void GetActors2D(vtkPropCollection*) override;
112 void ReleaseGraphicsResources(vtkWindow*) override;
113 int RenderOverlay(vtkViewport* viewport) override;
115
116 void Highlight(int highlight) override;
117
124 void SetPointPlacer(vtkPointPlacer*) override;
125
132 void SetVisibility(vtkTypeBool visible) override;
133
134 protected:
135 vtkPointHandleRepresentation2D();
136 ~vtkPointHandleRepresentation2D() override;
137
138 // Render the cursor
139 vtkActor2D* Actor;
140 vtkCoordinate* MapperCoordinate;
141 vtkPolyDataMapper2D* Mapper;
142 vtkGlyph2D* Glypher;
143 vtkPolyData* CursorShape;
144 vtkPolyData* FocalData;
145 vtkPoints* FocalPoint;
146
147 // Support picking
148 double LastPickPosition[3];
149 double LastEventPosition[2];
150
151 // Methods to manipulate the cursor
152 void Translate(const double* eventPos) override;
153 void Scale(const double eventPos[2]);
154
155 // Properties used to control the appearance of selected objects and
156 // the manipulator in general.
157 vtkProperty2D* Property;
158 vtkProperty2D* SelectedProperty;
159 void CreateDefaultProperties();
160
161 // The size of the hot spot.
162 int WaitingForMotion;
163 int WaitCount;
164
165 private:
166 vtkPointHandleRepresentation2D(const vtkPointHandleRepresentation2D&) = delete;
167 void operator=(const vtkPointHandleRepresentation2D&) = delete;
168 };
169
170 VTK_ABI_NAMESPACE_END
171 #endif
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:44
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
vtkGlyph2D
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:41
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:50
vtkHandleRepresentation::Translate
virtual void Translate(const double *p1, const double *p2)
Translates world position by vector p1p2 projected on the constraint axis if any.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPointHandleRepresentation2D
represent the position of a point in display coordinates
Definition: vtkPointHandleRepresentation2D.h:48
vtkPointHandleRepresentation2D::SetDisplayPosition
void SetDisplayPosition(double xyz[3]) override
Set/Get the position of the point in display coordinates.
vtkPointHandleRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkPointHandleRepresentation2D::SetSelectedProperty
void SetSelectedProperty(vtkProperty2D *)
Set/Get the handle properties when unselected and selected.
vtkPointHandleRepresentation2D::SetCursorShape
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape with an instance of vtkPolyData.
vtkPointHandleRepresentation2D::SetProperty
void SetProperty(vtkProperty2D *)
Set/Get the handle properties when unselected and selected.
vtkPointHandleRepresentation2D::GetBounds
double * GetBounds() override
Subclasses of vtkPointHandleRepresentation2D must implement these methods.
vtkPointHandleRepresentation2D::GetCursorShape
vtkPolyData * GetCursorShape()
Specify the cursor shape with an instance of vtkPolyData.
vtkPointHandleRepresentation2D::New
static vtkPointHandleRepresentation2D * New()
Instantiate this class.
vtkPointPlacer
Abstract interface to translate 2D display positions to world coordinates.
Definition: vtkPointPlacer.h:39
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:49
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:37
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:54
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkHandleRepresentation.h
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36