JavaView® v2.12

jv.loader
Class PgBdLoader

java.lang.Object
  |
  +--jv.loader.PgBdLoader
All Implemented Interfaces:
PgLoaderIf

public class PgBdLoader
extends java.lang.Object
implements PgLoaderIf

Reads a build file '*.bd' and fills information in PgMacroPatch. Class is later queried by an application for macro patches. An application is responsible to generate actual geometries, like triangulations, out of a macro patch.

Each macro patch may be bounded by simple straight lines or by curves with sophisticated boundary constraints to be used in calculus of variations. See description of the file format '*.bd' for more details.

Version:
23.09.01, 2.10 revised (kp) Implement PgLoaderIf extended with methods for display options.
11.06.01, 2.00 revised (kp) Implement PgLoaderIf.
10.06.01, 1.50 revised (kp) Move to package jvx.loader from jv.loader.
28.08.99, 1.10 revised (kp) Name changed from PgBuildFile to PgBdLoader.
00.00.98, 1.00 created (kp)
Author:
Konrad Polthier

Constructor Summary
PgBdLoader()
           
 
Method Summary
 PvDisplayOption getDisplayOption()
          Get display options which some parsers and geometry file formats supply.
 int getNumPatches()
          Get number of macro patches found in the build file.
 PgMacroPatch getPatch(int anInd)
          Return the macro patch with given index.
 boolean isAnimation()
          Determine if currently loaded data is an animation.
 PgJvxSrc[] read(java.io.BufferedReader in)
          Read an inhouse BD geometry file and return an array with a single surface.
 PgElementSet[] readElementSet(java.io.BufferedReader in)
           
 void setAnimation(boolean flag)
          Set flag whether current geometry data is an animation.
 void setDisplayOption(PvDisplayOption option)
          Set the display options to be saved within the geometry file.
 boolean write(java.io.Writer writer, PgJvxSrc[] geomArr)
          Write an array of geometries into an output stream writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PgBdLoader

public PgBdLoader()
Method Detail

getDisplayOption

public PvDisplayOption getDisplayOption()
Get display options which some parsers and geometry file formats supply. This geometry file format does not support loading/saving of display options.
Specified by:
getDisplayOption in interface PgLoaderIf

setDisplayOption

public void setDisplayOption(PvDisplayOption option)
Set the display options to be saved within the geometry file. This method must be called before writing the geometry. This geometry file format does not support loading/saving of display options.
Specified by:
setDisplayOption in interface PgLoaderIf

isAnimation

public boolean isAnimation()
Determine if currently loaded data is an animation.
Specified by:
isAnimation in interface PgLoaderIf

setAnimation

public void setAnimation(boolean flag)
Set flag whether current geometry data is an animation.
Specified by:
setAnimation in interface PgLoaderIf

getNumPatches

public int getNumPatches()
Get number of macro patches found in the build file.

getPatch

public PgMacroPatch getPatch(int anInd)
Return the macro patch with given index.

read

public PgJvxSrc[] read(java.io.BufferedReader in)
Read an inhouse BD geometry file and return an array with a single surface. All interior boundaries are removed.

The returned array of geometry may contain keyframes of an animation. This is checked with the method isAnimation().

Specified by:
read in interface PgLoaderIf
Parameters:
in - BufferedReader to read textual data from.
Returns:
Array of JVX geometries.
See Also:
#write(Writer)

readElementSet

public PgElementSet[] readElementSet(java.io.BufferedReader in)

write

public boolean write(java.io.Writer writer,
                     PgJvxSrc[] geomArr)
              throws java.io.IOException
Write an array of geometries into an output stream writer.

Numbers with absolute value less than EPS are shown as zero. This avoids the anoying fact that double precision numbers fill the whole text area hiding the exponent, which hides their small value.

Specified by:
write in interface PgLoaderIf
Parameters:
writer - Write all data to this stream
geomArr - Array with geometries to save
Returns:
true on success.
See Also:
#read(PgGeometry [], BufferedReader)

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.