Interface PgLoaderIf
-
- All Known Implementing Classes:
- PgAbcLoader, PgAbstractLoader, PgAnsLoader, PgBdLoader, PgByuLoader, PgDxfLoader, PgFeLoader, PgJvfLoader, PgJvxLoader, PgMaLoader, PgMapleLoader, PgMathLoader, PgObjLoader, PgOffLoader, PgPdfLoader, PgPlyLoader, PgPovLoader, PgStlbLoader, PgStlLoader, PgU3dLoader, PgWrlLoader, PgXyzLoader
public interface PgLoaderIfInterface which import loaders of geometric shape from files should implement in order to be accessible from PgLoader. Given a filename extension, PgLoader may automatically check availability of a loader, create a loader and load the geometry respectively animation from that file.Some file formats allow storage of display information. If an individual loader provides display information then calling methods may make use of it.
- Author:
- Konrad Polthier
- Version:
- 22.08.02, 2.00 revised (kp) Major revision, now use getGeometries and getAnimations.
25.09.01, 1.10 revised (kp) Handling of display options implemented.
10.06.01, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static intGEOM_DATA_AUTHORIdentifies author information of a geometry, for example, for export.static intGEOM_DATA_COLORSIdentifies individual vertex and element colors of a geometry, for example, for export.static intGEOM_DATA_HEADERIdentifies header information about creating software, for example, to prepend export files.static intGEOM_DATA_INFOIdentifies description of a geometry, for example, for export.static intGEOM_DATA_NORMALSIdentifies individual vertex and element normals of a geometry, for example, for export.static intGEOM_DATA_TEXTUREIdentifies texture coordinates and images of a geometry, for example, for export.static intGEOM_DATA_VECTORSIdentifies vector fields of a geometry, for example, for export.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description PgJvxSrc[][]getAnimations()Retrieve the previously loaded animations.PvDisplayOptiongetDisplayOption()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.booleanisAnimation()Determine if currently loaded data is an animation.booleanisEnabledOptimization()Determines if the loaded geometry requires some optimization.booleanload(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.voidsetAnimation(boolean flag)Set flag whether current geometry data is considered an animation.voidsetDisplayOption(PvDisplayOption option)Set the display options to be saved within the geometry file.voidsetGeometryOption(java.util.BitSet option)Set the geometry options which indicate which parts of a geometry shall be saved.booleanwrite(java.io.DataOutputStream outWriter, PgJvxSrc[] geom)Write an array of geometries into a binary output stream writer.booleanwrite(java.io.Writer writer, PgJvxSrc[] geom)Write an array of geometries into an output stream writer.
-
-
-
Field Detail
-
GEOM_DATA_HEADER
static final int GEOM_DATA_HEADER
Identifies header information about creating software, for example, to prepend export files.- See Also:
- Constant Field Values
-
GEOM_DATA_AUTHOR
static final int GEOM_DATA_AUTHOR
Identifies author information of a geometry, for example, for export.- See Also:
- Constant Field Values
-
GEOM_DATA_INFO
static final int GEOM_DATA_INFO
Identifies description of a geometry, for example, for export.- See Also:
- Constant Field Values
-
GEOM_DATA_NORMALS
static final int GEOM_DATA_NORMALS
Identifies individual vertex and element normals of a geometry, for example, for export.- See Also:
- Constant Field Values
-
GEOM_DATA_COLORS
static final int GEOM_DATA_COLORS
Identifies individual vertex and element colors of a geometry, for example, for export.- See Also:
- Constant Field Values
-
GEOM_DATA_TEXTURE
static final int GEOM_DATA_TEXTURE
Identifies texture coordinates and images of a geometry, for example, for export.- See Also:
- Constant Field Values
-
GEOM_DATA_VECTORS
static final int GEOM_DATA_VECTORS
Identifies vector fields of a geometry, for example, for export.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAnimations
PgJvxSrc[][] getAnimations()
Retrieve the previously loaded animations.This method may be called after successful parsing an input stream with the method
load(BufferedReader)and ifisAnimation()returnstrue.- Returns:
- Double array of JVX geometries.
- Since:
- JavaView 2.32
- See Also:
load(BufferedReader)- Author:
- Konrad Polthier
- Version:
- 21.08.02, 1.00 created (kp)
-
getGeometries
PgJvxSrc[] getGeometries()
Retrieve the previously loaded geometries in a container class.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
PgJvxSrcand 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 ifisAnimation()returnsfalse.- Returns:
- Array of JVX geometries.
- Since:
- JavaView 2.32
- See Also:
load(BufferedReader)- Author:
- Konrad Polthier
- Version:
- 21.08.02, 1.00 created (kp)
-
getSpecializedGeometries
PgGeometryIf[] getSpecializedGeometries()
Return the loaded geometry in a more specialized class. This method allows a loader to return a geometry class which best fits the data found in a geometry file.The loader manager
PgLoaderin 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 ifisAnimation()returnsfalse.- Returns:
- Array of geometries whose actual class type may vary between loaders.
- Since:
- JavaView 2.53
- See Also:
getGeometries()- Author:
- Konrad Polthier
- Version:
- 06.03.03, 1.00 created (kp)
-
load
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().- Parameters:
in- BufferedReader to read textual data from.- Returns:
trueif parsing was successfull.- Since:
- JavaView 2.32
- See Also:
getAnimations(),getGeometries(),isAnimation()- Author:
- Konrad Polthier
- Version:
- 21.08.02, 1.00 created (kp)
-
read
PgJvxSrc[] read(java.io.BufferedReader in)
Read a geometry file and return an array of new geometries.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.
- Parameters:
in- BufferedReader to read textual data from.- Returns:
- Array of JVX geometries.
- See Also:
write(Writer, PgJvxSrc [])- Author:
- Konrad Polthier
- Version:
- 10.06.01, 1.00 revised (kp)
10.06.01, 1.00 created (kp)
-
write
boolean write(java.io.Writer writer, PgJvxSrc[] geom) throws java.io.IOExceptionWrite an array of geometries into an output stream writer.- Parameters:
writer- Write all data to this streamgeom- Array with geometries to save- Returns:
trueon success.- Throws:
java.io.IOException- See Also:
read(BufferedReader),write(DataOutputStream, PgJvxSrc [])- Version:
- 10.06.01, 1.00 revised (kp)
10.06.01, 1.00 created (kp)
-
write
boolean write(java.io.DataOutputStream outWriter, PgJvxSrc[] geom) throws java.io.IOExceptionWrite an array of geometries into a binary output stream writer.- Parameters:
outWriter- Write all data to this streamgeom- Array with geometries to save- Returns:
trueon success.- Throws:
java.io.IOException- See Also:
read(BufferedReader),write(Writer, PgJvxSrc [])- Version:
- 30.04.06, 1.00 created (kp)
-
getDisplayOption
PvDisplayOption getDisplayOption()
Get display options which some parsers and geometry file formats supply. Note, not all geometry file formats support saving of display option.This method may be called after successful parsing an input stream with the method
load(BufferedReader).- See Also:
load(BufferedReader)
-
setDisplayOption
void setDisplayOption(PvDisplayOption option)
Set the display options to be saved within the geometry file. This method must be called before writing the geometry. Note, not all geometry file formats support saving of display option.
-
setGeometryOption
void setGeometryOption(java.util.BitSet option)
Set the geometry options which indicate which parts of a geometry shall be saved. This method must be called before writing the geometry. Note, not all geometry file formats support geometry options.
-
isAnimation
boolean isAnimation()
Determine if currently loaded data is an animation.This method may be called after successful parsing an input stream with the method
load(BufferedReader).- Returns:
trueif loaded data is considered an animation.- See Also:
load(BufferedReader)
-
setAnimation
void setAnimation(boolean flag)
Set flag whether current geometry data is considered an animation.- Parameters:
flag-trueif loaded data is an animation.
-
isEnabledOptimization
boolean isEnabledOptimization()
Determines if the loaded geometry requires some optimization.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.
- Returns:
trueif loader is enabled for optimization.- Since:
- JavaView 2.99.018
- See Also:
PgLoader.isEnabledOptimization(),PgLoader.setEnabledOptimization(boolean)- Version:
- 06.10.03, 1.00 created (kp)
-
-
"