public class Outline extends Object implements Comparable<Outline>
OutlineShape
,
Region
Constructor and Description |
---|
Outline()
Create an outline defined by control vertices.
|
Outline(Outline src)
Copy ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addVertex(int position,
Vertex vertex)
Insert the
Vertex element at the given position to the outline loop/strip. |
void |
addVertex(Vertex vertex)
Appends a vertex to the outline loop/strip.
|
int |
compareTo(Outline other)
Compare two outline's Bounding Box size.
|
boolean |
equals(Object obj) |
AABBox |
getBounds() |
Vertex |
getLastVertex() |
Vertex |
getVertex(int index) |
int |
getVertexCount() |
int |
getVertexIndex(Vertex vertex) |
ArrayList<Vertex> |
getVertices() |
int |
hashCode() |
boolean |
isClosed() |
boolean |
isEmpty() |
Vertex |
removeVertex(int position)
Removes the
Vertex element at the given position . |
boolean |
setClosed(boolean closeTail)
Ensure this outline is closed.
|
void |
setVertex(int position,
Vertex vertex)
Replaces the
Vertex element at the given position . |
void |
setVertices(ArrayList<Vertex> vertices)
Use the given outline loop/strip.
|
String |
toString() |
Outline |
transform(jogamp.graph.geom.plane.AffineTransform t,
Vertex.Factory<? extends Vertex> vertexFactory)
Return a transformed instance with all vertices are copied and transformed.
|
public Outline()
public Outline(Outline src)
public final int getVertexCount()
public final void addVertex(Vertex vertex) throws NullPointerException
vertex
- Vertex to be addedNullPointerException
- if the Vertex
element is nullpublic final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException
Vertex
element at the given position
to the outline loop/strip.position
- of the added Vertexvertex
- Vertex object to be addedNullPointerException
- if the Vertex
element is nullIndexOutOfBoundsException
- if position is out of range (position < 0 || position > getVertexNumber())public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException
Vertex
element at the given position
.
Sets the bounding box dirty, hence a next call to getBounds()
will validate it.
position
- of the replaced Vertexvertex
- replacement Vertex objectNullPointerException
- if the Outline
element is nullIndexOutOfBoundsException
- if position is out of range (position < 0 || position >= getVertexNumber())public final Vertex getVertex(int index)
public int getVertexIndex(Vertex vertex)
public final Vertex removeVertex(int position) throws IndexOutOfBoundsException
Vertex
element at the given position
.
Sets the bounding box dirty, hence a next call to getBounds()
will validate it.
position
- of the to be removed VertexIndexOutOfBoundsException
- if position is out of range (position < 0 || position >= getVertexNumber())public final boolean isEmpty()
public final Vertex getLastVertex()
public final void setVertices(ArrayList<Vertex> vertices)
Validates the bounding box.
vertices
- the new outline loop/strippublic final boolean isClosed()
public final boolean setClosed(boolean closeTail)
Checks whether the last vertex equals to the first.
If not equal, it either appends a clone of the first vertex
or prepends a clone of the last vertex, depending on closeTail
.
closeTail
- if true, a clone of the first vertex will be appended,
otherwise a clone of the last vertex will be prepended.public final Outline transform(jogamp.graph.geom.plane.AffineTransform t, Vertex.Factory<? extends Vertex> vertexFactory)
public final AABBox getBounds()
public final int compareTo(Outline other)
compareTo
in interface Comparable<Outline>
AABBox.getSize()
,
Comparable.compareTo(java.lang.Object)
public boolean equals(Object obj)
Copyright 2010 JogAmp Community.