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 vtkRenderer;
34
57class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAccuratePicker : public vtkCellPicker
58{
59public:
61 vtkTypeMacro(vtkMRMLAccuratePicker, vtkCellPicker);
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
68 vtkSetMacro(MinimumCellCountToIndex, vtkIdType);
69 vtkGetMacro(MinimumCellCountToIndex, vtkIdType);
70
71 using vtkCellPicker::Pick;
72
75 int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
76
77protected:
80
84 void UpdateLocators(vtkRenderer* renderer);
85
91 double IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkAssemblyPath* path, vtkProp3D* p, vtkAbstractMapper3D* m) override;
92
96 double IntersectActorWithLine(const double p1[3], const double p2[3], double t1, double t2, double tol, vtkProp3D* prop, vtkMapper* mapper) override;
97
115 bool IntersectDataSetWithLine(vtkDataSet* dataSet,
116 const double p1[3],
117 const double p2[3],
118 double t1,
119 double t2,
120 double tol,
121 vtkAbstractCellLocator*& locator,
122 vtkIdType& cellId,
123 int& subId,
124 double& tMin,
125 double& pDistMin,
126 double xyz[3],
127 double minPCoords[3]) override;
128
130 {
131 vtkSmartPointer<vtkAbstractCellLocator> Locator;
132 vtkMTimeType BuildMTime{ 0 };
133 };
134
136 std::map<vtkDataSet*, CachedLocator> LocatorsBySurface;
137
138 vtkIdType MinimumCellCountToIndex{ 10000 };
139
140private:
142 void operator=(const vtkMRMLAccuratePicker&) = delete;
143};
144
145#endif
A cell picker that stays fast when large surfaces are shown.
~vtkMRMLAccuratePicker() override
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
std::map< vtkDataSet *, CachedLocator > LocatorsBySurface
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