20 #ifndef GEOS_GEOM_ENVELOPE_H
21 #define GEOS_GEOM_ENVELOPE_H
24 #include <geos/export.h>
25 #include <geos/inline.h>
26 #include <geos/geom/Coordinate.h>
58 typedef std::auto_ptr<Envelope> AutoPtr;
74 Envelope(
double x1,
double x2,
double y1,
double y2);
146 void init(
double x1,
double x2,
double y1,
double y2);
172 void setToNull(
void);
182 bool isNull(
void)
const;
189 double getWidth(
void)
const;
196 double getHeight(
void)
const;
206 return getWidth() * getHeight();
213 double getMaxY()
const;
219 double getMaxX()
const;
225 double getMinY()
const;
231 double getMinX()
const;
260 void translate(
double transX,
double transY);
271 void expandBy(
double deltaX,
double deltaY);
300 void expandToInclude(
double x,
double y);
309 void expandToInclude(
const Envelope* other);
325 return covers(other);
328 bool contains(
const Envelope* other)
const {
329 return contains(*other);
342 return covers(p.
x, p.
y);
381 bool intersects(
double x,
double y)
const;
392 bool intersects(
const Envelope* other)
const;
394 bool intersects(
const Envelope& other)
const;
406 bool covers(
double x,
double y)
const;
426 bool covers(
const Envelope& other)
const;
428 bool covers(
const Envelope* other)
const {
429 return covers(*other);
443 bool equals(
const Envelope* other)
const;
452 std::string toString(
void)
const;
461 double distance(
const Envelope* env)
const;
463 int hashCode()
const;
473 std::vector<std::string> split(
const std::string &str,
474 const std::string &delimiters =
" ");
476 static double distance(
double x0,
double y0,
double x1,
double y1);
492 GEOS_DLL
bool operator==(
const Envelope& a,
const Envelope& b);
498 # include "geos/geom/Envelope.inl"
501 #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:324
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:54
double y
y-coordinate
Definition: Coordinate.h:84
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:61
bool contains(const Coordinate &p) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:341
double getArea() const
Definition: Envelope.h:204
bool contains(double x, double y) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:360
void expandBy(double distance)
Expands this envelope by a given distance in all directions. Both positive and negative distances are...
Definition: Envelope.h:280
GEOS_DLL bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
double x
x-coordinate
Definition: Coordinate.h:81