Class for capturing mouse clicks. More...
#include <mouse_click.h>
Public Member Functions | |
void | disable () |
void | enable () |
MouseClick (QWidget *widget, const ros::NodeHandle &nh) | |
void | setDimensions (int img_width, int img_height, int win_width, int win_height) |
void | setImageTopic (const QString &topic) |
Private Member Functions | |
virtual bool | eventFilter (QObject *obj, QEvent *event) |
Private Attributes | |
int | img_height_ |
int | img_width_ |
ros::NodeHandle | node_handle_ |
ros::Publisher | publisher_ |
std::string | topic_ |
bool | topic_name_ok_ |
int | win_height_ |
int | win_width_ |
Class for capturing mouse clicks.
This class handles mouse clicking functionalities integrated into the ImageDisplay. It uses a qt event filter to capture mouse clicks, handles image resizing and checks if the click was inside or outside the image. It also scales the pixel coordinates to get them w.r.t. the image (not the window) size. Mouse clicks image pixel coordinates are published as ros geometry_msgs PointStamped. The z component is ignored. The topic name where the mouse clicks are published is defined created after the subscribed image topic as: <image_topic>/mouse_click.
Definition at line 34 of file mouse_click.h.
rviz::MouseClick::MouseClick | ( | QWidget * | widget, |
const ros::NodeHandle & | nh | ||
) |
Definition at line 8 of file mouse_click.cpp.
void rviz::MouseClick::disable | ( | ) |
Definition at line 24 of file mouse_click.cpp.
void rviz::MouseClick::enable | ( | ) |
Definition at line 15 of file mouse_click.cpp.
|
privatevirtual |
Definition at line 30 of file mouse_click.cpp.
void rviz::MouseClick::setDimensions | ( | int | img_width, |
int | img_height, | ||
int | win_width, | ||
int | win_height | ||
) |
Definition at line 76 of file mouse_click.cpp.
void rviz::MouseClick::setImageTopic | ( | const QString & | topic | ) |
Definition at line 84 of file mouse_click.cpp.
|
private |
Definition at line 48 of file mouse_click.h.
|
private |
Definition at line 48 of file mouse_click.h.
|
private |
Definition at line 49 of file mouse_click.h.
|
private |
Definition at line 50 of file mouse_click.h.
|
private |
Definition at line 51 of file mouse_click.h.
|
private |
Definition at line 52 of file mouse_click.h.
|
private |
Definition at line 48 of file mouse_click.h.
|
private |
Definition at line 48 of file mouse_click.h.