1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************/
16 #include <geos/index/strtree/Interval.h>
17 //#include <geos/util.h>
26 namespace index
{ // geos.index
27 namespace strtree
{ // geos.index.strtree
29 Interval::Interval(double newMin
,double newMax
)
31 assert(newMin
<=newMax
);
43 Interval::expandToInclude(const Interval
*other
)
45 imax
=max(imax
,other
->imax
);
46 imin
=min(imin
,other
->imin
);
51 Interval::intersects(const Interval
*other
) const
53 return !(other
->imin
>imax
|| other
->imax
<imin
);
57 Interval::equals(const Interval
*other
) const {
58 return imin
==other
->imin
&& imax
==other
->imax
;
61 } // namespace geos.index.strtree
62 } // namespace geos.index