vtkPVRayCastPickingHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkPVRayCastPickingHelper_h
12 #define vtkPVRayCastPickingHelper_h
13 
14 #include "vtkObject.h"
15 #include "vtkRemotingViewsModule.h" //needed for exports
16 
17 class vtkAlgorithm;
18 class vtkCell;
19 class vtkDataSet;
20 
22 {
23 public:
26  void PrintSelf(ostream& os, vtkIndent indent) override;
27 
31  void SetInput(vtkAlgorithm*);
32 
34 
38  vtkSetClampMacro(InputPort, int, 0, VTK_INT_MAX);
39  vtkGetMacro(InputPort, int);
41 
45  void SetSelection(vtkAlgorithm*);
46 
48 
51  vtkSetVector3Macro(PointA, double);
52  vtkGetVector3Macro(PointA, double);
54 
56 
59  vtkSetVector3Macro(PointB, double);
60  vtkGetVector3Macro(PointB, double);
62 
64 
67  vtkSetMacro(SnapOnMeshPoint, bool);
68  vtkGetMacro(SnapOnMeshPoint, bool);
70 
74  void ComputeIntersection();
75 
76  // Provide access to the resulting intersection
77  vtkGetVector3Macro(Intersection, double);
78 
79  // Provide access to the resulting intersection normal
80  vtkGetVector3Macro(IntersectionNormal, double);
81 
82 protected:
84  ~vtkPVRayCastPickingHelper() override;
85 
89  void ComputeIntersectionFromDataSet(vtkDataSet* ds);
90 
95  int ComputeSurfaceNormal(vtkDataSet* data, vtkCell* cell, int subId, double* weights);
96 
97  double Intersection[3];
98  double IntersectionNormal[3];
99  double PointA[3];
100  double PointB[3];
104 
105 private:
107  void operator=(const vtkPVRayCastPickingHelper&) = delete;
108 
109  int InputPort = 0;
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 &)