|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.loaders.obj.OBJFileReader
public class OBJFileReader
Class to read OBJ files.
Usage: First create a OBJFileReader
object. To obtain the number
of objects, name of objects and number of facets for each object use the
appropriate methods. Then use the #getNextFacet
method repetitively
to obtain the geometric data for each facet. Call close()
to free the
resources.
In case that the file uses the binary OBJ format, no check can be done to assure that the file is in OBJ format. A wrong format will only be recognized if an invalid amount of data is contained in the file.
Constructor Summary | |
---|---|
OBJFileReader(java.io.File file)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.io.File file,
java.awt.Component parentComponent)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.io.File file,
java.awt.Component parentComponent,
boolean strict)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.lang.String fileName)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.lang.String fileName,
boolean strict)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.lang.String fileName,
java.awt.Component parentComponent)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.lang.String fileName,
java.awt.Component parentComponent,
boolean strict)
Creates a OBJFileReader object to read a OBJ file from a
file. |
|
OBJFileReader(java.net.URL url)
Creates a OBJFileReader object to read a OBJ file from an
URL. |
|
OBJFileReader(java.net.URL url,
boolean strict)
Creates a OBJFileReader object to read a OBJ file from an
URL. |
|
OBJFileReader(java.net.URL url,
java.awt.Component parentComponent)
Creates a OBJFileReader object to read a OBJ file from an
URL. |
|
OBJFileReader(java.net.URL url,
java.awt.Component parentComponent,
boolean strict)
Creates a OBJFileReader object to read a OBJ file from an
URL. |
Method Summary | |
---|---|
void |
close()
Releases used resources. |
GeometryData |
getNextObject()
Get the next object in the stream. |
java.util.List<java.lang.String> |
getParsingMessages()
Get detailed messages on what was wrong when parsing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OBJFileReader(java.io.File file) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format.
file
- File
object of OBJ file to read.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.lang.String fileName) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format.
fileName
- Name of OBJ file to read.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.lang.String fileName, boolean strict) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format.
fileName
- Name of OBJ file to read.strict
- Attempt to deal with crappy data or short downloads.
Will try to return any useable geometry.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.net.URL url) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from an
URL. The data may be in ASCII or binary format.
url
- URL of OBJ file to read.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.net.URL url, boolean strict) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from an
URL. The data may be in ASCII or binary format.
url
- URL of OBJ file to read.strict
- Attempt to deal with crappy data or short downloads.
Will try to return any useable geometry.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.net.URL url, java.awt.Component parentComponent) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from an
URL. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
url
- URL of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.net.URL url, java.awt.Component parentComponent, boolean strict) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from an
URL. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
url
- URL of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.strict
- Attempt to deal with crappy data or short downloads.
Will try to return any useable geometry.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.io.File file, java.awt.Component parentComponent) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
file
- File
object of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.io.File file, java.awt.Component parentComponent, boolean strict) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
file
- File
object of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.strict
- Attempt to deal with crappy data or short downloads.
Will try to return any useable geometry.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.lang.String fileName, java.awt.Component parentComponent) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
fileName
- Name of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
public OBJFileReader(java.lang.String fileName, java.awt.Component parentComponent, boolean strict) throws InvalidFormatException, java.io.IOException
OBJFileReader
object to read a OBJ file from a
file. The data may be in ASCII or binary format. A progress monitor will
show the progress during reading.
fileName
- Name of OBJ file to read.parentComponent
- Parent Component
of progress monitor.
Use null
if there is no parent.strict
- Attempt to deal with crappy data or short downloads.
Will try to return any useable geometry.
InvalidFormatException
- The file was structurally incorrect
java.io.IOException
Method Detail |
---|
public GeometryData getNextObject() throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getParsingMessages()
public void close() throws java.io.IOException
java.io.IOException
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |