Package com.kheops.jmap.spatial
Class OrientedRectangle
java.lang.Object
com.kheops.jmap.spatial.DefaultGeometry
com.kheops.jmap.spatial.Polygon
com.kheops.jmap.spatial.OrientedRectangle
- All Implemented Interfaces:
Geometry
,PolygonTypeGeometry
,Surface
,Serializable
,Cloneable
- Direct Known Subclasses:
Annotation
,OrientedRectangle.Double
,OrientedRectangle.Float
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
-
Field Summary
Fields inherited from interface com.kheops.jmap.spatial.Geometry
GEOMETRY_ANNOTATION, GEOMETRY_COMPLEX, GEOMETRY_ELLIPSE, GEOMETRY_LINE, GEOMETRY_LINEAR_RING, GEOMETRY_LINESTRING, GEOMETRY_MULTI_ANNOTATION, GEOMETRY_MULTI_LINESTRING, GEOMETRY_MULTI_POINT, GEOMETRY_MULTI_POLYGON, GEOMETRY_POINT, GEOMETRY_POLYGON, GEOMETRY_RECTANGLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(OrientedRectangle rect) Adds the specified rectangle to this one.centroid()
Computes the centroid (center of mass) of the polygon, considering possibles holes in it.boolean
boolean
contains
(Point coord, PrecisionModel precisionModel) void
creates the bounding box
called in the constructor, not needed from outsideabstract double
abstract double
getWidth()
inflate
(double factor) boolean
intersects
(OrientedRectangle rect) boolean
intersects
(OrientedRectangle rect, PrecisionModel precisionModel) boolean
intersects
(Rectangle rect) boolean
intersects
(Rectangle rect, PrecisionModel precisionModel) Point[]
This polygon as an array of Pointabstract void
void
void
void
void
void
abstract void
setHeight
(double height) abstract void
setWidth
(double width) Creates a clone of the current oriented rectangle and returns the new instance tranformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation.Methods inherited from class com.kheops.jmap.spatial.Polygon
area, asText, boundary, clone, equals, exteriorRing, getBounds, getCenteredPoint, getGeometryId, getGeometryType, getRings, hasHoles, interiorRingN, length, numInteriorRing, pointOnSurface, polygonIterator, setRings, sizeOf, spatiallyEquals, toString, translate, validate
Methods inherited from class com.kheops.jmap.spatial.DefaultGeometry
spatiallyEquals
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.kheops.jmap.spatial.Geometry
spatiallyEquals
-
Constructor Details
-
OrientedRectangle
-
-
Method Details
-
setCoord0
- Parameters:
point
-
-
setCoord1
- Parameters:
point
-
-
setCoord2
- Parameters:
point
-
-
setCoord3
- Parameters:
point
-
-
setCoord4
- Parameters:
point
-
-
centroid
Description copied from class:Polygon
Computes the centroid (center of mass) of the polygon, considering possibles holes in it.
it also computes Area, available with getTempArea if needed -
getCoord0
- Returns:
- Returns the coord0.
-
getCoord1
- Returns:
- Returns the coord1.
-
getCoord2
- Returns:
- Returns the coord2.
-
getCoord3
- Returns:
- Returns the coord3.
-
getCoord4
- Returns:
- Returns the coord4.
-
add
Adds the specified rectangle to this one. The reulting rectangle is not rotated. In other words, this method returns the minimum bounding rectangle containing this rotated rectangle and the specified rotated rectangle. This instance is modified.- Parameters:
rect
- the rectangle to add- Returns:
- the new rectangle combining the 2 rectangles
-
add
-
contains
-
contains
-
intersects
-
intersects
-
intersects
-
intersects
-
inflate
-
getWidth
public abstract double getWidth() -
getHeight
public abstract double getHeight() -
setWidth
public abstract void setWidth(double width) -
setHeight
public abstract void setHeight(double height) -
serialize
Description copied from class:Polygon
This polygon as an array of Point -
setBounds
-
createBounds
public void createBounds()Description copied from class:Polygon
creates the bounding box
called in the constructor, not needed from outside- Specified by:
createBounds
in interfaceGeometry
- Overrides:
createBounds
in classPolygon
-
transform
Creates a clone of the current oriented rectangle and returns the new instance tranformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation.
-