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 "vtkAbstractPropPicker.h"
53 
54 class vtkRenderer;
55 class vtkPoints;
56 class vtkPlanes;
59 class vtkDataSet;
61 class vtkProp;
62 class vtkImageActor;
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 
107  vtkProp3DCollection *GetProp3Ds() {return this->Prop3Ds;};
108 
110 
113  vtkGetObjectMacro(Frustum, vtkPlanes);
115 
117 
118  vtkGetObjectMacro(ClipPoints, vtkPoints);
120 
121 protected:
122  vtkAreaPicker();
123  ~vtkAreaPicker();
124 
125  virtual void Initialize();
126  void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *renderer);
127  virtual int PickProps(vtkRenderer *renderer);
128  int TypeDecipher(vtkProp *, vtkImageActor **, vtkAbstractMapper3D **);
129 
130  int ABoxFrustumIsect(double bounds[], double &mindist);
131 
134 
135  vtkProp3DCollection *Prop3Ds; //candidate actors (based on bounding box)
136  vtkAbstractMapper3D *Mapper; //selected mapper (if the prop has a mapper)
137  vtkDataSet *DataSet; //selected dataset (if there is one)
138 
139  //used internally to do prop intersection tests
141 
142  double X0;
143  double Y0;
144  double X1;
145  double Y1;
146 
147 private:
148  vtkAreaPicker(const vtkAreaPicker&); // Not implemented.
149  void operator=(const vtkAreaPicker&); // Not implemented.
150 };
151 
152 #endif
153 
154 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
vtkProp3DCollection * GetProp3Ds()
vtkAbstractMapper3D * Mapper
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
vtkProp3DCollection * Prop3Ds
void PrintSelf(ostream &os, vtkIndent indent)
implicit function for convex set of planes
Definition: vtkPlanes.h:52
abstract specification for renderers
Definition: vtkRenderer.h:69
vtkPlanes * Frustum
draw an image (data & properties) in a rendered 3D scene
Definition: vtkImageActor.h:49
a simple class to control print indentation
Definition: vtkIndent.h:37
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
#define VTK_RENDERING_EXPORT
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
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38