jvx.vector

## Class PwSeeds

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop
    - - jvx.vector.PwSeeds

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

      public class PwSeeds
      extends PjWorkshop
      implements PsTimeListenerIf

  Visualization of a vector field by animated particles.
  See Also:
    Serialized Form
  Author:
    Andreas Haferburg
  Version:
    09.12.06, 2.00 revised (kp) Moved to jvx.vector from jvx.geom.
    01.03.06, 1.00 created (ah)

- - ### Field Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.
    `PsAnimation` | `getAnimation()` Get the animation manager where this listener is registered.
    `int` | `getNumSeeds()`
    `double` | `getStepSize()`
    `int` | `getVectorFieldIndex()`
    `boolean` | `hasAnimation()` Check whether this object is registered as listener of an animation manager.
    `void` | `init()` Initialize and reset project, stops the running animation if any.
    `void` | `ok()` Accept current version of the geometry as new version.
    `void` | `removeGeometry()` Remove the assigned geometry and its backup clone.
    `void` | `removeSeeds()`
    `void` | `reset()` Remove all previously done simplification and set the workshop to its initial status.
    `void` | `setAnimation(PsAnimation anAnimation)` Assign the animation manager where this listener is registered.
    `void` | `setDisplay(PvDisplayIf display)` Set the active display when this workshop was launched.
    `void` | `setFirstOrder(boolean firstOrder)`
    `void` | `setGeometry(PgGeometry geom)` Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
    `void` | `setNumSeeds(int numSeeds)`
    `void` | `setStepSize(double h)`
    `boolean` | `setTime(PsTimeEvent timeEvent)` Animation updates the dynamic object through this method whenever time has changed.
    `static void` | `setToRandomPosition(PgPointSetOnElementSet seeds)` Set all points to random positions.
    `static void` | `setToRandomPosition(PgPointSetOnElementSet seeds, int startIndex, int endIndex)` Set the vertices from startIndex to endIndex-1 to a random position in a (almost) random element.
    `void` | `setVectorFieldIndex(int fieldIndex)`
    `boolean` | `update(java.lang.Object event)` Updates the geometry if this workshop has changed, i.e. if the event is `this` or `null`.
    `boolean` | `usesFirstOrder()`

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

      `close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, setDisplays, 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.anim.PsTimeListenerIf

      `getName`

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

      `getFather, getName, setParent`

- - ### Constructor Detail

    - #### PwSeeds

          public PwSeeds()

  - ### Method Detail

    - #### init

          public void init()

      Description copied from class: `PjWorkshop`
      Initialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.
      Overrides:
        `init` in class `PjWorkshop`

    - #### setGeometry

          public void setGeometry(PgGeometry geom)

      Description copied from class: `PjWorkshop`
      Assign a geometry on which this workshop operates, and create a backup clone of the geometry. The backup geometry is restored if the workshop is canceled.

      Subclasses frequently overwrite this method but are advised to call this method.

      Specified by:
        `setGeometry` in interface `PjWorkshopIf`
      Overrides:
        `setGeometry` in class `PjWorkshop`
      Parameters:
        `geom` - the workshop modifies this geometry.

    - #### hasAnimation

          public boolean hasAnimation()

      Description copied from interface: `PsTimeListenerIf`
      Check whether this object is registered as listener of an animation manager.
      Specified by:
        `hasAnimation` in interface `PsTimeListenerIf`
      See Also:
        `PsTimeListenerIf.getAnimation()`, `PsTimeListenerIf.setAnimation(PsAnimation)`

    - #### getAnimation

          public PsAnimation getAnimation()

      Description copied from interface: `PsTimeListenerIf`
      Get the animation manager where this listener is registered. This listener may only have a single animation manager which is assigned by the animation manager when this listener is registered using `setAnimation(PsAnimation)`.
      Specified by:
        `getAnimation` in interface `PsTimeListenerIf`
      See Also:
        `PsTimeListenerIf.hasAnimation()`, `PsTimeListenerIf.setAnimation(PsAnimation)`

    - #### setAnimation

          public void setAnimation(PsAnimation anAnimation)

      Description copied from interface: `PsTimeListenerIf`
      Assign the animation manager where this listener is registered. This method is invoked by the animation manager during registration of this listener, and usually is not required to be called by a user. If this listener has an assigned animation manager, then its animation panel may be shown to change the current time of this listener.

      Only one animation manager may be assigned to this listener. Subsequent assignments will replace the previous assignment.

      Specified by:
        `setAnimation` in interface `PsTimeListenerIf`
      See Also:
        `PsTimeListenerIf.getAnimation()`, `PsTimeListenerIf.hasAnimation()`

    - #### setTime

          public boolean setTime(PsTimeEvent timeEvent)

      Description copied from interface: `PsTimeListenerIf`
      Animation updates the dynamic object through this method whenever time has changed.
      Specified by:
        `setTime` in interface `PsTimeListenerIf`

    - #### getVectorFieldIndex

          public int getVectorFieldIndex()

    - #### setVectorFieldIndex

          public void setVectorFieldIndex(int fieldIndex)

    - #### getNumSeeds

          public int getNumSeeds()

    - #### setNumSeeds

          public void setNumSeeds(int numSeeds)

    - #### getStepSize

          public double getStepSize()

    - #### setStepSize

          public void setStepSize(double h)

    - #### usesFirstOrder

          public boolean usesFirstOrder()

    - #### setFirstOrder

          public void setFirstOrder(boolean firstOrder)

    - #### ok

          public void ok()

      Description copied from class: `PjWorkshop`
      Accept current version of the geometry as new version. Close workshop. The copy of the original geometry is ignored.

      Implementation in this class calls `close()`.

      Overrides:
        `ok` in class `PjWorkshop`

    - #### reset

          public void reset()

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

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

    - #### removeSeeds

          public void removeSeeds()

    - #### removeGeometry

          public void removeGeometry()

      Remove the assigned geometry and its backup clone. Subclasses frequently overwrite this method but are advised to call this method.
      Overrides:
        `removeGeometry` in class `PjWorkshop`

    - #### setDisplay

          public void setDisplay(PvDisplayIf display)

      Set the active display when this workshop was launched.
      Specified by:
        `setDisplay` in interface `PjWorkshopIf`
      Overrides:
        `setDisplay` in class `PjWorkshop`

    - #### update

          public boolean update(java.lang.Object event)

      Updates the geometry if this workshop has changed, i.e. if the event is `this` or `null`. Also propagates update() to superclass with the original argument event.

      Some subclasses may register themselves as update listener of the geometry of this workshop. In order to prevent an update loop, this method safely uses isUpdateSender() when updating the geometry.

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

    - #### setToRandomPosition

          public static void setToRandomPosition(PgPointSetOnElementSet seeds,
                                                 int startIndex,
                                                 int endIndex)

      Set the vertices from startIndex to endIndex-1 to a random position in a (almost) random element.

      The positions inside a triangle are equally distributed, and the number of points in a triangle is proportional to the area of the triangle.

      Parameters:
        `startIndex` - Index of the first vertex to be changed.
        `endIndex` - Upper limit of indices to be changed.
      Version:
        16.04.06, 2.00 revised (kp) Using new class structure.

    - #### setToRandomPosition

          public static void setToRandomPosition(PgPointSetOnElementSet seeds)

      Set all points to random positions.

"

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