#include <MapBox.h>
Collaboration diagram for MapBox:
Public Slots | |
void | updatePixel (QString layerName_h, int x_h, int y_h, QColor color_h) |
void | updateImage (QString layerName_h, const QImage &image_h) |
void | switchToLayer (QString layerName_h) |
Change the layer that currentLayer and currentLayerName points. | |
void | addLayer (QString layerName_h) |
void | fitInWindow () |
void | zoom (double zoomFactor) |
void | scroll (int deltaX, int deltaY) |
Signals | |
void | queryRequestOnPx (int px_ID, int currentLayerIndex, bool newRequest) |
Public Member Functions | |
MapBox (QWidget *parent=0) | |
int | getLayerIndex (QString layerName_h="") |
Return the index of the specified layer (null to ask for the current one). | |
Private Member Functions | |
void | updatePixmap (const QImage &image, bool reFit=false) |
void | paintEvent (QPaintEvent *event) |
Reimplementation of the standard paintEvent method. | |
void | prepareQueryEvent (QPoint click) |
void | keyPressEvent (QKeyEvent *event) |
void | wheelEvent (QWheelEvent *event) |
void | mousePressEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
Private Attributes | |
vector< QImage > | layersVector |
Vector of QImages. | |
vector< QString > | layersNameVector |
Vector of layer names. | |
QImage | currentLayer |
QString | currentLayerName |
QPoint | lastDragPos |
double | sx1 |
double | sy1 |
double | sx2 |
double | sy2 |
coordinates of corner pixels of source - pixmap - rectangle | |
double | dx1 |
double | dy1 |
double | dx2 |
double | dy2 |
coordinates of corner pixels of destination - widget - rectangle |
This class is based on QImage. It pick-ups from layersVector the choosed layer and display it.
It has methods to change the individual pixels or the whole image of a layer.
Definition at line 39 of file MapBox.h.
MapBox | ( | QWidget * | parent = 0 |
) |
Definition at line 32 of file MapBox.cpp.
int getLayerIndex | ( | QString | layerName_h = "" |
) |
Return the index of the specified layer (null to ask for the current one).
Definition at line 120 of file MapBox.cpp.
Referenced by prepareQueryEvent().
Here is the caller graph for this function:
void updatePixel | ( | QString | layerName_h, | |
int | x_h, | |||
int | y_h, | |||
QColor | color_h | |||
) | [slot] |
Definition at line 70 of file MapBox.cpp.
void updateImage | ( | QString | layerName_h, | |
const QImage & | image_h | |||
) | [slot] |
Definition at line 84 of file MapBox.cpp.
void switchToLayer | ( | QString | layerName_h | ) | [slot] |
Change the layer that currentLayer and currentLayerName points.
Definition at line 105 of file MapBox.cpp.
void addLayer | ( | QString | layerName_h | ) | [slot] |
Definition at line 132 of file MapBox.cpp.
void fitInWindow | ( | ) | [slot] |
void zoom | ( | double | zoomFactor | ) | [slot] |
void scroll | ( | int | deltaX, | |
int | deltaY | |||
) | [slot] |
void queryRequestOnPx | ( | int | px_ID, | |
int | currentLayerIndex, | |||
bool | newRequest | |||
) | [signal] |
Referenced by prepareQueryEvent().
void updatePixmap | ( | const QImage & | image, | |
bool | reFit = false | |||
) | [private] |
void paintEvent | ( | QPaintEvent * | event | ) | [private] |
Reimplementation of the standard paintEvent method.
We paint the image pixel by pixel picking up the colors from the map pointed by currentLayer.
Definition at line 52 of file MapBox.cpp.
void prepareQueryEvent | ( | QPoint | click | ) | [private] |
Definition at line 189 of file MapBox.cpp.
Referenced by mousePressEvent().
Here is the caller graph for this function:
void keyPressEvent | ( | QKeyEvent * | event | ) | [private] |
Definition at line 146 of file MapBox.cpp.
void wheelEvent | ( | QWheelEvent * | event | ) | [private] |
Definition at line 172 of file MapBox.cpp.
void mousePressEvent | ( | QMouseEvent * | event | ) | [private] |
Definition at line 179 of file MapBox.cpp.
void mouseMoveEvent | ( | QMouseEvent * | event | ) | [private] |
Definition at line 206 of file MapBox.cpp.
vector<QImage> layersVector [private] |
Vector of QImages.
Definition at line 66 of file MapBox.h.
Referenced by addLayer(), getLayerIndex(), paintEvent(), switchToLayer(), updateImage(), and updatePixel().
vector<QString> layersNameVector [private] |
Vector of layer names.
Definition at line 67 of file MapBox.h.
Referenced by addLayer(), getLayerIndex(), switchToLayer(), updateImage(), and updatePixel().
QImage currentLayer [private] |
Definition at line 68 of file MapBox.h.
Referenced by addLayer(), fitInWindow(), paintEvent(), switchToLayer(), updateImage(), and updatePixel().
QString currentLayerName [private] |
Definition at line 69 of file MapBox.h.
Referenced by addLayer(), getLayerIndex(), MapBox(), switchToLayer(), updateImage(), and updatePixel().
QPoint lastDragPos [private] |
double sx1 [private] |
Definition at line 71 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), and prepareQueryEvent().
double sy1 [private] |
Definition at line 71 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), and prepareQueryEvent().
double sx2 [private] |
Definition at line 71 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), and prepareQueryEvent().
double sy2 [private] |
coordinates of corner pixels of source - pixmap - rectangle
Definition at line 71 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), and prepareQueryEvent().
double dx1 [private] |
Definition at line 72 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), prepareQueryEvent(), scroll(), and zoom().
double dy1 [private] |
Definition at line 72 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), prepareQueryEvent(), scroll(), and zoom().
double dx2 [private] |
Definition at line 72 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), prepareQueryEvent(), scroll(), and zoom().
double dy2 [private] |
coordinates of corner pixels of destination - widget - rectangle
Definition at line 72 of file MapBox.h.
Referenced by fitInWindow(), MapBox(), paintEvent(), prepareQueryEvent(), scroll(), and zoom().