jvx.geom
Class PwGeodesicFlow
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.geom.PwGeodesicFlow
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsTimeListenerIf, PsUpdateIf, PjWorkshopIf, PvPickListenerIf
public class PwGeodesicFlow extends PjWorkshop implements PsTimeListenerIf, PvPickListenerIf
Visualizes the geodesic flow on an element set. Particles are emitted from a user picked point on the geometry and traced along straightest geodesics.- See Also:
- Serialized Form
- Author:
- Andreas Haferburg
- Version:
- 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 PwGeodesicFlow()Creates a new instance of PwGeodesicFlow
-
Method Summary
All 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.voiddragDisplay(PvPickEvent event)Drag a location in the display with 2d display and 3d world coordinates.voiddragInitial(PvPickEvent event)Drag an arbitrary point along a geometry, point may lie inside an element.voiddragVertex(PgGeometryIf geom, int vertindex, PdVector vector)Drag a picked vertex of a geometry.PsAnimationgetAnimation()Get the animation manager where this listener is registered.doublegetEmitInterval()Returns the emit interval of the particles.doublegetMaxAge()Returns the maximum age.intgetMaxNumParticles()Returns the maximum number of particles.doublegetSpeed()Returns the speed of the particles.booleanhasAnimation()Check whether this object is registered as listener of an animation manager.voidinit()Initialize and reset project, stops the running animation if any.intinitialize()Sets initial values for the particles.voidmarkVertices(PvPickEvent event)Mark a set of vertices of a geometry within a given bounding box.voidok()Accept current version of the geometry as new version.voidpickDisplay(PvPickEvent event)Get a location in the display with 2d display and 3d world coordinates.voidpickInitial(PvPickEvent pos)Sets the spawn point, starts the animation.voidpickVertex(PgGeometryIf geom, int vertIndex, PdVector vector)Get a picked vertex of a geometry.voidselectGeometry(PgGeometryIf event)Inform pick listener when selected geometry is changing.voidsetAnimation(PsAnimation anAnimation)Assign the animation manager where this listener is registered.voidsetDisplay(PvDisplayIf display)Set the active display when this workshop was launched.voidsetEmitInterval(double emitInterval)Sets the emit interval of the particles.voidsetEnabledHueColoring(boolean flag)Enable or disable coloring vertices by hue from starting direction.voidsetGeometry(PgGeometry geom)Initializes geometry dependent fields.voidsetMaxAge(double maxAge)Sets the maximum age.voidsetMaxNumParticles(int maxNumParticles)Sets the maximum number of particles.voidsetSpeed(double speed)Sets the speed of the particles.booleansetTime(PsTimeEvent timeEvent)Moves the particles one step forward.voidunmarkVertices(PvPickEvent event)Unmark a set of vertices of a geometry within a given bounding box.booleanupdate(java.lang.Object event)Updates the geometry if this workshop has changed, i.e. if the event isthisornull.-
Methods inherited from class jvx.project.PjWorkshop
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, removeGeometry, reset, 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.project.PvPickListenerIf
getName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
-
-
-
-
Method Detail
-
init
public void init()
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:
initin classPjWorkshop
-
ok
public void ok()
Accept current version of the geometry as new version. Close workshop. The copy of the original geometry is ignored.- Overrides:
okin classPjWorkshop
-
cancel
public void cancel()
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:
cancelin classPjWorkshop
-
setDisplay
public void setDisplay(PvDisplayIf display)
Set the active display when this workshop was launched.- Specified by:
setDisplayin interfacePjWorkshopIf- Overrides:
setDisplayin classPjWorkshop
-
pickInitial
public void pickInitial(PvPickEvent pos)
Sets the spawn point, starts the animation.- Specified by:
pickInitialin interfacePvPickListenerIf- Parameters:
pos- new spawn point- See Also:
PvPickListenerIf
-
initialize
public int initialize()
Sets initial values for the particles.- Returns:
- number of initialized particles
-
setTime
public boolean setTime(PsTimeEvent timeEvent)
Moves the particles one step forward.- Specified by:
setTimein interfacePsTimeListenerIf- Parameters:
timeEvent- ignored- Returns:
- super.update(this)
-
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()
-
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)
-
markVertices
public void markVertices(PvPickEvent event)
Description copied from interface:PvPickListenerIfMark a set of vertices of a geometry within a given bounding box.- Specified by:
markVerticesin interfacePvPickListenerIf- Parameters:
event- contains two points on the bounding box.
-
selectGeometry
public void selectGeometry(PgGeometryIf event)
Description copied from interface:PvPickListenerIfInform pick listener when selected geometry is changing. Supported by jv.viewer.PvDisplay since v3.98.003.- Specified by:
selectGeometryin interfacePvPickListenerIf- Parameters:
event- Now selected geometry of display.
-
pickVertex
public void pickVertex(PgGeometryIf geom, int vertIndex, PdVector vector)
Description copied from interface:PvPickListenerIfGet a picked vertex of a geometry.- Specified by:
pickVertexin interfacePvPickListenerIf- Parameters:
geom- Picked geometry on which vertex liesvertIndex- Index of vertex in vertex array of geometryvector- 3d coordinates of vertex position- See Also:
PvPickListenerIf
-
pickDisplay
public void pickDisplay(PvPickEvent event)
Description copied from interface:PvPickListenerIfGet a location in the display with 2d display and 3d world coordinates. Point may be independent of any geometry.- Specified by:
pickDisplayin interfacePvPickListenerIf- Parameters:
event- Pick event issued by the display- See Also:
PvPickListenerIf
-
unmarkVertices
public void unmarkVertices(PvPickEvent event)
Description copied from interface:PvPickListenerIfUnmark a set of vertices of a geometry within a given bounding box.- Specified by:
unmarkVerticesin interfacePvPickListenerIf- Parameters:
event- contains two points on the bounding box.
-
dragVertex
public void dragVertex(PgGeometryIf geom, int vertindex, PdVector vector)
Description copied from interface:PvPickListenerIfDrag a picked vertex of a geometry.- Specified by:
dragVertexin interfacePvPickListenerIf- Parameters:
geom- Picked geometry on which vertex liesvertindex- Index of vertex in vertex array of geometryvector- 3d coordinates of vertex position
-
dragDisplay
public void dragDisplay(PvPickEvent event)
Description copied from interface:PvPickListenerIfDrag a location in the display with 2d display and 3d world coordinates. Point may be independent of any geometry.- Specified by:
dragDisplayin interfacePvPickListenerIf- Parameters:
event- Pick event issued by the display- See Also:
PvPickListenerIf
-
dragInitial
public void dragInitial(PvPickEvent event)
Description copied from interface:PvPickListenerIfDrag an arbitrary point along a geometry, point may lie inside an element.- Specified by:
dragInitialin interfacePvPickListenerIf- Parameters:
event- Pick event issued by the display- See Also:
PvPickListenerIf
-
setGeometry
public void setGeometry(PgGeometry geom)
Initializes geometry dependent fields.- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geom- new geometry
-
setEnabledHueColoring
public void setEnabledHueColoring(boolean flag)
Enable or disable coloring vertices by hue from starting direction.
-
getMaxNumParticles
public int getMaxNumParticles()
Returns the maximum number of particles.- Returns:
- the maximum number of particles
-
setMaxNumParticles
public void setMaxNumParticles(int maxNumParticles)
Sets the maximum number of particles.- Parameters:
maxNumParticles- the maximum number of particles
-
getMaxAge
public double getMaxAge()
Returns the maximum age.- Returns:
- the maximum age
-
setMaxAge
public void setMaxAge(double maxAge)
Sets the maximum age.- Parameters:
maxAge- the maximum age
-
getEmitInterval
public double getEmitInterval()
Returns the emit interval of the particles.- Returns:
- the emit interval
-
setEmitInterval
public void setEmitInterval(double emitInterval)
Sets the emit interval of the particles.- Parameters:
emitInterval-
-
getSpeed
public double getSpeed()
Returns the speed of the particles.- Returns:
- the speed of the particles
-
setSpeed
public void setSpeed(double speed)
Sets the speed of the particles.- Parameters:
speed- the speed of the particles
-
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)
-
-
"