19 #ifndef GEOS_GEOM_ENVELOPE_H
20 #define GEOS_GEOM_ENVELOPE_H
23 #include <geos/export.h>
24 #include <geos/inline.h>
25 #include <geos/geom/Coordinate.h>
38 GEOS_DLL std::ostream&
operator<< (std::ostream& os,
const Envelope& o);
65 typedef std::unique_ptr<Envelope> Ptr;
81 Envelope(
double x1,
double x2,
double y1,
double y2);
153 void init(
double x1,
double x2,
double y1,
double y2);
179 void setToNull(
void);
189 bool isNull(
void)
const;
196 double getWidth(
void)
const;
203 double getHeight(
void)
const;
213 return getWidth() * getHeight();
220 double getMaxY()
const;
226 double getMaxX()
const;
232 double getMinY()
const;
238 double getMinX()
const;
267 void translate(
double transX,
double transY);
278 void expandBy(
double deltaX,
double deltaY);
307 void expandToInclude(
double x,
double y);
316 void expandToInclude(
const Envelope* other);
332 return covers(other);
335 bool contains(
const Envelope* other)
const {
336 return contains(*other);
349 return covers(p.
x, p.
y);
388 bool intersects(
double x,
double y)
const;
399 bool intersects(
const Envelope* other)
const;
401 bool intersects(
const Envelope& other)
const;
413 bool covers(
double x,
double y)
const;
433 bool covers(
const Envelope& other)
const;
435 bool covers(
const Envelope* other)
const {
436 return covers(*other);
450 bool equals(
const Envelope* other)
const;
459 std::string toString(
void)
const;
468 double distance(
const Envelope* env)
const;
470 int hashCode()
const;
480 std::vector<std::string> split(
const std::string &str,
481 const std::string &delimiters =
" ");
483 static double distance(
double x0,
double y0,
double x1,
double y1);
499 GEOS_DLL
bool operator==(
const Envelope& a,
const Envelope& b);
505 # include "geos/geom/Envelope.inl"
508 #endif // ndef GEOS_GEOM_ENVELOPE_H
bool contains(const Envelope &other) const
Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).
Definition: Envelope.h:331
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
double y
y-coordinate
Definition: Coordinate.h:83
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
GEOS_DLL std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
bool contains(const Coordinate &p) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:348
double getArea() const
Definition: Envelope.h:211
bool contains(double x, double y) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:367
void expandBy(double distance)
Expands this envelope by a given distance in all directions. Both positive and negative distances are...
Definition: Envelope.h:287
GEOS_DLL bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
double x
x-coordinate
Definition: Coordinate.h:80