VTK
vtkPicker.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPicker.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=========================================================================*/
44#ifndef vtkPicker_h
45#define vtkPicker_h
46
47#include "vtkRenderingCoreModule.h" // For export macro
49
51class vtkDataSet;
52class vtkTransform;
55class vtkPoints;
56
57class VTKRENDERINGCORE_EXPORT vtkPicker : public vtkAbstractPropPicker
58{
59public:
60 static vtkPicker *New();
62 void PrintSelf(ostream& os, vtkIndent indent);
63
65
70 vtkSetMacro(Tolerance, double);
71 vtkGetMacro(Tolerance, double);
73
75
79 vtkGetVectorMacro(MapperPosition, double, 3);
81
83
86 vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
88
90
94 vtkGetObjectMacro(DataSet, vtkDataSet);
96
102 { return this->Prop3Ds; }
103
110
117 { return this->PickedPositions; }
118
125 virtual int Pick(double selectionX, double selectionY, double selectionZ,
126 vtkRenderer *renderer);
127
133 int Pick(double selectionPt[3], vtkRenderer *ren)
134 { return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], ren); }
135
136protected:
139
141 double tMin, double mapperPos[3]);
142 virtual double IntersectWithLine(double p1[3], double p2[3], double tol,
143 vtkAssemblyPath *path, vtkProp3D *p,
145 virtual void Initialize();
146
147 double Tolerance; //tolerance for computation (% of window)
148 double MapperPosition[3]; //selection point in untransformed coordinates
149
150 vtkAbstractMapper3D *Mapper; //selected mapper (if the prop has a mapper)
151 vtkDataSet *DataSet; //selected dataset (if there is one)
152
153 double GlobalTMin; //parametric coordinate along pick ray where hit occurred
154 vtkTransform *Transform; //use to perform ray transformation
155 vtkActorCollection *Actors; //candidate actors (based on bounding box)
156 vtkProp3DCollection *Prop3Ds; //candidate actors (based on bounding box)
157 vtkPoints *PickedPositions; // candidate positions
158
159private:
160 vtkPicker(const vtkPicker&) VTK_DELETE_FUNCTION;
161 void operator=(const vtkPicker&) VTK_DELETE_FUNCTION;
162};
163
164#endif
abstract class specifies interface to map 3D data
virtual int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer)=0
Perform pick operation with selection point provided.
abstract API for pickers that can pick an instance of vtkProp
a list of actors
a list of nodes that form an assembly path
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
a simple class to control print indentation
Definition: vtkIndent.h:40
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:58
static vtkPicker * New()
vtkActorCollection * GetActors()
Return a collection of all the actors that were intersected.
vtkPoints * PickedPositions
Definition: vtkPicker.h:157
vtkPoints * GetPickedPositions()
Return a list of the points the the actors returned by GetProp3Ds were intersected at.
Definition: vtkPicker.h:116
int Pick(double selectionPt[3], vtkRenderer *ren)
Perform pick operation with selection point provided.
Definition: vtkPicker.h:133
vtkTransform * Transform
Definition: vtkPicker.h:154
vtkProp3DCollection * GetProp3Ds()
Return a collection of all the prop 3D's that were intersected by the pick ray.
Definition: vtkPicker.h:101
virtual void Initialize()
vtkDataSet * DataSet
Definition: vtkPicker.h:151
double GlobalTMin
Definition: vtkPicker.h:153
virtual double IntersectWithLine(double p1[3], double p2[3], double tol, vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m)
vtkProp3DCollection * Prop3Ds
Definition: vtkPicker.h:156
double Tolerance
Definition: vtkPicker.h:147
vtkActorCollection * Actors
Definition: vtkPicker.h:155
virtual int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer)
Perform pick operation with selection point provided.
void MarkPicked(vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m, double tMin, double mapperPos[3])
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkAbstractMapper3D * Mapper
Definition: vtkPicker.h:150
represent and manipulate 3D points
Definition: vtkPoints.h:40
a list of 3D props
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
abstract specification for renderers
Definition: vtkRenderer.h:64
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.