jv.loader

## Class PgLoader

- java.lang.Object
- - jv.loader.PgLoader

-     public final class PgLoader
      extends java.lang.Object

  Dispatcher for loading/saving geometries and images from/to file. Depending on the file name extension an appropriate filter is invoked.
  Author:
    Konrad Polthier
  Version:
    12.06.13, 4.40 revised (kp) Add jpeg support within jvx.
    18.09.09, 4.30 revised (fk) Add png support.
    09.12.06, 4.20 revised (kp) Two methods parseDouble() moved to PuDouble.
    06.10.03, 4.10 revised (kp) Optimization of loaded geometries implemented.
    24.11.02, 4.00 revised (kp) Re-organization to avoid static methods.
    25.01.02, 3.10 revised (kp) New method readAnimation().
    26.02.01, 3.10 revised (kp) Loading of STL format added.
    25.02.01, 3.00 revised (kp) Handling of animations added.
    11.12.00, 2.30 revised (ur) References to 'PgMathData' replaced with 'PgJvxSrc[]'.
    17.09.00, 2.20 revised (kp) Ansys loader added.
    27.04.00, 2.10 revised (kp) Allow compressed archives for loading.
    08.04.00, 2.00 revised (kp) Completely new saving methods.
    25.12.98, 1.10 revised (kp) Non-static instances removed.
    00.00.98, 1.00 created (kp)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `NUM_GEOMETRY_TAGS` Number of available geometry tags to describe state of geometry.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PgLoader()` Create an empty loader manager and initialize it.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `PvDisplayOption` | `getDisplayOption()` Get option of a single display which some parsers fill out.
    `PvDisplayOption[]` | `getDisplayOptions()` Get display options which some parsers fill out.
    `boolean` | `getTag(int aBit)` Check whether geometry tag is set.
    `void` | `init()` Initialize and reset this loader manager.
    `boolean` | `isAnimated()` Flag whether currently loaded data is interpreted as an animation.
    `boolean` | `isEnabledOptimization()` Determines if the loader is allowed to do some optimization on an imported geometry, or if it shall provide the data as found in the geometry file.
    `static PvDisplayOption[]` | `load(java.io.BufferedReader in, java.lang.String ext)` Deprecated. use #loadDisplay(BufferedReader in, String ext)
    `static PgGeometry[]` | `load(PgGeometry[] geomArr, java.io.BufferedReader in, java.lang.String ext)` Deprecated. use non-static method loadGeometry() with same method signature.
    `static PgGeometry[]` | `load(PgGeometry[] geomArr, java.lang.String fileName)` Deprecated. use non-static method loadGeometry() with same method signature.
    `static PgGeometry[]` | `load(PgGeometry[] geomArr, java.lang.String data, java.lang.String ext)` Deprecated. use non-static method loadGeometry() with same method signature.
    `static PgGeometry[]` | `load(java.lang.String fileName)` Deprecated. use non-static method loadGeometry() with same method signature.
    `PvDisplayOption[]` | `loadDisplay(java.io.BufferedReader in, java.lang.String ext)` Read display options from a buffered reader.
    `PvDisplayOption[]` | `loadDisplay(java.lang.String fileName)` Read display options from a buffered reader.
    `PgGeometry[]` | `loadGeometry(PgGeometry[] geomArr, java.io.BufferedReader in, java.lang.String ext)` Read a geometry from a buffered reader with the content of a geometry file.
    `PgGeometry[]` | `loadGeometry(PgGeometry[] geomArr, java.lang.String fileName)` Read a geometry from named file whose extension determines the file format.
    `PgGeometry[]` | `loadGeometry(PgGeometry[] geomArr, java.lang.String data, java.lang.String ext)` Read a geometry from a string representing content of a geometry file.
    `PgGeometry[]` | `loadGeometry(java.lang.String fileName)` Read a geometry from named file whose extension determines the file format.
    `PgGeometry[]` | `loadGeometry(java.lang.String data, java.lang.String ext)` Read a geometry from a string representing content of a geometry file.
    `static double` | `parseDouble(java.io.StreamTokenizer st)` Deprecated. since JavaView 3.97.040, use jv.number.PuDouble#parseDouble(String) instead.
    `static double` | `parseDouble(java.lang.String string)` Deprecated. since JavaView 3.97.040, use jv.number.PuDouble#parseDouble(String) instead.
    `static boolean` | `parseEndOfLine(java.io.StreamTokenizer st)` Ignore all tokens of a stream until the next end-of-line is reached.
    `static PgGeometry[]` | `read(PgJvxSrc[][] geomAnim, boolean bShowAnimationPanel)` Deprecated. use non-static method readAnimation() with same method signature.
    `static PgGeometry[]` | `read(PgJvxSrc[] geomAnim, boolean bShowAnimationPanel)` Deprecated. use non-static method readAnimation() with same method signature.
    `static boolean` | `readAll(java.awt.List list, java.lang.String fileName)` Read list of files from a given XML listing file.
    `PgGeometry[]` | `readAnimation(PgJvxSrc[][] geomAnim, boolean bShowAnimationPanel)` Create a set of keyframe objects from a double array of geometries and returns the list of dynamic geometries.
    `PgGeometry[]` | `readAnimation(PgJvxSrc[] geomAnim, boolean bShowAnimationPanel)` Create a set of keyframe objects containing a single keyframe from an array of geometries.
    `static PsKeyframe[]` | `readAnimation(PsKeyframe[] keyframe, int firstKey, int lastKey, java.lang.String fileName)` Deprecated. use readAnimation(PsKeyframe [], int, int, String, int);
    `PsKeyframe[]` | `readAnimation(PsKeyframe[] keyframe, int firstKey, int lastKey, java.lang.String fileName, int fixedLen)` Create a set of keyframe objects from a set of files.
    `static boolean` | `readDirs(java.awt.List list, java.lang.String fileName)` Read list of directories from a given XML listing file.
    `static java.lang.String[]` | `readDirs(java.lang.String fileName)` Read list of directories from a given XML listing file into array.
    `static boolean` | `save(java.awt.Image image, java.lang.String fileName)` Deprecated. use saveImage(Image, String)
    `static boolean` | `save(PgGeometryIf[] geomIf, java.lang.String fileName)` Deprecated. use saveGeometry(PgGeometry [], String).
    `static boolean` | `save(PvDisplayOption[] option, java.lang.String fileName)` Deprecated. use saveDisplay(PvDisplayOption [] option, String fileName).
    `static boolean` | `save(java.lang.String data, java.lang.String fileName)` Deprecated. use saveString(String, String).
    `boolean` | `saveDisplay(PvDisplayOption[] option, java.lang.String fileName)` Write display settings to a JVD file.
    `boolean` | `saveGeometry(PgGeometry[] geomSrc, java.lang.String fileName)` Write a set of geometries to a named file whose extension determines the format.
    `boolean` | `saveGeometry(PgGeometryIf[] geomIf, java.lang.String fileName)` Same functionality as `saveGeometry(PgGeometry [], String)` but provided to avoid casting.
    `java.lang.String` | `saveGeometryToString(PgGeometry[] geomSrc, java.lang.String ext)` Write a geometry to a string in a given format determined by its file extension.
    `boolean` | `saveImage(java.awt.Image image, java.lang.String fileName)` Write an image to a named file whose extension determines the file format.
    `boolean` | `saveString(java.lang.String data, java.lang.String fileName)` Write a string to a named file if running as application.
    `static java.lang.String` | `saveToString(PgGeometryIf[] geom, java.lang.String ext)` Deprecated. use non-static method saveGeometryToString(PgGeometry [], String)
    `void` | `setAnimated(boolean flag)` Set flag whether currently loaded data should be interpreted as an animation.
    `void` | `setDisplayOption(PvDisplayOption option)` Set option of a single display which some parsers fill out.
    `void` | `setDisplayOptions(PvDisplayOption[] option)` Set the display options to be used by some parsers.
    `void` | `setEnabledOptimization(boolean flag)` Set flag if the loader is allowed to do some optimization on an imported geometry, or if it shall provide the data as found in the geometry file.
    `void` | `setTag(int aBit, boolean flag)` Set geometry tag of this loader manager.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NUM_GEOMETRY_TAGS

          public static final int NUM_GEOMETRY_TAGS

      Number of available geometry tags to describe state of geometry. External loaders may add own tags beyond this number.
      See Also:
        `getTag(int)`, `setTag(int, boolean)`, Constant Field Values

  - ### Constructor Detail

    - #### PgLoader

          public PgLoader()

      Create an empty loader manager and initialize it.

  - ### Method Detail

    - #### init

          public void init()

      Initialize and reset this loader manager.

    - #### getTag

          public boolean getTag(int aBit)

      Check whether geometry tag is set. For possible tags see `jv.loader.PgLoaderIf`.
      See Also:
        `setTag(int, boolean)`

    - #### setTag

          public void setTag(int aBit,
                             boolean flag)

      Set geometry tag of this loader manager. For possible tags see `jv.loader.PgLoaderIf`.
      See Also:
        `getTag(int)`

    - #### isEnabledOptimization

          public boolean isEnabledOptimization()

      Determines if the loader is allowed to do some optimization on an imported geometry, or if it shall provide the data as found in the geometry file.

      For example, some file formats do not store a connected mesh but provide individual vertices for each face. In this case, a loader manager may identify equal vertices.

      By default this loader manager is enabled to do optimization if the individual loader allows optimization too.

      Returns:
        `true` if loader manager is enabled for optimization.
      Since:
        JavaView 2.99.018
      Version:
        06.10.03, 1.00 created (kp)

    - #### setEnabledOptimization

          public void setEnabledOptimization(boolean flag)

      Set flag if the loader is allowed to do some optimization on an imported geometry, or if it shall provide the data as found in the geometry file.

      For example, some file formats do not store a connected mesh but provide individual vertices for each face. In this case, a loader manager may identify equal vertices.

      Optimization is sometimes not suitable without further knowledge about a specific data set. Then the loader may be advised to keep the original data by enabling this flag.

      Method must be called before the loader manager starts reading a file.

      Parameters:
        `flag` - `true` if loader manager is enabled for optimization.
      Since:
        JavaView 2.99.018
      Version:
        06.10.03, 1.00 created (kp)

    - #### isAnimated

          public boolean isAnimated()

      Flag whether currently loaded data is interpreted as an animation.
      Since:
        JavaView 2.47
      Version:
        24.11.02, 1.00 created (kp)

    - #### setAnimated

          public void setAnimated(boolean flag)

      Set flag whether currently loaded data should be interpreted as an animation. This flag is used by specific loaders only whose file format allow such kind of specifications, for example, Maple and Mathematica.
      Since:
        JavaView 2.47
      Version:
        24.11.02, 1.00 created (kp)

    - #### getDisplayOption

          public PvDisplayOption getDisplayOption()

      Get option of a single display which some parsers fill out.

      Note, most geometry files provide no display options, or at most for a single display.

      Returns:
        display options for a single display
      Since:
        JavaView 2.46
      Version:
        24.11.02, 1.00 created (kp)

    - #### setDisplayOption

          public void setDisplayOption(PvDisplayOption option)

      Set option of a single display which some parsers fill out.

      Note, most geometry files provide no display options, or at most for a single display.

      Parameters:
        `option` - display options for a single display
      Since:
        JavaView 2.46
      Version:
        24.11.02, 1.00 created (kp)

    - #### getDisplayOptions

          public PvDisplayOption[] getDisplayOptions()

      Get display options which some parsers fill out. Options may be used to configure a set of displays.
      Returns:
        array of options obtained from a file
      Since:
        JavaView 2.46
      Version:
        24.11.02, 1.00 created (kp)

    - #### setDisplayOptions

          public void setDisplayOptions(PvDisplayOption[] option)

      Set the display options to be used by some parsers.
      Parameters:
        `option` - array of options of a set of displays
      Since:
        JavaView 2.46
      Version:
        24.11.02, 1.00 created (kp)

    - #### loadGeometry

          public PgGeometry[] loadGeometry(java.lang.String data,
                                           java.lang.String ext)

      Read a geometry from a string representing content of a geometry file. Method creates a StringReader and calls `loadGeometry(PgGeometry [],String,String)` with a null geometry array. Method is supplied for convenience.
      Parameters:
        `data` - String with geometry data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        new geometry array, or null if failure.
      Since:
        JavaView 2.46
      Version:
        23.11.02, 1.10 revised (kp) Made non-static and renamed to loadGeometry() from load().
        15.11.02, 1.00 created (kp)

    - #### loadGeometry

          public PgGeometry[] loadGeometry(PgGeometry[] geomArr,
                                           java.lang.String data,
                                           java.lang.String ext)

      Read a geometry from a string representing content of a geometry file. Method creates a StringReader and calls `loadGeometry(PgGeometry [],BufferedReader,String)` with a null geometry array. Method is supplied for convenience.
      Parameters:
        `geomArr` - Geometry which will be filled with data, maybe null.
        `data` - String with geometry data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        either old geometry array with new data, or new geometry array, or null if failure.
      Since:
        JavaView 2.46
      Version:
        23.11.01, 3.00 revised (kp) Created from body of deprecated static method.
        20.02.01, 2.00 revised (kp) Parameter 'geom' added.
        08.08.00, 1.00 created (kp)

    - #### loadGeometry

          public PgGeometry[] loadGeometry(java.lang.String fileName)

      Read a geometry from named file whose extension determines the file format. Extension of file name determines the type of loader. Models may be compressed having extensions like "filename.obj.gz" or "filename.obj.zip" where middle extension determines the file format and the last extension the compression type.
      Parameters:
        `fileName` - full qualified name of geometry file, e.g. http://... or file:/...
      Returns:
        newGeom Either old geometry with new data, or new geometry, or null.
      Version:
        06.04.01, 1.00 revised (kp)
        06.04.01, 1.00 created (kp)

    - #### loadGeometry

          public PgGeometry[] loadGeometry(PgGeometry[] geomArr,
                                           java.lang.String fileName)

      Read a geometry from named file whose extension determines the file format. The geometry is passed as an argument and filled. Passing the geometry allows updating of the same geometry. Extension of file name determines the type of loader. Models may be compressed having extensions like "filename.obj.gz" or "filename.obj.zip" where middle extension determines the file format and the last extension the compression type.
      Parameters:
        `geomArr` - Geometry which will be filled with data, maybe null.
        `fileName` - full qualified name of geometry file, e.g. http://... or file:/...
      Returns:
        newGeom Either old geometry with new data, or new geometry, or null.
      Since:
        JavaView 2.46
      Version:
        03.03.03, 3.10 revised (kp) No longer match case when comparing name with "object_".
        23.11.02, 3.00 revised (kp) Made non-static and renamed to loadGeometry() from load().
        27.04.00, 2.50 revised (kp) Allow parsing of zip and gz archives.
        27.04.00, 2.10 revised (kp) Cleaning of elementSet removed to speed up loading.
        14.04.00, 2.00 revised (kp) Use array of geometries.
        25.01.00, 1.20 revised (ur) Added call of adapt() and removeUnusedVertices(), if geom is elementset.
        28.11.99, 1.10 revised (kp) Return value changed from boolean to PgGeometry.
        00.00.98, 1.00 created (kp)

    - #### loadGeometry

          public PgGeometry[] loadGeometry(PgGeometry[] geomArr,
                                           java.io.BufferedReader in,
                                           java.lang.String ext)

      Read a geometry from a buffered reader with the content of a geometry file. The geometry is passed as an argument and filled. Passing the geometry allows updating of the same geometry. The file format and loader are determined by the file extension.

      If the geometry data is available at an input stream 'data', for example standard input System.in, then use the following command to generate a BufferedReader `new BufferedReader(new InputStreamReader(data))` as argument of this method. If data is read from a file, then use `jv.object.PsUtil#open(String)` to create a buffered reader or use another load of this class.

      Parameters:
        `geomArr` - Array of geometries which will be filled with data, maybe null.
        `in` - Buffered reader with geometry data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        either old geometry array with new data, or new geometry array, or null if failure.
      Since:
        JavaView 2.46
      Version:
        04.10.19, 2.20 revised (ur) Remove marker for utf-8 encoding at the start of the BufferedReader, if present. 26.05.04, 2.10 revised (kp) Neighbour created even for JVX files if missing.
        23.11.02, 2.00 revised (kp) Made non-static and renamed to loadGeometry() from load().
        20.08.02, 1.60 revised (kp) Maple import is no longer a special case.
        20.02.01, 1.50 revised (kp) Type of argument 'data' converted to InputStream from String.
        11.12.00, 1.10 revised (ur) 'PgMathData' replaced by PgJvxSrc[] in reading mgs files.
        26.07.00, 1.00 created (kp)

    - #### load

          public static PgGeometry[] load(PgGeometry[] geomArr,
                                          java.lang.String data,
                                          java.lang.String ext)

      Deprecated. use non-static method loadGeometry() with same method signature.
      Read a geometry from a string representing content of a geometry file. Method creates a StringReader and calls `load(PgGeometry [], BufferedReader, String)` with a null geometry array. Method is supplied for convenience.
      Parameters:
        `geomArr` - Geometries which will be filled with data, maybe null.
        `data` - String with geometry data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        either old geometry array with new data, or new geometry array, or null if failure.
      Version:
        20.02.01, 2.00 revised (kp) Parameter 'geomArr' added.
        08.08.00, 1.00 created (kp)

    - #### load

          public static PgGeometry[] load(java.lang.String fileName)

      Deprecated. use non-static method loadGeometry() with same method signature.
      Read a geometry from named file whose extension determines the file format. Extension of file name determines the type of loader. Models may be compressed having extensions like "filename.obj.gz" or "filename.obj.zip" where middle extension determines the file format and the last extension the compression type.
      Parameters:
        `fileName` - full qualified name of geometry file, e.g. http://... or file:/...
      Returns:
        newGeom Either old geometry with new data, or new geometry, or null.
      Version:
        06.04.01, 1.00 revised (kp)
        06.04.01, 1.00 created (kp)

    - #### load

          public static PgGeometry[] load(PgGeometry[] geomArr,
                                          java.lang.String fileName)

      Deprecated. use non-static method loadGeometry() with same method signature.
      Read a geometry from named file whose extension determines the file format. The geometry is passed as an argument and filled. Passing the geometry allows updating of the same geometry. Extension of file name determines the type of loader. Models may be compressed having extensions like "filename.obj.gz" or "filename.obj.zip" where middle extension determines the file format and the last extension the compression type.
      Parameters:
        `geomArr` - Geometries which will be filled with data, maybe null.
        `fileName` - full qualified name of geometry file, e.g. http://... or file:/...
      Returns:
        newGeom Either old geometry with new data, or new geometry, or null.
      Version:
        27.04.00, 2.50 revised (kp) Allow parsing of zip and gz archives.
        27.04.00, 2.10 revised (kp) Cleaning of elementSet removed to speed up loading.
        14.04.00, 2.00 revised (kp) Use array of geometries.
        25.01.00, 1.20 revised (ur) Added call of adapt() and removeUnusedVertices(), if geom is elementset.
        28.11.99, 1.10 revised (kp) Return value changed from boolean to PgGeometry.
        00.00.98, 1.00 created (kp)

    - #### load

          public static PgGeometry[] load(PgGeometry[] geomArr,
                                          java.io.BufferedReader in,
                                          java.lang.String ext)

      Deprecated. use non-static method loadGeometry() with same method signature.
      Read a geometry from a buffered reader with the content of a geometry file. The geometry is passed as an argument and filled. Passing the geometry allows updating of the same geometry. The file format and loader are determined by the file extension.

      If the geometry data is available at an input stream 'data', for example standard input System.in, then use the following command to generate a BufferedReader `new BufferedReader(new InputStreamReader(data))` as argument of this method. If data is read from a file, then use `jv.object.PsUtil#open(String)` to create a buffered reader or use another load of this class.

      Parameters:
        `geomArr` - Geometries which will be filled with data, maybe null.
        `in` - Buffered reader with geometry data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        either old geometry array with new data, or new geometry array, or null if failure.
      Version:
        20.08.02, 1.60 revised (kp) Maple import is no longer a special case.
        20.02.01, 1.50 revised (kp) Type of argument 'data' converted to InputStream from String.
        11.12.00, 1.10 revised (ur) 'PgMathData' replaced by PgJvxSrc[] in reading mgs files.
        26.07.00, 1.00 created (kp)

    - #### load

          public static PvDisplayOption[] load(java.io.BufferedReader in,
                                               java.lang.String ext)

      Deprecated. use #loadDisplay(BufferedReader in, String ext)
      Read display options from a buffered reader.

    - #### loadDisplay

          public PvDisplayOption[] loadDisplay(java.lang.String fileName)

      Read display options from a buffered reader. Format is same as file extension and determines the type of loader.

      Method opens the file connection and calls loadDisplay(BufferedReader,String).

      Parameters:
        `fileName` - full qualified name of geometry file, e.g. http://... or file:/...
      Returns:
        array with display options, or null on failure.
      Since:
        JavaView 2.32
      Version:
        23.11.02, 2.00 revised (kp) Method made non-static.
        21.08.02, 1.00 created (kp)

    - #### loadDisplay

          public PvDisplayOption[] loadDisplay(java.io.BufferedReader in,
                                               java.lang.String ext)

      Read display options from a buffered reader. Format is same as file extension and determines the type of loader.

      If the display data is available at an input stream 'data', for example standard input System.in, then use the following command to generate a BufferedReader `new BufferedReader(new InputStreamReader(data))` as argument of this method. If data is read from a file, then use `jv.object.PsUtil#open(String)` to create a buffered reader or use another load of this class.

      Parameters:
        `in` - Buffered reader with display option data
        `ext` - Extension identifying the file format, usually 3 characters.
      Returns:
        display option array, or null if failure.
      Version:
        23.11.02, 2.00 revised (kp) Incompatible change: method made non-static.
        23.09.01, 1.10 revised (kp) Renamed to loadDisplay(..) from load(..).
        13.03.01, 1.00 created (kp)

    - #### saveGeometryToString

          public java.lang.String saveGeometryToString(PgGeometry[] geomSrc,
                                                       java.lang.String ext)

      Write a geometry to a string in a given format determined by its file extension. The chosen file format is determined from the 3-digit filename extension passed as argument. Many file formats allow saving only of a single geometry, in which case the first geometry in the array is saved and the others not.

      Note, this method does not save texture images, use `saveGeometry(PgGeometry [], String)` instead.

      Parameters:
        `geomSrc` - array of geometries to be saved to string
        `ext` - filename extension to determine the file format
      Returns:
        geometry as string in specified file format.
      Since:
        JavaView 2.46
      See Also:
        `saveGeometry(PgGeometry [], String)`
      Version:
        24.11.02, 2.00 revised (kp) Method created from body of saveToString(PgGeometryIf [], String).
        26.08.02, 1.30 revised (kp) Special handling of Mathematica avoided.
        19.07.00, 1.20 revised (kp) Check for null arguments.
        17.04.00, 1.10 revised (kp) Allow to save an array of geometries.
        08.04.00, 1.00 created (kp)

    - #### saveToString

          public static java.lang.String saveToString(PgGeometryIf[] geom,
                                                      java.lang.String ext)

      Deprecated. use non-static method saveGeometryToString(PgGeometry [], String)
      Write a geometry to a string in a given format determined by its file extension. The chosen file format is determined from the 3-digit filename extension passed as argument. Many file formats allow saving only of a single geometry, in which case the first geometry in the array is saved and the others not.
      Parameters:
        `geom` - array of geometries to be saved to string
        `ext` - filename extension to determine the file format
      Returns:
        geometry as string in specified file format.
      See Also:
        `saveGeometry(PgGeometry [], String)`
      Version:
        26.08.02, 1.30 revised (kp) Special handling of Mathematica avoided.
        19.07.00, 1.20 revised (kp) Check for null arguments.
        17.04.00, 1.10 revised (kp) Allow to save an array of geometries.
        08.04.00, 1.00 created (kp)

    - #### saveGeometry

          public boolean saveGeometry(PgGeometry[] geomSrc,
                                      java.lang.String fileName)

      Write a set of geometries to a named file whose extension determines the format. The chosen file format is determined from the 3-digit extension of the filename. Many file formats allow saving only of a single geometry, in which case the first geometry in the array is saved and the others not.

      Note, if geometry has texture then the texture image to saved in the same directory. The name of the texture file is either name='path of geometry file'/'name of texture'(.gif), if texture has a name, or name='path of geometry file'/'geom[i].getName()'_'texture.gif'.

      Parameters:
        `geomSrc` - array of geometries to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Since:
        JavaView 2.47
      See Also:
        `saveGeometry(PgGeometryIf [], String)`, `saveGeometryToString(PgGeometry [],String)`, `PgGeometryIf.isVisible()`, `PgGeometryIf.getTextureImage()`
      Version:
        24.11.02, 2.00 revised (kp) Created from body of save(PgGeometryIf [], String).
        26.08.02, 1.60 revised (kp) Special handling of Mathematica avoided.
        16.12.00, 1.50 revised (kp) Save texture image of geometries if available.
        17.04.00, 1.10 revised (kp) Allow to save an array of geometries.
        08.04.00, 1.00 created (kp)

    - #### saveGeometry

          public boolean saveGeometry(PgGeometryIf[] geomIf,
                                      java.lang.String fileName)

      Same functionality as `saveGeometry(PgGeometry [], String)` but provided to avoid casting.
      Parameters:
        `geomIf` - array of geometries to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Since:
        JavaView 2.47
      See Also:
        `saveGeometry(PgGeometry [], String)`
      Version:
        25.11.02, 1.00 created (kp)

    - #### save

          public static boolean save(PgGeometryIf[] geomIf,
                                     java.lang.String fileName)

      Deprecated. use saveGeometry(PgGeometry [], String).
      Write a set of geometries to a named file whose extension determines the format. The chosen file format is determined from the 3-digit extension of the filename. Many file formats allow saving only of a single geometry, in which case the first geometry in the array is saved and the others not.

      Note, only visible geometries are saved.

      Note, if geometry has texture then the texture image to saved in the same directory. The name of the texture file is either name='path of geometry file'/'name of texture'(.gif), if texture has a name, or name='path of geometry file'/'geom[i].getName()'_'texture.gif'.

      Parameters:
        `geomIf` - array of geometries to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      See Also:
        `PgGeometryIf.isVisible()`, `PgGeometryIf.getTextureImage()`, `saveToString(PgGeometryIf [], String)`
      Version:
        26.08.02, 1.60 revised (kp) Special handling of Mathematica avoided.
        16.12.00, 1.50 revised (kp) Save texture image of geometries if available.
        17.04.00, 1.10 revised (kp) Allow to save an array of geometries.
        08.04.00, 1.00 created (kp)

    - #### save

          public static boolean save(java.lang.String data,
                                     java.lang.String fileName)

      Deprecated. use saveString(String, String).
      Write a string to a named file if running as application. When running as applet then the string is displayed inside a dialog `PgExport_Dialog` from which it may be saved using cut-and-paste.
      Parameters:
        `data` - string to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Version:
        08.04.00, 1.00 revised (kp)
        08.04.00, 1.00 created (kp)

    - #### saveString

          public boolean saveString(java.lang.String data,
                                    java.lang.String fileName)

      Write a string to a named file if running as application. When running as applet then the string is displayed inside a dialog `PgExport_Dialog` from which it may be saved using cut-and-paste.
      Parameters:
        `data` - string to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Since:
        JavaView 2.46
      Version:
        24.11.02, 2.00 revised (kp) Created from body of save(String, String).
        08.04.00, 1.00 created (kp)

    - #### save

          public static boolean save(PvDisplayOption[] option,
                                     java.lang.String fileName)

      Deprecated. use saveDisplay(PvDisplayOption [] option, String fileName).
      Write display settings to a JVD file.
      Parameters:
        `option` - Display options to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Version:
        08.04.00, 1.00 revised (kp)
        08.04.00, 1.00 created (kp)

    - #### saveDisplay

          public boolean saveDisplay(PvDisplayOption[] option,
                                     java.lang.String fileName)

      Write display settings to a JVD file.
      Parameters:
        `option` - Display options to be saved to file
        `fileName` - full file name including path
      Returns:
        `true` on success
      Version:
        23.08.04, 2.10 revised (kp) Back- and foreground image only saved if visible and existent.
        24.11.02, 2.00 revised (kp) Created from body of save(PvDisplayOption [], String).
        08.04.00, 1.00 created (kp)

    - #### save

          public static boolean save(java.awt.Image image,
                                     java.lang.String fileName)

      Deprecated. use saveImage(Image, String)
      Write an image to a named file whose extension determines the file format.
      Parameters:
        `image` - Image to be saved to file
        `fileName` - Full file name including path
      Returns:
        `true` on success
      Version:
        08.04.00, 1.00 revised (kp)
        08.04.00, 1.00 created (kp)

    - #### saveImage

          public boolean saveImage(java.awt.Image image,
                                   java.lang.String fileName)

      Write an image to a named file whose extension determines the file format.
      Parameters:
        `image` - Image to be saved to file
        `fileName` - Full file name including path
      Returns:
        `true` on success
      Since:
        JavaView 2.47
      Version:
        24.11.02, 2.00 revised (kp) Created from body of save(Image, String).
        08.04.00, 1.00 created (kp)

    - #### parseEndOfLine

          public static boolean parseEndOfLine(java.io.StreamTokenizer st)
                                        throws java.io.IOException

      Ignore all tokens of a stream until the next end-of-line is reached. The next token will start at the beginning of the new line. This method is useful to skip the rest of a current line. Note, EOL must be significant in the current stream tokenizer.
      Returns:
        `true` if EOL is found, else `false`, i.e. EOF is found.
      Throws:
        `java.io.IOException`
      Author:
        Konrad Polthier
      Version:
        18.11.01, 1.00 revised (kp)
        18.11.01, 1.00 created (kp).

    - #### parseDouble

          public static double parseDouble(java.io.StreamTokenizer st)
                                    throws java.io.IOException

      Deprecated. since JavaView 3.97.040, use jv.number.PuDouble#parseDouble(String) instead.
      Parse double value in exponential notation. This method tries to catch different settings of character in the StreamTokenizer, but not any situations might be handled correctly.

      This method first acquires the next token from StreamTokenizer, then analyzes the following token if there is a number in exponential form. If yes, then the number is created in this method, otherwise the second token is pushed back.

      The need for this method arise from the special setup of some StreamTokenizers in JavaView where several characters like 'e', 'E', '+', are sometimes marked as word characters.

      Throws:
        `java.io.IOException`
      Author:
        Ulrich Reitebuch
      Version:
        09.12.06, 2.00 revised (kp) Method moved to PuDouble.
        16.09.02, 1.30 revised (kp) Check for '/' added since Maple uses 3/4.
        27.02.01, 1.21 revised (kp) Throw exception, compress code.
        27.02.01, 1.20 revised (ur) Call of st.nextToken() in the beginning added.
        07.04.00, 1.10 revised (ur) Bug removed.
        16.02.00, 1.00 created (ur).

    - #### parseDouble

          public static double parseDouble(java.lang.String string)

      Deprecated. since JavaView 3.97.040, use jv.number.PuDouble#parseDouble(String) instead.
      Parse double value in exponential notation using Double(String).doubleValue(). This method is a convenience to avoid catching NumberFormatException.
      Author:
        Ulrich Reitebuch
      Version:
        09.12.06, 2.00 revised (kp) Method moved to PuDouble.
        16.02.00, 1.00 created (ur).

    - #### readAll

          public static boolean readAll(java.awt.List list,
                                        java.lang.String fileName)

      Read list of files from a given XML listing file.
      Author:
        Konrad Polthier
      Version:
        16.01.00, 2.00 revised (kp) Listing file converted to XML.
        06.08.99, 1.10 revised (kp) DataInputStream replaced with BufferedReader.
        00.00.99, 1.00 created (kp)

    - #### readDirs

          public static boolean readDirs(java.awt.List list,
                                         java.lang.String fileName)

      Read list of directories from a given XML listing file.
      Author:
        Konrad Polthier
      Version:
        16.01.00, 2.00 revised (kp) Listing file converted to XML.
        06.08.99, 1.10 revised (kp) DataInputStream replaced with BufferedReader.
        00.00.99, 1.00 created (kp)

    - #### readDirs

          public static java.lang.String[] readDirs(java.lang.String fileName)

      Read list of directories from a given XML listing file into array.
      Author:
        Konrad Polthier
      Version:
        16.01.00, 1.00 revised (kp)
        16.01.00, 1.00 created (kp)

    - #### readAnimation

          public PgGeometry[] readAnimation(PgJvxSrc[] geomAnim,
                                            boolean bShowAnimationPanel)

      Create a set of keyframe objects containing a single keyframe from an array of geometries. Method just calls readAnimation(PgJvxSrc [][] geomAnim, ...).
      Since:
        JavaView 2.46
      Author:
        Konrad Polthier
      Version:
        23.11.01, 2.00 revised (kp) Created from body of deprecated static method.
        21.08.02, 1.60 revised (kp) Argument bIsAnimation removed since unused.
        10.06.01, 1.50 revised (kp) Method moved to PgLoader from PjMathView.
        21.02.01, 1.10 revised (kp) Method made static.
        21.02.01, 1.00 created (kp)

    - #### read

          public static PgGeometry[] read(PgJvxSrc[] geomAnim,
                                          boolean bShowAnimationPanel)

      Deprecated. use non-static method readAnimation() with same method signature.
      Create a set of keyframe objects containing a single keyframe from an array of geometries. Method just calls read(PgJvxSrc [][] geomAnim, ...).
      Author:
        Konrad Polthier
      Version:
        21.08.02, 1.60 revised (kp) Argument bIsAnimation removed since unused.
        10.06.01, 1.50 revised (kp) Method moved to PgLoader from PjMathView.
        21.02.01, 1.10 revised (kp) Method made static.
        21.02.01, 1.00 created (kp)

    - #### readAnimation

          public static PsKeyframe[] readAnimation(PsKeyframe[] keyframe,
                                                   int firstKey,
                                                   int lastKey,
                                                   java.lang.String fileName)

      Deprecated. use readAnimation(PsKeyframe [], int, int, String, int);

    - #### readAnimation

          public PsKeyframe[] readAnimation(PsKeyframe[] keyframe,
                                            int firstKey,
                                            int lastKey,
                                            java.lang.String fileName,
                                            int fixedLen)

      Create a set of keyframe objects from a set of files. All files must have the same number of geometries. In case the geometries may be of different type within a keyframe, then the i-th geometry in a keyframe must be of the same type for all keyframes.

      An application calling this method typically adds the dynamic geometries of each keyframe to a display or performs another action.

      The argument fixedLen==0 indicates that no leading zeros appear in the keyframe index. A positive value indicates that the keyframe index of the file name must have the format "name.0017.ext" (here fixedLen==4).

      Returns:
        an array of keyframe geometries
      Author:
        Konrad Polthier
      Version:
        23.11.02, 2.00 revised (kp) Incompatible change: method made non-static.
        05.09.02, 1.20 revised (kp) Additional argument fixedLen.
        15.02.02, 1.10 revised (kp) Bug removed which restricted numFiles less than 10.
        25.01.02, 1.00 created (kp).

    - #### readAnimation

          public PgGeometry[] readAnimation(PgJvxSrc[][] geomAnim,
                                            boolean bShowAnimationPanel)

      Create a set of keyframe objects from a double array of geometries and returns the list of dynamic geometries.

      Each keyframe object has a dynamic geometry which represents the current state of a keyframe animation at a specific time.

      The parent of the dynamic geometry is the corresponding keyframe object.

      Since:
        JavaView 2.46
      Author:
        Konrad Polthier, Ulrich Reitebuch
      Version:
        23.11.01, 3.00 revised (kp) Created from body of deprecated static method.
        21.08.02, 2.60 revised (kp) Argument bIsAnimation removed since unused.
        10.06.01, 2.50 revised (kp) Method moved to PgLoader from PjMathView.
        21.02.01, 2.00 revised (kp) Full revision, dependency on Mathematica graphics removed.
        12.12.00, 1.30 revised (ur) Arguments of method changed, ask loader for display options.
        18.09.00, 1.11 revised (ep) Return value 'null' from m_loader caught.
        12.12.99, 1.10 revised (kp) Deprecated method setGeometry() replaced with addGeometry().
        29.09.99, 1.00 created (ur)

    - #### read

          public static PgGeometry[] read(PgJvxSrc[][] geomAnim,
                                          boolean bShowAnimationPanel)

      Deprecated. use non-static method readAnimation() with same method signature.
      Create a set of keyframe objects from a double array of geometries.
      Author:
        Konrad Polthier, Ulrich Reitebuch
      Version:
        21.08.02, 2.60 revised (kp) Argument bIsAnimation removed since unused.
        10.06.01, 2.50 revised (kp) Method moved to PgLoader from PjMathView.
        21.02.01, 2.00 revised (kp) Full revision, dependency on Mathematica graphics removed.
        12.12.00, 1.30 revised (ur) Arguments of method changed, ask loader for display options.
        18.09.00, 1.11 revised (ep) Return value 'null' from m_loader caught.
        12.12.99, 1.10 revised (kp) Deprecated method setGeometry() replaced with addGeometry().
        29.09.99, 1.00 created (ur)

"

The software JavaView? is copyright protected. All Rights Reserved.
"