public class Polygonal2DRegion extends AbstractRegion implements FlatRegion
world| Constructor and Description |
|---|
Polygonal2DRegion()
Construct the region
|
Polygonal2DRegion(LocalWorld world)
Deprecated.
|
Polygonal2DRegion(LocalWorld world,
List<BlockVector2D> points,
int minY,
int maxY)
Deprecated.
|
Polygonal2DRegion(Polygonal2DRegion region)
Make a copy of another region.
|
Polygonal2DRegion(World world)
Construct the region.
|
Polygonal2DRegion(World world,
List<BlockVector2D> points,
int minY,
int maxY)
Construct the region.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPoint(BlockVector2D position)
Add a point to the list.
|
void |
addPoint(Vector position)
Add a point to the list.
|
void |
addPoint(Vector2D position)
Add a point to the list.
|
Iterable<Vector2D> |
asFlatRegion()
Get this region as an iterable flat region.
|
Polygonal2DRegion |
clone()
Make a clone of the region.
|
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 position)
Returns true based on whether the region contains the point.
|
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()
Gets the maximum Y value
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Gets the minimum Y value
|
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, setWorld, setWorldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCenter, getChunkCubes, getChunks, getWorld, setWorld, setWorldforEach, spliteratorpublic Polygonal2DRegion()
@Deprecated public Polygonal2DRegion(LocalWorld world)
public Polygonal2DRegion(World world)
world - the world@Deprecated public Polygonal2DRegion(LocalWorld world, List<BlockVector2D> points, int minY, int maxY)
public Polygonal2DRegion(World world, List<BlockVector2D> points, int minY, int maxY)
world - the worldpoints - list of pointsminY - minimum YmaxY - maximum Ypublic Polygonal2DRegion(Polygonal2DRegion region)
region - the other regionpublic List<BlockVector2D> getPoints()
protected void recalculate()
public void addPoint(Vector2D position)
position - the positionpublic void addPoint(BlockVector2D position)
position - the positionpublic void addPoint(Vector position)
position - the positionpublic int getMinimumY()
FlatRegiongetMinimumY in interface FlatRegion@Deprecated public int getMininumY()
public void setMinimumY(int y)
y - the Ypublic int getMaximumY()
FlatRegiongetMaximumY in interface FlatRegionpublic void setMaximumY(int y)
y - the Ypublic Vector getMinimumPoint()
RegiongetMinimumPoint in interface Regionpublic Vector getMaximumPoint()
RegiongetMaximumPoint in interface Regionpublic int getArea()
AbstractRegiongetArea in interface RegiongetArea in class AbstractRegionpublic int getWidth()
AbstractRegiongetWidth in interface RegiongetWidth in class AbstractRegionpublic int getHeight()
AbstractRegiongetHeight in interface RegiongetHeight in class AbstractRegionpublic int getLength()
AbstractRegiongetLength in interface RegiongetLength in class AbstractRegionpublic void expand(Vector... changes) throws RegionOperationException
Regionexpand in interface Regionchanges - array/arguments with multiple related changesRegionOperationExceptionpublic void contract(Vector... changes) throws RegionOperationException
Regioncontract in interface Regionchanges - array/arguments with multiple related changesRegionOperationExceptionpublic void shift(Vector change) throws RegionOperationException
Regionshift in interface Regionshift in class AbstractRegionchange - the changeRegionOperationExceptionpublic boolean contains(Vector position)
Regionpublic static boolean contains(List<BlockVector2D> points, int minY, int maxY, Vector pt)
points - a list of pointsminY - the min YmaxY - the max Ypt - the position to checkpublic int size()
public boolean expandY(int y)
y - the amount to expandpublic Iterator<BlockVector> iterator()
AbstractRegioniterator in interface Iterable<BlockVector>iterator in class AbstractRegionpublic Iterable<Vector2D> asFlatRegion()
FlatRegionasFlatRegion in interface FlatRegionpublic String toString()
public Polygonal2DRegion clone()
Regionclone 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.