Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

MapVisuals Class Reference

#include <MapVisuals.H>

Collaboration diagram for MapVisuals:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is the core of the mapVisuals for BikeQuest. The first method defined will only be used once, and it will be offline. Once all the mapTile gifs have been created, the webGUI will be able to call the other two methods to access both a visual and textual description of the user's requested route.


Public Member Functions

 MapVisuals (DBInterface *db, bool tiles=false)
virtual ~MapVisuals ()
bool areTilesGenerated ()
 Since the TilesGeneration method isn't really called by another component it doesn't really need to be shown on the interface. Instead we will have a method that returns true if the tiles have been generated. If its false then we know that the tiles haven't been made.
string drawRoute (path_t *route, int dZoom=-1, int sX=0, int sY=0, int Pan=0, string routeID="")
 PathDesc is a struct that is defined elsewhere in our program. I will use this struct to obtain graphical information from the database so that I can draw out a path. The zoom parameter will determine how big this path must be drawn, in order to accommodate the map that is being shown by the webGUI. I then draw this route on the tiles and return the whole image to the webGUI. For right now, I am returning a QImage, but most likely that will change.
string routeInstructions (path_t route)
 PathDesc is a struct that is defined elsewhere in our program. Using the struct, I am able to obtain intersection information that I can then use to call getPath on the database. Once I have obtained the all the information, this method will create a string that will give the user instructions on how to get to their destination.
seg_t streetHit (double x, double y)
 Once a user clicks on a portion of the map, I am returned an x and y coordinate. Using the coordinates I check if the user clicked on a road and then return the streetSeg that the user clicked on.

Private Attributes

MapGeneratorm_mGenerator
 Pointer to an instance of MapGenerator, which is responsible for drawing an actual route.
int m_argc
 Parameter indicating the number of parameters being passed in.
char * m_argv
 Parameter indicating a file name.
DBInterfacem_db
 Pointer to an instance of the database, where MapVisuals gets data to perform its tasks.


Constructor & Destructor Documentation

MapVisuals::MapVisuals DBInterface db,
bool  tiles = false
 

MapVisuals::~MapVisuals  )  [virtual]
 


Member Function Documentation

bool MapVisuals::areTilesGenerated  ) 
 

Since the TilesGeneration method isn't really called by another component it doesn't really need to be shown on the interface. Instead we will have a method that returns true if the tiles have been generated. If its false then we know that the tiles haven't been made.

string MapVisuals::drawRoute path_t route,
int  dZoom = -1,
int  sX = 0,
int  sY = 0,
int  Pan = 0,
string  routeID = ""
 

PathDesc is a struct that is defined elsewhere in our program. I will use this struct to obtain graphical information from the database so that I can draw out a path. The zoom parameter will determine how big this path must be drawn, in order to accommodate the map that is being shown by the webGUI. I then draw this route on the tiles and return the whole image to the webGUI. For right now, I am returning a QImage, but most likely that will change.

Here is the call graph for this function:

string MapVisuals::routeInstructions path_t  route  ) 
 

PathDesc is a struct that is defined elsewhere in our program. Using the struct, I am able to obtain intersection information that I can then use to call getPath on the database. Once I have obtained the all the information, this method will create a string that will give the user instructions on how to get to their destination.

seg_t MapVisuals::streetHit double  x,
double  y
 

Once a user clicks on a portion of the map, I am returned an x and y coordinate. Using the coordinates I check if the user clicked on a road and then return the streetSeg that the user clicked on.


Member Data Documentation

int MapVisuals::m_argc [private]
 

Parameter indicating the number of parameters being passed in.

char* MapVisuals::m_argv [private]
 

Parameter indicating a file name.

DBInterface* MapVisuals::m_db [private]
 

Pointer to an instance of the database, where MapVisuals gets data to perform its tasks.

MapGenerator* MapVisuals::m_mGenerator [private]
 

Pointer to an instance of MapGenerator, which is responsible for drawing an actual route.


The documentation for this class was generated from the following files:
Generated on Mon May 16 11:08:52 2005 for BikeQuest by  doxygen 1.4.0