public interface PgLoaderIf
Some file formats allow storage of display information. If an individual loader provides display information then calling methods may make use of it.
Modifier and Type | Field and Description |
---|---|
static int |
GEOM_DATA_AUTHOR
Identifies author information of a geometry, for example, for export.
|
static int |
GEOM_DATA_COLORS
Identifies individual vertex and element colors of a geometry, for example, for export.
|
static int |
GEOM_DATA_HEADER
Identifies header information about creating software, for example, to prepend export files.
|
static int |
GEOM_DATA_INFO
Identifies description of a geometry, for example, for export.
|
static int |
GEOM_DATA_NORMALS
Identifies individual vertex and element normals of a geometry, for example, for export.
|
static int |
GEOM_DATA_TEXTURE
Identifies texture coordinates and images of a geometry, for example, for export.
|
static int |
GEOM_DATA_VECTORS
Identifies vector fields of a geometry, for example, for export.
|
Modifier and Type | Method and Description |
---|---|
PgJvxSrc[][] |
getAnimations()
Retrieve the previously loaded animations.
|
PvDisplayOption |
getDisplayOption()
Get display options which some parsers and geometry file formats supply.
|
PgJvxSrc[] |
getGeometries()
Retrieve the previously loaded geometries in a container class.
|
PgGeometryIf[] |
getSpecializedGeometries()
Return the loaded geometry in a more specialized class.
|
boolean |
isAnimation()
Determine if currently loaded data is an animation.
|
boolean |
isEnabledOptimization()
Determines if the loaded geometry requires some optimization.
|
boolean |
load(java.io.BufferedReader in)
Read a geometry file containing a set of geometries or animations.
|
PgJvxSrc[] |
read(java.io.BufferedReader in)
Read a geometry file and return an array of new geometries.
|
void |
setAnimation(boolean flag)
Set flag whether current geometry data is considered an animation.
|
void |
setDisplayOption(PvDisplayOption option)
Set the display options to be saved within the geometry file.
|
void |
setGeometryOption(java.util.BitSet option)
Set the geometry options which indicate which parts of a geometry shall be saved.
|
boolean |
write(java.io.DataOutputStream outWriter,
PgJvxSrc[] geom)
Write an array of geometries into a binary output stream writer.
|
boolean |
write(java.io.Writer writer,
PgJvxSrc[] geom)
Write an array of geometries into an output stream writer.
|
static final int GEOM_DATA_HEADER
static final int GEOM_DATA_AUTHOR
static final int GEOM_DATA_INFO
static final int GEOM_DATA_NORMALS
static final int GEOM_DATA_COLORS
static final int GEOM_DATA_TEXTURE
static final int GEOM_DATA_VECTORS
PgJvxSrc[][] getAnimations()
This method may be called after successful parsing an input stream
with the method load(BufferedReader)
and
if isAnimation()
returns true
.
load(BufferedReader)
PgJvxSrc[] getGeometries()
Using a general container class to return geometric data from
a loader frees a loader from knowing about special geometry classes.
There exist several ways to exchange geometric data between the
container class PgJvxSrc
and specialized
classes, for example, those found in jv.geom.
This method may be called after successful parsing an input stream
with the method load(BufferedReader)
and
if isAnimation()
returns false
.
load(BufferedReader)
PgGeometryIf[] getSpecializedGeometries()
The loader manager PgLoader
in JavaView
will first check if a loader returns specialized geometries, and if
not, check for a data supplied in a container class PgJvxSrc.
This method may be called after successful parsing an input stream
with the method load(BufferedReader)
and
if isAnimation()
returns false
.
getGeometries()
boolean load(java.io.BufferedReader in)
After successful parsing retrieve the loaded geometries or animations
using the methods getGeometries()
respectively
getAnimations()
depending on the return value
of the method isAnimation()
.
in
- BufferedReader to read textual data from.true
if parsing was successfull.getAnimations()
,
getGeometries()
,
isAnimation()
PgJvxSrc[] read(java.io.BufferedReader in)
The returned array of geometry may contain keyframes of
an animation. This is checked with the method isAnimation()
.
Alternatively, one may call load(BuffereredReader) followed by getGeometries() resp. getAnimations() to have a finer control about which information one wants to use from a source. For example, optional display information must be retrieve by a subsequent call getDisplayOption() if available.
in
- BufferedReader to read textual data from.write(Writer, PgJvxSrc [])
boolean write(java.io.Writer writer, PgJvxSrc[] geom) throws java.io.IOException
writer
- Write all data to this streamgeom
- Array with geometries to savetrue
on success.java.io.IOException
read(BufferedReader)
,
write(DataOutputStream, PgJvxSrc [])
boolean write(java.io.DataOutputStream outWriter, PgJvxSrc[] geom) throws java.io.IOException
outWriter
- Write all data to this streamgeom
- Array with geometries to savetrue
on success.java.io.IOException
read(BufferedReader)
,
write(Writer, PgJvxSrc [])
PvDisplayOption getDisplayOption()
This method may be called after successful parsing an input stream
with the method load(BufferedReader)
.
load(BufferedReader)
void setDisplayOption(PvDisplayOption option)
void setGeometryOption(java.util.BitSet option)
boolean isAnimation()
This method may be called after successful parsing an input stream
with the method load(BufferedReader)
.
true
if loaded data is considered an animation.load(BufferedReader)
void setAnimation(boolean flag)
flag
- true
if loaded data is an animation.boolean isEnabledOptimization()
For example, some file formats do not store a connected mesh but provide individual vertices for each face every time the face is mentioned. In this case, a loader manager may identify equal vertices.
A similar method in the loader manager PgLoader may override the individual settings of each loader.
true
if loader is enabled for optimization.PgLoader.isEnabledOptimization()
,
PgLoader.setEnabledOptimization(boolean)
"