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 double` | `getRsrcAsDoubleF(PsXmlNode rsrcNode, java.lang.String type)` Get content of node in resource tree with given element type by searching from given node.
    `boolean` | `load(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.
    `boolean` | `write(java.io.Writer writer, PgJvxSrc[] geom)` Write all geometries in a XML tree structure of instances of type `PsXmlNode` and into a writer.

    - ### Methods inherited from class jv.loader.PgAbstractLoader

      `getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, isEnabledOptimization, read, read, setAnimation, setDisplayOption, setGeometryOption, write`

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

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

- - ### Constructor Detail

    - #### PgJvfLoader

          public PgJvfLoader()

  - ### 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()` respectively `getAnimations()` depending on the return value of the method `isAnimation()`.

      Specified by:
        `load` in interface `PgLoaderIf`
      Overrides:
        `load` in class `PgAbstractLoader`
      Parameters:
        `in` - BufferedReader to read textual data from.
      Returns:
        `true` if 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 type `PsXmlNode` and into a writer.
      Specified by:
        `write` in interface `PgLoaderIf`
      Overrides:
        `write` in class `PgAbstractLoader`
      Parameters:
        `writer` - Write all data to this stream
        `geom` - Array with geometries to save
      Returns:
        `true` on 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 children
        `type` - type of elements in array
        `attr` - 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 itself
        `type` - element type of node to be searched
      Returns:
        content of resource if resource is found, else default value 0.

"

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