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 vtkPolyData;
33class vtkRenderer;
34
54class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAccuratePicker : public vtkCellPicker
55{
56public:
58 vtkTypeMacro(vtkMRMLAccuratePicker, vtkCellPicker);
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
64 vtkSetMacro(MinimumCellCountToIndex, vtkIdType);
65 vtkGetMacro(MinimumCellCountToIndex, vtkIdType);
66
67 using vtkCellPicker::Pick;
68
71 int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
72
73protected:
76
80 void UpdateLocators(vtkRenderer* renderer);
81
83 {
84 vtkSmartPointer<vtkAbstractCellLocator> Locator;
85 vtkMTimeType BuildMTime{ 0 };
86 };
87 std::map<vtkPolyData*, CachedLocator> Locators;
88
89 vtkIdType MinimumCellCountToIndex{ 10000 };
90
91private:
93 void operator=(const vtkMRMLAccuratePicker&) = delete;
94};
95
96#endif
A cell picker that stays fast when large surfaces are shown.
~vtkMRMLAccuratePicker() override
void UpdateLocators(vtkRenderer *renderer)
static vtkMRMLAccuratePicker * New()
std::map< vtkPolyData *, CachedLocator > Locators
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer *renderer) override
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSmartPointer< vtkAbstractCellLocator > Locator