Serves the Qt events of the map-holding widget. Inherits from QObject. More...
#include <stdr_map_connector.h>
Public Slots | |
bool | eventFilter (QObject *watched, QEvent *event) |
General event filter. Captures all events. | |
void | serveImage (QImage *img) |
Called from signalUpdateImage signal. Calls the updateImage of CMapLoader. | |
void | setCursorAdjusted (bool state) |
Called when zoom adjusted event happens. | |
void | setCursorZoomIn (bool state) |
Called when zoom in event happens. | |
void | setCursorZoomOut (bool state) |
Called when zoom out event happens. | |
void | waitForCo2Place (void) |
Changes the map state. Waits for a CO2 source to be placed. | |
void | waitForPlace (void) |
Changes the map state. Waits for a robot to be placed. | |
void | waitForReplace (std::string robotFrameId) |
Changes the map state. Waits for a robot to be re-placed. | |
void | waitForRfidPlace (void) |
Changes the map state. Waits for an RFID tag to be placed. | |
void | waitForSoundPlace (void) |
Changes the map state. Waits for a sound source to be placed. | |
void | waitForThermalPlace (void) |
Changes the map state. Waits for a thermal source to be placed. | |
Signals | |
void | co2PlaceSet (QPoint p) |
Emmited when click is captured and state is SETCO2PLACE. | |
void | itemClicked (QPoint p, Qt::MouseButton b) |
Emmited when click is captured and state is NORMAL. | |
void | rfidPlaceSet (QPoint p) |
Emmited when click is captured and state is SETRFIDPLACE. | |
void | robotPlaceSet (QPoint p) |
Emmited when click is captured and state is SETPLACE. | |
void | robotReplaceSet (QPoint p, std::string robotName) |
Emmited when click is captured and state is SETREPLACE. | |
void | signalUpdateImage (QImage *img) |
Emmited in updateImage function. | |
void | soundPlaceSet (QPoint p) |
Emmited when click is captured and state is SETSOUNDPLACE. | |
void | thermalPlaceSet (QPoint p) |
Emmited when click is captured and state is SETTHERMALPLACE. | |
void | zoomInPressed (QPoint p) |
Emmited when click is captured and state is ZOOMIN. | |
void | zoomOutPressed (QPoint p) |
Emmited when click is captured and state is ZOOMOUT. | |
Public Member Functions | |
CMapConnector (int argc, char **argv) | |
Default contructor. | |
void | drawGrid (QImage *img, float resolution) |
Wrapper for the draw grid function of loader. | |
QPoint | getGlobalPoint (QPoint p) |
Returns the point in the real map image. Wrapper for a loader function. | |
QWidget * | getLoader (void) |
Returns the CMapLoader object. | |
QPoint | mapToGlobal (QPoint p) |
Calls the Qt function that gets the real point that the event happened. | |
void | setInitialImageSize (QSize s) |
Sets map initial size to the loader. | |
void | setMapInitialized (bool mi) |
Sets the map initialization status. | |
void | updateCenter (QPoint p) |
Updates the map center when a robot is followed. | |
void | updateImage (QImage *img) |
Emits the signalUpdateImage signal. | |
void | updateZoom (QPoint p, bool z) |
Updates the map zoom. Wrapper for a loader function. | |
~CMapConnector (void) | |
Default destructor. | |
Private Attributes | |
int | argc_ |
< Number of input arguments | |
char ** | argv_ |
Holds the currently clicked robot frame id. | |
std::string | current_robot_frame_id_ |
Mouse cursor for zoom in. | |
CMapLoader | loader_ |
True if map is initialized. | |
bool | map_initialized_ |
EStdrMapState | map_state_ |
Object of CMapLoader. | |
QCursor | zoom_in_cursor_ |
Mouse cursor for zoom out. | |
QCursor | zoom_out_cursor_ |
Holds the map state. |
Serves the Qt events of the map-holding widget. Inherits from QObject.
Definition at line 55 of file stdr_map_connector.h.
stdr_gui::CMapConnector::CMapConnector | ( | int | argc, |
char ** | argv | ||
) |
Default contructor.
argc | [int] Number of input arguments |
argv | [char **] Input arguments |
Definition at line 32 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::co2PlaceSet | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is SETCO2PLACE.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::drawGrid | ( | QImage * | img, |
float | resolution | ||
) |
Wrapper for the draw grid function of loader.
img | [QImage*] The image on which the grid will be painted |
resolution | [float] The map resolution |
Definition at line 124 of file stdr_map_connector.cpp.
bool stdr_gui::CMapConnector::eventFilter | ( | QObject * | watched, |
QEvent * | event | ||
) | [slot] |
General event filter. Captures all events.
watched | [QObject*] The object in which the event was triggered |
event | [QEvent*] The type of event |
Definition at line 139 of file stdr_map_connector.cpp.
QPoint stdr_gui::CMapConnector::getGlobalPoint | ( | QPoint | p | ) |
Returns the point in the real map image. Wrapper for a loader function.
p | [QPoint] A point |
Definition at line 113 of file stdr_map_connector.cpp.
QWidget * stdr_gui::CMapConnector::getLoader | ( | void | ) |
Returns the CMapLoader object.
Definition at line 423 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::itemClicked | ( | QPoint | p, |
Qt::MouseButton | b | ||
) | [signal] |
Emmited when click is captured and state is NORMAL.
p | [QPoint] The event point |
b | [Qt::MouseButton] The mouse button clicked |
QPoint stdr_gui::CMapConnector::mapToGlobal | ( | QPoint | p | ) |
Calls the Qt function that gets the real point that the event happened.
p | [QPoint] The point of the event |
Definition at line 282 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::rfidPlaceSet | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is SETRFIDPLACE.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::robotPlaceSet | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is SETPLACE.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::robotReplaceSet | ( | QPoint | p, |
std::string | robotName | ||
) | [signal] |
Emmited when click is captured and state is SETREPLACE.
p | [QPoint] The event point |
robotName | [std::string] Frame id of the robot re-placed |
void stdr_gui::CMapConnector::serveImage | ( | QImage * | img | ) | [slot] |
Called from signalUpdateImage signal. Calls the updateImage of CMapLoader.
img | [QImage*] The image to be painted |
Definition at line 272 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::setCursorAdjusted | ( | bool | state | ) | [slot] |
Called when zoom adjusted event happens.
state | [bool] True when zoom adjusted active |
Definition at line 338 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::setCursorZoomIn | ( | bool | state | ) | [slot] |
Called when zoom in event happens.
state | [bool] True when zoom in active |
Definition at line 292 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::setCursorZoomOut | ( | bool | state | ) | [slot] |
Called when zoom out event happens.
state | [bool] True when zoom out active |
Definition at line 315 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::setInitialImageSize | ( | QSize | s | ) |
Sets map initial size to the loader.
s | [QSize] Map size |
Definition at line 75 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::setMapInitialized | ( | bool | mi | ) |
Sets the map initialization status.
mi | [bool] The initialization status |
Definition at line 448 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::signalUpdateImage | ( | QImage * | img | ) | [signal] |
Emmited in updateImage function.
img | [QImage*] The image to be updated |
void stdr_gui::CMapConnector::soundPlaceSet | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is SETSOUNDPLACE.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::thermalPlaceSet | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is SETTHERMALPLACE.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::updateCenter | ( | QPoint | p | ) |
Updates the map center when a robot is followed.
p | [QPoint] The new center |
Definition at line 100 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::updateImage | ( | QImage * | img | ) |
Emits the signalUpdateImage signal.
img | [QImage*] The image to be updated |
Definition at line 262 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::updateZoom | ( | QPoint | p, |
bool | z | ||
) |
Updates the map zoom. Wrapper for a loader function.
p | [QPoint] The point of the zoom event |
z | [bool] True if zoom in, false if zoom out |
Definition at line 86 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForCo2Place | ( | void | ) | [slot] |
Changes the map state. Waits for a CO2 source to be placed.
Definition at line 395 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForPlace | ( | void | ) | [slot] |
Changes the map state. Waits for a robot to be placed.
Definition at line 353 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForReplace | ( | std::string | robotFrameId | ) | [slot] |
Changes the map state. Waits for a robot to be re-placed.
robotFrameId | [std::string] The robot frame id of robot to be re-placed |
Definition at line 433 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForRfidPlace | ( | void | ) | [slot] |
Changes the map state. Waits for an RFID tag to be placed.
Definition at line 381 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForSoundPlace | ( | void | ) | [slot] |
Changes the map state. Waits for a sound source to be placed.
Definition at line 409 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::waitForThermalPlace | ( | void | ) | [slot] |
Changes the map state. Waits for a thermal source to be placed.
Definition at line 367 of file stdr_map_connector.cpp.
void stdr_gui::CMapConnector::zoomInPressed | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is ZOOMIN.
p | [QPoint] The event point |
void stdr_gui::CMapConnector::zoomOutPressed | ( | QPoint | p | ) | [signal] |
Emmited when click is captured and state is ZOOMOUT.
p | [QPoint] The event point |
int stdr_gui::CMapConnector::argc_ [private] |
char** stdr_gui::CMapConnector::argv_ [private] |
Holds the currently clicked robot frame id.
Definition at line 67 of file stdr_map_connector.h.
std::string stdr_gui::CMapConnector::current_robot_frame_id_ [private] |
Mouse cursor for zoom in.
Definition at line 70 of file stdr_map_connector.h.
CMapLoader stdr_gui::CMapConnector::loader_ [private] |
True if map is initialized.
Definition at line 81 of file stdr_map_connector.h.
bool stdr_gui::CMapConnector::map_initialized_ [private] |
Definition at line 82 of file stdr_map_connector.h.
Object of CMapLoader.
Definition at line 78 of file stdr_map_connector.h.
QCursor stdr_gui::CMapConnector::zoom_in_cursor_ [private] |
Mouse cursor for zoom out.
Definition at line 72 of file stdr_map_connector.h.
QCursor stdr_gui::CMapConnector::zoom_out_cursor_ [private] |
Holds the map state.
Definition at line 75 of file stdr_map_connector.h.