~ubuntu-branches/ubuntu/quantal/marble/quantal

« back to all changes in this revision

Viewing changes to tools/osm-addresses/OsmRegionTree.h

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-11 15:43:02 UTC
  • Revision ID: james.westby@ubuntu.com-20110711154302-lq69ftcx125g1jx5
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// This file is part of the Marble Virtual Globe.
 
3
//
 
4
// This program is free software licensed under the GNU LGPL. You can
 
5
// find a copy of this license in LICENSE.txt in the top directory of
 
6
// the source code.
 
7
//
 
8
// Copyright 2011      Dennis Nienhüser <earthwings@gentoo.org>
 
9
//
 
10
 
 
11
#ifndef OSMREGIONTREE_H
 
12
#define OSMREGIONTREE_H
 
13
 
 
14
#include "OsmRegion.h"
 
15
 
 
16
#include <QtCore/QVector>
 
17
 
 
18
namespace Marble
 
19
{
 
20
 
 
21
class OsmRegionTree
 
22
{
 
23
public:
 
24
    OsmRegionTree( const OsmRegion & node = OsmRegion() );
 
25
 
 
26
    const OsmRegion &node() const;
 
27
 
 
28
    void setChildren( const QVector<OsmRegionTree> children );
 
29
 
 
30
    const QVector<OsmRegionTree> & children() const;
 
31
 
 
32
    void append( QList<OsmRegion> &regions );
 
33
 
 
34
    void traverse( int &counter );
 
35
 
 
36
    operator QList<OsmRegion>() const;
 
37
 
 
38
    int smallestRegionId( const GeoDataCoordinates &coordinates ) const;
 
39
 
 
40
private:
 
41
    int smallestRegionId( const GeoDataCoordinates &coordinates, int &level ) const;
 
42
 
 
43
    void enumerate( QList<OsmRegion> &list ) const;
 
44
 
 
45
    OsmRegion m_node;
 
46
 
 
47
    QVector<OsmRegionTree> m_children;
 
48
};
 
49
 
 
50
}
 
51
 
 
52
#endif // OSMREGIONTREE_H
 
53