public class PwGeodesicFlow extends PjWorkshop implements PsTimeListenerIf, PvPickListenerIf
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
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
Constructor and Description |
---|
PwGeodesicFlow()
Creates a new instance of PwGeodesicFlow
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel operation of this workshop by resetting the assigned geometry,
and finally close this workshop.
|
void |
dragDisplay(PvPickEvent event)
Drag a location in the display with 2d display and 3d world coordinates.
|
void |
dragInitial(PvPickEvent event)
Drag an arbitrary point along a geometry, point may lie inside an element.
|
void |
dragVertex(PgGeometryIf geom,
int vertindex,
PdVector vector)
Drag a picked vertex of a geometry.
|
PsAnimation |
getAnimation()
Get the animation manager where this listener is registered.
|
double |
getEmitInterval()
Returns the emit interval of the particles.
|
double |
getMaxAge()
Returns the maximum age.
|
int |
getMaxNumParticles()
Returns the maximum number of particles.
|
double |
getSpeed()
Returns the speed of the particles.
|
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.
|
int |
initialize()
Sets initial values for the particles.
|
void |
markVertices(PvPickEvent event)
Mark a set of vertices of a geometry within a given bounding box.
|
void |
ok()
Accept current version of the geometry as new version.
|
void |
pickDisplay(PvPickEvent event)
Get a location in the display with 2d display and 3d world coordinates.
|
void |
pickInitial(PvPickEvent pos)
Sets the spawn point, starts the animation.
|
void |
pickVertex(PgGeometryIf geom,
int vertIndex,
PdVector vector)
Get a picked vertex of a geometry.
|
void |
selectGeometry(PgGeometryIf event)
Inform pick listener when selected geometry is changing.
|
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 |
setEmitInterval(double emitInterval)
Sets the emit interval of the particles.
|
void |
setEnabledHueColoring(boolean flag)
Enable or disable coloring vertices by hue from starting direction.
|
void |
setGeometry(PgGeometry geom)
Initializes geometry dependent fields.
|
void |
setMaxAge(double maxAge)
Sets the maximum age.
|
void |
setMaxNumParticles(int maxNumParticles)
Sets the maximum number of particles.
|
void |
setSpeed(double speed)
Sets the speed of the particles.
|
boolean |
setTime(PsTimeEvent timeEvent)
Moves the particles one step forward.
|
void |
unmarkVertices(PvPickEvent event)
Unmark a set of vertices of a geometry within a given bounding box.
|
boolean |
update(java.lang.Object event)
Updates the geometry if this workshop has changed,
i.e. if the event is
this or null . |
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, openDialog, removeGeometry, reset, setDisplays, setModal, setMode, setStandalone, setViewer
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getName
getFather, getName, setParent
public void init()
init
in class PjWorkshop
public void ok()
ok
in class PjWorkshop
public void cancel()
If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.
cancel
in class PjWorkshop
public void setDisplay(PvDisplayIf display)
setDisplay
in interface PjWorkshopIf
setDisplay
in class PjWorkshop
public void pickInitial(PvPickEvent pos)
pickInitial
in interface PvPickListenerIf
pos
- new spawn pointPvPickListenerIf
public int initialize()
public boolean setTime(PsTimeEvent timeEvent)
setTime
in interface PsTimeListenerIf
timeEvent
- ignoredpublic void setAnimation(PsAnimation anAnimation)
PsTimeListenerIf
Only one animation manager may be assigned to this listener. Subsequent assignments will replace the previous assignment.
setAnimation
in interface PsTimeListenerIf
PsTimeListenerIf.getAnimation()
,
PsTimeListenerIf.hasAnimation()
public boolean hasAnimation()
PsTimeListenerIf
hasAnimation
in interface PsTimeListenerIf
PsTimeListenerIf.getAnimation()
,
PsTimeListenerIf.setAnimation(PsAnimation)
public PsAnimation getAnimation()
PsTimeListenerIf
setAnimation(PsAnimation)
.getAnimation
in interface PsTimeListenerIf
PsTimeListenerIf.hasAnimation()
,
PsTimeListenerIf.setAnimation(PsAnimation)
public void markVertices(PvPickEvent event)
PvPickListenerIf
markVertices
in interface PvPickListenerIf
event
- contains two points on the bounding box.public void selectGeometry(PgGeometryIf event)
PvPickListenerIf
selectGeometry
in interface PvPickListenerIf
event
- Now selected geometry of display.public void pickVertex(PgGeometryIf geom, int vertIndex, PdVector vector)
PvPickListenerIf
pickVertex
in interface PvPickListenerIf
geom
- Picked geometry on which vertex liesvertIndex
- Index of vertex in vertex array of geometryvector
- 3d coordinates of vertex positionPvPickListenerIf
public void pickDisplay(PvPickEvent event)
PvPickListenerIf
pickDisplay
in interface PvPickListenerIf
event
- Pick event issued by the displayPvPickListenerIf
public void unmarkVertices(PvPickEvent event)
PvPickListenerIf
unmarkVertices
in interface PvPickListenerIf
event
- contains two points on the bounding box.public void dragVertex(PgGeometryIf geom, int vertindex, PdVector vector)
PvPickListenerIf
dragVertex
in interface PvPickListenerIf
geom
- Picked geometry on which vertex liesvertindex
- Index of vertex in vertex array of geometryvector
- 3d coordinates of vertex positionpublic void dragDisplay(PvPickEvent event)
PvPickListenerIf
dragDisplay
in interface PvPickListenerIf
event
- Pick event issued by the displayPvPickListenerIf
public void dragInitial(PvPickEvent event)
PvPickListenerIf
dragInitial
in interface PvPickListenerIf
event
- Pick event issued by the displayPvPickListenerIf
public void setGeometry(PgGeometry geom)
setGeometry
in interface PjWorkshopIf
setGeometry
in class PjWorkshop
geom
- new geometrypublic void setEnabledHueColoring(boolean flag)
public int getMaxNumParticles()
public void setMaxNumParticles(int maxNumParticles)
maxNumParticles
- the maximum number of particlespublic double getMaxAge()
public void setMaxAge(double maxAge)
maxAge
- the maximum agepublic double getEmitInterval()
public void setEmitInterval(double emitInterval)
emitInterval
- public double getSpeed()
public void setSpeed(double speed)
speed
- the speed of the particlespublic boolean update(java.lang.Object event)
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.
update
in interface PsUpdateIf
update
in class PjWorkshop
event
- sender of this update.PsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
"