1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPropPicker.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkPropPicker
* @brief pick an actor/prop using graphics hardware
*
* vtkPropPicker is used to pick an actor/prop given a selection
* point (in display coordinates) and a renderer. This class uses
* graphics hardware/rendering system to pick rapidly (as compared
* to using ray casting as does vtkCellPicker and vtkPointPicker).
* This class determines the actor/prop and pick position in world
* coordinates; point and cell ids are not determined.
*
* @sa
* vtkPicker vtkWorldPointPicker vtkCellPicker vtkPointPicker
*/
#ifndef vtkPropPicker_h
#define vtkPropPicker_h
#include "vtkAbstractPropPicker.h"
#include "vtkRenderingCoreModule.h" // For export macro
VTK_ABI_NAMESPACE_BEGIN
class vtkProp;
class vtkWorldPointPicker;
class VTKRENDERINGCORE_EXPORT vtkPropPicker : public vtkAbstractPropPicker
{
public:
static vtkPropPicker* New();
vtkTypeMacro(vtkPropPicker, vtkAbstractPropPicker);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Perform the pick and set the PickedProp ivar. If something is picked, a
* 1 is returned, otherwise 0 is returned. Use the GetViewProp() method
* to get the instance of vtkProp that was picked. Props are picked from
* the renderers list of pickable Props.
*/
int PickProp(double selectionX, double selectionY, vtkRenderer* renderer);
/**
* Perform a pick from the user-provided list of vtkProps and not from the
* list of vtkProps that the render maintains.
*/
int PickProp(
double selectionX, double selectionY, vtkRenderer* renderer, vtkPropCollection* pickfrom);
/**
* override superclasses' Pick() method.
*/
int Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer) override;
int Pick(double selectionPt[3], vtkRenderer* renderer)
{
return this->Pick(selectionPt[0], selectionPt[1], selectionPt[2], renderer);
}
/**
* Perform pick operation with selection point provided. The
* selectionPt is in world coordinates.
* Return non-zero if something was successfully picked.
*/
int Pick3DPoint(double selectionPt[3], vtkRenderer* ren) override;
/**
* Perform the pick and set the PickedProp ivar. If something is picked, a
* 1 is returned, otherwise 0 is returned. Use the GetViewProp() method
* to get the instance of vtkProp that was picked. Props are picked from
* the renderers list of pickable Props.
*/
int PickProp3DPoint(double pos[3], vtkRenderer* renderer);
/**
* Perform a pick from the user-provided list of vtkProps and not from the
* list of vtkProps that the render maintains.
*/
int PickProp3DPoint(double pos[3], vtkRenderer* renderer, vtkPropCollection* pickfrom);
/**
* Perform a pick from the user-provided list of vtkProps.
*/
virtual int PickProp3DRay(double selectionPt[3], double eventWorldOrientation[4],
vtkRenderer* renderer, vtkPropCollection* pickfrom);
/**
* Perform pick operation with selection point provided. The
* selectionPt is in world coordinates.
* Return non-zero if something was successfully picked.
*/
int Pick3DRay(double selectionPt[3], double orient[4], vtkRenderer* ren) override;
protected:
vtkPropPicker();
~vtkPropPicker() override;
void Initialize() override;
vtkPropCollection* PickFromProps;
// Used to get x-y-z pick position
vtkWorldPointPicker* WorldPointPicker;
private:
vtkPropPicker(const vtkPropPicker&) = delete;
void operator=(const vtkPropPicker&) = delete;
};
VTK_ABI_NAMESPACE_END
#endif
|