jvx.loader
Class PgJvfLoader
- java.lang.Object
-
- jv.loader.PgAbstractLoader
-
- jvx.loader.PgJvfLoader
-
- All Implemented Interfaces:
- PgLoaderIf
public class PgJvfLoader extends PgAbstractLoader
Loader for geometry files containing functional descriptions.- Author:
- Konrad Polthier
- Version:
- 09.03.15, 3.00 revised (kp) Moved to jvx.loader from dev.loader.
22.03.10, 2.00 revised (kp) Superclass changed to PgAbstractLoader.
13.10.04, 1.10 revised (kp) Keyword expr in JVF file replaced with funExpr.
26.07.04, 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 PgJvfLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static doublegetRsrcAsDoubleF(PsXmlNode rsrcNode, java.lang.String type)Get content of node in resource tree with given element type by searching from given node.booleanload(java.io.BufferedReader in)Read a geometry file containing a set of geometries or animations.static java.lang.String[][]parseFunList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)Parse an array of PsXmlNodes of same element type, where each element has data consisting of a blank separated list of functions to be interpreted.static PgGeometryIf[]readSpecial(java.lang.String fileName)Read JVF geometry file in JavaView JVF file format.booleanwrite(java.io.Writer writer, PgJvxSrc[] geom)Write all geometries in a XML tree structure of instances of typePsXmlNodeand into a writer.-
Methods inherited from class jv.loader.PgAbstractLoader
getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, isEnabledOptimization, read, read, setAnimation, setDisplayOption, setGeometryOption, write
-
-
-
-
Method Detail
-
load
public boolean load(java.io.BufferedReader in)
Read a geometry file containing a set of geometries or animations.After successful parsing retrieve the loaded geometries or animations using the methods
getGeometries()respectivelygetAnimations()depending on the return value of the methodisAnimation().- Specified by:
loadin interfacePgLoaderIf- Overrides:
loadin classPgAbstractLoader- Parameters:
in- BufferedReader to read textual data from.- Returns:
trueif parsing was successfull.- See Also:
PgAbstractLoader.getAnimations(),PgAbstractLoader.getGeometries(),PgAbstractLoader.isAnimation()- Author:
- Konrad Polthier
- Version:
- 25.03.04, 1.00 created (kp)
-
readSpecial
public static PgGeometryIf[] readSpecial(java.lang.String fileName)
Read JVF geometry file in JavaView JVF file format.- Author:
- Konrad Polthier
- Version:
- 13.03.2018, 1.00 created (kp)
-
write
public boolean write(java.io.Writer writer, PgJvxSrc[] geom)Write all geometries in a XML tree structure of instances of typePsXmlNodeand into a writer.- Specified by:
writein interfacePgLoaderIf- Overrides:
writein classPgAbstractLoader- Parameters:
writer- Write all data to this streamgeom- Array with geometries to save- Returns:
trueon success.- See Also:
PgAbstractLoader.read(BufferedReader),PgAbstractLoader.write(DataOutputStream, PgJvxSrc [])- Version:
- 25.03.04, 1.00 created (kp)
-
parseFunList
public static java.lang.String[][] parseFunList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
Parse an array of PsXmlNodes of same element type, where each element has data consisting of a blank separated list of functions to be interpreted.- Parameters:
parentNode- parent node containing a set of color nodes as childrentype- type of elements in arrayattr- array of attributes the vector might have, may be null.- Returns:
- parsed string array, or null if failed
- Version:
- 25.03.04, 1.00 created (kp)
-
getRsrcAsDoubleF
public static double getRsrcAsDoubleF(PsXmlNode rsrcNode, java.lang.String type)
Get content of node in resource tree with given element type by searching from given node. Method assumes that content is formated as double and does some checking.- Parameters:
rsrcNode- node whose descendants are searched including itselftype- element type of node to be searched- Returns:
- content of resource if resource is found, else default value 0.
-
-
"