GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 **********************************************************************/ 00014 00015 #ifndef GEOS_IDX_BINTREE_KEY_H 00016 #define GEOS_IDX_BINTREE_KEY_H 00017 00018 #include <geos/export.h> 00019 00020 // Forward declarations 00021 namespace geos { 00022 namespace index { 00023 namespace bintree { 00024 class Interval; 00025 } 00026 } 00027 } 00028 00029 namespace geos { 00030 namespace index { // geos::index 00031 namespace bintree { // geos::index::bintree 00032 00039 class GEOS_DLL Key { 00040 00041 public: 00042 00043 static int computeLevel(Interval *newInterval); 00044 00045 Key(Interval *newInterval); 00046 00047 ~Key(); 00048 00049 double getPoint(); 00050 00051 int getLevel(); 00052 00053 Interval* getInterval(); 00054 00055 void computeKey(Interval *itemInterval); 00056 00057 private: 00058 00059 // the fields which make up the key 00060 double pt; 00061 int level; 00062 00063 // auxiliary data which is derived from the key for use in computation 00064 Interval *interval; 00065 00066 void computeInterval(int level, Interval *itemInterval); 00067 }; 00068 00069 } // namespace geos::index::bintree 00070 } // namespace geos::index 00071 } // namespace geos 00072 00073 #endif // GEOS_IDX_BINTREE_KEY_H 00074