VTK  9.1.0
vtkAbstractPicker.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAbstractPicker.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=========================================================================*/
87#ifndef vtkAbstractPicker_h
88#define vtkAbstractPicker_h
89
90#include "vtkObject.h"
91#include "vtkRenderingCoreModule.h" // For export macro
92
93class vtkRenderer;
94class vtkProp;
96
97class VTKRENDERINGCORE_EXPORT vtkAbstractPicker : public vtkObject
98{
99public:
101 void PrintSelf(ostream& os, vtkIndent indent) override;
102
104
107 vtkGetObjectMacro(Renderer, vtkRenderer);
109
111
115 vtkGetVectorMacro(SelectionPoint, double, 3);
117
119
122 vtkGetVectorMacro(PickPosition, double, 3);
124
131 virtual int Pick(
132 double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) = 0;
133
139 int Pick(double selectionPt[3], vtkRenderer* ren)
140 {
141 return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren);
142 }
143
149 virtual int Pick3DPoint(double /* selectionPt */[3], vtkRenderer* /*ren*/)
150 {
151 vtkErrorMacro("Pick3DPoint called without implementation");
152 return 0;
153 }
154
160 virtual int Pick3DRay(double /* selectionPt */[3], double /* orient */[4], vtkRenderer* /*ren*/)
161 {
162 vtkErrorMacro("Pick3DRay called without implementation");
163 return 0;
164 }
165
167
172 vtkSetMacro(PickFromList, vtkTypeBool);
173 vtkGetMacro(PickFromList, vtkTypeBool);
174 vtkBooleanMacro(PickFromList, vtkTypeBool);
176
181
186
191
195 vtkPropCollection* GetPickList() { return this->PickList; }
196
197protected:
200
201 virtual void Initialize();
202
203 vtkRenderer* Renderer; // pick occurred in this renderer's viewport
204 double SelectionPoint[3]; // selection point in window (pixel) coordinates
205 double PickPosition[3]; // selection point in world coordinates
206
207 // use the following to control picking from a list
210
211private:
212 vtkAbstractPicker(const vtkAbstractPicker&) = delete;
213 void operator=(const vtkAbstractPicker&) = delete;
214};
215
216#endif
define API for picking subclasses
vtkRenderer * Renderer
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool PickFromList
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:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
abstract specification for renderers
Definition: vtkRenderer.h:173
int vtkTypeBool
Definition: vtkABI.h:69