From 6e6ef8adb1b05f9e8088fa83db63ed0943868497 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Wed, 31 Mar 2010 09:44:30 +0300 Subject: [PATCH] Fixed license & changed setting map tile offset to position. --- src/map/mapengine.cpp | 41 ++++++++++++++++++++-------------------- src/map/mapengine.h | 42 ++++++++++++++++++++--------------------- src/map/mapscene.cpp | 37 ++++++++++++++++-------------------- src/map/mapscene.h | 42 ++++++++++++++++++++--------------------- src/map/maptile.cpp | 50 +++++++++++++++++++++++++++++++------------------ src/map/maptile.h | 38 +++++++++++++++++++------------------ src/map/mapview.cpp | 41 ++++++++++++++++++++-------------------- src/map/mapview.h | 42 ++++++++++++++++++++--------------------- 8 files changed, 168 insertions(+), 165 deletions(-) diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp index e545c59..079cb36 100644 --- a/src/map/mapengine.cpp +++ b/src/map/mapengine.cpp @@ -1,24 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: - - Sami Rämö - sami.ramo@ixonos.com - - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: + + Sami Rämö - sami.ramo@ixonos.com + + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #include diff --git a/src/map/mapengine.h b/src/map/mapengine.h index 882bd2e..f5c5e94 100644 --- a/src/map/mapengine.h +++ b/src/map/mapengine.h @@ -1,25 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: - - Sami Rämö - sami.ramo@ixonos.com - - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ - +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: + + Sami Rämö - sami.ramo@ixonos.com + + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #ifndef MAPENGINE_H #define MAPENGINE_H diff --git a/src/map/mapscene.cpp b/src/map/mapscene.cpp index e0203f6..39f7955 100644 --- a/src/map/mapscene.cpp +++ b/src/map/mapscene.cpp @@ -1,24 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: - Sami Rämö - sami.ramo@ixonos.com + Sami Rämö - sami.ramo@ixonos.com - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #include @@ -31,9 +30,5 @@ MapScene::MapScene(QObject *parent) : QGraphicsScene(parent) void MapScene::addMapTile(MapTile *mapTile) { - /// \todo Study why offset must not be scaled with zoom level - mapTile->setOffset(MapEngine::convertTileNumberToSceneCoordinate(MapEngine::MAX_ZOOM_LEVEL, mapTile->tileNumber())); -// qDebug() << __PRETTY_FUNCTION__ << "offset" << mapTile->offset(); - addItem(mapTile); } diff --git a/src/map/mapscene.h b/src/map/mapscene.h index cba96ce..557c9f2 100644 --- a/src/map/mapscene.h +++ b/src/map/mapscene.h @@ -1,25 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: - - Sami Rämö - sami.ramo@ixonos.com - - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ - +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: + + Sami Rämö - sami.ramo@ixonos.com + + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #ifndef MAPSCENE_H #define MAPSCENE_H diff --git a/src/map/maptile.cpp b/src/map/maptile.cpp index f2f1e05..b8680ca 100644 --- a/src/map/maptile.cpp +++ b/src/map/maptile.cpp @@ -1,24 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: - Sami Rämö - sami.ramo@ixonos.com + Sami Rämö - sami.ramo@ixonos.com - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #include @@ -40,8 +39,9 @@ quint8 MapTile::zoomLevel() void MapTile::setZoomLevel(quint8 zoomLevel) { m_zoomLevel = zoomLevel; + setPosition(); - double zoomFactor = pow(2, (MapEngine::MAX_ZOOM_LEVEL - zoomLevel)); + double zoomFactor = pow(2, (MapEngine::MAX_ZOOM_LEVEL - m_zoomLevel)); setScale(zoomFactor); } @@ -53,4 +53,18 @@ QPoint MapTile::tileNumber() void MapTile::setTileNumber(QPoint tileNumber) { m_tileNumber = tileNumber; + setPosition(); } + +//void MapTile::setPixmap(QPixmap pixmap) +//{ +// QGraphicsPixmapItem::setPixmap(pixmap); +//} + +void MapTile::setPosition() +{ +// mapTile->setPos(MapEngine::convertTileNumberToSceneCoordinate(mapTile->zoomLevel(), mapTile->tileNumber())); + setPos(MapEngine::convertTileNumberToSceneCoordinate(m_zoomLevel, m_tileNumber)); +} + + diff --git a/src/map/maptile.h b/src/map/maptile.h index ca04793..0fa650f 100644 --- a/src/map/maptile.h +++ b/src/map/maptile.h @@ -1,25 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: - Sami Rämö - sami.ramo@ixonos.com + Sami Rämö - sami.ramo@ixonos.com - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #ifndef MAPTILE_H #define MAPTILE_H @@ -35,6 +33,10 @@ public: void setZoomLevel(quint8 zoomLevel); QPoint tileNumber(); void setTileNumber(QPoint tileNumber); +// void setPixmap(QPixmap pixmap); + +private: + void setPosition(); private: quint32 m_zoomLevel; diff --git a/src/map/mapview.cpp b/src/map/mapview.cpp index 24c14ee..2eff41d 100644 --- a/src/map/mapview.cpp +++ b/src/map/mapview.cpp @@ -1,24 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: - - Sami Rämö - sami.ramo@ixonos.com - - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: + + Sami Rämö - sami.ramo@ixonos.com + + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #include diff --git a/src/map/mapview.h b/src/map/mapview.h index aa57005..8844fd8 100644 --- a/src/map/mapview.h +++ b/src/map/mapview.h @@ -1,25 +1,23 @@ - /* - Situare - A location system for Facebook - Copyright (C) 2010 Ixonos Plc. Authors: - - Sami Rämö - sami.ramo@ixonos.com - - Situare is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - Situare is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Situare; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. - */ - +/* + Situare - A location system for Facebook + Copyright (C) 2010 Ixonos Plc. Authors: + + Sami Rämö - sami.ramo@ixonos.com + + Situare is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + + Situare is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Situare; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. +*/ #ifndef MAPVIEW_H #define MAPVIEW_H -- 1.7.9.5