jvx.geom

## Class PwRefinePolygon

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop
    - - jvx.geom.PwRefinePolygon

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf

      public class PwRefinePolygon
      extends PjWorkshop

  Class to refine or coarsen a PgPolygon
  See Also:
    Serialized Form
  Author:
    Ulrich Reitebuch
  Version:
    20.06.07, 2.40 revised (ur) Added methods for DFH refinement.
    19.04.06, 2.30 revised (ur) Added methods for linear interpolation.
    01.10.04, 2.20 revised (ur) Removed update calls from compute methods.
    22.04.04, 2.10 revised (ur) Blend vertex normals in all methods.
    09.03.03, 2.00 revised (kp) Several methods names changed and synchronized.
    18.01.02, 1.20 revised (ur) PwRefinePolygon now extends PjWorkshop, Control Polygon added.
    26.11.01, 1.10 revised (ur) Extended to handle PolygonSets.
    28.05.01, 1.00 created (ur)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COARSEN_CHAIKIN`
    `static int` | `COARSEN_DFH`
    `static int` | `COARSEN_DLG`
    `static int` | `COARSEN_LINEAR`
    `static int` | `REFINE_CHAIKIN`
    `static int` | `REFINE_DFH`
    `static int` | `REFINE_DLG`
    `static int` | `REFINE_LINEAR`

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

    - ### Fields inherited from interface jv.project.PjWorkshopIf

      `MODE_BUG, MODE_STANDARD, MODE_VALIDATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PwRefinePolygon()` Constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSequenceEntry(int entry)` Store a new refinement step to the refinement sequence.
    `void` | `close()` Remove the control polygon from the display and destroy this workshop.
    `static void` | `coarsenChaikin(PgPolygon poly)` Coarsen a PgPolygon global by a reversed Chaikin algorithm.
    `static void` | `coarsenChaikin(PgPolygonSet polySet)` Coarsen a PgPolygonSet global by a reversed Chaikin algorithm.
    `static void` | `coarsenDFH(PgPolygon poly)` Coarsen a PgPolygon global by a reversed DFH algorithm.
    `static void` | `coarsenDFH(PgPolygonSet polySet)` Coarsen a PgPolygonSet global by a reversed Chaikin algorithm.
    `static void` | `coarsenDLG(PgPolygon poly)` Coarsen a PgPolygon by removing every second vertex.
    `static void` | `coarsenDLG(PgPolygonSet polySet)` Coarsen a PgPolygonSet by removing every second vertex.
    `static void` | `coarsenLinear(PgPolygon poly)` Coarsen a PgPolygon by removing every second vertex.
    `static void` | `coarsenLinear(PgPolygonSet polySet)` Coarsen a PgPolygonSet by removing every second vertex.
    `static PdVector` | `getFourPointMask()` Return mask vector for Dyn, Floater, Hormann new four point scheme.
    `static PdVector` | `getFourPointMask(double tension)` Return mask vector for Dyn, Floater, Hormann new four point scheme.
    `boolean` | `isShowingControlGrid()` Checks if control grid of polygon is visible.
    `static void` | `refineChaikin(PgPolygon poly)` Refine a PgPolygon globally by Chaikin's algorithm.
    `static void` | `refineChaikin(PgPolygonSet polySet)` Refine a PgPolygonSet globally by Chaikin's algorithm.
    `static void` | `refineDFH(PgPolygon poly, PdVector weight)` Refine a PgPolygon globally by a 2n-point rule.
    `static void` | `refineDFH(PgPolygonSet polySet, PdVector weight)` Refine a PgPolygon globally by a 2n-point rule.
    `static void` | `refineDLG(PgPolygon poly)` Refine a PgPolygon globally by DLG scheme.
    `static void` | `refineDLG(PgPolygonSet polySet)` Refine a PgPolygonSet globally by DLG scheme.
    `static void` | `refineLinear(PgPolygon poly)` Refine a PgPolygon globally by inserting edge midpoints.
    `static void` | `refineLinear(PgPolygonSet polySet)` Refine a PgPolygonSet globally by inserting edge mid points.
    `void` | `reset()` Remove all previously done refining and and coarsening and set the workshop to its initial status.
    `void` | `sequenceRefine()` Recompute all refinement steps.
    `void` | `setGeometry(PgPolygon geom)` Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygon for the refined geometry.
    `void` | `setGeometry(PgPolygonSet geom)` Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygonSet for the refined geometry.
    `void` | `showControlGrid(boolean bShow)` Set the control polygon visible or invisible in the display.
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.

    - ### Methods inherited from class jvx.project.PjWorkshop

      `cancel, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, init, isModal, isStandalone, ok, removeGeometry, setDisplay, setDisplays, setGeometry, setModal, setMode, setStandalone, setViewer`

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

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

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

    - ### Methods inherited from interface jv.object.PsUpdateIf

      `getFather, getName, setParent`

- - ### Field Detail

    - #### REFINE_DLG

          public static final int REFINE_DLG

      See Also:
        Constant Field Values

    - #### COARSEN_DLG

          public static final int COARSEN_DLG

      See Also:
        Constant Field Values

    - #### REFINE_CHAIKIN

          public static final int REFINE_CHAIKIN

      See Also:
        Constant Field Values

    - #### COARSEN_CHAIKIN

          public static final int COARSEN_CHAIKIN

      See Also:
        Constant Field Values

    - #### REFINE_LINEAR

          public static final int REFINE_LINEAR

      See Also:
        Constant Field Values

    - #### COARSEN_LINEAR

          public static final int COARSEN_LINEAR

      See Also:
        Constant Field Values

    - #### REFINE_DFH

          public static final int REFINE_DFH

      See Also:
        Constant Field Values

    - #### COARSEN_DFH

          public static final int COARSEN_DFH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PwRefinePolygon

          public PwRefinePolygon()

      Constructor

  - ### Method Detail

    - #### setGeometry

          public void setGeometry(PgPolygon geom)

      Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygon for the refined geometry.

    - #### setGeometry

          public void setGeometry(PgPolygonSet geom)

      Assign a geometry on which this workshop operates, and create two backup copies: One for canceling and one to be used as control polygonSet for the refined geometry.

    - #### update

          public boolean update(java.lang.Object event)

      Update the class whenever a child has changed. Method is usually invoked from the children.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PjWorkshop`
      Parameters:
        `event` - sender of this update.
      Returns:
        true if update was correctly handled by superclass.
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### reset

          public void reset()

      Remove all previously done refining and and coarsening and set the workshop to its initial status.
      Overrides:
        `reset` in class `PjWorkshop`

    - #### isShowingControlGrid

          public boolean isShowingControlGrid()

      Checks if control grid of polygon is visible. By default, control grid is not visible.
      Version:
        13.02.05, 1.10 revised (kp) No longer invoke update(this).

    - #### showControlGrid

          public void showControlGrid(boolean bShow)

      Set the control polygon visible or invisible in the display.
      Version:
        13.02.05, 1.10 revised (kp) No longer invoke update(this).

    - #### close

          public void close()

      Remove the control polygon from the display and destroy this workshop.
      Overrides:
        `close` in class `PjWorkshop`

    - #### addSequenceEntry

          public void addSequenceEntry(int entry)

      Store a new refinement step to the refinement sequence.

    - #### sequenceRefine

          public void sequenceRefine()

      Recompute all refinement steps.

    - #### getFourPointMask

          public static PdVector getFourPointMask()

      Return mask vector for Dyn, Floater, Hormann new four point scheme.
      Author:
        Ulrich Reitebuch
      Version:
        21.06.07, 1.00 created (ur)

    - #### getFourPointMask

          public static PdVector getFourPointMask(double tension)

      Return mask vector for Dyn, Floater, Hormann new four point scheme.
      Author:
        Ulrich Reitebuch
      Version:
        21.06.07, 1.00 created (ur)

    - #### refineLinear

          public static void refineLinear(PgPolygon poly)

      Refine a PgPolygon globally by inserting edge midpoints.
      Author:
        Ulrich Reitebuch
      Version:
        19.04.06, 1.00 created (ur)

    - #### refineDLG

          public static void refineDLG(PgPolygon poly)

      Refine a PgPolygon globally by DLG scheme. Afterwards the polygon will have twice as much vertices, the vertices v(i) at even indices are the original vertices of the polygon, the vertices at odd indices are blended from the next two vertices in both directions by 1/16(-v(i-1) + 9v(i) + 9v(i+1) - v(i+2)).
      Author:
        Ulrich Reitebuch
      Version:
        22.04.04, 1.20 revised (ur) Blend vertex normals.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        28.05.01, 1.00 created (ur)

    - #### coarsenDLG

          public static void coarsenDLG(PgPolygon poly)

      Coarsen a PgPolygon by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.
      Author:
        Ulrich Reitebuch
      Version:
        09.05.03, 1.20 revised (kp) Renamed to coarsenDLG from coarsenInterpolation.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        30.05.01, 1.00 created (ur)

    - #### coarsenLinear

          public static void coarsenLinear(PgPolygon poly)

      Coarsen a PgPolygon by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.
      Author:
        Ulrich Reitebuch
      Version:
        09.05.03, 1.20 revised (kp) Renamed to coarsenDLG from coarsenInterpolation.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        30.05.01, 1.00 created (ur)

    - #### refineChaikin

          public static void refineChaikin(PgPolygon poly)

      Refine a PgPolygon globally by Chaikin's algorithm. On each edge of the polygon two vertices of the refined polygon will be computed at 1/4 and 3/4 length.
      Author:
        Ulrich Reitebuch
      Version:
        07.07.04, 1.30 revised (ur) Refine polygon of only one edge by a center vertex.
        22.04.04, 1.20 revised (ur) Blend vertex normals.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        29.05.01, 1.00 created (ur)

    - #### coarsenChaikin

          public static void coarsenChaikin(PgPolygon poly)

      Coarsen a PgPolygon global by a reversed Chaikin algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).
      Author:
        Ulrich Reitebuch
      Version:
        06.07.04, 1.30 revised (ur) Bug removed.
        22.04.04, 1.20 revised (ur) Blend vertex normals.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        29.05.01, 1.00 created (ur)

    - #### refineDFH

          public static void refineDFH(PgPolygon poly,
                                       PdVector weight)

      Refine a PgPolygon globally by a 2n-point rule. An example for n=1 is Chaikin's algorithm, for n=2 there is an one-parameter class of rules given by a paper of N. Dyn, M.S. Floater and K. Hormann.
      Author:
        Ulrich Reitebuch
      Version:
        14.06.07, 1.00 created (ur)

    - #### coarsenDFH

          public static void coarsenDFH(PgPolygon poly)

      Coarsen a PgPolygon global by a reversed DFH algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).
      Author:
        Ulrich Reitebuch
      Version:
        06.07.04, 1.30 revised (ur) Bug removed.
        22.04.04, 1.20 revised (ur) Blend vertex normals.
        05.05.03, 1.10 revised (ur) Handle edge colors.
        29.05.01, 1.00 created (ur)

    - #### refineLinear

          public static void refineLinear(PgPolygonSet polySet)

      Refine a PgPolygonSet globally by inserting edge mid points.
      Author:
        Ulrich Reitebuch
      Version:
        19.04.06, 1.00 created (ur)

    - #### refineDLG

          public static void refineDLG(PgPolygonSet polySet)

      Refine a PgPolygonSet globally by DLG scheme. Afterwards the polygon will have twice as much vertices, the vertices v(i) at even indices are the original vertices of the polygon, the vertices at odd indices are blended from the next two vertices in both directions by 1/16(-v(i-1) + 9v(i) + 9v(i+1) - v(i+2)).
      Author:
        Ulrich Reitebuch
      Version:
        13.07.17, 1.30 revised (ur) Blend vertex textures (for use in PwParameterLines).
        22.04.04, 1.10 revised (ur) Blend vertex normals.
        23.11.01, 1.00 created (ur)

    - #### coarsenDLG

          public static void coarsenDLG(PgPolygonSet polySet)

      Coarsen a PgPolygonSet by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.
      Author:
        Ulrich Reitebuch
      Version:
        09.05.03, 1.20 revised (kp) Renamed to coarsenDLG from coarsenInterpolation.
        23.11.01, 1.00 created (ur)

    - #### coarsenLinear

          public static void coarsenLinear(PgPolygonSet polySet)

      Coarsen a PgPolygonSet by removing every second vertex. This is the reverse algorithm for interpolating refinement algorithms.
      Author:
        Ulrich Reitebuch
      Version:
        09.05.03, 1.20 revised (kp) Renamed to coarsenDLG from coarsenInterpolation.
        23.11.01, 1.00 created (ur)

    - #### refineChaikin

          public static void refineChaikin(PgPolygonSet polySet)

      Refine a PgPolygonSet globally by Chaikin's algorithm. On each edge of the polygon two vertices of the refined polygon will be computed at 1/4 and 3/4 length.
      Author:
        Ulrich Reitebuch
      Version:
        22.04.04, 1.10 revised (ur) Blend vertex normals.
        29.05.01, 1.00 created (ur)

    - #### coarsenChaikin

          public static void coarsenChaikin(PgPolygonSet polySet)

      Coarsen a PgPolygonSet global by a reversed Chaikin algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).
      Author:
        Ulrich Reitebuch
      Version:
        22.04.04, 1.10 revised (ur) Blend vertex normals.
        23.11.01, 1.00 created (ur)

    - #### refineDFH

          public static void refineDFH(PgPolygonSet polySet,
                                       PdVector weight)

      Refine a PgPolygon globally by a 2n-point rule. An example for n=1 is Chaikin's algorithm, for n=2 there is an one-parameter class of rules given by a paper of N. Dyn, M.S. Floater and K. Hormann.
      Author:
        Ulrich Reitebuch
      Version:
        18.06.07, 1.00 created (ur)

    - #### coarsenDFH

          public static void coarsenDFH(PgPolygonSet polySet)

      Coarsen a PgPolygonSet global by a reversed Chaikin algorithm. Each vertex of the coarsened polygon gets blended from two of the extrapolated ancestor vertices of the edges v(i-2) to v(i-1) and v(i) to v(i+1).
      Author:
        Ulrich Reitebuch
      Version:
        22.04.04, 1.10 revised (ur) Blend vertex normals.
        23.11.01, 1.00 created (ur)

"

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