VTK  9.3.0
vtkAreaPicker.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
38#ifndef vtkAreaPicker_h
39#define vtkAreaPicker_h
40
42#include "vtkRenderingCoreModule.h" // For export macro
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkRenderer;
46class vtkPoints;
47class vtkPlanes;
50class vtkDataSet;
52class vtkProp;
53
54class VTKRENDERINGCORE_EXPORT vtkAreaPicker : public vtkAbstractPropPicker
55{
56public:
57 static vtkAreaPicker* New();
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
64 void SetPickCoords(double x0, double y0, double x1, double y1);
65
70
74 virtual int Pick();
75
81 virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer* renderer = nullptr);
82
88 int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer* renderer = nullptr) override
89 {
90 return this->AreaPick(x0, y0, x0 + 1.0, y0 + 1.0, renderer);
91 }
92
94
97 vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
99
101
105 vtkGetObjectMacro(DataSet, vtkDataSet);
107
112 vtkProp3DCollection* GetProp3Ds() { return this->Prop3Ds; }
113
115
120 vtkGetObjectMacro(Frustum, vtkPlanes);
122
124
127 vtkGetObjectMacro(ClipPoints, vtkPoints);
129
130protected:
132 ~vtkAreaPicker() override;
133
134 void Initialize() override;
135 void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer*);
136 virtual int PickProps(vtkRenderer* renderer);
138
139 int ABoxFrustumIsect(double bounds[], double& mindist);
140
143
144 vtkProp3DCollection* Prop3Ds; // candidate actors (based on bounding box)
145 vtkAbstractMapper3D* Mapper; // selected mapper (if the prop has a mapper)
146 vtkDataSet* DataSet; // selected dataset (if there is one)
147
148 // used internally to do prop intersection tests
150
151 double X0;
152 double Y0;
153 double X1;
154 double Y1;
155
156private:
157 vtkAreaPicker(const vtkAreaPicker&) = delete;
158 void operator=(const vtkAreaPicker&) = delete;
159};
160
161VTK_ABI_NAMESPACE_END
162#endif
abstract class specifies interface to map 3D data
abstract API for pickers that can pick an instance of vtkProp
Picks props behind a selection rectangle on a viewport.
static vtkAreaPicker * New()
int ABoxFrustumIsect(double bounds[], double &mindist)
void SetRenderer(vtkRenderer *)
Set the default renderer to pick on.
vtkProp3DCollection * GetProp3Ds()
Return a collection of all the prop 3D's that were intersected by the pick ray.
vtkAbstractMapper3D * Mapper
vtkPlanes * Frustum
virtual int Pick()
Perform an AreaPick within the default screen rectangle and renderer.
vtkDataSet * DataSet
void Initialize() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int PickProps(vtkRenderer *renderer)
void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *)
int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer *renderer=nullptr) override
Perform pick operation in volume behind the given screen coordinate.
int TypeDecipher(vtkProp *, vtkAbstractMapper3D **)
virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer *renderer=nullptr)
Perform pick operation in volume behind the given screen coordinates.
void SetPickCoords(double x0, double y0, double x1, double y1)
Set the default screen rectangle to pick in.
vtkExtractSelectedFrustum * FrustumExtractor
vtkPoints * ClipPoints
~vtkAreaPicker() override
vtkProp3DCollection * Prop3Ds
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
Returns the portion of the input dataset that lies within a selection frustum.
a simple class to control print indentation
Definition vtkIndent.h:29
implicit function for convex set of planes
Definition vtkPlanes.h:42
represent and manipulate 3D points
Definition vtkPoints.h:29
an ordered list of 3D props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:46
abstract specification for renderers
Definition vtkRenderer.h:62