41 #include <pcl/pcl_base.h>
42 #include <pcl/pcl_macros.h>
43 #include <pcl/types.h>
44 #include <pcl/visualization/common/actor_map.h>
46 #include <vtkCommand.h>
53 class vtkRenderWindowInteractor;
57 namespace visualization
71 Execute (vtkObject *caller,
unsigned long eventid,
void*)
override;
74 performSinglePick (vtkRenderWindowInteractor *iren);
77 performSinglePick (vtkRenderWindowInteractor *iren,
float &x,
float &y,
float &z);
80 performAreaPick (vtkRenderWindowInteractor *iren,
82 std::map<std::string, pcl::Indices>& cloud_indices)
const;
86 float x_{0.0f}, y_{0.0f}, z_{0.0f};
88 bool pick_first_{
false};
89 const vtkActor* actor_{
nullptr};
97 PointPickingEvent (
pcl::index_t idx,
float x,
float y,
float z,
const std::string& name =
"") : idx_ (idx), idx2_ (-1), x_ (x), y_ (y), z_ (z), x2_ (), y2_ (), z2_ (), name_ (name) {}
99 idx_ (idx1), idx2_ (idx2), x_ (x1), y_ (y1), z_ (z1), x2_ (x2), y2_ (y2), z2_ (z2)
123 x = x_; y = y_; z = z_;
136 getPoints (
float &x1,
float &y1,
float &z1,
float &x2,
float &y2,
float &z2)
const
140 x1 = x_; y1 = y_; z1 = z_;
141 x2 = x2_; y2 = y2_; z2 = z2_;
168 inline const std::string&
static constexpr index_t UNAVAILABLE
bool getPoints(float &x1, float &y1, float &z1, float &x2, float &y2, float &z2) const
For situations when multiple points are selected in a sequence, return the point coordinates.
pcl::index_t getPointIndex() const
Obtain the ID of a point that the user just clicked on.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
PointPickingEvent(pcl::index_t idx, float x, float y, float z, const std::string &name="")
shared_ptr< CloudActorMap > CloudActorMapPtr
/brief Class representing 3D point picking events.
PointPickingEvent(pcl::index_t idx)
static PointPickingCallback * New()
PointPickingEvent(pcl::index_t idx1, pcl::index_t idx2, float x1, float y1, float z1, float x2, float y2, float z2)
const std::string & getCloudName() const
Get name of selected cloud.
bool getPointIndices(pcl::index_t &index_1, pcl::index_t &index_2) const
For situations where multiple points are selected in a sequence, return the points indices...
void getPoint(float &x, float &y, float &z) const
Obtain the XYZ point coordinates of a point that the user just clicked on.