VTK  9.3.0
vtkAbstractPicker.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
46#ifndef vtkAbstractPicker_h
47#define vtkAbstractPicker_h
48
49#include "vtkObject.h"
50#include "vtkRenderingCoreModule.h" // For export macro
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkRenderer;
54class vtkProp;
56
57class VTKRENDERINGCORE_EXPORT vtkAbstractPicker : public vtkObject
58{
59public:
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
64
67 vtkGetObjectMacro(Renderer, vtkRenderer);
69
71
75 vtkGetVectorMacro(SelectionPoint, double, 3);
77
79
82 vtkGetVectorMacro(PickPosition, double, 3);
84
91 virtual int Pick(
92 double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) = 0;
93
99 int Pick(double selectionPt[3], vtkRenderer* ren)
100 {
101 return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren);
102 }
103
109 virtual int Pick3DPoint(double /* selectionPt */[3], vtkRenderer* /*ren*/)
110 {
111 vtkErrorMacro("Pick3DPoint called without implementation");
112 return 0;
113 }
114
120 virtual int Pick3DRay(double /* selectionPt */[3], double /* orient */[4], vtkRenderer* /*ren*/)
121 {
122 vtkErrorMacro("Pick3DRay called without implementation");
123 return 0;
124 }
125
127
132 vtkSetMacro(PickFromList, vtkTypeBool);
133 vtkGetMacro(PickFromList, vtkTypeBool);
134 vtkBooleanMacro(PickFromList, vtkTypeBool);
136
141
146
151
155 vtkPropCollection* GetPickList() { return this->PickList; }
156
157protected:
160
161 virtual void Initialize();
162
163 vtkRenderer* Renderer; // pick occurred in this renderer's viewport
164 double SelectionPoint[3]; // selection point in window (pixel) coordinates
165 double PickPosition[3]; // selection point in world coordinates
166
167 // use the following to control picking from a list
170
171private:
172 vtkAbstractPicker(const vtkAbstractPicker&) = delete;
173 void operator=(const vtkAbstractPicker&) = delete;
174};
175
176VTK_ABI_NAMESPACE_END
177#endif
define API for picking subclasses
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer)=0
Perform pick operation with selection point provided.
vtkPropCollection * GetPickList()
Return the list of actors in the PickList.
virtual void Initialize()
virtual int Pick3DRay(double[3], double[4], vtkRenderer *)
Perform pick operation with selection point and orientation provided.
void DeletePickList(vtkProp *)
Delete an actor from the pick list.
~vtkAbstractPicker() override
void AddPickList(vtkProp *)
Add an actor to the pick list.
void InitializePickList()
Initialize list of actors in pick list.
virtual int Pick3DPoint(double[3], vtkRenderer *)
Perform pick operation with selection point provided.
int Pick(double selectionPt[3], vtkRenderer *ren)
provided.
vtkPropCollection * PickList
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
abstract specification for renderers
Definition vtkRenderer.h:59
int vtkTypeBool
Definition vtkABI.h:64