41 #include <pcl/pcl_base.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;
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&
pcl::index_t performAreaPick(vtkRenderWindowInteractor *iren, CloudActorMapPtr cam_ptr, std::map< std::string, pcl::Indices > &cloud_indices) const
pcl::index_t performSinglePick(vtkRenderWindowInteractor *iren, float &x, float &y, float &z)
pcl::index_t performSinglePick(vtkRenderWindowInteractor *iren)
void Execute(vtkObject *caller, unsigned long eventid, void *) override
~PointPickingCallback() override=default
Empty destructor.
static PointPickingCallback * New()
/brief Class representing 3D point picking events.
PointPickingEvent(pcl::index_t idx, float x, float y, float z, const std::string &name="")
const std::string & getCloudName() const
Get name of selected cloud.
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.
void getPoint(float &x, float &y, float &z) const
Obtain the XYZ point coordinates of a point that the user just clicked on.
PointPickingEvent(pcl::index_t idx)
PointPickingEvent(pcl::index_t idx1, pcl::index_t idx2, float x1, float y1, float z1, float x2, float y2, float z2)
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.
pcl::index_t getPointIndex() const
Obtain the ID of a point that the user just clicked on.
shared_ptr< CloudActorMap > CloudActorMapPtr
static constexpr index_t UNAVAILABLE
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
Defines all the PCL and non-PCL macros used.
Defines basic non-point types used by PCL.