GEOS  3.9.1dev
bintree/Interval.h
Go to the documentation of this file.
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 #ifndef GEOS_IDX_BINTREE_INTERVAL_H
16 #define GEOS_IDX_BINTREE_INTERVAL_H
17 
18 #include <geos/export.h>
19 
20 namespace geos {
21 namespace index { // geos::index
22 namespace bintree { // geos::index::bintree
23 
26 
27 public:
28 
29  double min, max;
30 
31  Interval();
32 
33  Interval(double nmin, double nmax);
34 
36  Interval(const Interval* interval);
37 
38  void init(double nmin, double nmax);
39 
40  double getMin() const;
41 
42  double getMax() const;
43 
44  double getWidth() const;
45 
46  void expandToInclude(Interval* interval);
47 
48  bool overlaps(const Interval* interval) const;
49 
50  bool overlaps(double nmin, double nmax) const;
51 
52  bool contains(const Interval* interval) const;
53 
54  bool contains(double nmin, double nmax) const;
55 
56  bool contains(double p) const;
57 };
58 
59 } // namespace geos::index::bintree
60 } // namespace geos::index
61 } // namespace geos
62 
63 #endif // GEOS_IDX_BINTREE_INTERVAL_H
64 
Represents an (1-dimensional) closed interval on the Real number line.
#define GEOS_DLL
Definition: export.h:28
Basic namespace for all GEOS functionalities.