~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/core/spatialindex/include/RTree.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Spatial Index Library
 
2
//
 
3
// Copyright (C) 2003 Navel Ltd.
 
4
//
 
5
// This library is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU Lesser General Public
 
7
// License as published by the Free Software Foundation; either
 
8
// version 2.1 of the License, or (at your option) any later version.
 
9
//
 
10
// This library is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
// Lesser General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU Lesser General Public
 
16
// License along with this library; if not, write to the Free Software
 
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
//
 
19
//  Email:
 
20
//    mhadji@gmail.com
 
21
 
 
22
#ifndef __spatialindex_rtree_h
 
23
#define __spatialindex_rtree_h
 
24
 
 
25
namespace SpatialIndex
 
26
{
 
27
  namespace RTree
 
28
  {
 
29
    enum RTreeVariant
 
30
    {
 
31
      RV_LINEAR = 0x0,
 
32
      RV_QUADRATIC,
 
33
      RV_RSTAR
 
34
    };
 
35
 
 
36
    enum BulkLoadMethod
 
37
    {
 
38
      BLM_STR = 0x0
 
39
    };
 
40
 
 
41
    enum PersistenObjectIdentifier
 
42
    {
 
43
      PersistentIndex = 0x1,
 
44
      PersistentLeaf = 0x2
 
45
    };
 
46
 
 
47
    enum RangeQueryType
 
48
    {
 
49
      ContainmentQuery = 0x1,
 
50
      IntersectionQuery = 0x2
 
51
    };
 
52
 
 
53
    class Data : public IData, public Tools::ISerializable
 
54
    {
 
55
      public:
 
56
        Data( unsigned long len, byte* pData, Tools::Geometry::Region& r, long id );
 
57
        virtual ~Data();
 
58
 
 
59
        virtual Data* clone();
 
60
        virtual long getIdentifier() const;
 
61
        virtual void getShape( IShape** out ) const;
 
62
        virtual void getData( unsigned long& len, byte** data ) const;
 
63
        virtual unsigned long getByteArraySize();
 
64
        virtual void loadFromByteArray( const byte* data );
 
65
        virtual void storeToByteArray( byte** data, unsigned long& len );
 
66
 
 
67
        long m_id;
 
68
        Tools::Geometry::Region m_region;
 
69
        byte* m_pData;
 
70
        unsigned long m_dataLength;
 
71
    }; // Data
 
72
 
 
73
#ifdef _MSC_VER
 
74
    // MSVC didn't like the difference in parameter names between declaration
 
75
    // definition
 
76
    extern ISpatialIndex* returnRTree( IStorageManager& sm, Tools::PropertySet& ps );
 
77
#else
 
78
    extern ISpatialIndex* returnRTree( IStorageManager& in0, Tools::PropertySet& in1 );
 
79
#endif//_MSC_VER
 
80
    extern ISpatialIndex* createNewRTree(
 
81
      IStorageManager& sm,
 
82
      double fillFactor,
 
83
      unsigned long indexCapacity,
 
84
      unsigned long leafCapacity,
 
85
      unsigned long dimension,
 
86
      RTreeVariant rv,
 
87
      long& indexIdentifier
 
88
    );
 
89
    extern ISpatialIndex* createAndBulkLoadNewRTree(
 
90
      BulkLoadMethod m,
 
91
      IDataStream& stream,
 
92
      IStorageManager& sm,
 
93
      double fillFactor,
 
94
      unsigned long indexCapacity,
 
95
      unsigned long leafCapacity,
 
96
      unsigned long dimension,
 
97
      RTreeVariant rv,
 
98
      long& indexIdentifier
 
99
    );
 
100
    extern ISpatialIndex* loadRTree( IStorageManager& in, long indexIdentifier );
 
101
  }
 
102
}
 
103
 
 
104
#endif /* __spatialindex_rtree_h */