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>
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);
213 return getWidth() * getHeight();
332 return covers(other);
335 bool contains(
const Envelope* other)
const {
336 return contains(*other);
349 return covers(p.
x, p.
y);
401 bool intersects(
const Envelope& other)
const;
435 bool covers(
const Envelope* other)
const {
436 return covers(*other);
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);
505 # include "geos/geom/Envelope.inl"
508 #endif // ndef GEOS_GEOM_ENVELOPE_H
void translate(double transX, double transY)
Translates this envelope by given amounts in the X and Y direction.
Envelope & operator=(const Envelope &e)
Assignment operator.
Envelope(void)
Creates a null Envelope.
bool intersects(const Envelope *other) const
void expandBy(double deltaX, double deltaY)
Expands this envelope by a given distance in all directions. Both positive and negative distances are...
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
GEOS_DLL bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
void init(const Coordinate &p)
Initialize an Envelope to a region defined by a single Coordinate.
Envelope(const Coordinate &p)
Creates an Envelope for a region defined by a single Coordinate.
void expandToInclude(const Envelope *other)
Enlarges the boundary of the Envelope so that it contains other. Does nothing if other is wholly on o...
double y
y-coordinate
Definition: Coordinate.h:83
bool intersection(const Envelope &env, Envelope &result) const
Envelope(double x1, double x2, double y1, double y2)
Creates an Envelope for a region defined by maximum and minimum values.
bool contains(const Envelope &other) const
Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).
Definition: Envelope.h:331
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
void expandToInclude(const Coordinate &p)
Enlarges the boundary of the Envelope so that it contains p. Does nothing if p is already on or withi...
Envelope(const Coordinate &p1, const Coordinate &p2)
Creates an Envelope for a region defined by two Coordinates.
bool centre(Coordinate ¢re) const
Envelope(const std::string &str)
Create an Envelope from an Envelope string representation produced by Envelope.toString()
bool intersects(const Coordinate &p) const
double getWidth(void) const
Returns the difference between the maximum and minimum x values.
double distance(const Envelope *env) const
Computes the distance between this and another Envelope.
std::string toString(void) const
Returns a string of the form Env[minx:maxx,miny:maxy] .
void init(const Coordinate &p1, const Coordinate &p2)
Initialize an Envelope to a region defined by two Coordinates.
bool contains(double x, double y) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:367
static bool intersects(const Coordinate &p1, const Coordinate &p2, const Coordinate &q1, const Coordinate &q2)
Test the envelope defined by p1-p2 for intersection with the envelope defined by q1-q2.
double x
x-coordinate
Definition: Coordinate.h:80
bool covers(const Envelope &other) const
double getArea() const
Definition: Envelope.h:211
GEOS_DLL std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
void expandBy(double distance)
Expands this envelope by a given distance in all directions. Both positive and negative distances are...
Definition: Envelope.h:287
double getHeight(void) const
Returns the difference between the maximum and minimum y values.
bool equals(const Envelope *other) const
Returns true if the Envelope other spatially equals this Envelope.
bool covers(double x, double y) const
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
bool intersects(double x, double y) const
void init(double x1, double x2, double y1, double y2)
Initialize an Envelope for a region defined by maximum and minimum values.
bool covers(const Coordinate *p) const
bool isNull(void) const
Returns true if this Envelope is a "null" envelope.
static bool intersects(const Coordinate &p1, const Coordinate &p2, const Coordinate &q)
Test the point q to see whether it intersects the Envelope defined by p1-p2.
bool contains(const Coordinate &p) const
Returns true if the given point lies in or on the envelope.
Definition: Envelope.h:348
void setToNull(void)
Makes this Envelope a "null" envelope, that is, the envelope of the empty geometry.
void expandToInclude(double x, double y)
Enlarges the boundary of the Envelope so that it contains (x,y). Does nothing if (x,...
void init(void)
Initialize to a null Envelope.
Envelope(const Envelope &env)
Copy constructor.