Public Member Functions | Private Member Functions | Private Attributes
stdr_gui::CMapLoader Class Reference

Implements the low level Qt functionalities of the map widget. Inherits from Ui_mapWidget (generated from an ui file) and QWidget. More...

#include <stdr_map_loader.h>

List of all members.

Public Member Functions

 CMapLoader (int argc, char **argv)
 Default contructor.
void drawGrid (QImage *img, float resolution)
 Draws a grid in an image.
QPoint getGlobalPoint (QPoint p)
 Calculates the "real" point in the image.
void moveDirectionally (int key)
 Updates the image center by moving directionally.
void resetZoom (void)
 Resets the zoom of the image.
void resizeEvent (QResizeEvent *e)
 Captures the resize event.
void setInitialImageSize (QSize s)
 Sets the initial image size.
void updateCenter (QPoint p)
 Updates the image center.
void updateImage (QImage *img)
 Updates the image.
void updateZoom (QPoint p, bool zoomIn)
 Updates the zoom of the image.

Private Member Functions

std::pair< int, int > checkDimensions (int w, int h)
 Return the dimensions according to the container size.
QPoint pointUnscaled (QPoint p)
 Unscales the input point.

Private Attributes

int argc_
 < Number of input arguments
char ** argv_
 Current zoom. Calculated as pow(2,zoom_) * initial image size.
QSize initial_image_size_
QImage * internal_img_
 The upper left point of map visualization.
QPoint map_max_
 The original image size.
QPoint map_min_
 The lower right point of map visualization.
int zoom_
 Internal image used before a map is loaded.

Detailed Description

Implements the low level Qt functionalities of the map widget. Inherits from Ui_mapWidget (generated from an ui file) and QWidget.

Definition at line 40 of file stdr_map_loader.h.


Constructor & Destructor Documentation

stdr_gui::CMapLoader::CMapLoader ( int  argc,
char **  argv 
)

Default contructor.

Parameters:
argc[int] Number of input arguments
argv[char **] Input arguments
Returns:
void

Definition at line 32 of file stdr_map_loader.cpp.


Member Function Documentation

std::pair< int, int > stdr_gui::CMapLoader::checkDimensions ( int  w,
int  h 
) [private]

Return the dimensions according to the container size.

Parameters:
w[int] Image width
h[int] Image height
Returns:
std::pair<int,int> : The size the map must be resized to

Definition at line 59 of file stdr_map_loader.cpp.

void stdr_gui::CMapLoader::drawGrid ( QImage *  img,
float  resolution 
)

Draws a grid in an image.

Parameters:
img[QImage*] The image for the grid to be drawn on
resolution[float] The map resolution
Returns:
void

Definition at line 108 of file stdr_map_loader.cpp.

Calculates the "real" point in the image.

Parameters:
p[QPoint] The point to be translated
Returns:
QPoint : The new point

Definition at line 304 of file stdr_map_loader.cpp.

Updates the image center by moving directionally.

Parameters:
key[int] The key pressed
Returns:
void

Definition at line 196 of file stdr_map_loader.cpp.

QPoint stdr_gui::CMapLoader::pointUnscaled ( QPoint  p) [private]

Unscales the input point.

Parameters:
p[QPoint] Point of an event in the adjusted map
Returns:
QPoint : The same point in the original map

Definition at line 274 of file stdr_map_loader.cpp.

Resets the zoom of the image.

Returns:
void

Definition at line 292 of file stdr_map_loader.cpp.

void stdr_gui::CMapLoader::resizeEvent ( QResizeEvent *  e)

Captures the resize event.

Parameters:
e[QResizeEvent*] The resize event
Returns:
void

Definition at line 48 of file stdr_map_loader.cpp.

Sets the initial image size.

Parameters:
s[QSize] The initial image size
Returns:
void

Definition at line 319 of file stdr_map_loader.cpp.

Updates the image center.

Parameters:
p[QPoint] The new center
Returns:
void

Definition at line 230 of file stdr_map_loader.cpp.

void stdr_gui::CMapLoader::updateImage ( QImage *  img)

Updates the image.

Parameters:
img[QImage*] The image to be updated
Returns:
void

Definition at line 83 of file stdr_map_loader.cpp.

void stdr_gui::CMapLoader::updateZoom ( QPoint  p,
bool  zoomIn 
)

Updates the zoom of the image.

Parameters:
p[QPoint] The point of the zoom event
zoomIn[bool] True if zoom in, false if zoom out
Returns:
void

Definition at line 129 of file stdr_map_loader.cpp.


Member Data Documentation

< Number of input arguments

Input arguments

Definition at line 48 of file stdr_map_loader.h.

char** stdr_gui::CMapLoader::argv_ [private]

Current zoom. Calculated as pow(2,zoom_) * initial image size.

Definition at line 50 of file stdr_map_loader.h.

Definition at line 63 of file stdr_map_loader.h.

The upper left point of map visualization.

Definition at line 56 of file stdr_map_loader.h.

The original image size.

Definition at line 62 of file stdr_map_loader.h.

The lower right point of map visualization.

Definition at line 59 of file stdr_map_loader.h.

Internal image used before a map is loaded.

Definition at line 53 of file stdr_map_loader.h.


The documentation for this class was generated from the following files:


stdr_gui
Author(s): Manos Tsardoulias
autogenerated on Tue Feb 7 2017 03:46:43