-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
925 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include <iostream> | ||
|
||
#include <QFile> | ||
|
||
#include "QctMapDB.h" | ||
#include "QctFile.h" | ||
|
||
#define NOT_IMPLEMENTED std::cerr << __PRETTY_FUNCTION__ << ": not implemented yet." | ||
|
||
QctMapDB::QctMapDB(const QString& name) | ||
: MapDB(name) | ||
{ | ||
if(!QFile(name).exists()) | ||
throw std::runtime_error("Specified file " + name.toStdString() + " is not present on disk."); | ||
|
||
std::cerr << "Reading Qct file " + name.toStdString() << std::endl; | ||
|
||
mQctFile.readFilename(name.toStdString().c_str(),true,nullptr); | ||
|
||
double lat_00, lon_00, lat_10, lon_10, lat_01, lon_01, lat_11, lon_11 ; | ||
mQctFile.computeLatLonLimits(lat_00, lon_00, lat_10, lon_10, lat_01, lon_01, lat_11, lon_11 ); | ||
|
||
std::cerr << "Limits: (" << lat_00 << "," << lon_00 << ")" << std::endl; | ||
std::cerr << "Limits: (" << lat_01 << "," << lon_01 << ")" << std::endl; | ||
std::cerr << "Limits: (" << lat_10 << "," << lon_10 << ")" << std::endl; | ||
std::cerr << "Limits: (" << lat_11 << "," << lon_11 << ")" << std::endl; | ||
|
||
if(lat_00 == lat_01 && lon_00 == lon_10) | ||
std::cerr << "Area is axis aligned. Good." << std::endl; | ||
else | ||
std::cerr << "Area is not axis aligned. Not good." << std::endl; | ||
} | ||
|
||
const std::map<MapDB::ImageHandle,MapDB::RegisteredImage>& QctMapDB::getFullListOfImages() const | ||
{ | ||
NOT_IMPLEMENTED; | ||
|
||
return std::map<MapDB::ImageHandle,MapDB::RegisteredImage>(); | ||
} | ||
bool QctMapDB::getImageParams(ImageHandle h, MapDB::RegisteredImage& img) const | ||
{ | ||
NOT_IMPLEMENTED; | ||
|
||
return false; | ||
} | ||
QImage QctMapDB::getImageData(ImageHandle h) const | ||
{ | ||
NOT_IMPLEMENTED; | ||
|
||
return QImage(); | ||
} | ||
bool QctMapDB::imageSpaceCoordinatesToGPSCoordinates(const MapDB::ImageSpaceCoord& ic,MapDB::GPSCoord& g) const | ||
{ | ||
NOT_IMPLEMENTED; | ||
|
||
return false; | ||
} | ||
|
||
const MapDB::ReferencePoint& QctMapDB::getReferencePoint(int i) const | ||
{ | ||
NOT_IMPLEMENTED; | ||
return ReferencePoint(); | ||
} | ||
int QctMapDB::numberOfReferencePoints() const { return 2 ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "QctFile.h" | ||
#include "MapDB.h" | ||
|
||
// Manages a collection of maps represented by a single QCT file | ||
|
||
class QctMapDB : public MapDB | ||
{ | ||
public: | ||
QctMapDB(const QString& qct_filename) ; // initializes the map. Loads the registered images entries from xml file. | ||
virtual ~QctMapDB() {} | ||
|
||
virtual const std::map<ImageHandle,MapDB::RegisteredImage>& getFullListOfImages() const override ; | ||
virtual bool getImageParams(ImageHandle h, MapDB::RegisteredImage& img) const override; | ||
virtual QImage getImageData(ImageHandle h) const override; | ||
virtual bool imageSpaceCoordinatesToGPSCoordinates(const MapDB::ImageSpaceCoord& ic,MapDB::GPSCoord& g) const override; | ||
virtual const ReferencePoint& getReferencePoint(int i) const override; | ||
virtual int numberOfReferencePoints() const override; | ||
|
||
private: | ||
|
||
QctFile mQctFile; | ||
}; |
Oops, something went wrong.