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);
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);
288 expandBy(p_distance, p_distance);
310 void expandToInclude(
double x,
double y);
319 void expandToInclude(
const Envelope* other);
336 return covers(other);
340 contains(
const Envelope* other)
const 342 return contains(*other);
355 return covers(p.
x, p.
y);
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;
424 bool 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);
485 GEOS_DLL
bool operator==(
const Envelope& a,
const Envelope& b);
491 # include "geos/geom/Envelope.inl" 494 #endif // ndef GEOS_GEOM_ENVELOPE_H An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
double getArea() const
Gets the area of this envelope.
Definition: Envelope.h:212
bool contains(const Coordinate &p) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:353
double y
y-coordinate
Definition: Coordinate.h:83
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
bool contains(const Envelope &other) const
Tests if the Envelope other lies wholly inside this Envelope (inclusive of the boundary).
Definition: Envelope.h:334
std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
double x
x-coordinate
Definition: Coordinate.h:80
bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
bool contains(double x, double y) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:369
void expandBy(double p_distance)
Expands this envelope by a given distance in all directions.
Definition: Envelope.h:286