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 =========================================================================*/
57 #ifndef vtkAbstractPicker_h
58 #define vtkAbstractPicker_h
59 
60 #include "vtkRenderingCoreModule.h" // For export macro
61 #include "vtkObject.h"
62 
63 class vtkRenderer;
64 class vtkProp;
65 class vtkPropCollection;
66 
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
74 
75  vtkGetObjectMacro(Renderer,vtkRenderer);
77 
79 
81  vtkGetVectorMacro(SelectionPoint,double,3);
83 
85 
86  vtkGetVectorMacro(PickPosition,double,3);
88 
90 
94  virtual int Pick(double selectionX, double selectionY, double selectionZ,
95  vtkRenderer *renderer) = 0;
97 
99 
102  int Pick(double selectionPt[3], vtkRenderer *ren)
103  {return this->Pick(selectionPt[0],selectionPt[1],selectionPt[2],ren);};
105 
107 
110  vtkSetMacro(PickFromList,int);
111  vtkGetMacro(PickFromList,int);
112  vtkBooleanMacro(PickFromList,int);
114 
116  void InitializePickList();
117 
119  void AddPickList(vtkProp *);
120 
122  void DeletePickList(vtkProp *);
123 
125  vtkPropCollection *GetPickList() {return this->PickList;}
126 
127 protected:
130 
131  virtual void Initialize();
132 
133  vtkRenderer *Renderer; //pick occurred in this renderer's viewport
134  double SelectionPoint[3]; //selection point in window (pixel) coordinates
135  double PickPosition[3]; //selection point in world coordinates
136 
137  // use the following to control picking from a list
140 private:
141  vtkAbstractPicker(const vtkAbstractPicker&); // Not implemented.
142  void operator=(const vtkAbstractPicker&); // Not implemented.
143 };
144 
145 #endif
146 
147 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPropCollection * GetPickList()
vtkRenderer * Renderer
abstract specification for renderers
Definition: vtkRenderer.h:63
a list of Props
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKRENDERINGCORE_EXPORT
define API for picking subclasses
vtkPropCollection * PickList
int Pick(double selectionPt[3], vtkRenderer *ren)