VTK  9.4.20241226
vtkScenePicker.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
31#ifndef vtkScenePicker_h
32#define vtkScenePicker_h
33
34#include "vtkObject.h"
35#include "vtkRenderingCoreModule.h" // For export macro
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkRenderer;
39class vtkProp;
42class vtkScenePickerSelectionRenderCommand;
43
44class VTKRENDERINGCORE_EXPORT vtkScenePicker : public vtkObject
45{
46
47 friend class vtkRenderer;
48 friend class vtkScenePickerSelectionRenderCommand;
49
50public:
52 vtkTypeMacro(vtkScenePicker, vtkObject);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
59 virtual void SetRenderer(vtkRenderer*);
60 vtkGetObjectMacro(Renderer, vtkRenderer);
62
68 vtkIdType GetCellId(int displayPos[2]);
69
75 vtkIdType GetVertexId(int displayPos[2]);
76
82 vtkProp* GetViewProp(int displayPos[2]);
83
85
90 vtkSetMacro(EnableVertexPicking, vtkTypeBool);
91 vtkGetMacro(EnableVertexPicking, vtkTypeBool);
92 vtkBooleanMacro(EnableVertexPicking, vtkTypeBool);
94
95protected:
97 ~vtkScenePicker() override;
98
99 // Pick render entire viewport
100 // Automatically invoked from vtkRenderer at the end of a still render.
102
103 // Pick render a region of the renderwindow
104 void PickRender(int x0, int y0, int x1, int y1);
105
106 // Internal update method retrieves info from the Selector
107 void Update(int displayPos[2]);
108
109 // The RenderWindowInteractor must be set, so that avoid scene picks (which
110 // involve extra renders) during interaction. This is done by observing the
111 // RenderWindowInteractor for start and end interaction events.
113
122 int LastQueriedDisplayPos[2];
123 vtkScenePickerSelectionRenderCommand* SelectionRenderCommand;
124
126
127private:
128 vtkScenePicker(const vtkScenePicker&) = delete;
129 void operator=(const vtkScenePicker&) = delete;
130};
131
132VTK_ABI_NAMESPACE_END
133#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Picks an entire viewport at one shot.
vtkTypeBool EnableVertexPicking
virtual void SetRenderer(vtkRenderer *)
Set the renderer.
vtkRenderWindowInteractor * Interactor
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void PickRender(int x0, int y0, int x1, int y1)
vtkRenderer * Renderer
void SetInteractor(vtkRenderWindowInteractor *)
~vtkScenePicker() override
vtkIdType GetCellId(int displayPos[2])
Get cell id at the pick position.
void Update(int displayPos[2])
vtkHardwareSelector * Selector
vtkScenePickerSelectionRenderCommand * SelectionRenderCommand
static vtkScenePicker * New()
vtkTimeStamp PickRenderTime
vtkProp * GetViewProp(int displayPos[2])
Get actor at the pick position.
vtkIdType GetVertexId(int displayPos[2])
Get cell id at the pick position.
record modification and/or execution time
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315