jvx.loader

## Class PgPlyLoader

- java.lang.Object
- - jv.loader.PgAbstractLoader
  - - jvx.loader.PgPlyLoader

- All Implemented Interfaces:
    PgLoaderIf

      public class PgPlyLoader
      extends PgAbstractLoader

  Loader for geometry files given in PLY file format.
  Author:
    Maximilian Dohlus
  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.
    07.02.09, 1.20 revised (mad) Write- and reading-errors fixed.
    07.03.03, 1.10 revised (kp) Index of first vertex may now be changed.
    09.11.01, 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
    `PgPlyLoader()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getFirstVertexIndex()` Vertices are assigned an index starting at the given value.
    `PgJvxSrc[]` | `read(java.io.BufferedReader in)` Read a PLY geometry file and return an array of new geometries.
    `void` | `setFirstVertexIndex(int index)` Vertices are assigned an index starting at the given value.
    `boolean` | `write(java.io.Writer writer, PgJvxSrc[] geomArr)` Write an array of geometries into an output stream writer.
    `boolean` | `write(java.io.Writer writer, PgJvxSrc[] geomArr, PdVector[] ex, PdVector[] pcVal, PdVector[][] pcDir)` Write an array of geometries into an output stream writer.

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

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

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

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

- - ### Constructor Detail

    - #### PgPlyLoader

          public PgPlyLoader()

  - ### Method Detail

    - #### read

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

      Read a PLY 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.

      Specified by:
        `read` in interface `PgLoaderIf`
      Overrides:
        `read` in class `PgAbstractLoader`
      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.10 revised (kp) Return an array instead a single geometry.
        26.02.01, 1.00 created (kp)

    - #### write

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

      Write an array of geometries into an output stream writer.
      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)`
      Version:
        28.10.09, 1.20 revised (mad) Comments added, basic writer implemented.
        07.03.03, 1.10 revised (kp) Index of first vertex is used.
        09.11.01, 1.00 created (kp)

    - #### write

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

      Write an array of geometries into an output stream writer. Uses write(Writer, PgJvxSrc[]).
      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)`
      Version:
        07.03.03, 1.10 revised (kp) Index of first vertex is used.
        09.11.01, 1.00 created (kp)

    - #### getFirstVertexIndex

          public int getFirstVertexIndex()

      Vertices are assigned an index starting at the given value. Default index counting starts at 0. For example, OBJ, OFF and JVX use index counting [0, numOfVertices-1] while BUY use indices in the range [1, numOfVertices].

      The faces of a mesh are defined by referencing the vertices of a face by their index.

      Returns:
        index of first vertex
      Since:
        JavaView 2.81.000
      Version:
        07.06.03, 1.00 created (kp)

    - #### setFirstVertexIndex

          public void setFirstVertexIndex(int index)

      Vertices are assigned an index starting at the given value. Default index counting starts at 0. For example, OBJ, OFF and JVX use index counting [0, numOfVertices-1] while BUY use indices in the range [1, numOfVertices].

      The faces of a mesh are defined by referencing the vertices of a face by their index.

      Parameters:
        `index` - index of first vertex
      Since:
        JavaView 2.81.000
      Version:
        07.06.03, 1.00 created (kp)

"

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