Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAccuratePicker.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef vtkMRMLAccuratePicker_h
19#define vtkMRMLAccuratePicker_h
20
21// MRMLDisplayableManager includes
22#include "vtkMRMLDisplayableManagerExport.h"
23
24// VTK includes
25#include <vtkCellPicker.h>
26#include <vtkSmartPointer.h>
27
28// STD includes
29#include <map>
30
31class vtkAbstractCellLocator;
32class vtkDataSet;
33class vtkPolyData;
34class vtkRenderer;
35
58class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAccuratePicker : public vtkCellPicker
59{
60public:
62 vtkTypeMacro(vtkMRMLAccuratePicker, vtkCellPicker);
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
69 vtkSetMacro(MinimumCellCountToIndex, vtkIdType);
70 vtkGetMacro(MinimumCellCountToIndex, vtkIdType);
71
72 using vtkCellPicker::Pick;
73
76 int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
77
78protected:
81
85 void UpdateLocators(vtkRenderer* renderer);
86
92 double IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkAssemblyPath* path, vtkProp3D* p, vtkAbstractMapper3D* m) override;
93
97 double IntersectActorWithLine(const double p1[3], const double p2[3], double t1, double t2, double tol, vtkProp3D* prop, vtkMapper* mapper) override;
98
116 bool IntersectDataSetWithLine(vtkDataSet* dataSet,
117 const double p1[3],
118 const double p2[3],
119 double t1,
120 double t2,
121 double tol,
122 vtkAbstractCellLocator*& locator,
123 vtkIdType& cellId,
124 int& subId,
125 double& tMin,
126 double& pDistMin,
127 double xyz[3],
128 double minPCoords[3]) override;
129
131 {
132 vtkSmartPointer<vtkAbstractCellLocator> Locator;
133 vtkMTimeType BuildMTime{ 0 };
134 };
135
137 std::map<vtkPolyData*, CachedLocator> LocatorsBySurface;
138
139 vtkIdType MinimumCellCountToIndex{ 10000 };
140
141private:
143 void operator=(const vtkMRMLAccuratePicker&) = delete;
144};
145
146#endif
A cell picker that stays fast when large surfaces are shown.
~vtkMRMLAccuratePicker() override
std::map< vtkPolyData *, CachedLocator > LocatorsBySurface
void UpdateLocators(vtkRenderer *renderer)
bool IntersectDataSetWithLine(vtkDataSet *dataSet, const double p1[3], const double p2[3], double t1, double t2, double tol, vtkAbstractCellLocator *&locator, vtkIdType &cellId, int &subId, double &tMin, double &pDistMin, double xyz[3], double minPCoords[3]) override
double IntersectActorWithLine(const double p1[3], const double p2[3], double t1, double t2, double tol, vtkProp3D *prop, vtkMapper *mapper) override
static vtkMRMLAccuratePicker * New()
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer) override
double IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m) override
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSmartPointer< vtkAbstractCellLocator > Locator