addVertex(...)
addVertex(...)
addVertex(...)
addEmptyOutline()
addVertex(...)
addVertex(...)
addVertex(...)
The above will create two outlines each with three vertices. By adding these two outlines to
the OutlineShape, we are stating that the combination of the two outlines represent the shape.
addVertex(0,0, true);
addVertex(0,1, false);
addVertex(1,1, false);
addVertex(1,0, true);
The above snippet defines a cubic nurbs curve where (0,1 and 1,1)
do not belong to the final rendered shape.
Implementation Notes:Outline, Region
| Modifier and Type | Class and Description |
|---|---|
| public static enum | OutlineShape.
Outline's vertices have undefined state until transformed. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final AABBox | |
| public static final float | DEFAULT_SHARPNESS
Initial |
| public static final int | |
| public static final int | DIRTY_TRIANGLES
Modified shape, requires to update the vertices and triangles, here: triangulation. |
| public static final int | DIRTY_VERTICES
Modified shape, requires to update the vertices and triangles, here: vertices. |
| private int | dirtyBits
dirty bits DIRTY_BOUNDS |
| pack-priv final ArrayList | |
| private OutlineShape. | |
| private static Comparator | |
| private float | |
| private final float[] | |
| private final float[] | |
| private final float[] | |
| private final ArrayList | |
| private final Vertex. | |
| private final ArrayList |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | addOutline(final Outline
Outline object to be added outline)Appends the |
| public final void | addOutline(final int
of the added Outline position, final Outline Outline object to be added outline)Insert the |
| public final void | addOutlineShape(final OutlineShape
OutlineShape elements to be added. outlineShape)Insert the |
| public final void | |
| public final void | |
| public final void | |
| public final void | addVertex(final float
the x coordinate x, final float the y coordinate y, final float the z coordinate z, final boolean flag if this vertex is on the final curve or defines a curved region
of the shape around this vertex. onCurve)Add a 3D |
| public final void | addVertex(final float[]
the coordinate array where the vertex attributes are to be picked from coordsBuffer, final int the offset in the buffer to the x coordinate offset, final int the number of attributes to pick from the buffer (maximum 3) length, final boolean flag if this vertex is on the final curve or defines a curved region
of the shape around this vertex. onCurve)Add a vertex to the last outline by passing a float array and specifying the offset and length in which. |
| private void | checkOverlaps()
Check overlaps between curved triangles first check if any vertex in triangle a is in triangle b second check if edges of triangle a intersect segments of triangle b if any of the two tests is true we divide current triangle and add the other to the list of overlaps Loop until overlap array is empty. |
| private Vertex | |
| private Vertex | |
| private void | |
| public void | |
| public void | |
| public final void | closeLastOutline(final boolean
if true, a clone of the first vertex will be appended,
otherwise a clone of the last vertex will be prepended. closeTail)Closes the last outline in the shape. |
| public final int | compareTo(final OutlineShape
the object to be compared. other)Implements java. |
| public boolean | Returns: true ifobj is an OutlineShape, not null,
same outlineState, equal bounds and equal outlines in the same orderthe Object to compare this OutlineShape with obj)Overrides java. |
| private int | |
| public int | getAddedVerticeCount()
Return the number of newly added vertices during |
| public final AABBox | |
| public final Outline | Returns: the last outlineGet the last added outline to the list of outlines that define the shape |
| public final Outline | |
| public final int | |
| public final OutlineShape. | |
| public float | |
| public ArrayList | Returns: an arraylist of triangles representing the filled region which is produced by the combination of the outlinesTriangulate the |
| public final ArrayList | |
| public final int | |
| public final Outline | removeOutline(final int
of the to be removed Outline position)Removes the |
| public final void | setIsQuadraticNurbs()
Claim this outline's vertices are all |
| public final void | setOutline(final int
of the replaced Outline position, final Outline replacement Outline object outline)Replaces the |
| public void | |
| private void | |
| private void | subdivideTriangle(final Outline outline, final Vertex a, final Vertex b, final Vertex c, final int index)
|
| public String | |
| public final OutlineShape | transform(final AffineTransform t)
Return a transformed instance with all |
| private void | |
| private void | |
| public final Vertex. | Returns: Vertex.Factory objectReturns the associated vertex factory of this outline shape |
| addedVerticeCount | back to summary |
|---|---|
| private int addedVerticeCount | |
| bbox | back to summary |
|---|---|
| private final AABBox bbox | |
| DEFAULT_SHARPNESS | back to summary |
|---|---|
| public static final float DEFAULT_SHARPNESS Initial | |
| DIRTY_BOUNDS | back to summary |
|---|---|
| public static final int DIRTY_BOUNDS | |
| DIRTY_TRIANGLES | back to summary |
|---|---|
| public static final int DIRTY_TRIANGLES Modified shape, requires to update the vertices and triangles, here: triangulation. | |
| DIRTY_VERTICES | back to summary |
|---|---|
| public static final int DIRTY_VERTICES Modified shape, requires to update the vertices and triangles, here: vertices. | |
| dirtyBits | back to summary |
|---|---|
| private int dirtyBits dirty bits DIRTY_BOUNDS | |
| outlines | back to summary |
|---|---|
| pack-priv final ArrayList<Outline> outlines The list of | |
| outlineState | back to summary |
|---|---|
| private OutlineShape. | |
| reversSizeComparator | back to summary |
|---|---|
| private static Comparator<Outline> reversSizeComparator | |
| sharpness | back to summary |
|---|---|
| private float sharpness | |
| tmpV1 | back to summary |
|---|---|
| private final float[] tmpV1 | |
| tmpV2 | back to summary |
|---|---|
| private final float[] tmpV2 | |
| tmpV3 | back to summary |
|---|---|
| private final float[] tmpV3 | |
| triangles | back to summary |
|---|---|
| private final ArrayList<Triangle> triangles | |
| vertexFactory | back to summary |
|---|---|
| private final Vertex. | |
| vertices | back to summary |
|---|---|
| private final ArrayList<Vertex> vertices | |
| OutlineShape | back to summary |
|---|---|
| public OutlineShape(final Vertex. Create a new Outline based Shape | |
| addEmptyOutline | back to summary |
|---|---|
| public final void addEmptyOutline() Add a new empty If the | |
| addOutline | back to summary |
|---|---|
| public final void addOutline(final Outline outline) throws NullPointerException Appends the A clean tail is ensured, no double empty Outlines are produced and a pre-existing empty outline will be replaced with the given one.
| |
| addOutline | back to summary |
|---|---|
| public final void addOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException Insert the If the
| |
| addOutlineShape | back to summary |
|---|---|
| public final void addOutlineShape(final OutlineShape outlineShape) throws NullPointerException Insert the Closes the current last outline via
| |
| addVertex | back to summary |
|---|---|
| public final void addVertex(final Vertex v) Adds a vertex to the last open outline to the shape's tail.
| |
| addVertex | back to summary |
|---|---|
| public final void addVertex(final int position, final Vertex v) Adds a vertex to the last open outline to the shape at
| |
| addVertex | back to summary |
|---|---|
| public final void addVertex(final float x, final float y, final boolean onCurve) Add a 2D
| |
| addVertex | back to summary |
|---|---|
| public final void addVertex(final float x, final float y, final float z, final boolean onCurve) Add a 3D
| |
| addVertex | back to summary |
|---|---|
| public final void addVertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) Add a vertex to the last outline by passing a float array and specifying the offset and length in which. The attributes of the vertex are located. The attributes should be continuous (stride = 0). Attributes which value are not set (when length less than 3) are set implicitly to zero.
| |
| checkOverlaps | back to summary |
|---|---|
| private void checkOverlaps() Check overlaps between curved triangles first check if any vertex in triangle a is in triangle b second check if edges of triangle a intersect segments of triangle b if any of the two tests is true we divide current triangle and add the other to the list of overlaps Loop until overlap array is empty. (check only in first pass) | |
| checkTriOverlaps0 | back to summary |
|---|---|
| private Vertex checkTriOverlaps0(final Vertex a, final Vertex b, final Vertex c) | |
| checkTriOverlaps1 | back to summary |
|---|---|
private Vertex checkTriOverlaps1(final Vertex a, final Vertex b, final Vertex c)
| |
| cleanupOutlines | back to summary |
|---|---|
| private void cleanupOutlines() | |
| clear | back to summary |
|---|---|
| public void clear() Clears all data and reset all states as if this instance was newly created | |
| clearCache | back to summary |
|---|---|
| public void clearCache() Clears cached triangulated data, i.e. | |
| closeLastOutline | back to summary |
|---|---|
| public final void closeLastOutline(final boolean closeTail) Closes the last outline in the shape.
Checks whether the last vertex equals to the first of the last outline.
If not equal, it either appends a clone of the first vertex
or prepends a clone of the last vertex, depending on
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(final OutlineShape other) Implements java. Compare two outline shape's Bounding Box size.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| generateVertexIds | back to summary |
|---|---|
| private int generateVertexIds() | |
| getAddedVerticeCount | back to summary |
|---|---|
| public int getAddedVerticeCount() Return the number of newly added vertices during
| |
| getBounds | back to summary |
|---|---|
| public final AABBox getBounds() | |
| getLastOutline | back to summary |
|---|---|
| public final Outline getLastOutline() Get the last added outline to the list of outlines that define the shape
| |
| getOutline | back to summary |
|---|---|
| public final Outline getOutline(final int position) throws IndexOutOfBoundsException Returns the
| |
| getOutlineNumber | back to summary |
|---|---|
| public final int getOutlineNumber() | |
| getOutlineState | back to summary |
|---|---|
| public final OutlineShape. Return the outline's vertices state, | |
| getSharpness | back to summary |
|---|---|
| public float getSharpness() Sharpness value, defaults to | |
| getTriangles | back to summary |
|---|---|
| public ArrayList Triangulate the Triangles are cached until marked dirty. | |
| getVertices | back to summary |
|---|---|
| public final ArrayList Return list of concatenated vertices associated with all
Vertices are cached until marked dirty.
Should always be called after | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| removeOutline | back to summary |
|---|---|
| public final Outline removeOutline(final int position) throws IndexOutOfBoundsException Removes the Sets the bounding box dirty, hence a next call to
| |
| setIsQuadraticNurbs | back to summary |
|---|---|
| public final void setIsQuadraticNurbs() Claim this outline's vertices are all | |
| setOutline | back to summary |
|---|---|
| public final void setOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException Replaces the Sets the bounding box dirty, hence a next call to
| |
| setSharpness | back to summary |
|---|---|
| public void setSharpness(final float s) Sets sharpness, defaults to | |
| sortOutlines | back to summary |
|---|---|
| private void sortOutlines() Sort the outlines from large to small depending on the AABox | |
| subdivideTriangle | back to summary |
|---|---|
| private void subdivideTriangle(final Outline outline, final Vertex a, final Vertex b, final Vertex c, final int index) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| transform | back to summary |
|---|---|
| public final OutlineShape transform(final AffineTransform t) Return a transformed instance with all Note Triangulated data is lost in returned instance! | |
| triangulateImpl | back to summary |
|---|---|
| private void triangulateImpl() | |
| validateBoundingBox | back to summary |
|---|---|
| private void validateBoundingBox() | |
| vertexFactory | back to summary |
|---|---|
| public final Vertex. Returns the associated vertex factory of this outline shape | |
| Modifier and Type | Field and Description |
|---|---|
| public static final OutlineShape. | |
| public final int | |
| public static final OutlineShape. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static OutlineShape. | |
| public static OutlineShape. |
| QUADRATIC_NURBS | back to summary |
|---|---|
| public static final OutlineShape. | |
| state | back to summary |
|---|---|
| public final int state | |
| UNDEFINED | back to summary |
|---|---|
| public static final OutlineShape. | |
| VerticesState | back to summary |
|---|---|
| private VerticesState(final int state) | |
| valueOf | back to summary |
|---|---|
| public static OutlineShape. | |
| values | back to summary |
|---|---|
| public static OutlineShape. | |