VTK
vtkCellPicker.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCellPicker.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 vtkCellPicker_h
48#define vtkCellPicker_h
49
50#include "vtkRenderingCoreModule.h" // For export macro
51#include "vtkPicker.h"
52
53class vtkMapper;
54class vtkTexture;
59class vtkDataArray;
60class vtkDoubleArray;
61class vtkIdList;
62class vtkCell;
63class vtkGenericCell;
64class vtkImageData;
66class vtkCollection;
67class vtkMatrix4x4;
68
69class VTKRENDERINGCORE_EXPORT vtkCellPicker : public vtkPicker
70{
71public:
72 static vtkCellPicker *New();
73 vtkTypeMacro(vtkCellPicker, vtkPicker);
74 void PrintSelf(ostream& os, vtkIndent indent);
75
82 virtual int Pick(double selectionX, double selectionY, double selectionZ,
83 vtkRenderer *renderer);
84
95
102
107
109
117 vtkSetMacro(VolumeOpacityIsovalue, double);
118 vtkGetMacro(VolumeOpacityIsovalue, double);
120
122
128 vtkSetMacro(UseVolumeGradientOpacity, int);
129 vtkBooleanMacro(UseVolumeGradientOpacity, int);
130 vtkGetMacro(UseVolumeGradientOpacity, int);
132
134
146 vtkSetMacro(PickClippingPlanes, int);
147 vtkBooleanMacro(PickClippingPlanes, int);
148 vtkGetMacro(PickClippingPlanes, int);
150
152
160 vtkGetMacro(ClippingPlaneId, int);
162
164
169 vtkGetVectorMacro(PickNormal, double, 3);
171
173
177 vtkGetVector3Macro(MapperNormal, double);
179
181
185 vtkGetVector3Macro(PointIJK, int);
187
189
194 vtkGetVector3Macro(CellIJK, int);
196
198
202 vtkGetMacro(PointId, vtkIdType);
204
206
209 vtkGetMacro(CellId, vtkIdType);
211
213
217 vtkGetMacro(SubId, int);
219
221
226 vtkGetVector3Macro(PCoords, double);
228
233 vtkTexture *GetTexture() { return this->Texture; };
234
236
246 vtkSetMacro(PickTextureData, int);
247 vtkBooleanMacro(PickTextureData, int);
248 vtkGetMacro(PickTextureData, int);
250
251protected:
254
256
257 virtual void ResetPickInfo();
258
259 virtual double IntersectWithLine(double p1[3], double p2[3], double tol,
260 vtkAssemblyPath *path, vtkProp3D *p,
262
263 virtual double IntersectActorWithLine(const double p1[3], const double p2[3],
264 double t1, double t2, double tol,
265 vtkProp3D *prop, vtkMapper *mapper);
266
267 virtual double IntersectVolumeWithLine(const double p1[3],
268 const double p2[3],
269 double t1, double t2,
270 vtkProp3D *prop,
272
273 virtual double IntersectImageWithLine(const double p1[3],
274 const double p2[3],
275 double t1, double t2,
276 vtkProp3D *prop,
277 vtkImageMapper3D *mapper);
278
279 virtual double IntersectProp3DWithLine(const double p1[3],
280 const double p2[3],
281 double t1, double t2, double tol,
282 vtkProp3D *prop,
283 vtkAbstractMapper3D *mapper);
284
286 vtkMatrix4x4 *propMatrix,
287 const double p1[3], const double p2[3],
288 double &t1, double &t2, int& planeId);
289
290 static int ClipLineWithExtent(const int extent[6],
291 const double x1[3], const double x2[3],
292 double &t1, double &t2, int &planeId);
293
295 const double *weights, double normal[3]);
296
298 const double *weights, double tcoord[3]);
299
300 static int HasSubCells(int cellType);
301
302 static int GetNumberOfSubCells(vtkIdList *pointIds, int cellType);
303
304 static void GetSubCell(vtkDataSet *data, vtkIdList *pointIds, int subId,
305 int cellType, vtkGenericCell *cell);
306
307 static void SubCellFromCell(vtkGenericCell *cell, int subId);
308
309 void SetImageDataPickInfo(const double x[3], const int extent[6]);
310
311 double ComputeVolumeOpacity(const int xi[3], const double pcoords[3],
312 vtkImageData *data, vtkDataArray *scalars,
313 vtkPiecewiseFunction *scalarOpacity,
314 vtkPiecewiseFunction *gradientOpacity);
315
317
322
325 int SubId;
326 double PCoords[3];
327
328 int PointIJK[3];
329 int CellIJK[3];
330
331 double PickNormal[3];
332 double MapperNormal[3];
333
336
337private:
338 void ResetCellPickerInfo();
339
340 vtkGenericCell *Cell; //used to accelerate picking
341 vtkIdList *PointIds; // used to accelerate picking
342 vtkDoubleArray *Gradients; //used in volume picking
343
344private:
345 vtkCellPicker(const vtkCellPicker&) VTK_DELETE_FUNCTION;
346 void operator=(const vtkCellPicker&) VTK_DELETE_FUNCTION;
347};
348
349#endif
350
351
an abstract base class for locators which find cells
abstract class specifies interface to map 3D data
Abstract class for a volume mapper.
a list of nodes that form an assembly path
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:70
vtkTexture * Texture
vtkCollection * Locators
virtual int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer)
Perform pick operation with selection point provided.
int UseVolumeGradientOpacity
static vtkCellPicker * New()
void Initialize()
static int ComputeSurfaceNormal(vtkDataSet *data, vtkCell *cell, const double *weights, double normal[3])
virtual double IntersectActorWithLine(const double p1[3], const double p2[3], double t1, double t2, double tol, vtkProp3D *prop, vtkMapper *mapper)
virtual double IntersectWithLine(double p1[3], double p2[3], double tol, vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m)
virtual void ResetPickInfo()
void RemoveAllLocators()
Remove all locators associated with this picker.
static int ComputeSurfaceTCoord(vtkDataSet *data, vtkCell *cell, const double *weights, double tcoord[3])
static void SubCellFromCell(vtkGenericCell *cell, int subId)
vtkTexture * GetTexture()
Get the texture that was picked.
void SetImageDataPickInfo(const double x[3], const int extent[6])
static int ClipLineWithPlanes(vtkAbstractMapper3D *mapper, vtkMatrix4x4 *propMatrix, const double p1[3], const double p2[3], double &t1, double &t2, int &planeId)
vtkIdType PointId
static int ClipLineWithExtent(const int extent[6], const double x1[3], const double x2[3], double &t1, double &t2, int &planeId)
virtual double IntersectVolumeWithLine(const double p1[3], const double p2[3], double t1, double t2, vtkProp3D *prop, vtkAbstractVolumeMapper *mapper)
double VolumeOpacityIsovalue
static int HasSubCells(int cellType)
void AddLocator(vtkAbstractCellLocator *locator)
Add a locator for one of the data sets that will be included in the scene.
virtual double IntersectImageWithLine(const double p1[3], const double p2[3], double t1, double t2, vtkProp3D *prop, vtkImageMapper3D *mapper)
void RemoveLocator(vtkAbstractCellLocator *locator)
Remove a locator that was previously added.
double ComputeVolumeOpacity(const int xi[3], const double pcoords[3], vtkImageData *data, vtkDataArray *scalars, vtkPiecewiseFunction *scalarOpacity, vtkPiecewiseFunction *gradientOpacity)
static void GetSubCell(vtkDataSet *data, vtkIdList *pointIds, int subId, int cellType, vtkGenericCell *cell)
virtual double IntersectProp3DWithLine(const double p1[3], const double p2[3], double t1, double t2, double tol, vtkProp3D *prop, vtkAbstractMapper3D *mapper)
static int GetNumberOfSubCells(vtkIdList *pointIds, int cellType)
vtkIdType CellId
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
abstract class to specify cell behavior
Definition: vtkCell.h:60
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
abstract class for mapping images to the screen
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:92
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:58
Defines a 1D piecewise function.
maintain a list of planes
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
abstract specification for renderers
Definition: vtkRenderer.h:64
handles properties associated with a texture map
Definition: vtkTexture.h:71
CellTypeInDataSet cellType(vtkDataSet *input)
@ extent
Definition: vtkX3D.h:345
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287