de.javagl.simplemesh.impl
Class DefaultMeshPrimitives

java.lang.Object
  extended by de.javagl.simplemesh.impl.DefaultMeshPrimitives
All Implemented Interfaces:
MeshPrimitives, java.io.Serializable

public class DefaultMeshPrimitives
extends java.lang.Object
implements MeshPrimitives

Default implementation of MeshPrimitives.

See Also:
Serialized Form

Constructor Summary
DefaultMeshPrimitives(java.util.Collection<? extends Vertex> vertices, java.util.Collection<? extends Edge> edges, java.util.Collection<? extends Face> faces)
          Creates new mesh primtives that contain copies of the given collections.
DefaultMeshPrimitives(float[] vertices, int stride, int[] faceVertexIndices)
          Creates new mesh primitives from the given information.
 
Method Summary
 java.util.List<Edge> getEdges()
          Returns an unmodifiable list of edges.
 java.util.List<Face> getFaces()
          Returns an unmodifiable list of faces.
 java.util.List<Vertex> getVertices()
          Returns an unmodifiable list of vertices.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMeshPrimitives

public DefaultMeshPrimitives(java.util.Collection<? extends Vertex> vertices,
                             java.util.Collection<? extends Edge> edges,
                             java.util.Collection<? extends Face> faces)
Creates new mesh primtives that contain copies of the given collections.

Parameters:
vertices - The vertices
edges - The edges
faces - The faces

DefaultMeshPrimitives

public DefaultMeshPrimitives(float[] vertices,
                             int stride,
                             int[] faceVertexIndices)
Creates new mesh primitives from the given information.

Parameters:
vertices - The vertex coordinates
stride - The stride for the vertex array
faceVertexIndices - The indices of the vertices that the faces consist of. Each three consecutive indices of this array will be the indices of one triangle.
Method Detail

getVertices

public java.util.List<Vertex> getVertices()
Description copied from interface: MeshPrimitives
Returns an unmodifiable list of vertices.

Specified by:
getVertices in interface MeshPrimitives
Returns:
The list of vertices.

getEdges

public java.util.List<Edge> getEdges()
Description copied from interface: MeshPrimitives
Returns an unmodifiable list of edges.

Specified by:
getEdges in interface MeshPrimitives
Returns:
The list of edges.

getFaces

public java.util.List<Face> getFaces()
Description copied from interface: MeshPrimitives
Returns an unmodifiable list of faces.

Specified by:
getFaces in interface MeshPrimitives
Returns:
The list of faces.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object