GEOS 3.9.1
bintree/Interval.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#ifndef GEOS_IDX_BINTREE_INTERVAL_H
16#define GEOS_IDX_BINTREE_INTERVAL_H
17
18#include <geos/export.h>
19
20namespace geos {
21namespace index { // geos::index
22namespace bintree { // geos::index::bintree
23
25class GEOS_DLL Interval {
26
27public:
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.
Definition: bintree/Interval.h:25
Interval(const Interval *interval)
TODO: drop this, rely on copy ctor.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26