maspack.geometry.io
Class XyzWriter

java.lang.Object
  extended by maspack.geometry.io.MeshWriterBase
      extended by maspack.geometry.io.XyzWriter
All Implemented Interfaces:
MeshWriter

public class XyzWriter
extends MeshWriterBase

Writes a PointMesh to an ascii .xyz file.

Author:
John Lloyd, Jan 2014

Nested Class Summary
 
Nested classes/interfaces inherited from interface maspack.geometry.io.MeshWriter
MeshWriter.DataFormat, MeshWriter.FloatType
 
Field Summary
 
Fields inherited from class maspack.geometry.io.MeshWriterBase
DEFAULT_FORMAT
 
Constructor Summary
XyzWriter(java.io.File file)
           
XyzWriter(java.io.OutputStream os)
           
XyzWriter(java.lang.String fileName)
           
 
Method Summary
 void writeMesh(MeshBase mesh)
           
 void writeMesh(java.io.PrintWriter pw, PointMesh mesh)
          Writes a PointMesh to a PrintWriter, using the simple ascii xyz format.
 
Methods inherited from class maspack.geometry.io.MeshWriterBase
close, getFormat, setFormat, setFormat
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XyzWriter

public XyzWriter(java.io.OutputStream os)
          throws java.io.IOException
Throws:
java.io.IOException

XyzWriter

public XyzWriter(java.io.File file)
          throws java.io.IOException
Throws:
java.io.IOException

XyzWriter

public XyzWriter(java.lang.String fileName)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

writeMesh

public void writeMesh(MeshBase mesh)
               throws java.io.IOException
Specified by:
writeMesh in interface MeshWriter
Specified by:
writeMesh in class MeshWriterBase
Throws:
java.io.IOException

writeMesh

public void writeMesh(java.io.PrintWriter pw,
                      PointMesh mesh)
               throws java.io.IOException
Writes a PointMesh to a PrintWriter, using the simple ascii xyz format.

The format used to print the vertex and normal coordinates can be controlled by MeshWriterBase.setFormat(String) or MeshWriterBase.setFormat(NumberFormat). The default format has eight decimal places and is specified by the string "%.8g".

Parameters:
pw - PrintWriter to write this mesh to
mesh - PointMesh to be written
Throws:
java.io.IOException