~fluidity-core/fluidity/refactor-netcdf

« back to all changes in this revision

Viewing changes to spatialindex-1.8.0/include/spatialindex/RTree.h

  • Committer: Jon Hill
  • Date: 2013-02-16 09:01:40 UTC
  • mfrom: (3981.7.159 fluidity)
  • Revision ID: jon.hill@imperial.ac.uk-20130216090140-bplzxqzdk1eik4za
Megre from trunk, fixing several conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * Project:  libspatialindex - A C++ library for spatial indexing
 
3
 * Author:   Marios Hadjieleftheriou, mhadji@gmail.com
 
4
 ******************************************************************************
 
5
 * Copyright (c) 2004, Marios Hadjieleftheriou
 
6
 *
 
7
 * All rights reserved.
 
8
 * 
 
9
 * Permission is hereby granted, free of charge, to any person obtaining a
 
10
 * copy of this software and associated documentation files (the "Software"),
 
11
 * to deal in the Software without restriction, including without limitation
 
12
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
13
 * and/or sell copies of the Software, and to permit persons to whom the
 
14
 * Software is furnished to do so, subject to the following conditions:
 
15
 *
 
16
 * The above copyright notice and this permission notice shall be included
 
17
 * in all copies or substantial portions of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
20
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
22
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
24
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
25
 * DEALINGS IN THE SOFTWARE.
 
26
******************************************************************************/
 
27
 
 
28
#pragma once
 
29
 
 
30
namespace SpatialIndex
 
31
{
 
32
        namespace RTree
 
33
        {
 
34
                SIDX_DLL enum RTreeVariant
 
35
                {
 
36
                        RV_LINEAR = 0x0,
 
37
                        RV_QUADRATIC,
 
38
                        RV_RSTAR
 
39
                };
 
40
 
 
41
                SIDX_DLL enum BulkLoadMethod
 
42
                {
 
43
                        BLM_STR = 0x0
 
44
                };
 
45
 
 
46
                SIDX_DLL enum PersistenObjectIdentifier
 
47
                {
 
48
                        PersistentIndex = 0x1,
 
49
                        PersistentLeaf = 0x2
 
50
                };
 
51
 
 
52
                SIDX_DLL enum RangeQueryType
 
53
                {
 
54
                        ContainmentQuery = 0x1,
 
55
                        IntersectionQuery = 0x2
 
56
                };
 
57
 
 
58
                class SIDX_DLL Data : public IData, public Tools::ISerializable
 
59
                {
 
60
                public:
 
61
                        Data(uint32_t len, byte* pData, Region& r, id_type id);
 
62
                        virtual ~Data();
 
63
 
 
64
                        virtual Data* clone();
 
65
                        virtual id_type getIdentifier() const;
 
66
                        virtual void getShape(IShape** out) const;
 
67
                        virtual void getData(uint32_t& len, byte** data) const;
 
68
                        virtual uint32_t getByteArraySize();
 
69
                        virtual void loadFromByteArray(const byte* data);
 
70
                        virtual void storeToByteArray(byte** data, uint32_t& len);
 
71
 
 
72
                        id_type m_id;
 
73
                        Region m_region;
 
74
                        byte* m_pData;
 
75
                        uint32_t m_dataLength;
 
76
                }; // Data
 
77
 
 
78
                SIDX_DLL ISpatialIndex* returnRTree(IStorageManager& ind, Tools::PropertySet& in);
 
79
                SIDX_DLL ISpatialIndex* createNewRTree(
 
80
                        IStorageManager& sm,
 
81
                        double fillFactor,
 
82
                        uint32_t indexCapacity,
 
83
                        uint32_t leafCapacity,
 
84
                        uint32_t dimension,
 
85
                        RTreeVariant rv,
 
86
                        id_type& indexIdentifier
 
87
                );
 
88
                SIDX_DLL ISpatialIndex* createAndBulkLoadNewRTree(
 
89
                        BulkLoadMethod m,
 
90
                        IDataStream& stream,
 
91
                        IStorageManager& sm,
 
92
                        double fillFactor,
 
93
                        uint32_t indexCapacity,
 
94
                        uint32_t leafCapacity,
 
95
                        uint32_t dimension,
 
96
                        RTreeVariant rv,
 
97
                        id_type& indexIdentifier
 
98
                );
 
99
                SIDX_DLL ISpatialIndex* createAndBulkLoadNewRTree(
 
100
                        BulkLoadMethod m,
 
101
                        IDataStream& stream,
 
102
                        IStorageManager& sm,
 
103
                        Tools::PropertySet& ps,
 
104
                        id_type& indexIdentifier
 
105
                );
 
106
                SIDX_DLL ISpatialIndex* loadRTree(IStorageManager& in, id_type indexIdentifier);
 
107
        }
 
108
}