PolygonBuilder

Inheritance: java.lang.Object

public final class PolygonBuilder

A helper class to build polygon for Mesh Example:

Mesh mesh = new Mesh();
  PolygonBuilder builder = new PolygonBuilder(mesh);
  builder.begin();
  builder.addVertex(0);
  builder.addVertex(1);
  builder.addVertex(2);
  builder.end();

Equals to :

Mesh mesh = new Mesh();
  int[] indices = new int[] {0, 1, 2};
  mesh.createPolygon(indices);

If all indices are ready to use, Mesh is preferred, otherwise PolygonBuilder would be a better choice.

Constructors

ConstructorDescription
PolygonBuilder(Mesh mesh)Initializes a new instance of the PolygonBuilder class.

Methods

MethodDescription
addVertex(int index)Adds a vertex index to the polygon
begin()Begins to add a new polygon
end()Finishes the polygon creation
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PolygonBuilder(Mesh mesh)

public PolygonBuilder(Mesh mesh)

Initializes a new instance of the PolygonBuilder class.

Parameters:

ParameterTypeDescription
meshMeshOn which mesh to build polygon.

addVertex(int index)

public void addVertex(int index)

Adds a vertex index to the polygon

Parameters:

ParameterTypeDescription
indexint

begin()

public void begin()

Begins to add a new polygon

end()

public void end()

Finishes the polygon creation

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int