jvx.geom

## Class PwSmooth

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

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

      public class PwSmooth
      extends PjWorkshop
      implements java.lang.Runnable

  Workshop for feature preserving smoothing of surfaces. Anisotropic mean curvature flow and anisotropic prescribed mean curvature flow are implemented.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `METHOD_ANISOTROPIC` This smoothing method preserves features and sharpens linear feature.
    `static int` | `METHOD_ANSIO_PRECRIBED` This smoothing method preserves features and sharpens non-linear feature.
    `PvViewer` | `viewer`

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.
    `static java.awt.Color` | `colorMap(double d)` Maps (0,1) onto a Color, starting from white to red.
    `static java.awt.Color` | `colorMapGray(double d)` Maps (0,1) onto a Color using only gray levels.
    `double` | `getFeatureDetect()` Get parameter that determines what is regareded as a feature when smoothing.
    `boolean` | `getKeepBoundary()` Get flag to enable/disable moving of boundary vertices during smoothing.
    `boolean` | `getKeepSelected()` Get flag to enable/disable moving of selected vertices during smoothing.
    `int` | `getMaxNumLoops()` A smooting process is stoped after this number of loops have been performed cp `start`.
    `int` | `getMethod()` Get method used for smoothing.
    `double` | `getStepWidth()` The step width is a factor the gradient of the actual flow is multiplied with at each iteration step.
    `void` | `init()` Initializations
    `boolean` | `isRunning()` Check whether smoothing prcess will be stopped.
    `boolean` | `isStopped()` Check whether smoothing prcess is currently NOT running a thread.
    `boolean` | `isUsingImplicit()` See if implicit method to integrate the flow is used.
    `void` | `run()` Do energy minimization until `m_numLoops` are done or until a call of stop().
    `static boolean` | `scaleGeomByVolume(PgElementSet geom, double volume, double eps, int maxSteps)` Rescale geometry to have a given volume.
    `void` | `setFeatureDetect(double value)` Set parameter that determines what is regareded as a feature when smoothing.
    `void` | `setGeometry(PgElementSet geom)` Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.
    `void` | `setKeepBoundary(boolean bKeepBoundary)` Enable/Disable moving of boundary vertices during smoothing.
    `void` | `setKeepSelected(boolean bKeepSelected)` Enable/Disable moving of selected vertices during smoothing.
    `void` | `setMaxNumLoops(int numLoops)` A smooting process is stoped after the given number of loops have been performed cp `start`.
    `void` | `setMethod(int method)` Set method used for smoothing.
    `void` | `setStepWidth(double stepWidth)` The step width is a factor the gradient of the actual flow is multiplied with at each iteration step.
    `void` | `smoothingStep()` Perform one step of smoothing using the actually choosen method and settings.
    `void` | `start()` Start smoothing in separate thread.
    `void` | `stop()` Stop smoothing in separate thread.
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.
    `void` | `useImplicit(boolean flag)` Use implicit instead of explicit method to integrate the flow.

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

      `close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, reset, 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

    - #### METHOD_ANISOTROPIC

          public static int METHOD_ANISOTROPIC

      This smoothing method preserves features and sharpens linear feature.

    - #### METHOD_ANSIO_PRECRIBED

          public static int METHOD_ANSIO_PRECRIBED

      This smoothing method preserves features and sharpens non-linear feature. Shrinking effects are compensated.

    - #### viewer

          public PvViewer viewer

  - ### Constructor Detail

    - #### PwSmooth

          public PwSmooth()

      Constructor

  - ### Method Detail

    - #### init

          public void init()

      Initializations
      Overrides:
        `init` in class `PjWorkshop`

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

    - #### setGeometry

          public void setGeometry(PgElementSet geom)

      Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.

    - #### cancel

          public void cancel()

      Description copied from class: `PjWorkshop`
      Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.

      If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.

      Overrides:
        `cancel` in class `PjWorkshop`

    - #### setMethod

          public void setMethod(int method)

      Set method used for smoothing. All methods available are indexed see `METHOD_ANISOTROPIC` and `METHOD_ANSIO_PRECRIBED`.

    - #### getMethod

          public int getMethod()

      Get method used for smoothing. All methods available are indexed see `METHOD_ANISOTROPIC` and `METHOD_ANSIO_PRECRIBED`.

    - #### setFeatureDetect

          public void setFeatureDetect(double value)

      Set parameter that determines what is regareded as a feature when smoothing.

    - #### getFeatureDetect

          public double getFeatureDetect()

      Get parameter that determines what is regareded as a feature when smoothing.

    - #### useImplicit

          public void useImplicit(boolean flag)

      Use implicit instead of explicit method to integrate the flow.

    - #### isUsingImplicit

          public boolean isUsingImplicit()

      See if implicit method to integrate the flow is used.

    - #### setStepWidth

          public void setStepWidth(double stepWidth)

      The step width is a factor the gradient of the actual flow is multiplied with at each iteration step. This parameter is often called the time discretization of the flow. A recommanded choice is between 0.01 and 0.1.

    - #### getStepWidth

          public double getStepWidth()

      The step width is a factor the gradient of the actual flow is multiplied with at each iteration step. This parameter is often called the time discretization of the flow. A recommanded choice is between 0.01 and 0.1.

    - #### setMaxNumLoops

          public void setMaxNumLoops(int numLoops)

      A smooting process is stoped after the given number of loops have been performed cp `start`.

    - #### getMaxNumLoops

          public int getMaxNumLoops()

      A smooting process is stoped after this number of loops have been performed cp `start`.

    - #### setKeepBoundary

          public void setKeepBoundary(boolean bKeepBoundary)

      Enable/Disable moving of boundary vertices during smoothing.

    - #### getKeepBoundary

          public boolean getKeepBoundary()

      Get flag to enable/disable moving of boundary vertices during smoothing.

    - #### setKeepSelected

          public void setKeepSelected(boolean bKeepSelected)

      Enable/Disable moving of selected vertices during smoothing.

    - #### getKeepSelected

          public boolean getKeepSelected()

      Get flag to enable/disable moving of selected vertices during smoothing.

    - #### smoothingStep

          public void smoothingStep()

      Perform one step of smoothing using the actually choosen method and settings.

    - #### colorMapGray

          public static java.awt.Color colorMapGray(double d)

      Maps (0,1) onto a Color using only gray levels.

    - #### colorMap

          public static java.awt.Color colorMap(double d)

      Maps (0,1) onto a Color, starting from white to red.

    - #### scaleGeomByVolume

          public static boolean scaleGeomByVolume(PgElementSet geom,
                                  double volume,
                                  double eps,
                                  int maxSteps)

      Rescale geometry to have a given volume. Method iterativly approximates the given value. Rescaling stops when actual volume and given volume differ less than given eps or more than given maximal number of steps ave been performed.
      Parameters:
        `geom` - geometry to be scaled.
        `volume` - volume the geometry willhave after rescaling.
        `eps` - rescaling stops when actual volume and given volume differ less than eps.
        `maxSteps` - stop when maximal number of steps have benn performed.
      Returns:
        false if maximal number of steps has been reached, true otherwise.

    - #### isRunning

          public boolean isRunning()

      Check whether smoothing prcess will be stopped.
      Returns:
        false, if the energy minimizer will stop (just shutting down regularely).

    - #### isStopped

          public boolean isStopped()

      Check whether smoothing prcess is currently NOT running a thread.

    - #### start

          public void start()

      Start smoothing in separate thread.
      See Also:
        `stop()`

    - #### stop

          public void stop()

      Stop smoothing in separate thread.

    - #### run

          public void run()

      Do energy minimization until `m_numLoops` are done or until a call of stop().
      Specified by:
        `run` in interface `java.lang.Runnable`

"

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