Class MultiPolylines
java.lang.Object
org.apache.sis.internal.feature.AbstractGeometry
org.apache.sis.internal.feature.j2d.FlatShape
org.apache.sis.internal.feature.j2d.MultiPolylines
- All Implemented Interfaces:
Shape
Collection of polylines or polygons as a Java2D
Shape
.
This class has some similarities with Path2D
with the following differences:
- No synchronization.
- Line segments only (no Bézier curves).
- Since:
- 1.1
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Polyline[]
The polylines or polygons in this collection. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double x, double y) Tests if the given coordinates are inside the boundary of this shape.boolean
contains
(double x, double y, double w, double h) Tests if the interior of this shape entirely contains the interior of the given rectangle.boolean
Tests if the interior of this shape entirely contains the interior of the given rectangle.fastClip
(Rectangle2D areaOfInterest) Returns a potentially smaller shape containing all polylines that intersect the given area of interest.Returns an iterator over coordinates in this multi-polylines.boolean
intersects
(double x, double y, double w, double h) Tests if the interior of this shape intersects the interior of the given rectangle.boolean
Tests if the interior of this shape intersects the interior of the given rectangle.toString()
Returns a string representation for debugging purposes.Methods inherited from class org.apache.sis.internal.feature.j2d.FlatShape
contains, getBounds, getBounds2D, getPathIterator
-
Field Details
-
polylines
The polylines or polygons in this collection.
-
-
Constructor Details
-
MultiPolylines
Creates a collection of polylines. The given argument is stored by reference; it is not cloned.- Parameters:
polylines
- the polylines. This array is not cloned.
-
-
Method Details
-
contains
public boolean contains(double x, double y) Tests if the given coordinates are inside the boundary of this shape. -
intersects
public boolean intersects(double x, double y, double w, double h) Tests if the interior of this shape intersects the interior of the given rectangle. May conservatively returntrue
if an intersection is probable but accurate answer would be too costly to compute. -
intersects
Tests if the interior of this shape intersects the interior of the given rectangle. May conservatively returntrue
if an intersection is probable but accurate answer would be too costly to compute. -
contains
public boolean contains(double x, double y, double w, double h) Tests if the interior of this shape entirely contains the interior of the given rectangle. May conservatively returnfalse
if an accurate answer would be too costly to compute. -
contains
Tests if the interior of this shape entirely contains the interior of the given rectangle. May conservatively returnfalse
if an accurate answer would be too costly to compute. -
getPathIterator
Returns an iterator over coordinates in this multi-polylines. -
fastClip
Returns a potentially smaller shape containing all polylines that intersect the given area of interest. This method performs only a quick check based on bounds intersections. The returned shape may still have many points outside the given bounds. -
toString
Returns a string representation for debugging purposes.
-