Class IsobandContours
java.lang.Object
com.github.basking2.sdsai.marchinesquares.IsobandContours
Contours are lines in a square.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIsobandContours
(byte p1, byte p2, byte p3, byte p4) Create a contour given the 4-element array of point values. -
Method Summary
Modifier and TypeMethodDescriptionstatic IsobandContours
build
(byte[] pointValues) Create a contour given the 4-element array of point values.toString()
-
Field Details
-
lines
protected final byte[] linesAn array of integers values that represent lines in a square. A square is a 4-cell (2x2) grid. Lines start on even indexes (0, 2, 4) and end on odd indexes (1, 3, 5). Thus the array of 8 can hold 4 line segment. If a line starts and ends on 0, it is not set. Otherwise, the line will be defined by the even-indexed value being the side of the square the line begins on and the odd-indexed value being the side of the square the line ends on. For line start and stop values, 0 means the line starts or ends in the center of the top-side of the square. A value of 1 means the line starts or ends in the center of the right-side of the square. A value of 2 means the line starts or ends in the center of the bottom-side of the square. A value of 3 means the line starts or ends in the center of the left-side of the square. -
lineCount
protected final int lineCount
-
-
Constructor Details
-
IsobandContours
public IsobandContours(byte p1, byte p2, byte p3, byte p4) Create a contour given the 4-element array of point values. Point values may be -1, 0, or 1 denoting that a corner of the square is below, at, or above the threshold. The 4-value array is used to populate thelines
member of this class with line segments. The order of the points, starting at index 0 are top-left, top-right, bottom-right, bottom-left. That is, they proceed around the square in a clockwise manner.- Parameters:
p1
- The north-west point.p2
- The north-east pont.p3
- The south-east point.p4
- The sout-west point.
-
-
Method Details
-
build
Create a contour given the 4-element array of point values. Point values may be -1, 0, or 1 denoting that a corner of the square is below, at, or above the threshold. The 4-value array is used to populate thelines
member of this class with line segments. The order of the points, starting at index 0 are top-left, top-right, bottom-right, bottom-left. That is, they proceed around the square in a clockwise manner.- Parameters:
pointValues
- A 4-element array of values -1, 0, or 1.
-
toString
-