Class Vertex
- java.lang.Object
-
- com.macrofocus.treemap.voronoi.smoothing.Vertex
-
public class Vertex extends java.lang.ObjectThis class represents a corner (or vertex) of voronoi cells. A corner is defined as contact point of three different cell pixels or to different cell pixels and the domain bounds or a corner in the domain bounds.
-
-
Constructor Summary
Constructors Constructor Description Vertex(double x, double y, boolean touchingParentSpline)Creates a corner (or vertex) with its location in pixels.Vertex(double x, double y, boolean touchingParentSpline, boolean isRectangleCorner, boolean vertexOfParentSegment)Vertex(Vertex vertex, boolean vertexOfParentSegment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAdjacentCellPixel(CellWithLocation cellWithLocation)voidaddAdjacentCellPixel(VoronoiCell cell, int x, int y)Store a cell which has contact to the corner, and with which pixel (x/y) this is.voidaddAdjacentCellPixel(VoronoiCell cell, Point2i postion)Store a cell which has contact to the corner, and with which pixel (x/y) this is.booleanequals(java.lang.Object other)java.util.List<VoronoiCell>getAdjacentCells()Returns the list of adjacent cells.intgetId()Point2dgetLocation()Returns the loction o f this corner.booleanisPixelNextToCorner(int x, int y)Returns true if a pixel located at x/y is next to this corner.booleanisPixelNextToCorner(Point2d point)booleanisRectangleCorner()booleanisTouchingParentSpline()booleanisVertexOfParentSegment()java.lang.StringtoString()
-
-
-
Constructor Detail
-
Vertex
public Vertex(double x, double y, boolean touchingParentSpline, boolean isRectangleCorner, boolean vertexOfParentSegment)
-
Vertex
public Vertex(double x, double y, boolean touchingParentSpline)Creates a corner (or vertex) with its location in pixels.- Parameters:
x- x-coordinate of the locationy- y-coordinate of the locationtouchingParentSpline-
-
Vertex
public Vertex(Vertex vertex, boolean vertexOfParentSegment)
-
-
Method Detail
-
addAdjacentCellPixel
public void addAdjacentCellPixel(VoronoiCell cell, int x, int y)
Store a cell which has contact to the corner, and with which pixel (x/y) this is.- Parameters:
cell- the adjacent cellx- x-coordinate of the pixel which contactsy- y-coordinate of the pixel which contacts
-
addAdjacentCellPixel
public void addAdjacentCellPixel(VoronoiCell cell, Point2i postion)
Store a cell which has contact to the corner, and with which pixel (x/y) this is.- Parameters:
cell- the adjacent cellpostion- x/y-coordinate of the pixel which contacts
-
addAdjacentCellPixel
public void addAdjacentCellPixel(CellWithLocation cellWithLocation)
-
isPixelNextToCorner
public boolean isPixelNextToCorner(int x, int y)Returns true if a pixel located at x/y is next to this corner. flase otherwise.- Parameters:
x- the x-coordinate of the pixely- the y-coordinate of the pixel- Returns:
- true if a pixel located at x/y is next to this corner. flase otherwise.
-
getLocation
public Point2d getLocation()
Returns the loction o f this corner.- Returns:
- the loction o f this corner
-
getAdjacentCells
public java.util.List<VoronoiCell> getAdjacentCells()
Returns the list of adjacent cells.- Returns:
- the list of adjacent cells
-
isTouchingParentSpline
public boolean isTouchingParentSpline()
-
isRectangleCorner
public boolean isRectangleCorner()
-
isVertexOfParentSegment
public boolean isVertexOfParentSegment()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
-
isPixelNextToCorner
public boolean isPixelNextToCorner(Point2d point)
-
getId
public int getId()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-