GEOS 3.14.0dev
|
Clipping rectangle. More...
#include <Rectangle.h>
Public Types | |
enum | Position { Inside = 1 , Outside = 2 , Left = 4 , Top = 8 , Right = 16 , Bottom = 32 , TopLeft = Top | Left , TopRight = Top | Right , BottomLeft = Bottom | Left , BottomRight = Bottom | Right } |
Position with respect to a clipping rectangle. | |
Public Member Functions | |
Rectangle (double x1, double y1, double x2, double y2) | |
Construct a clipping rectangle. | |
double | xmin () const |
double | ymin () const |
double | xmax () const |
double | ymax () const |
std::unique_ptr< geom::Polygon > | toPolygon (const geom::GeometryFactory &f) const |
std::unique_ptr< geom::LinearRing > | toLinearRing (const geom::GeometryFactory &f) const |
Position | position (double x, double y) const |
Establish position of coordinate with respect to a Rectangle. | |
Static Public Member Functions | |
static bool | onEdge (Position pos) |
Test if the given position is on a Rectangle edge. | |
static bool | onSameEdge (Position pos1, Position pos2) |
Test if the given positions are on the same Rectangle edge. | |
static Position | nextEdge (Position pos) |
Next edge in clock-wise direction. | |
Clipping rectangle.
A clipping rectangle defines the boundaries of the rectangle by defining the limiting x- and y-coordinates. The clipping rectangle must be non-empty. In addition, methods are provided for specifying the location of a given coordinate with respect to the clipping rectangle similarly to the Cohen-Sutherland clipping algorithm.
geos::operation::intersection::Rectangle::Rectangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Construct a clipping rectangle.
x1 | x-coordinate of the left edge |
y1 | y-coordinate of the bottom edge |
x2 | x-coordinate of the right edge |
y2 | y-coordinate of the right edge |
IllegalArgumentException | if the rectangle is empty |
|
inlinestatic |
Test if the given position is on a Rectangle edge.
pos | Rectangle::Position |
true
, if the position is on an edge
|
inline |
std::unique_ptr< geom::Polygon > geos::operation::intersection::Rectangle::toPolygon | ( | const geom::GeometryFactory & | f | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |