vtkPVRayCastPickingHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPVRayCastPickingHelper.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 =========================================================================*/
22 #ifndef vtkPVRayCastPickingHelper_h
23 #define vtkPVRayCastPickingHelper_h
24 
25 #include "vtkObject.h"
26 #include "vtkRemotingViewsModule.h" //needed for exports
27 
28 class vtkAlgorithm;
29 class vtkCell;
30 class vtkDataSet;
31 
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  void SetInput(vtkAlgorithm*);
43 
47  void SetSelection(vtkAlgorithm*);
48 
50 
53  vtkSetVector3Macro(PointA, double);
54  vtkGetVector3Macro(PointA, double);
56 
58 
61  vtkSetVector3Macro(PointB, double);
62  vtkGetVector3Macro(PointB, double);
64 
66 
69  vtkSetMacro(SnapOnMeshPoint, bool);
70  vtkGetMacro(SnapOnMeshPoint, bool);
72 
76  void ComputeIntersection();
77 
78  // Provide access to the resulting intersection
79  vtkGetVector3Macro(Intersection, double);
80 
81  // Provide access to the resulting intersection normal
82  vtkGetVector3Macro(IntersectionNormal, double);
83 
84 protected:
86  ~vtkPVRayCastPickingHelper() override;
87 
91  void ComputeIntersectionFromDataSet(vtkDataSet* ds);
92 
97  int ComputeSurfaceNormal(vtkDataSet* data, vtkCell* cell, int subId, double* weights);
98 
99  double Intersection[3];
100  double IntersectionNormal[3];
101  double PointA[3];
102  double PointB[3];
106 
107 private:
109  void operator=(const vtkPVRayCastPickingHelper&) = delete;
110 };
111 
112 #endif
#define VTKREMOTINGVIEWS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
helper class that used selection and ray casting to find the intersection point between the user pick...
static vtkObject * New()
void operator=(const vtkObjectBase &)