ch.dieseite.colladaloader.asmbeans

## Class Common

- java.lang.Object
- - ch.dieseite.colladaloader.asmbeans.Common

-     public class Common
      extends java.lang.Object

  The handler for proprietary issues. It contains static methods:

- they work for Blender and Sketchup beans only
- doing small defined jobs they work for both beans
- a way to prevent code duplications
- can also be invoked by DataAssembler via LinkingSchema.xml
- do not change behavior to other methods but invoke order may be important

This source is free; you can redistribute it and/or modify it under the terms of the GNU General Public License and by nameing of the originally author

Version:
  3.1
Author:
  Markus Zimmermann http://www.die-seite.ch

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Common.CoordData` wrapper for parsed vertex/texcoord data
    `static class` | `Common.Texture` Wrapper for Texture containing meta data

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Common()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addShapes(java.util.ArrayList<DataAssembler.Param> p)` add Parsed triangles or lines to master pool
    `static java.util.ArrayList<Line>` | `createLines(java.util.ArrayList<DataAssembler.Param> p)` creates Lines based on this shape.
    `static Common.Texture` | `getTexImage(java.util.ArrayList<DataAssembler.Param> p)` extracts PImage from triangles tag
    `static java.util.HashMap<java.lang.String,Common.Texture>` | `importTextures(java.util.ArrayList<DataAssembler.Param> p)` Adds a new PImage Texture (with meta data) from a image file (given by <init_from> tag) into a new created or existing texture pool.
    `static void` | `submitShapes(java.util.ArrayList<DataAssembler.Param> p)` Send Triangle and Line Masterpool to Model

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

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

- - ### Constructor Detail

    - #### Common

          public Common()

  - ### Method Detail

    - #### getTexImage

          public static Common.Texture getTexImage(java.util.ArrayList<DataAssembler.Param> p)

      extracts PImage from triangles tag
      Parameters:
        `1.` - a <Triangles> or a <PolyList> (parent) with args: path to <init_from> tag (<library_images>)
        `2.` - PImage Pool (HashMap<String,Texture>)
      Returns:
        a Processing Image with meta data

    - #### importTextures

          public static java.util.HashMap<java.lang.String,Common.Texture> importTextures(java.util.ArrayList<DataAssembler.Param> p)

      Adds a new PImage Texture (with meta data) from a image file (given by <init_from> tag) into a new created or existing texture pool.
      Parameters:
        `1.` - a certain subtag of <effect> with args to <init_from>, containing a single image file name
        `2.` - an existing texture pool (HashMap<String,Texture>) or null
        `3.` - interface descriptor (implementing DataAssembler.LoadingListener)
      Returns:
        a new image is added to pool

    - #### addShapes

          public static void addShapes(java.util.ArrayList<DataAssembler.Param> p)

      add Parsed triangles or lines to master pool
      Parameters:
        `1.` - Interface descriptor
        `2.` - Triangle Sublist (ArrayList<Triangle>)
        `3.` - Line Sublist (ArrayList<Line>)

    - #### submitShapes

          public static void submitShapes(java.util.ArrayList<DataAssembler.Param> p)

      Send Triangle and Line Masterpool to Model. = fires DataAssembler.LoadingListener methods
      Parameters:
        `p` -

    - #### createLines

          public static java.util.ArrayList<Line> createLines(java.util.ArrayList<DataAssembler.Param> p)

      creates Lines based on this shape. The coordinates is converted from Collada to Processing as follows:

      processing x = Collada x

      processing y = Collada -z

      processing z = Collada -y

      Parameters:
        `1.` - Raw coords (vertex) Type:Common.CoordData
        `2.` - a Color (converted to processing) Type:wrappers.Color
      Returns:
        a sublist for this lines Type:ArrayList<Line>