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 =========================================================================*/
49 #ifndef vtkAreaPicker_h
50 #define vtkAreaPicker_h
51 
52 #include "vtkRenderingCoreModule.h" // For export macro
53 #include "vtkAbstractPropPicker.h"
54 
55 class vtkRenderer;
56 class vtkPoints;
57 class vtkPlanes;
60 class vtkDataSet;
62 class vtkProp;
63 
65 {
66 public:
67  static vtkAreaPicker *New();
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72  void SetPickCoords(double x0, double y0, double x1, double y1);
73 
75  void SetRenderer(vtkRenderer *);
76 
78  virtual int Pick();
79 
84  virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer *renderer = NULL);
85 
87 
90  virtual int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer = NULL)
91  { return this->AreaPick(x0, y0, x0+1.0, y0+1.0, renderer); }
93 
95 
96  vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
98 
100 
102  vtkGetObjectMacro(DataSet, vtkDataSet);
104 
106 
109  { return this->Prop3Ds; }
111 
113 
116  vtkGetObjectMacro(Frustum, vtkPlanes);
118 
120 
121  vtkGetObjectMacro(ClipPoints, vtkPoints);
123 
124 protected:
125  vtkAreaPicker();
126  ~vtkAreaPicker();
127 
128  virtual void Initialize();
129  void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *);
130  virtual int PickProps(vtkRenderer *renderer);
131  int TypeDecipher(vtkProp *, vtkAbstractMapper3D **);
132 
133  int ABoxFrustumIsect(double bounds[], double &mindist);
134 
137 
138  vtkProp3DCollection *Prop3Ds; //candidate actors (based on bounding box)
139  vtkAbstractMapper3D *Mapper; //selected mapper (if the prop has a mapper)
140  vtkDataSet *DataSet; //selected dataset (if there is one)
141 
142  //used internally to do prop intersection tests
144 
145  double X0;
146  double Y0;
147  double X1;
148  double Y1;
149 
150 private:
151  vtkAreaPicker(const vtkAreaPicker&); // Not implemented.
152  void operator=(const vtkAreaPicker&); // Not implemented.
153 };
154 
155 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkProp3DCollection * GetProp3Ds()
vtkAbstractMapper3D * Mapper
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
vtkProp3DCollection * Prop3Ds
void PrintSelf(ostream &os, vtkIndent indent)
implicit function for convex set of planes
Definition: vtkPlanes.h:53
abstract specification for renderers
Definition: vtkRenderer.h:62
vtkPlanes * Frustum
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkDataSet * DataSet
abstract class specifies interface to map 3D data
vtkExtractSelectedFrustum * FrustumExtractor
a list of 3D props
Returns the portion of the input dataset that lies within a selection frustum.
vtkPoints * ClipPoints
abstract API for pickers that can pick an instance of vtkProp
virtual int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer=NULL)
Definition: vtkAreaPicker.h:90
virtual int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer)=0
Picks props behind a selection rectangle on a viewport.
Definition: vtkAreaPicker.h:64
#define VTKRENDERINGCORE_EXPORT
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38