Package org.tinfour.utils.alphashape
Class AlphaPart
- java.lang.Object
-
- org.tinfour.utils.alphashape.AlphaPart
-
public class AlphaPart extends Object
Provides a set of edges that define the path of an alpha shape. The path may represent either the outer bounds of a region or an enclosed region.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetArea()Gets the computed area of a polygon feature.List<AlphaPart>getChildren()Gets a list of any child (embedded) alpha part components.List<IQuadEdge>getEdges()Gets a list of the edges that define the alpha part.AlphaPartgetParent()Gets the alpha part that contains this instance (if any).AlphaPartTypegetPartType()Gets the type of part (polygon, unconnected lines, or unassociated vertices) for this alpha part.Path2DgetPath2D()Get an instance of Path2D populated with coordinates taken from the edges that define this alpha part.List<Vertex>getVertices()Gets a list of the Vertices that define the alpha part.booleanisAnEnclosure()Indicates that the path encloses a region.booleanisEnclosed()Indicates that the path represents a region that is in the interior of an alpha shape..booleanisPolygon()Indicates whether the part is a polygon feature.StringtoString()
-
-
-
Method Detail
-
getPartType
public AlphaPartType getPartType()
Gets the type of part (polygon, unconnected lines, or unassociated vertices) for this alpha part.- Returns:
- a valid enumeration instance.
-
getChildren
public List<AlphaPart> getChildren()
Gets a list of any child (embedded) alpha part components.- Returns:
- a valid, potentially empty list.
-
getEdges
public List<IQuadEdge> getEdges()
Gets a list of the edges that define the alpha part. Because this call exposes the internal list element of the part, applications should not modify the List instance that is returned from this call.- Returns:
- a valid, potentially empty list
-
getVertices
public List<Vertex> getVertices()
Gets a list of the Vertices that define the alpha part. Because this call exposes the internal list element of the part, applications should not modify the List instance that is returned from this call.- Returns:
- a valid, potentially empty list
-
getParent
public AlphaPart getParent()
Gets the alpha part that contains this instance (if any).- Returns:
- if a parent exists, a valid reference; otherwise, a null.
-
isAnEnclosure
public boolean isAnEnclosure()
Indicates that the path encloses a region.- Returns:
- true if the region indicated by the path encloses a set of points definition an alpha shape.
-
isEnclosed
public boolean isEnclosed()
Indicates that the path represents a region that is in the interior of an alpha shape..- Returns:
- true if the region indicated by the path is enclosed by a set of points defining an alpha shape.
-
isPolygon
public boolean isPolygon()
Indicates whether the part is a polygon feature.- Returns:
- true if the part is a polygon feature; false if it is a an open-line.
-
getArea
public double getArea()
Gets the computed area of a polygon feature.- Returns:
- a signed real value (positive for polygons with a counterclockwise orientation, negative for clockwise).
-
getPath2D
public Path2D getPath2D()
Get an instance of Path2D populated with coordinates taken from the edges that define this alpha part. For a polygon part, the defining points will be linked together as a series of connected line segments. For a non-polygon part, the Path2D will consist of a series of separate line segments. Non-polygon parts are no suitable for rendering using Java's area-fill routines.- Returns:
- a valid instance
-
-