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
44#ifndef vtkAreaPicker_h
45#define vtkAreaPicker_h
46
48#include "vtkRenderingCoreModule.h" // For export macro
49
50VTK_ABI_NAMESPACE_BEGIN
51class vtkRenderer;
52class vtkPoints;
53class vtkPlanes;
56class vtkDataSet;
58class vtkProp;
59
60class VTKRENDERINGCORE_EXPORT vtkAreaPicker : public vtkAbstractPropPicker
61{
62public:
63 static vtkAreaPicker* New();
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
70 void SetPickCoords(double x0, double y0, double x1, double y1);
71
76
80 virtual int Pick();
81
87 virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer* renderer = nullptr);
88
94 int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer* renderer = nullptr) override
95 {
96 return this->AreaPick(x0, y0, x0 + 1.0, y0 + 1.0, renderer);
97 }
98
100
103 vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
105
107
111 vtkGetObjectMacro(DataSet, vtkDataSet);
113
118 vtkProp3DCollection* GetProp3Ds() { return this->Prop3Ds; }
119
121
126 vtkGetObjectMacro(Frustum, vtkPlanes);
128
130
133 vtkGetObjectMacro(ClipPoints, vtkPoints);
135
136protected:
138 ~vtkAreaPicker() override;
139
140 void Initialize() override;
141 void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer*);
142 virtual int PickProps(vtkRenderer* renderer);
144
145 int ABoxFrustumIsect(double bounds[], double& mindist);
146
149
150 vtkProp3DCollection* Prop3Ds; // candidate actors (based on bounding box)
151 vtkAbstractMapper3D* Mapper; // selected mapper (if the prop has a mapper)
152 vtkDataSet* DataSet; // selected dataset (if there is one)
153
154 // used internally to do prop intersection tests
156
157 double X0;
158 double Y0;
159 double X1;
160 double Y1;
161
162private:
163 vtkAreaPicker(const vtkAreaPicker&) = delete;
164 void operator=(const vtkAreaPicker&) = delete;
165};
166
167VTK_ABI_NAMESPACE_END
168#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:62
Returns the portion of the input dataset that lies within a selection frustum.
a simple class to control print indentation
Definition vtkIndent.h:38
implicit function for convex set of planes
Definition vtkPlanes.h:51
represent and manipulate 3D points
Definition vtkPoints.h:38
an ordered list of 3D props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:52
abstract specification for renderers
Definition vtkRenderer.h:68