VTK
vtkPointPicker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointPicker.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 =========================================================================*/
36 #ifndef vtkPointPicker_h
37 #define vtkPointPicker_h
38 
39 #include "vtkRenderingCoreModule.h" // For export macro
40 #include "vtkPicker.h"
41 
42 class vtkDataSet;
43 
44 class VTKRENDERINGCORE_EXPORT vtkPointPicker : public vtkPicker
45 {
46 public:
47  static vtkPointPicker *New();
48  vtkTypeMacro(vtkPointPicker,vtkPicker);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
55  vtkGetMacro(PointId, vtkIdType);
57 
59 
63  vtkSetMacro(UseCells, vtkTypeBool);
64  vtkGetMacro(UseCells, vtkTypeBool);
65  vtkBooleanMacro(UseCells, vtkTypeBool);
67 
68 protected:
70  ~vtkPointPicker() override {}
71 
72  vtkIdType PointId; //picked point
73  vtkTypeBool UseCells; // Use cell points vs. points directly
74 
75  double IntersectWithLine(const double p1[3], const double p2[3], double tol,
76  vtkAssemblyPath *path, vtkProp3D *p,
77  vtkAbstractMapper3D *m) override;
78  void Initialize() override;
79 
80  vtkIdType IntersectDataSetWithLine(const double p1[3], double ray[3],
81  double rayFactor, double tol,
82  vtkDataSet* dataSet,
83  double& tMin, double minXYZ[3]);
84  bool UpdateClosestPoint(double x[3], const double p1[3],
85  double ray[3], double rayFactor, double tol,
86  double& tMin, double& distMin);
87 private:
88  vtkPointPicker(const vtkPointPicker&) = delete;
89  void operator=(const vtkPointPicker&) = delete;
90 };
91 
92 #endif
93 
94 
vtkTypeBool UseCells
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual double IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m)
~vtkPointPicker() override
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
int vtkIdType
Definition: vtkType.h:347
vtkIdType PointId
superclass for 3D geometric pickers (uses ray cast)
Definition: vtkPicker.h:58
int vtkTypeBool
Definition: vtkABI.h:69
a list of nodes that form an assembly path
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkPicker * New()
abstract class specifies interface to map 3D data
void Initialize() override
select a point by shooting a ray into a graphics window