jv.loader

## Class PgMathLoader

- java.lang.Object
- - jv.loader.PgAbstractLoader
  - - jv.loader.PgMathLoader

- All Implemented Interfaces:
    PgLoaderIf

      public final class PgMathLoader
      extends PgAbstractLoader

  Loader for Mathematica geometries. Reads Graphics, Graphics3d, SurfaceGraphics or lists of these from the Mathematica format "InputForm". If a list of Graphics, Graphics3d or SurfaceGraphics should get animated in JavaView, it must be applied with the keyword "ShowAnimation"; the former keywords "Animation" and "KeyAnimation" will work still.

- - ### 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
    `PgMathLoader()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PvDisplayOption[]` | `getDisplayOptions()` Get array of display options which some parsers and geometry file formats supply.
    `boolean` | `isEnabledOptimization()` Determines if the loaded geometry requires some optimization.
    `boolean` | `isKeyAnimation()` Return, if list of geometries is a keyframe animation.
    `PgJvxSrc[]` | `read(java.io.BufferedReader in)` Read a Mathematica graphics from a bufferedReader.
    `void` | `setKeyAnimation(boolean flag)` Set flag, if list of geometries is a keyframe animation.
    `void` | `setMathematicaVersion(double version)` Set Mathematica Version number.
    `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[] geomArr)` Write an array of geometries into an output stream writer in Mathematica expression file format, called MGS.

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

      `getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, load, read, setAnimation, setDisplayOption, setGeometryOption`

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

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

- - ### Constructor Detail

    - #### PgMathLoader

          public PgMathLoader()

  - ### Method Detail

    - #### isEnabledOptimization

          public boolean isEnabledOptimization()

      Determines if the loaded geometry requires some optimization. The method in this class allows optimization and always returns true.

      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.

      Specified by:
        `isEnabledOptimization` in interface `PgLoaderIf`
      Overrides:
        `isEnabledOptimization` in class `PgAbstractLoader`
      Returns:
        `true` if loader is enabled for optimization.
      Since:
        JavaView 2.99.018
      See Also:
        `PgLoader.isEnabledOptimization()`, `PgLoader.setEnabledOptimization(boolean)`

    - #### setMathematicaVersion

          public void setMathematicaVersion(double version)

      Set Mathematica Version number. Some default settings are changed significantly from Mathematica Version 5.* to 6.0, so the version number should be known to handle default parameters correctly.
      Parameters:
        `version` -

    - #### isKeyAnimation

          public boolean isKeyAnimation()

      Return, if list of geometries is a keyframe animation.

    - #### setKeyAnimation

          public void setKeyAnimation(boolean flag)

      Set flag, if list of geometries is a keyframe animation. During animation the time steps of a keyframe animation are morphed into another using the blend method.

    - #### read

          public PgJvxSrc[] read(java.io.BufferedReader in)

      Read a Mathematica graphics from a bufferedReader. Depending on the result of calling the method `isAnimation()` use either the methods `getGeometries()` or `getAnimations()` to retrieve the loaded geometries from this loader.

      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.

      Specified by:
        `read` in interface `PgLoaderIf`
      Overrides:
        `read` in class `PgAbstractLoader`
      Parameters:
        `in` - BufferedReader to read textual data from.
      Returns:
        Array of JVX geometries.
      Since:
        JavaView 2.32
      See Also:
        `PgAbstractLoader.isAnimation()`, `PgAbstractLoader.getAnimations()`, `PgAbstractLoader.getGeometries()`

    - #### write

          public boolean write(java.io.DataOutputStream outWriter,
                      PgJvxSrc[] geom)
                        throws java.io.IOException

      Write an array of geometries into a binary output stream writer.
      Specified by:
        `write` in interface `PgLoaderIf`
      Overrides:
        `write` in class `PgAbstractLoader`
      Parameters:
        `outWriter` - Write all data to this stream
        `geom` - Array with geometries to save
      Returns:
        `true` on success.
      Throws:
        `java.io.IOException`
      See Also:
        `read(BufferedReader)`, `write(Writer, PgJvxSrc [])`

    - #### write

          public boolean write(java.io.Writer writer,
                      PgJvxSrc[] geomArr)
                        throws java.io.IOException

      Write an array of geometries into an output stream writer in Mathematica expression file format, called MGS.

      Numbers with absolute value less than `jv.vecmath.PuMath#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`
      Overrides:
        `write` in class `PgAbstractLoader`
      Parameters:
        `writer` - Write all data to this stream
        `geomArr` - Array with geometries to save
      Returns:
        `true` on success.
      Throws:
        `java.io.IOException`
      See Also:
        `read(BufferedReader)`

    - #### getDisplayOptions

          public PvDisplayOption[] getDisplayOptions()

      Get array of display options which some parsers and geometry file formats supply. This array is needed for individual option settings in GraphicsArrays or animations.

"

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