|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.von_gagern.martin.confoo.mesh.ObjFormat
public class ObjFormat
Bare bones interoperability with obj file format.
This class facililiates interaction with the Object File Format introduced by Wavefront Technologies for the description of 3D objects, including meshes.
The implementation provides both read and write access to said format, but only considers meshes at the moment. Other lines will be disregarded on input and not generated on output.
| Constructor Summary | |
|---|---|
ObjFormat(BufferedReader in)
Construct from object file text. |
|
ObjFormat(InputStream in)
Construct from object file input stream. |
|
ObjFormat(LocatedMesh<Integer> mesh)
Construct from integer mesh. |
|
ObjFormat(LocatedMesh<V> mesh,
Map<V,Integer> vertexMap)
Construct from arbitrary located mesh. |
|
ObjFormat(Reader in)
Construct from object file text. |
|
| Method Summary | |
|---|---|
double |
edgeLength(Integer v1,
Integer v2)
Determine edge length. |
double |
getX(Integer v)
Get x coordinate of vertex. |
double |
getY(Integer v)
Get y coordinate of vertex. |
double |
getZ(Integer v)
Get z coordinate of vertex. |
MeshIterator<Integer> |
iterator()
Get iterator over all triangles. |
void |
write(Appendable out)
Write out object file text. |
void |
write(OutputStream out)
Write out object file stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjFormat(BufferedReader in)
throws IOException
in - a reader over some object file
IOException
public ObjFormat(Reader in)
throws IOException
in - a reader over some object file
IOException
public ObjFormat(InputStream in)
throws IOException
in - an input stream over some object file
IOException
public ObjFormat(LocatedMesh<V> mesh,
Map<V,Integer> vertexMap)
A map can be provided to map vertices to indices. It must
assign indices continuously, starting from 1. Vertices not
present in the map will be added to the map and cann therefore
be obtained from the map after this function returns. If the
caller is not interested in this information, he may pass
null as the vertexMap.
mesh - the mesh to construct the object file fromvertexMap - the vertex map as described above or nullpublic ObjFormat(LocatedMesh<Integer> mesh)
The integers identifying vertices in the undrlying mesh must start at 1 and form a continuous range.
mesh - the mesh to construct the object file from| Method Detail |
|---|
public void write(Appendable out)
throws IOException
out - the appendable to which the object file will be written
IOException - if an I/O error occurs
public void write(OutputStream out)
throws IOException
out - the strem to which the object file will be written
IOException - if an I/O error occurs
public double edgeLength(Integer v1,
Integer v2)
edgeLength in interface MetricMesh<Integer>v1 - index of first vertexv2 - index of second vertex
public double getX(Integer v)
getX in interface LocatedMesh<Integer>v - index of a vertex
public double getY(Integer v)
getY in interface LocatedMesh<Integer>v - index of a vertex
public double getZ(Integer v)
getZ in interface LocatedMesh<Integer>v - index of a vertex
public MeshIterator<Integer> iterator()
iterator in interface Iterable<CorneredTriangle<Integer>>iterator in interface CombinatoricMesh<Integer>Iterable.iterator(),
MeshIterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||