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);
58 class GEOS_DLL Envelope {
62 friend std::ostream&
operator<< (std::ostream& os,
const Envelope& o);
64 typedef std::unique_ptr<Envelope> Ptr;
79 Envelope(
double x1,
double x2,
double y1,
double y2);
157 void init(
double x1,
double x2,
double y1,
double y2);
181 void setToNull(
void);
189 bool isNull(
void)
const;
196 double getWidth(
void)
const;
203 double getHeight(
void)
const;
214 return getWidth() * getHeight();
221 double getMaxY()
const;
227 double getMaxX()
const;
233 double getMinY()
const;
239 double getMinX()
const;
267 void translate(
double transX,
double transY);
276 void expandBy(
double deltaX,
double deltaY);
286 expandBy(
double p_distance)
288 expandBy(p_distance, p_distance);
310 void expandToInclude(
double x,
double y);
319 void expandToInclude(
const Envelope* other);
334 contains(
const Envelope& other)
const
336 return covers(other);
340 contains(
const Envelope* other)
const
342 return contains(*other);
355 return covers(p.
x, p.
y);
369 contains(
double x,
double y)
const
380 bool intersects(
const Coordinate& p)
const;
389 bool intersects(
double x,
double y)
const;
397 bool intersects(
const Envelope* other)
const;
399 bool intersects(
const Envelope& other)
const;
408 bool covers(
double x,
double y)
const;
416 bool covers(
const Coordinate* p)
const;
424 bool covers(
const Envelope& other)
const;
427 covers(
const Envelope* other)
const
429 return covers(*other);
439 bool equals(
const Envelope* other)
const;
446 std::string toString(
void)
const;
454 double distance(
const Envelope* env)
const;
456 size_t hashCode()
const;
466 std::vector<std::string> split(
const std::string& str,
467 const std::string& delimiters =
" ");
469 static double distance(
double x0,
double y0,
double x1,
double y1);
491 # include "geos/geom/Envelope.inl"
494 #endif // ndef GEOS_GEOM_ENVELOPE_H
std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
double y
y-coordinate
Definition: Coordinate.h:107
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:84
double x
x-coordinate
Definition: Coordinate.h:104
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:90