Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pilibocik: Doxygen

  • Loading branch information...
commit 6168b8108505bd9d8348a63d2b039e28c34a50b4 1 parent d7d5b76
@dotevo authored
View
32 lib/PiLibocik/include/pilibocik/boundarybox.h
@@ -10,15 +10,39 @@
namespace PiLibocik{
+/**
+ * @brief Boundary box has positions of two corners.
+ *
+ * @class BoundaryBox boundarybox.h "include/pilibocik/boundarybox.h"
+ */
class BoundaryBox{
private:
- Position p1;
- Position p2;
- int precision;
- QMap< int, QPair< double,double > > spatialError;
+ Position p1; /**< TODO */
+ Position p2; /**< TODO */
+ int precision; /**< TODO */
+ QMap< int, QPair< double,double > > spatialError; /**< TODO */
public:
+/**
+ * @brief Constructor
+ *
+ * @fn BoundaryBox
+ * @param p1 First corner
+ * @param p2 Second corner
+ */
BoundaryBox(Position p1,Position p2);
+ /**
+ * @brief
+ *
+ * @fn getCurrentError
+ * @return Error of precision
+ */
QPair< double,double > getCurrentError();
+ /**
+ * @brief List of geohashes in box.
+ *
+ * @fn getGeohashesIn
+ * @param precision precision of geohash.
+ */
QList < Geohash > getGeohashesIn(int precision);
};
View
162 lib/PiLibocik/include/pilibocik/geohash.h
@@ -7,42 +7,182 @@
#include <QHash>
namespace PiLibocik{
+ /**
+ * @brief
+ *
+ * @class Geohash geohash.h "include/pilibocik/geohash.h"
+ */
class Geohash
{
private:
- static const QString char_map;
+ static const QString char_map; /**< TODO */
+ /**
+ * @brief
+ *
+ * @fn init
+ * @param geohash
+ */
void init(QString geohash);
public:
- int geohashSize;
- char *geohashValue;
+ int geohashSize; /**< TODO */
+ char *geohashValue; /**< TODO */
+/**
+ * @brief Empty constructor
+ *
+ * @fn Geohash
+ */
Geohash();
+/**
+ * @brief Constructor with precision and empty data.
+ *
+ * @fn Geohash
+ * @param precision Length of geohash in base32.
+ */
Geohash(int precision);
+/**
+ * @brief Construct geohash from QString.
+ *
+ * @fn Geohash
+ * @param geohash Geohash in base32.
+ */
Geohash(QString geohash);
+/**
+ * @brief Coping constructor.
+ *
+ * @fn Geohash
+ * @param geohash
+ */
Geohash(const Geohash &geohash);
+/**
+ * @brief Geohash from position.
+ *
+ * @fn Geohash
+ * @param lon
+ * @param lat
+ * @param precision
+ */
Geohash(double lon,double lat,int precision);
+/**
+ * @brief Geohash from data.
+ *
+ * @fn Geohash
+ * @param n Array of chars.
+ * @param size Array size.
+ */
Geohash(char *n,int size);
+ /**
+ * @brief Destructor
+ *
+ * @fn ~Geohash
+ */
~Geohash();
+ /**
+ * @brief Geohash to QString (in base32).
+ *
+ * @fn toQString
+ */
QString toQString();
+ /**
+ * @brief Static method to generate geohash in position.
+ *
+ * @fn generateGeohash
+ * @param lon
+ * @param lat
+ * @param precision geohash length
+ */
static QString generateGeohash(double lon, double lat, int precision);
+ /**
+ * @brief Increment geohash value. 009 to 00a etc.
+ *
+ * @fn operator ++
+ * @param int
+ */
void operator++(int);
+ /**
+ * @brief Decrement geohash value.
+ *
+ * @fn operator --
+ * @param int
+ */
void operator--(int);
+ /**
+ * @brief
+ *
+ * @fn operator -
+ * @param q
+ */
unsigned long long operator-(Geohash &q);
- bool operator>(Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator >
+ * @param q
+ */
+ bool operator>(Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator <
+ * @param q
+ */
bool operator<(Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator <
+ * @param q
+ */
bool operator<(const Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator ==
+ * @param q
+ */
bool operator==(Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator =
+ * @param q
+ */
Geohash &operator=(Geohash &q);
+ /**
+ * @brief
+ *
+ * @fn operator =
+ * @param q
+ */
Geohash &operator=(const Geohash &q);
+ /**
+ * @brief Return error.
+ *
+ * @fn getError
+ * @param prec
+ */
static QPair< double, double > getError(int prec);
+ /**
+ * @brief Return error.
+ *
+ * @fn getError
+ */
QPair< double, double > getError();
};
}
+/**
+ * @brief
+ *
+ * @fn operator <
+ * @param e1
+ * @param e2
+ * @return bool operator
+ */
inline bool operator<(const PiLibocik::Geohash &e1, const PiLibocik::Geohash &e2){
for(int i=0;i<e1.geohashSize&&i<e2.geohashSize;i++){
if((short)e1.geohashValue[i]<(short)e2.geohashValue[i]){
@@ -53,12 +193,26 @@ inline bool operator<(const PiLibocik::Geohash &e1, const PiLibocik::Geohash &e
return false;
}
+/**
+ * @brief Function used in Hash.
+ *
+ * @fn caseInsensitiveLessThan
+ * @param s1
+ * @param s2
+ * @return bool
+ */
inline bool caseInsensitiveLessThan(const PiLibocik::Geohash &s1, const PiLibocik::Geohash &s2)
{
return s1<s2;
}
+/**
+ * @brief
+ *
+ * @fn qHash
+ * @param key
+ */
uint qHash(PiLibocik::Geohash &key);
#endif // GEOHASH_H
View
141 lib/PiLibocik/include/pilibocik/poi.h
@@ -11,22 +11,73 @@
namespace PiLibocik{
+ /**
+ * @brief
+ *
+ * @class PoiDisplay poi.h "include/pilibocik/poi.h"
+ */
class PoiDisplay
{
private:
- int type;
- bool display;
- int zoom;
- QString iconPath;
+ int type; /**< TODO */
+ bool display; /**< TODO */
+ int zoom; /**< TODO */
+ QString iconPath; /**< TODO */
public:
+/**
+ * @brief
+ *
+ * @fn PoiDisplay
+ */
PoiDisplay();
+/**
+ * @brief
+ *
+ * @fn PoiDisplay
+ * @param type
+ * @param display
+ * @param zoom
+ * @param iconPath
+ */
PoiDisplay(int type, bool display, int zoom, QString iconPath);
+ /**
+ * @brief
+ *
+ * @fn setDisplay
+ * @param display
+ */
void setDisplay(bool display);
+ /**
+ * @brief
+ *
+ * @fn getDisplay
+ */
bool getDisplay();
+ /**
+ * @brief
+ *
+ * @fn getZoom
+ */
int getZoom();
+ /**
+ * @brief
+ *
+ * @fn getType
+ */
int getType();
+ /**
+ * @brief
+ *
+ * @fn getIconPath
+ */
QString getIconPath();
+ /**
+ * @brief
+ *
+ * @fn operator ==
+ * @param p
+ */
bool operator ==(const PoiDisplay &p) const;
};
@@ -36,22 +87,32 @@ namespace PiLibocik{
*
* @class Poi poi.h <pilibocik/poi.h>
*/
+ /**
+ * @brief
+ *
+ * @class Poi poi.h "include/pilibocik/poi.h"
+ */
class Poi:public Position
{
private:
- QMap <int,QString> types; /**< TODO */
+ QMap <int,QString> types; /**< TODO */ /**< TODO */
- QString name; /**< TODO */
- int type; /**< TODO */
- QList < QPair <QString, QString> > tags; /**< TODO */
+ QString name; /**< TODO */ /**< TODO */
+ int type; /**< TODO */ /**< TODO */
+ QList < QPair <QString, QString> > tags; /**< TODO */ /**< TODO */
//#ifdef PiLibocik_WRITE_MODE
- QString geohash; /**< TODO */
+ QString geohash; /**< TODO */ /**< TODO */
//#endif
public:
/**
* @brief
*
*/
+/**
+ * @brief
+ *
+ * @fn Poi
+ */
Poi();
/**
* @brief
@@ -64,6 +125,17 @@ namespace PiLibocik{
* @param QList<QPair<QString
* @param tags
*/
+/**
+ * @brief
+ *
+ * @fn Poi
+ * @param lon
+ * @param lat
+ * @param name
+ * @param type
+ * @param QList<QPair<QString
+ * @param tags
+ */
Poi(double lon,double lat,QString name, int type, QList < QPair <QString, QString> > tags);
/**
* @brief
@@ -71,6 +143,11 @@ namespace PiLibocik{
* @fn getName
* @return QString with name of POI
*/
+ /**
+ * @brief
+ *
+ * @fn getName
+ */
QString getName() const;
/**
* @brief
@@ -78,6 +155,11 @@ namespace PiLibocik{
* @fn getTags
* @return all tags at POI
*/
+ /**
+ * @brief
+ *
+ * @fn getTags
+ */
QList < QPair <QString, QString> > getTags() const;
/**
* @brief
@@ -85,6 +167,11 @@ namespace PiLibocik{
* @fn getType
* @return type Id
*/
+ /**
+ * @brief
+ *
+ * @fn getType
+ */
int getType() const;
/**
* @brief
@@ -93,6 +180,13 @@ namespace PiLibocik{
* @param QMap<int
* @param types
*/
+ /**
+ * @brief
+ *
+ * @fn setTypes
+ * @param QMap<int
+ * @param types
+ */
void setTypes(QMap <int,QString> types);
/**
* @brief
@@ -100,12 +194,24 @@ namespace PiLibocik{
* @fn getTypeName
* @param type
*/
+ /**
+ * @brief
+ *
+ * @fn getTypeName
+ * @param type
+ */
QString getTypeName(int type);
/**
* @brief
*
* @param now
*/
+ /**
+ * @brief
+ *
+ * @fn isOpen
+ * @param now
+ */
int isOpen(QDateTime now);
@@ -122,12 +228,29 @@ namespace PiLibocik{
* @param tags
* @param geohash
*/
+/**
+ * @brief
+ *
+ * @fn Poi
+ * @param lon
+ * @param lat
+ * @param name
+ * @param type
+ * @param QList<QPair<QString
+ * @param tags
+ * @param geohash
+ */
Poi(double lon,double lat,QString name, int type, QList < QPair <QString, QString> > tags, QString geohash);
/**
* @brief
*
* @fn getGeohash
*/
+ /**
+ * @brief
+ *
+ * @fn getGeohash
+ */
QString getGeohash();
//#endif
};
View
41 lib/PiLibocik/include/pilibocik/poifileppoi.h
@@ -6,11 +6,35 @@
namespace PiLibocik{
+/**
+ * @brief
+ *
+ * @class PoiFilePPOI poifileppoi.h "include/pilibocik/poifileppoi.h"
+ */
class PoiFilePPOI:public PoiFile
{
public:
+/**
+ * @brief
+ *
+ * @fn PoiFilePPOI
+ */
PoiFilePPOI();
+ /**
+ * @brief
+ *
+ * @fn loadPOIsTypesFromFile
+ * @param file
+ */
QMap< int,QString > loadPOIsTypesFromFile(QString file);
+ /**
+ * @brief
+ *
+ * @fn loadPOIsFromFile
+ * @param file
+ * @param bbox
+ * @param PoiType
+ */
QList<Poi> loadPOIsFromFile(QString file,BoundaryBox &bbox,int PoiType);
@@ -19,7 +43,24 @@ class PoiFilePPOI:public PoiFile
void makeBlock(QDataStream &stream,QVector<Poi*>*data,int types);
#endif
private:
+ /**
+ * @brief
+ *
+ * @fn loadBlock
+ * @param inData
+ * @param position
+ * @param poiType
+ * @param typeSize
+ */
QList<Poi> loadBlock(QDataStream &inData,int position,int poiType,int typeSize);
+ /**
+ * @brief
+ *
+ * @fn loadPoisInType
+ * @param inData
+ * @param position
+ * @param type
+ */
QList<Poi> loadPoisInType(QDataStream &inData,int position,int type);
};
View
108 lib/PiLibocik/include/pilibocik/preparedata.h
@@ -21,39 +21,131 @@
namespace PiLibocik{
+ /**
+ * @brief
+ *
+ * @class PrepareData preparedata.h "include/pilibocik/preparedata.h"
+ */
class PrepareData: public QObject
{
Q_OBJECT
private:
- QSqlDatabase db;
- QStringList queriesBuffer;
- QList<Poi> poiList;
- QList<Poi> poiFromNodesList;
- QMap<int, QList<QPair<QString,QString> > > poiTypes;
- QMap<int,QString> poiTypeNames;
- QMap<int,QList<QString> > poiTypeSubtags;
- QMap<int,QList<Position> > wayNodes;
+ QSqlDatabase db; /**< TODO */
+ QStringList queriesBuffer; /**< TODO */
+ QList<Poi> poiList; /**< TODO */
+ QList<Poi> poiFromNodesList; /**< TODO */
+ QMap<int, QList<QPair<QString,QString> > > poiTypes; /**< TODO */
+ QMap<int,QString> poiTypeNames; /**< TODO */
+ QMap<int,QList<QString> > poiTypeSubtags; /**< TODO */
+ QMap<int,QList<Position> > wayNodes; /**< TODO */
+ /**
+ * @brief
+ *
+ * @fn shapeToPoint
+ * @param shape
+ */
Position shapeToPoint(QList<Position> shape);
+ /**
+ * @brief
+ *
+ * @fn removePoiDuplicates
+ */
void removePoiDuplicates();
+ /**
+ * @brief
+ *
+ * @fn createTables
+ */
void createTables();
public:
+/**
+ * @brief
+ *
+ * @fn PrepareData
+ * @param dbMapPath
+ * @param dbOutPath
+ * @param XMLconfigPath
+ */
PrepareData(QString dbMapPath, QString dbOutPath, QString XMLconfigPath);
+/**
+ * @brief
+ *
+ * @fn PrepareData
+ * @param dbMapPath
+ * @param XMLconfigPath
+ */
PrepareData(QString dbMapPath, QString XMLconfigPath);
+/**
+ * @brief
+ *
+ * @fn PrepareData
+ * @param dbLoadPath
+ */
PrepareData(QString dbLoadPath);
+/**
+ * @brief
+ *
+ * @fn PrepareData
+ */
PrepareData();
+ /**
+ * @brief
+ *
+ * @fn getPoiList
+ */
QList<Poi> getPoiList();
+ /**
+ * @brief
+ *
+ * @fn getPoiTypeNames
+ */
QMap<int,QString> getPoiTypeNames();
+ /**
+ * @brief
+ *
+ * @fn init
+ * @param dbMapPath
+ * @param XMLconfigPath
+ */
void init(QString dbMapPath, QString XMLconfigPath);
+ /**
+ * @brief
+ *
+ * @fn generateData
+ */
void generateData();
+ /**
+ * @brief
+ *
+ * @fn saveToDatabase
+ */
void saveToDatabase();
+ /**
+ * @brief
+ *
+ * @fn loadXMLconfig
+ * @param XMLpath
+ */
void loadXMLconfig(QString XMLpath);
+ /**
+ * @brief
+ *
+ * @fn loadFromDatabase
+ * @param dbLoadPath
+ */
void loadFromDatabase(QString dbLoadPath);
signals:
+ /**
+ * @brief
+ *
+ * @fn progress
+ * @param percent
+ */
void progress(int percent);
};
Please sign in to comment.
Something went wrong with that request. Please try again.