public class Polygonal2DRegion extends AbstractRegion implements FlatRegion
world| Constructor and Description |
|---|
Polygonal2DRegion()
Construct the region
|
Polygonal2DRegion(LocalWorld world)
Construct the region.
|
Polygonal2DRegion(LocalWorld world,
List<BlockVector2D> points,
int minY,
int maxY)
Construct the region.
|
Polygonal2DRegion(Polygonal2DRegion region) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPoint(BlockVector2D pt)
Add a point to the list.
|
void |
addPoint(Vector pt)
Add a point to the list.
|
void |
addPoint(Vector2D pt)
Add a point to the list.
|
Iterable<Vector2D> |
asFlatRegion() |
Polygonal2DRegion |
clone() |
static boolean |
contains(List<BlockVector2D> points,
int minY,
int maxY,
Vector pt)
Checks to see if a point is inside a region.
|
boolean |
contains(Vector pt)
Checks to see if a point is inside this region.
|
void |
contract(Vector... changes)
Contract the region.
|
void |
expand(Vector... changes)
Expand the region.
|
boolean |
expandY(int y)
Expand the height of the polygon to fit the specified Y.
|
int |
getArea()
Get the number of blocks in the region.
|
int |
getHeight()
Get Y-size.
|
int |
getLength()
Get Z-size.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
int |
getMaximumY()
Get the maximum Y.
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Get the minimum Y.
|
int |
getMininumY()
Deprecated.
|
List<BlockVector2D> |
getPoints()
Get the list of points.
|
int |
getWidth()
Get X-size.
|
Iterator<BlockVector> |
iterator()
Get the iterator.
|
List<BlockVector2D> |
polygonize(int maxPoints)
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.
|
protected void |
recalculate()
Recalculate the bounding box of this polygonal region.
|
void |
setMaximumY(int y)
Set the maximum Y.
|
void |
setMinimumY(int y)
Set the minimum Y.
|
void |
shift(Vector change)
Shift the region.
|
int |
size()
Return the number of points.
|
String |
toString()
Returns string representation in the format
"(x1, z1) - ...
|
getCenter, getChunkCubes, getChunks, getWorld, setWorldpublic Polygonal2DRegion()
public Polygonal2DRegion(LocalWorld world)
world - public Polygonal2DRegion(LocalWorld world, List<BlockVector2D> points, int minY, int maxY)
world - points - minY - maxY - public Polygonal2DRegion(Polygonal2DRegion region)
public List<BlockVector2D> getPoints()
protected void recalculate()
public void addPoint(Vector2D pt)
pt - public void addPoint(BlockVector2D pt)
pt - public void addPoint(Vector pt)
pt - public int getMinimumY()
getMinimumY in interface FlatRegion@Deprecated public int getMininumY()
public void setMinimumY(int y)
y - public int getMaximumY()
getMaximumY in interface FlatRegionpublic void setMaximumY(int y)
y - public Vector getMinimumPoint()
getMinimumPoint in interface Regionpublic Vector getMaximumPoint()
getMaximumPoint in interface Regionpublic int getArea()
getArea in interface RegiongetArea in class AbstractRegionpublic int getWidth()
getWidth in interface RegiongetWidth in class AbstractRegionpublic int getHeight()
getHeight in interface RegiongetHeight in class AbstractRegionpublic int getLength()
getLength in interface RegiongetLength in class AbstractRegionpublic void expand(Vector... changes) throws RegionOperationException
expand in interface Regionchanges - RegionOperationExceptionpublic void contract(Vector... changes) throws RegionOperationException
contract in interface Regionchanges - RegionOperationExceptionpublic void shift(Vector change) throws RegionOperationException
Regionshift in interface Regionshift in class AbstractRegionRegionOperationExceptionpublic boolean contains(Vector pt)
public static boolean contains(List<BlockVector2D> points, int minY, int maxY, Vector pt)
points - minY - maxY - pt - public int size()
public boolean expandY(int y)
y - public Iterator<BlockVector> iterator()
iterator in interface Iterable<BlockVector>iterator in class AbstractRegionpublic Iterable<Vector2D> asFlatRegion()
asFlatRegion in interface FlatRegionpublic String toString()
public Polygonal2DRegion clone()
clone in interface Regionclone in class AbstractRegionpublic List<BlockVector2D> polygonize(int maxPoints)
Regionpolygonize in interface Regionpolygonize in class AbstractRegionmaxPoints - maximum number of points to generate. -1 for no limit.Copyright © 2010-2014. All Rights Reserved.