maspack.geometry.io
Class WavefrontReader
java.lang.Object
maspack.geometry.io.MeshReaderBase
maspack.geometry.io.WavefrontReader
- All Implemented Interfaces:
- MeshReader
- Direct Known Subclasses:
- GeomagicObjReader
public class WavefrontReader
- extends MeshReaderBase
Interprets a subset of the Alias-Wavefront OBJ file format. Groups are
implemented, but only one group may be specified at a time and grouping
applies only to faces, lines, curves, and surfaces.
Nested Class Summary |
static class |
WavefrontReader.Curve
A simple container class to hold all the info for a Wavefront curve
specification. |
static class |
WavefrontReader.Surface
A simple container class to hold all the info for a Wavefront curve
specification. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
BEZIER
public static final int BEZIER
- See Also:
- Constant Field Values
BMATRIX
public static final int BMATRIX
- See Also:
- Constant Field Values
BSPLINE
public static final int BSPLINE
- See Also:
- Constant Field Values
CARDINAL
public static final int CARDINAL
- See Also:
- Constant Field Values
TAYLOR
public static final int TAYLOR
- See Also:
- Constant Field Values
WavefrontReader
public WavefrontReader(ReaderTokenizer rtok)
WavefrontReader
public WavefrontReader(java.io.Reader reader)
WavefrontReader
public WavefrontReader(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
WavefrontReader
public WavefrontReader(java.lang.String fileName)
throws java.io.IOException
- Throws:
java.io.IOException
getZeroIndexed
public boolean getZeroIndexed()
setZeroIndexed
public void setZeroIndexed(boolean enable)
hasGroup
public boolean hasGroup(java.lang.String name)
setGroup
public void setGroup(java.lang.String name)
getPolyhedralGroupNames
public java.lang.String[] getPolyhedralGroupNames()
getPolylineGroupNames
public java.lang.String[] getPolylineGroupNames()
getGroupNames
public java.lang.String[] getGroupNames()
setParentPath
public void setParentPath(java.lang.String pathname)
clear
public void clear()
getMaterial
public RenderProps getMaterial(java.lang.String matName)
getMaterialNames
public java.lang.String[] getMaterialNames()
parse
public void parse()
throws java.io.IOException
- Throws:
java.io.IOException
equals
public boolean equals(java.lang.Object obj)
- For testing ...
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- For testing ...
- Overrides:
toString
in class java.lang.Object
getRenderProps
public RenderProps getRenderProps()
getGroupRenderProps
public RenderProps getGroupRenderProps(java.lang.String groupName)
getLocalFaceIndicesAndVertices
public int[][] getLocalFaceIndicesAndVertices(java.util.ArrayList<Point3d> vtxList)
throws java.io.IOException
- Throws:
java.io.IOException
getLocalLineIndicesAndVertices
public int[][] getLocalLineIndicesAndVertices(java.util.ArrayList<Point3d> vtxList)
throws java.io.IOException
- Throws:
java.io.IOException
getLocalNormalIndicesAndVertices
public int[][] getLocalNormalIndicesAndVertices(java.util.ArrayList<Vector3d> nrmList)
throws java.io.IOException
- Throws:
java.io.IOException
getLocalTextureIndicesAndVertices
public int[][] getLocalTextureIndicesAndVertices(java.util.ArrayList<Vector3d> vtxList)
throws java.io.IOException
- Throws:
java.io.IOException
getVertexPoints
public Point3d[] getVertexPoints()
getVertexNormals
public Vector3d[] getVertexNormals()
getHomogeneousPoints
public Vector4d[] getHomogeneousPoints()
getFaceIndices
public int[][] getFaceIndices()
getLineIndices
public int[][] getLineIndices()
getTextureIndices
public int[][] getTextureIndices()
getVertexNormalIndices
public int[][] getVertexNormalIndices()
getVertexList
public java.util.ArrayList<Vector4d> getVertexList()
getTextureVertexList
public java.util.ArrayList<Vector3d> getTextureVertexList()
getNormalList
public java.util.ArrayList<Vector3d> getNormalList()
getFaceList
public java.util.ArrayList<maspack.geometry.io.WavefrontReader.Face> getFaceList()
getLineList
public java.util.ArrayList<maspack.geometry.io.WavefrontReader.Line> getLineList()
getCurveList
public java.util.ArrayList<WavefrontReader.Curve> getCurveList()
getSurfaceList
public java.util.ArrayList<WavefrontReader.Surface> getSurfaceList()
isVerbose
public boolean isVerbose()
setVerbose
public void setVerbose(boolean verb)
setMesh
public void setMesh(PolygonalMesh mesh)
throws java.io.IOException
- Throws:
java.io.IOException
setMesh
public void setMesh(PolygonalMesh mesh,
java.lang.String groupName)
throws java.io.IOException
- Throws:
java.io.IOException
readMesh
public MeshBase readMesh(MeshBase mesh)
throws java.io.IOException
- Throws:
java.io.IOException
setMesh
public void setMesh(PointMesh mesh)
throws java.io.IOException
- Throws:
java.io.IOException
setMesh
public void setMesh(PointMesh mesh,
java.lang.String groupName)
throws java.io.IOException
- Throws:
java.io.IOException
setMesh
public void setMesh(PolylineMesh mesh)
throws java.io.IOException
- Throws:
java.io.IOException
setMesh
public void setMesh(PolylineMesh mesh,
java.lang.String groupName)
throws java.io.IOException
- Throws:
java.io.IOException
read
public static MeshBase read(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
read
public static MeshBase read(java.lang.String fileName)
throws java.io.IOException
- Throws:
java.io.IOException