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 voidcancel()Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.PsAnimationgetAnimation()Get the animation manager where this listener is registered.intgetNumSeeds()doublegetStepSize()intgetVectorFieldIndex()booleanhasAnimation()Check whether this object is registered as listener of an animation manager.voidinit()Initialize and reset project, stops the running animation if any.voidok()Accept current version of the geometry as new version.voidremoveGeometry()Remove the assigned geometry and its backup clone.voidremoveSeeds()voidreset()Remove all previously done simplification and set the workshop to its initial status.voidsetAnimation(PsAnimation anAnimation)Assign the animation manager where this listener is registered.voidsetDisplay(PvDisplayIf display)Set the active display when this workshop was launched.voidsetFirstOrder(boolean firstOrder)voidsetGeometry(PgGeometry geom)Assign a geometry on which this workshop operates, and create a backup clone of the geometry.voidsetNumSeeds(int numSeeds)voidsetStepSize(double h)booleansetTime(PsTimeEvent timeEvent)Animation updates the dynamic object through this method whenever time has changed.static voidsetToRandomPosition(PgPointSetOnElementSet seeds)Set all points to random positions.static voidsetToRandomPosition(PgPointSetOnElementSet seeds, int startIndex, int endIndex)Set the vertices from startIndex to endIndex-1 to a random position in a (almost) random element.voidsetVectorFieldIndex(int fieldIndex)booleanupdate(java.lang.Object event)Updates the geometry if this workshop has changed, i.e. if the event isthisornull.booleanusesFirstOrder()-
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
-
-
-
-
Method Detail
-
init
public void init()
Description copied from class:PjWorkshopInitialize 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:
initin classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geom)
Description copied from class:PjWorkshopAssign 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:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geom- the workshop modifies this geometry.
-
hasAnimation
public boolean hasAnimation()
Description copied from interface:PsTimeListenerIfCheck whether this object is registered as listener of an animation manager.- Specified by:
hasAnimationin interfacePsTimeListenerIf- See Also:
PsTimeListenerIf.getAnimation(),PsTimeListenerIf.setAnimation(PsAnimation)
-
getAnimation
public PsAnimation getAnimation()
Description copied from interface:PsTimeListenerIfGet 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 usingsetAnimation(PsAnimation).- Specified by:
getAnimationin interfacePsTimeListenerIf- See Also:
PsTimeListenerIf.hasAnimation(),PsTimeListenerIf.setAnimation(PsAnimation)
-
setAnimation
public void setAnimation(PsAnimation anAnimation)
Description copied from interface:PsTimeListenerIfAssign 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:
setAnimationin interfacePsTimeListenerIf- See Also:
PsTimeListenerIf.getAnimation(),PsTimeListenerIf.hasAnimation()
-
setTime
public boolean setTime(PsTimeEvent timeEvent)
Description copied from interface:PsTimeListenerIfAnimation updates the dynamic object through this method whenever time has changed.- Specified by:
setTimein interfacePsTimeListenerIf
-
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:PjWorkshopAccept 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:
okin classPjWorkshop
-
reset
public void reset()
Remove all previously done simplification and set the workshop to its initial status.- Overrides:
resetin classPjWorkshop
-
cancel
public void cancel()
Description copied from class:PjWorkshopCancel 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:
cancelin classPjWorkshop
-
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:
removeGeometryin classPjWorkshop
-
setDisplay
public void setDisplay(PvDisplayIf display)
Set the active display when this workshop was launched.- Specified by:
setDisplayin interfacePjWorkshopIf- Overrides:
setDisplayin classPjWorkshop
-
update
public boolean update(java.lang.Object event)
Updates the geometry if this workshop has changed, i.e. if the event isthisornull. 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:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- 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.
-
-
"