jv.loader
Class PgObjLoader
- java.lang.Object
-
- jv.loader.PgAbstractLoader
-
- jv.loader.PgObjLoader
-
- All Implemented Interfaces:
- PgLoaderIf
public final class PgObjLoader extends PgAbstractLoader
Loader for geometry files given in Wavefront's OBJ file format. This reader supports a subset of the commands, similar to the subset supported by Java3d. For details see the web page on supported file formats.- Author:
- Konrad Polthier
- Version:
- 22.03.10, 3.00 revised (kp) Superclass changed to PgAbstractLoader.
06.05.05, 2.20 revised (kp) Vertex colors improved and geomagic hack of OBJ implemented.
06.10.03, 2.15 revised (kp) Interface extended by isEnabledOptimization().
19.04.03, 2.10 revised (kp) Interface extended by setGeometryOption().
09.09.02, 2.00 revised (kp) Exchange vn and vt to comply with OBJ format.
21.08.02, 1.70 revised (kp) New methods getGeometries/getAnimations of PgLoaderIf implemented.
10.05.02, 1.65 revised (ep) Writes vector field now.
23.09.01, 1.60 revised (kp) Implement PgLoaderIf extended with methods for display options.
11.06.01, 1.50 revised (kp) Implement PgLoaderIf.
18.02.00, 1.30 revised (sk) Field specific entries included.
27.11.99, 1.20 revised (kp) Parsing of elements and polygons separated.
22.11.99, 1.10 revised (kp) Check incomplete data, obj extended.
00.00.98, 1.00 created (kp)
-
-
Field Summary
-
Fields inherited from interface jv.loader.PgLoaderIf
GEOM_DATA_AUTHOR, GEOM_DATA_COLORS, GEOM_DATA_HEADER, GEOM_DATA_INFO, GEOM_DATA_NORMALS, GEOM_DATA_TEXTURE, GEOM_DATA_VECTORS
-
-
Constructor Summary
Constructors Constructor and Description PgObjLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PgJvxSrc[]read(java.io.BufferedReader in)Read geometry file in Wavefront's OBJ file format.PgJvxSrc[]read(java.lang.String fileName)Read geometry file in Wavefront's OBJ file format.booleanwrite(java.io.Writer writer, PgJvxSrc[] geomArr)Write an array of geometries into an output stream writer.-
Methods inherited from class jv.loader.PgAbstractLoader
getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, isEnabledOptimization, load, read, setAnimation, setDisplayOption, setGeometryOption, write
-
-
-
-
Method Detail
-
read
public PgJvxSrc[] read(java.lang.String fileName)
Read geometry file in Wavefront's OBJ file format.- Author:
- Konrad Polthier
- Version:
- 20.02.01, 2.00 revised (kp) Method body moved to read(BufferedReader).
04.03.00, 1.50 revised (kp) Argument geometry removed, just fill private arrays.
00.00.98, 1.00 created (kp)
-
read
public PgJvxSrc[] read(java.io.BufferedReader in)
Read geometry file in Wavefront's OBJ file format.- Specified by:
readin interfacePgLoaderIf- Overrides:
readin classPgAbstractLoader- Parameters:
in- BufferedReader to read textual data from.- Returns:
- Array of JVX geometries.
- See Also:
PgAbstractLoader.write(Writer, PgJvxSrc [])- Author:
- Konrad Polthier
- Version:
- 20.02.01, 1.00 revised (kp)
20.02.01, 1.00 created (kp) Method body from former version read(String fileName).
-
write
public boolean write(java.io.Writer writer, PgJvxSrc[] geomArr) throws java.io.IOExceptionWrite an array of geometries into an output stream writer.Numbers with absolute value less than
jv.vecmath.PuMath#EPSare shown as zero. This avoids the annoying fact that double precision numbers fill the whole text area hiding the exponent, which hides their small value.- Specified by:
writein interfacePgLoaderIf- Overrides:
writein classPgAbstractLoader- Parameters:
writer- Write all data to this streamgeomArr- Array with geometries to save- Returns:
trueon success.- Throws:
java.io.IOException- See Also:
read(BufferedReader)- Version:
- 09.09.02, 2.00 revised (kp) Exchange vn and vt, remove vd vector fields to comply with OBJ format.
10.05.02, 1.30 revised (ep) Save first vector field if existent and vertex based as 'vd'.
10.06.01, 1.20 revised (kp) Save array of geometries instead of single geometry.
22.08.99, 1.10 revised (kp) Number with abs value less than PuMath.EPS are shown as zero.
22.08.99, 1.00 created (kp)
-
-
"