Class PwIntegralLine
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.vector.PwIntegralLine
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf, PvPickListenerIf
public class PwIntegralLine extends PjWorkshop implements PvPickListenerIf
Compute a single integral line of a given vector field on a triangulated surface.Assign a surface by
setGeometry(PgGeometry)and a display where the calculated integral line will show up bysetDisplay(PvDisplayIf)(if you wish that behaviour). Various parameters may be configured.Use method
getInfoPanel()to get a control panel for parametersstep size,number of stepsandindex of vector field.- See Also:
- Serialized Form
- Author:
- Eike Preuss
- Version:
- 09.12.06, 2.00 revised (kp) Moved to jvx.vector from jvx.geom.
16.01.03, 1.30 revised (ep) Ensure to make edges visible.
15.01.03, 1.20 revised (ep) New integration type 'ignore direction' added (methods set/getIgnoreDirection).
17.06.02, 1.10 revised (ep) Now extends PjWorkshop.
15.11.01, 1.00 created (ep)
-
-
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 PwIntegralLine()
-
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.voidclose()Call this method to shutdown the workshop.PgPolygoncomputeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly)PgPolygoncomputeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly, boolean ignoreDir)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.booleangetFast()booleangetIgnoreDirection()PgPolygongetIntegralLine()Get the polygon instance which is used for integrationintgetNumSteps()Get the number of steps that will be used for integration.doublegetStepSize()Get step size used for integration.intgetVectorFieldIndex()Get index of the vector field that will be integrated.voidinit()Initializes by setting all parameters to initial values and removing computed integral lines.voidmarkVertices(PvPickEvent event)Mark a set of vertices of a geometry within a given bounding box.voidpickDisplay(PvPickEvent event)Get a location in the display with 2d display and 3d world coordinates.voidpickInitial(PvPickEvent event)Pick an arbitrary point on a geometry, point may lie inside an element.voidpickVertex(PgGeometryIf geom, int vertIndex, PdVector vector)Get a picked vertex of a geometry.voidremoveIntegralLine()Removes previously computed integral line from the display and internal uses.voidselectGeometry(PgGeometryIf event)Inform pick listener when selected geometry is changing.voidsetDisplay(PvDisplayIf disp)Set the display where computed integral lines will show up.voidsetFast(boolean flag)voidsetGeometry(PgGeometry geo)Set the geometry that will be used for integration.voidsetIgnoreDirection(boolean flag)Ignores the direction of vertex based vector fields, i.e.voidsetNumSteps(int num)Set the number of steps that will be used for integration.voidsetStepSize(double step)Set the step size used for integration.voidsetVectorFieldIndex(int vfIndex)Set the vector field that will be integrated by index in the element set as set bysetGeometry(PgGeometry), beginning with index 0.voidunmarkVertices(PvPickEvent event)Unmark a set of vertices of a geometry within a given bounding box.booleanupdate(java.lang.Object source)07.11.04, 1.10 revised (kh) Added checks to avoid calling recompute more than once.-
Methods inherited from class jvx.project.PjWorkshop
getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, 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.project.PvPickListenerIf
getName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
-
-
-
-
Method Detail
-
init
public void init()
Initializes by setting all parameters to initial values and removing computed integral lines. Does not remove the settings for geometry and display!- Overrides:
initin classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geo)
Set the geometry that will be used for integration. This geometry must be a triangulated element set!A second call of the method will remove the previous setting. The workshop will register as an update listener to the given geometry to be informed about the number of vector fields on it.
A call with argument
nullremoves the settings.- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geo- triangulated surface with vector field(s)- See Also:
PjWorkshop.getGeometry()
-
setDisplay
public void setDisplay(PvDisplayIf disp)
Set the display where computed integral lines will show up. Registeres the workshop as a pick listener.
A second call of the method will remove the previous setting.
- Specified by:
setDisplayin interfacePjWorkshopIf- Overrides:
setDisplayin classPjWorkshop- Parameters:
disp- display that will be used to present the results, may be null
-
update
public boolean update(java.lang.Object source)
07.11.04, 1.10 revised (kh) Added checks to avoid calling recompute more than once.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- Parameters:
source- sender of this update.- Returns:
- true if update was correctly handled by superclass.
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
setStepSize
public void setStepSize(double step)
Set the step size used for integration.- Parameters:
step- positive step size- See Also:
getStepSize(),setNumSteps(int)
-
getStepSize
public double getStepSize()
Get step size used for integration.- Returns:
- positive step size
- See Also:
setStepSize(double),getNumSteps()
-
setNumSteps
public void setNumSteps(int num)
Set the number of steps that will be used for integration.- Parameters:
num- number of integration steps- See Also:
getNumSteps(),setStepSize(double)
-
getNumSteps
public int getNumSteps()
Get the number of steps that will be used for integration.- See Also:
setNumSteps(int),getStepSize()
-
setFast
public void setFast(boolean flag)
-
getFast
public boolean getFast()
-
setVectorFieldIndex
public void setVectorFieldIndex(int vfIndex)
Set the vector field that will be integrated by index in the element set as set bysetGeometry(PgGeometry), beginning with index 0.- Parameters:
vfIndex- index of vector field that shall be visualized 0,...- See Also:
getVectorFieldIndex(),setGeometry(PgGeometry)
-
getVectorFieldIndex
public int getVectorFieldIndex()
Get index of the vector field that will be integrated.- See Also:
setVectorFieldIndex(int)
-
getIntegralLine
public PgPolygon getIntegralLine()
Get the polygon instance which is used for integration- Returns:
- the polygon set that is updated at each computation
-
removeIntegralLine
public void removeIntegralLine()
Removes previously computed integral line from the display and internal uses. Next computation of a integral line will create a new polygon, the old polygon will not be updated with further results but the new one will. This new polygon will be returned by methodgetIntegralLine().- See Also:
getIntegralLine()
-
close
public void close()
Call this method to shutdown the workshop. Removes the workshop from the list of update listeners of the geometry and from the list of pick listeners of the display.- Overrides:
closein 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
-
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
-
pickInitial
public void pickInitial(PvPickEvent event)
Description copied from interface:PvPickListenerIfPick an arbitrary point on a geometry, point may lie inside an element.- Specified by:
pickInitialin interfacePvPickListenerIf- Parameters:
event- Pick event issued by the display- See Also:
PvPickListenerIf
-
setIgnoreDirection
public void setIgnoreDirection(boolean flag)
Ignores the direction of vertex based vector fields, i.e. at each point there are two possible vectors: + and - the original vector.- Since:
- JavaView 2.48.007
-
getIgnoreDirection
public boolean getIgnoreDirection()
- Since:
- JavaView 2.48.007
-
computeIntegralLine
public PgPolygon computeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly)
-
computeIntegralLine
public PgPolygon computeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly, boolean ignoreDir)
-
-
"