VTK  9.5.20250822
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
77#ifndef vtkAreaPicker_h
78#define vtkAreaPicker_h
79
81#include "vtkRenderingCoreModule.h" // For export macro
82#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
83
84VTK_ABI_NAMESPACE_BEGIN
85class vtkDataObject;
86class vtkRenderer;
87class vtkPoints;
88class vtkPlanes;
91class vtkDataSet;
93class vtkProp;
94
95class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkAreaPicker : public vtkAbstractPropPicker
96{
97public:
98 static vtkAreaPicker* New();
100 void PrintSelf(ostream& os, vtkIndent indent) override;
101
105 void SetPickCoords(double x0, double y0, double x1, double y1);
106
111
115 virtual int Pick();
116
122 virtual int AreaPick(double x0, double y0, double x1, double y1, vtkRenderer* renderer = nullptr);
123
129 int Pick(double x0, double y0, double vtkNotUsed(z0), vtkRenderer* renderer = nullptr) override
130 {
131 return this->AreaPick(x0, y0, x0 + 1.0, y0 + 1.0, renderer);
132 }
133
135
138 vtkGetObjectMacro(Mapper, vtkAbstractMapper3D);
140
142
146 vtkGetObjectMacro(DataSet, vtkDataSet);
148
150
154 vtkGetObjectMacro(DataObject, vtkDataObject);
156
161 vtkProp3DCollection* GetProp3Ds() { return this->Prop3Ds; }
162
164
169 vtkGetObjectMacro(Frustum, vtkPlanes);
171
173
176 vtkGetObjectMacro(ClipPoints, vtkPoints);
178
179protected:
181 ~vtkAreaPicker() override;
182
183 void Initialize() override;
184 void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer*);
185 virtual int PickProps(vtkRenderer* renderer);
187
188 int ABoxFrustumIsect(double bounds[], double& mindist);
189
192
193 vtkProp3DCollection* Prop3Ds; // candidate actors (based on bounding box)
194 vtkAbstractMapper3D* Mapper; // selected mapper (if the prop has a mapper)
195 vtkDataSet* DataSet; // selected dataset (if there is one)
196 vtkDataObject* DataObject; // selected dataobject (this is useful to represent selected objects
197 // which directly derive vtkDataObject)
198
199 // used internally to do prop intersection tests
201
202 double X0;
203 double Y0;
204 double X1;
205 double Y1;
206
207private:
208 vtkAreaPicker(const vtkAreaPicker&) = delete;
209 void operator=(const vtkAreaPicker&) = delete;
210};
211
212VTK_ABI_NAMESPACE_END
213#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
vtkDataObject * DataObject
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)
int Pick(double x0, double y0, double z0, vtkRenderer *renderer=nullptr) override
Perform pick operation in volume behind the given screen coordinate.
void DefineFrustum(double x0, double y0, double x1, double y1, vtkRenderer *)
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
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
Returns the portion of the input dataset that lies within a selection frustum.
a simple class to control print indentation
Definition vtkIndent.h:108
implicit function for convex set of planes
Definition vtkPlanes.h:151
represent and manipulate 3D points
Definition vtkPoints.h:139
an ordered list of 3D props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:69
abstract specification for renderers
#define VTK_MARSHALAUTO