GEOS 3.11.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#pragma once
16
17#include <geos/export.h>
18
19namespace geos {
20namespace index { // geos::index
21namespace bintree { // geos::index::bintree
22
24class GEOS_DLL Interval {
25
26public:
27
28 double min, max;
29
30 Interval();
31
32 Interval(double nmin, double nmax);
33
35 Interval(const Interval* interval);
36
37 void init(double nmin, double nmax);
38
39 double getMin() const;
40
41 double getMax() const;
42
43 double getWidth() const;
44
45 void expandToInclude(Interval* interval);
46
47 bool overlaps(const Interval* interval) const;
48
49 bool overlaps(double nmin, double nmax) const;
50
51 bool contains(const Interval* interval) const;
52
53 bool contains(double nmin, double nmax) const;
54
55 bool contains(double p) const;
56};
57
58} // namespace geos::index::bintree
59} // namespace geos::index
60} // namespace geos
61
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:24
Interval(const Interval *interval)
TODO: drop this, rely on copy ctor.
Basic namespace for all GEOS functionalities.
Definition: geos.h:39