de.javagl.simplemesh.utils
Class ObjLoader

java.lang.Object
  extended by de.javagl.simplemesh.utils.ObjLoader

public class ObjLoader
extends java.lang.Object

Utility methods for reading MeshPrimitives from OBJ files.


Method Summary
static MeshPrimitives load(java.io.InputStream objInputStream)
          Reads mesh primitives from the given OBJ input stream.
static MeshPrimitives load(java.lang.String fileName)
          Reads the mesh primitives from the OBJ with the given name
static void save(MeshPrimitives meshPrimitives, java.io.OutputStream objOutputStream)
          Write the given mesh primitives as OBJ data into the given stream
static void save(MeshPrimitives meshPrimitives, java.lang.String fileName)
          Save the given mesh primitives into an OBJ file with the given name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static MeshPrimitives load(java.lang.String fileName)
Reads the mesh primitives from the OBJ with the given name

Parameters:
fileName - The OBJ file name
Returns:
The mesh primitives, or null if the data could not be read.

load

public static MeshPrimitives load(java.io.InputStream objInputStream)
                           throws java.io.IOException
Reads mesh primitives from the given OBJ input stream.

Parameters:
objInputStream - The input stream
Returns:
The mesh primitives
Throws:
java.io.IOException - If something goes wrong...

save

public static void save(MeshPrimitives meshPrimitives,
                        java.lang.String fileName)
Save the given mesh primitives into an OBJ file with the given name

Parameters:
meshPrimitives - The mesh primitives
fileName - The file name

save

public static void save(MeshPrimitives meshPrimitives,
                        java.io.OutputStream objOutputStream)
                 throws java.io.IOException
Write the given mesh primitives as OBJ data into the given stream

Parameters:
meshPrimitives - The mesh primitives
objOutputStream - The stream
Throws:
java.io.IOException - If an IO error occurs