VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
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:50
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPropCollection * GetPickList()
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
vtkRenderer * Renderer
abstract specification for renderers
Definition: vtkRenderer.h:63
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
a list of Props
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
#define VTKRENDERINGCORE_EXPORT
define API for picking subclasses
vtkPropCollection * PickList
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:414
int Pick(double selectionPt[3], vtkRenderer *ren)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69