Public Member Functions | Private Member Functions | Private Attributes | List of all members
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>

Inheritance diagram for stdr_gui::CMapLoader:
Inheritance graph
[legend]

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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.

QPoint stdr_gui::CMapLoader::getGlobalPoint ( QPoint  p)

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.

void stdr_gui::CMapLoader::moveDirectionally ( int  key)

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.

void stdr_gui::CMapLoader::resetZoom ( void  )

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.

void stdr_gui::CMapLoader::setInitialImageSize ( QSize  s)

Sets the initial image size.

Parameters
s[QSize] The initial image size
Returns
void

Definition at line 319 of file stdr_map_loader.cpp.

void stdr_gui::CMapLoader::updateCenter ( QPoint  p)

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

int stdr_gui::CMapLoader::argc_
private

< Number of input arguments

Input arguments

Definition at line 47 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 49 of file stdr_map_loader.h.

QSize stdr_gui::CMapLoader::initial_image_size_
private

Definition at line 63 of file stdr_map_loader.h.

QImage* stdr_gui::CMapLoader::internal_img_
private

The upper left point of map visualization.

Definition at line 54 of file stdr_map_loader.h.

QPoint stdr_gui::CMapLoader::map_max_
private

The original image size.

Definition at line 60 of file stdr_map_loader.h.

QPoint stdr_gui::CMapLoader::map_min_
private

The lower right point of map visualization.

Definition at line 57 of file stdr_map_loader.h.

int stdr_gui::CMapLoader::zoom_
private

Internal image used before a map is loaded.

Definition at line 51 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 Mon Jun 10 2019 15:15:17