|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultFileFormat
cz.cuni.jagrlib.DefaultBrepFileFormat
cz.cuni.jagrlib.piece.OBJFileFormat
public class OBJFileFormat
Wavefront OBJ file format (persistence of B-rep 3D data).
| Nested Class Summary | |
|---|---|
protected static class |
OBJFileFormat.Vertex
Vertex triple [ coords, texture, normal ]. |
| Field Summary | |
|---|---|
static RegPiece |
reg
Static registration instance for this class. |
protected boolean |
reorient
Change coordinate orientation? |
static java.lang.String |
REORIENT
|
protected int |
solid
Id of solid read from input stream. |
static java.lang.String |
SOLID
|
protected boolean |
triangulate
Triangulate all read faces? |
static java.lang.String |
TRIANGULATE
|
| Fields inherited from class cz.cuni.jagrlib.DefaultBrepFileFormat |
|---|
CATEGORY, TEMPLATE_NAME |
| Fields inherited from class cz.cuni.jagrlib.Piece |
|---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
| Fields inherited from interface cz.cuni.jagrlib.iface.DataFileFormat |
|---|
DOUBLE_STREAM |
| Fields inherited from interface cz.cuni.jagrlib.iface.Property |
|---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
| Constructor Summary | |
|---|---|
OBJFileFormat()
|
|
| Method Summary | |
|---|---|
protected void |
commonLoad(BitStream stream,
Brep b)
Common load code. |
protected void |
commonSave(BitStream stream,
Brep b)
Common save code. |
java.lang.String[] |
fileNameMasks()
Returns file-name masks associated with the file-format type. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
int |
headerLength()
Length of file-format header (number of bytes which is necessary for file-format matching). |
double |
match(byte[] header,
java.lang.String fileName)
File-format match test. |
protected static boolean |
parseDouble(java.lang.String token,
double[] arr,
int i)
Parses double number, returns true if succeeded. |
protected static int |
parseFace(java.lang.String[] tokens,
int len,
int vertices,
int textures,
int normals,
OBJFileFormat.Vertex[] vert)
Parse one face, parsed vertices are written into the vert array,
their number is returned. |
protected static int |
parseVector(java.lang.String[] tokens,
int len,
double[] arr)
Parses double-precision vector starting at token[1],
stores result in the arr array, returns its length. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
| Methods inherited from class cz.cuni.jagrlib.DefaultBrepFileFormat |
|---|
loadFile, loadFile, saveFile, saveFile |
| Methods inherited from class cz.cuni.jagrlib.DefaultFileFormat |
|---|
closeFile, init, readFloat, readLine, readParameters, readToken, readUnsigned16, readUnsigned16, readUnsigned32, writeFloat, writeLine, writeParameters, writeUnsigned16, writeUnsigned16, writeUnsigned32 |
| Methods inherited from class cz.cuni.jagrlib.Piece |
|---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
| Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
|---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface cz.cuni.jagrlib.iface.Property |
|---|
commit |
| Methods inherited from interface cz.cuni.jagrlib.Breakable |
|---|
setProgressListener, stop |
| Field Detail |
|---|
protected boolean triangulate
protected boolean reorient
protected int solid
Brep.NULL, no solid identifiers will be set..
public static final java.lang.String TRIANGULATE
public static final java.lang.String REORIENT
public static final java.lang.String SOLID
public static final RegPiece reg
| Constructor Detail |
|---|
public OBJFileFormat()
| Method Detail |
|---|
protected static boolean parseDouble(java.lang.String token,
double[] arr,
int i)
true if succeeded.
protected static int parseVector(java.lang.String[] tokens,
int len,
double[] arr)
token[1],
stores result in the arr array, returns its length.
protected static int parseFace(java.lang.String[] tokens,
int len,
int vertices,
int textures,
int normals,
OBJFileFormat.Vertex[] vert)
vert array,
their number is returned.
protected void commonLoad(BitStream stream,
Brep b)
throws java.io.IOException
commonLoad in class DefaultBrepFileFormatstream - Opened input bit-stream.b - Checked B-rep database object.
java.io.IOException
protected void commonSave(BitStream stream,
Brep b)
throws java.io.IOException
commonSave in class DefaultBrepFileFormatstream - Opened output bit-stream.b - Checked B-rep database object.
java.io.IOExceptionpublic int headerLength()
headerLength in interface DataFileFormatheaderLength in class DefaultFileFormatmatch(byte[], java.lang.String)
public double match(byte[] header,
java.lang.String fileName)
match in interface DataFileFormatmatch in class DefaultFileFormatheader - Bytes from beginning of the file.fileName - Optional file-name string.
0.0 .. no way,
0.5 .. maybe, 0.9 .. almost sure, 1.0 ..
absolutely - no need to check another formats).headerLength(),
fileNameMasks()public java.lang.String[] fileNameMasks()
fileNameMasks in interface DataFileFormatfileNameMasks in class DefaultFileFormatnull.match(byte[], java.lang.String)
public void set(java.lang.String key,
java.lang.Object value)
set in interface Propertyset in class DefaultPropertykey - Key string.value - The new value.Property.commit()public java.lang.Object get(java.lang.String key)
get in interface Propertyget in class DefaultPropertykey - Key string.
null.
public static int setTemplate(Template t,
int ord)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||