VTK
vtkAreaPicker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAreaPicker.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 =========================================================================*/
47 #ifndef vtkAreaPicker_h
48 #define vtkAreaPicker_h
49 
50 #include "vtkRenderingCoreModule.h" // For export macro
51 #include "vtkAbstractPropPicker.h"
52 
53 class vtkRenderer;
54 class vtkPoints;
55 class vtkPlanes;
58 class vtkDataSet;
60 class vtkProp;
61 
62 class VTKRENDERINGCORE_EXPORT vtkAreaPicker : public vtkAbstractPropPicker
63 {
64 public:
65  static vtkAreaPicker *New();
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
72  void SetPickCoords(double x0, double y0, double x1, double y1);
73 
78 
82  virtual int Pick();
83 
89  virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer *renderer = NULL);
90 
96  virtual int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer = NULL)
97  { return this->AreaPick(x0, y0, x0+1.0, y0+1.0, renderer); }
98 
100 
103  vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
105 
107 
111  vtkGetObjectMacro(DataSet, vtkDataSet);
113 
119  { return this->Prop3Ds; }
120 
122 
127  vtkGetObjectMacro(Frustum, vtkPlanes);
129 
131 
134  vtkGetObjectMacro(ClipPoints, vtkPoints);
136 
137 protected:
140 
141  virtual void Initialize();
142  void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *);
143  virtual int PickProps(vtkRenderer *renderer);
145 
146  int ABoxFrustumIsect(double bounds[], double &mindist);
147 
150 
151  vtkProp3DCollection *Prop3Ds; //candidate actors (based on bounding box)
152  vtkAbstractMapper3D *Mapper; //selected mapper (if the prop has a mapper)
153  vtkDataSet *DataSet; //selected dataset (if there is one)
154 
155  //used internally to do prop intersection tests
157 
158  double X0;
159  double Y0;
160  double X1;
161  double Y1;
162 
163 private:
164  vtkAreaPicker(const vtkAreaPicker&) VTK_DELETE_FUNCTION;
165  void operator=(const vtkAreaPicker&) VTK_DELETE_FUNCTION;
166 };
167 
168 #endif
abstract class specifies interface to map 3D data
abstract API for pickers that can pick an instance of vtkProp
Picks props behind a selection rectangle on a viewport.
Definition: vtkAreaPicker.h:63
int ABoxFrustumIsect(double bounds[], double &mindist)
void SetRenderer(vtkRenderer *)
Set the default renderer to pick on.
vtkAbstractMapper3D * Mapper
vtkPlanes * Frustum
virtual int Pick()
Perform an AreaPick within the default screen rectangle and renderer.
vtkDataSet * DataSet
static vtkAreaPicker * New()
virtual int PickProps(vtkRenderer *renderer)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer=NULL)
Perform pick operation in volume behind the given screen coordinate.
Definition: vtkAreaPicker.h:96
vtkProp3DCollection * GetProp3Ds()
Return a collection of all the prop 3D's that were intersected by the pick ray.
void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *)
int TypeDecipher(vtkProp *, vtkAbstractMapper3D **)
void SetPickCoords(double x0, double y0, double x1, double y1)
Set the default screen rectangle to pick in.
virtual void Initialize()
virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer *renderer=NULL)
Perform pick operation in volume behind the given screen coordinates.
vtkExtractSelectedFrustum * FrustumExtractor
vtkPoints * ClipPoints
vtkProp3DCollection * Prop3Ds
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
Returns the portion of the input dataset that lies within a selection frustum.
a simple class to control print indentation
Definition: vtkIndent.h:40
implicit function for convex set of planes
Definition: vtkPlanes.h:55
represent and manipulate 3D points
Definition: vtkPoints.h:40
a list of 3D props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for renderers
Definition: vtkRenderer.h:64