Package kiyut.sketsa.util

## Class GeomUtilities

- java.lang.Object
- - kiyut.sketsa.util.GeomUtilities

-     public class GeomUtilities
      extends Object

  Collection of Geometry Utilities
  Author:
    KIYUT

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GeomUtilities()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Shape` | `createShape​(String pathString)` | Return Shape for the supplied pathString that conform to SVG d attribute
    `static Rectangle2D` | `getBounds2D​(List<Shape> shapeList)` | Return bounds for the supplied shapeList
    `static int` | `getPathSegType​(String type)` |
    `static double` | `scaleToFit​(Dimension src, Dimension dest)` | Return the scale value from `src` to `dest` proportionally
    `static List<Point2D>` | `simplify​(double tol, List<Point2D> pointList, List<Point2D> simplifyList)` | Computes the simplified version of the pointList and approximation tolerance and stores on the simplifyList.

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

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

- - ### Constructor Detail

    - #### GeomUtilities

          public GeomUtilities()

  - ### Method Detail

    - #### scaleToFit

          public static double scaleToFit​(Dimension src,
                                          Dimension dest)

      Return the scale value from `src` to `dest` proportionally
      Parameters:
        `src` - source dimension
        `dest` - destination dimension
      Returns:
        the scale value

    - #### getBounds2D

          public static Rectangle2D getBounds2D​(List<Shape> shapeList)

      Return bounds for the supplied shapeList
      Parameters:
        `shapeList` - List of Shape
      Returns:
        bounds for the supplied shapeList

    - #### createShape

          public static Shape createShape​(String pathString)
                                   throws IllegalArgumentException

      Return Shape for the supplied pathString that conform to SVG d attribute
      Parameters:
        `pathString` - String that conform to SVG d attribute
      Returns:
        Shape
      Throws:
        `IllegalArgumentException` - when parse fail

    - #### simplify

          public static List<Point2D> simplify​(double tol,
                                               List<Point2D> pointList,
                                               List<Point2D> simplifyList)

      Computes the simplified version of the pointList and approximation tolerance and stores on the simplifyList. If simplifyList is null a new List object is allocated.
      Parameters:
        `tol` - approximation tolerance in pixel
        `pointList` - List of Point2D
        `simplifyList` - List of Point2D or null
      Returns:
        simplifyList of Point2D

    - #### getPathSegType

          public static int getPathSegType​(String type)