GEOS  3.14.0dev
bintree/Key.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #pragma once
16 
17 #include <geos/export.h>
18 
19 // Forward declarations
20 namespace geos {
21 namespace index {
22 namespace bintree {
23 class Interval;
24 }
25 }
26 }
27 
28 namespace geos {
29 namespace index { // geos::index
30 namespace bintree { // geos::index::bintree
31 
38 class GEOS_DLL Key {
39 
40 public:
41 
42  static int computeLevel(Interval* newInterval);
43 
44  Key(Interval* newInterval);
45 
46  ~Key();
47 
48  double getPoint();
49 
50  int getLevel();
51 
52  Interval* getInterval();
53 
54  void computeKey(Interval* itemInterval);
55 
56 private:
57 
58  // the fields which make up the key
59  double pt;
60  int level;
61 
62  // auxiliary data which is derived from the key for use in computation
63  Interval* interval;
64 
65  void computeInterval(int level, Interval* itemInterval);
66 };
67 
68 } // namespace geos::index::bintree
69 } // namespace geos::index
70 } // namespace geos
71 
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:24
A Key is a unique identifier for a node in a tree.
Definition: bintree/Key.h:38
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25