Class Vertex
java.lang.Object
com.treemap.swing.voronoi.smoothing.Vertex
This 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdjacentCellPixel
(CellWithLocation cellWithLocation) 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.void
addAdjacentCellPixel
(VoronoiCell cell, Point2i postion) Store a cell which has contact to the corner, and with which pixel (x/y) this is.boolean
Returns the list of adjacent cells.int
getId()
Returns the loction o f this corner.boolean
isPixelNextToCorner
(int x, int y) Returns true if a pixel located at x/y is next to this corner.boolean
isPixelNextToCorner
(Point2d point) boolean
boolean
boolean
toString()
-
Constructor Details
-
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
-
-
Method Details
-
addAdjacentCellPixel
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
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
-
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
Returns the loction o f this corner.- Returns:
- the loction o f this corner
-
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
-
isPixelNextToCorner
-
getId
public int getId() -
equals
-