dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
rawtile.cpp
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #include "rawtile.h"
28 
29 
30 namespace core {
31 RawTile::RawTile(const MapType::Types &Type, const Point &Pos, const int &Zoom)
32 {
33  zoom=Zoom;
34  type=Type;
35  pos=Pos;
36 }
38 {
39  return QString("%1 at zoom %2, pos:%3,%4").arg(type).arg(zoom).arg(pos.X()).arg(pos.Y());
40 }
42 {
43  return pos;
44 }
45 MapType::Types RawTile::Type()
46 {
47  return type;
48 }
50 {
51  return zoom;
52 }
53 void RawTile::setType(const MapType::Types &value)
54 {
55  type=value;
56 }
57 void RawTile::setPos(const Point &value)
58 {
59  pos=value;
60 }
61 void RawTile::setZoom(const int &value)
62 {
63  zoom=value;
64 }
65 uint qHash(RawTile const& tile)
66 {
67  // RawTile tile=tilee;
68  quint64 tmp=(((quint64)(tile.zoom))<<54)+(((quint64)(tile.type))<<36)+(((quint64)(tile.pos.X()))<<18)+(((quint64)(tile.pos.Y())));
69  // quint64 tmp5=tmp+tmp2+tmp3+tmp4;
70  return ::qHash(tmp);
71 }
72 bool operator==(RawTile const &lhs,RawTile const &rhs)
73 {
74  return (lhs.pos==rhs.pos && lhs.zoom==rhs.zoom && lhs.type==rhs.type);
75 }
76 }
qint64 X() const
Definition: point.h:51
void setType(const MapType::Types &value)
Definition: rawtile.cpp:53
void setPos(const core::Point &value)
Definition: rawtile.cpp:57
bool operator==(Point const &lhs, Point const &rhs)
Definition: point.cpp:49
MapType::Types Type()
Definition: rawtile.cpp:45
int Zoom()
Definition: rawtile.cpp:49
uint qHash(RawTile const &tile)
Definition: rawtile.cpp:65
core::Point Pos()
Definition: rawtile.cpp:41
quint64 qHash(Point const &point)
Definition: point.cpp:45
qint64 Y() const
Definition: point.h:52
void setZoom(const int &value)
Definition: rawtile.cpp:61
QString ToString(void)
Definition: rawtile.cpp:37
RawTile(const MapType::Types &Type, const core::Point &Pos, const int &Zoom)
Definition: rawtile.cpp:31