VTK
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 =========================================================================*/
58 #ifndef vtkAbstractPicker_h
59 #define vtkAbstractPicker_h
60 
61 #include "vtkRenderingCoreModule.h" // For export macro
62 #include "vtkObject.h"
63 
64 class vtkRenderer;
65 class vtkProp;
66 class vtkPropCollection;
67 
68 class VTKRENDERINGCORE_EXPORT vtkAbstractPicker : public vtkObject
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
75 
78  vtkGetObjectMacro(Renderer,vtkRenderer);
80 
82 
86  vtkGetVectorMacro(SelectionPoint,double,3);
88 
90 
93  vtkGetVectorMacro(PickPosition,double,3);
95 
102  virtual int Pick(double selectionX, double selectionY, double selectionZ,
103  vtkRenderer *renderer) = 0;
104 
110  int Pick(double selectionPt[3], vtkRenderer *ren)
111  {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};
112 
114 
119  vtkSetMacro(PickFromList,int);
120  vtkGetMacro(PickFromList,int);
121  vtkBooleanMacro(PickFromList,int);
123 
127  void InitializePickList();
128 
132  void AddPickList(vtkProp *);
133 
137  void DeletePickList(vtkProp *);
138 
142  vtkPropCollection *GetPickList() {return this->PickList;}
143 
144 protected:
147 
148  virtual void Initialize();
149 
150  vtkRenderer *Renderer; //pick occurred in this renderer's viewport
151  double SelectionPoint[3]; //selection point in window (pixel) coordinates
152  double PickPosition[3]; //selection point in world coordinates
153 
154  // use the following to control picking from a list
157 private:
158  vtkAbstractPicker(const vtkAbstractPicker&) VTK_DELETE_FUNCTION;
159  void operator=(const vtkAbstractPicker&) VTK_DELETE_FUNCTION;
160 };
161 
162 #endif
163 
164 
vtkAbstractPicker::GetPickList
vtkPropCollection * GetPickList()
Return the list of actors in the PickList.
Definition: vtkAbstractPicker.h:142
vtkAbstractPicker::Pick
int Pick(double selectionPt[3], vtkRenderer *ren)
provided.
Definition: vtkAbstractPicker.h:110
vtkAbstractPicker::Renderer
vtkRenderer * Renderer
Definition: vtkAbstractPicker.h:150
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:68
vtkAbstractPicker::PickFromList
int PickFromList
Definition: vtkAbstractPicker.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkAbstractPicker::PickList
vtkPropCollection * PickList
Definition: vtkAbstractPicker.h:156
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38