Class PwIntegralLineSet
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.vector.PwIntegralLineSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
public class PwIntegralLineSet extends PjWorkshop
Compute a whole set of integral lines of a given vector field on a triangulated surface for visualization purposes.Assign a surface by
setGeometry(PgGeometry)and a display where the calculated integral lines will show up bysetDisplay(PvDisplayIf)(if you wish that behaviour) and compute the integral lines (makeIntegralLines()). Various parameters may be configured.Use method
getInfoPanel()to get a control panel for parametersstep size,number of stepsandindex of vector field.An action event is fired whenever integral line computation that had been invoked from the info panel is completed.
Of course you may also use the static method that computes the integral lines direcly (
makeIntegralLines(PgElementSet,PgVectorField,PgPolygonSet,double,int).- See Also:
- Serialized Form
- Author:
- Eike Preuss
- Version:
- 09.12.06, 2.00 revised (kp) Moved to jvx.vector from jvx.geom.
01.03.06, 1.90 revised (ah)PgPolygonOnElementSet.getVertexElemInd()not used anymore.
10.02.03, 1.80 revised (ep) New methodsget/setMaxNumLinesPerElement, and JavaDoc.
24.01.03, 1.70 revised (ep) Backward integration and maxLinesPerElement combination corrected.
22.01.03, 1.60 revised (ep) Addedset/getIgnoreDirection, set/getLimitNumLinesPerElement.
22.01.03, 1.50 revised (ep) Addedset/getBackwardIntegration.
20.01.03, 1.40 revised (ep) Addedset/getFastmethod.
17.12.02, 1.30 revised (ep) Add only polygons withnumVertices >= 2.
14.06.02, 1.20 revised (ep) Now extends PjWorkshop.
31.12.01, 1.10 revised (ep) Added action listener support. 07.05.01, 1.00 created,revised (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 PwIntegralLineSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddActionListener(java.awt.event.ActionListener listener)An action event is fired whenever integral line computation that had been invoked from the info panel is completed.voidcancel()Removes previously comuted integral lines from display and invokes the same method of super-class.booleangetBackwardIntegration()Whether integral lines are computed in negative direction as well.booleangetFast()Whether euler-integration is used (true) or a 4th order runge kutta method (false).booleangetIgnoreDirection()Whether the direction of vertex based vector fields is ignored, i.e.PgPolygonSetgetIntegralLines()Get the polygon set instance which is updated by methodmakeIntegralLines.booleangetLimitNumLinesPerElement()Whether integral lines should stop when they reach a face with a number of passing integral lines that exceeds a given number.intgetMaxNumLinesPerElement()Gets the maximal number of integral lines that may pass through one face.intgetNumSteps()Get the number of steps that will be used for integration inmakeIntegralLines().doublegetStepSize()Get step size used for integration inmakeIntegralLines().intgetVectorFieldIndex()Get index of the vector field that will be integrated when usingmakeIntegralLines().voidinit()Initializes by setting all parameters to initial values and removing computed integral lines.voidmakeIntegralLines()Compute a set of integral lines, each beginning at the center of an element.static PgPolygonSetmakeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps)Static method that computes a set of integral lines on the given geometry of the given vector field.static PgPolygonSetmakeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps, int elemStep)Static method that computes a set of integral lines on the given geometry of the given vector field.static PgPolygonSetmakeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps, int elemStep, boolean fast, boolean ignoreDir, boolean backward, int maxLinesPerElement, int[] elementCount)Static method that computes a set of integral lines on the given geometry of the given vector field.voidremoveActionListener(java.awt.event.ActionListener listener)An action event is fired whenever integral line computation that had been invoked from the info panel is completed.voidremoveGeometry()Removes the reference to the registered element set and removes this as update listener from geometry.voidremoveIntegralLines()Removes previously computed set of integral lines from the display and internal uses.voidsetBackwardIntegration(boolean flag)Compute integral lines in negative direction as well.voidsetDisplay(PvDisplayIf disp)Set the display where computed integral lines will show up when using the workshop's info panel or methodmakeIntegralLines().voidsetFast(boolean flag)Use euler-integration.voidsetGeometry(PgGeometry geo)Set the geometry that will be used for integration when using the workshop's info panel or methodmakeIntegralLines().voidsetIgnoreDirection(boolean flag)Ignores the direction of vertex based vector fields, i.e.voidsetLimitNumLinesPerElement(boolean flag)Whether integral lines should stop when they reach a face with a number of passing integral lines that exceeds a given number.voidsetMaxNumLinesPerElement(int val)Sets the maximal number of integral lines that may pass through one face.voidsetNumSteps(int num)Set the number of steps that will be used for integration inmakeIntegralLines().voidsetStepSize(double step)Set the step size used for integration inmakeIntegralLines().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.booleanupdate(java.lang.Object source)Handle events originating from given object.-
Methods inherited from class jvx.project.PjWorkshop
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, 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.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 when using the workshop's info panel or methodmakeIntegralLines(). 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 keep being informed about the number of vector fields on it.
- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geo- triangulated surface with vector field(s)
-
removeGeometry
public void removeGeometry()
Removes the reference to the registered element set and removes this as update listener from geometry.- Overrides:
removeGeometryin classPjWorkshop
-
setDisplay
public void setDisplay(PvDisplayIf disp)
Set the display where computed integral lines will show up when using the workshop's info panel or methodmakeIntegralLines(). If called withnullas argument this method will remove the display settings.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)
Handle events originating from given object.- 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 inmakeIntegralLines().- Parameters:
step- positive step size- See Also:
getStepSize(),setNumSteps(int)
-
setFast
public void setFast(boolean flag)
Use euler-integration.- Since:
- JavaView 2.49.004
-
getFast
public boolean getFast()
Whether euler-integration is used (true) or a 4th order runge kutta method (false).- Since:
- JavaView 2.49.004
-
setBackwardIntegration
public void setBackwardIntegration(boolean flag)
Compute integral lines in negative direction as well.- Since:
- JavaView 2.49.004
-
getBackwardIntegration
public boolean getBackwardIntegration()
Whether integral lines are computed in negative direction as well. The forward and backward integration is concatenated to a single integral line.- Since:
- JavaView 2.49.004
-
setLimitNumLinesPerElement
public void setLimitNumLinesPerElement(boolean flag)
Whether integral lines should stop when they reach a face with a number of passing integral lines that exceeds a given number.- Since:
- JavaView 2.49.004
- See Also:
setMaxNumLinesPerElement(int)
-
getLimitNumLinesPerElement
public boolean getLimitNumLinesPerElement()
Whether integral lines should stop when they reach a face with a number of passing integral lines that exceeds a given number.- Since:
- JavaView 2.49.004
-
setMaxNumLinesPerElement
public void setMaxNumLinesPerElement(int val)
Sets the maximal number of integral lines that may pass through one face. Is only used when the switch for it is on, seesetLimitNumLinesPerElement(boolean).- Since:
- JavaView 2.49.009
- See Also:
setLimitNumLinesPerElement(boolean)
-
getMaxNumLinesPerElement
public int getMaxNumLinesPerElement()
Gets the maximal number of integral lines that may pass through one face. Is only used when the switch for it is on, seesetLimitNumLinesPerElement(boolean).- Since:
- JavaView 2.49.009
-
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()
Whether the direction of vertex based vector fields is ignored, i.e. at each point there are two possible vectors: + and - the original vector.- Since:
- JavaView 2.48.007
-
getStepSize
public double getStepSize()
Get step size used for integration inmakeIntegralLines().- 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 inmakeIntegralLines().- 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 inmakeIntegralLines().- See Also:
setNumSteps(int),getStepSize()
-
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 when usingmakeIntegralLines().- See Also:
setVectorFieldIndex(int)
-
makeIntegralLines
public void makeIntegralLines()
Compute a set of integral lines, each beginning at the center of an element. This method uses the parameters that can be adjusted by the set/get-methods. The resulting polygon set is shown in the display that was set bysetDisplay(PvDisplayIf). You can get the computed polygon set by methodgetIntegralLines().
-
getIntegralLines
public PgPolygonSet getIntegralLines()
Get the polygon set instance which is updated by methodmakeIntegralLines.- Returns:
- the polygon set that is updated at each computation
- See Also:
makeIntegralLines()
-
removeIntegralLines
public void removeIntegralLines()
Removes previously computed set of integral lines from the display and internal uses. Next call ofmakeIntegralLines()will create a new polygon set, the old polygon set will not be updated with further results but the new one will. This new polygon set will be returned by methodgetIntegralLines().- See Also:
getIntegralLines()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener listener)
An action event is fired whenever integral line computation that had been invoked from the info panel is completed.
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
An action event is fired whenever integral line computation that had been invoked from the info panel is completed.
-
cancel
public void cancel()
Removes previously comuted integral lines from display and invokes the same method of super-class.- Overrides:
cancelin classPjWorkshop
-
makeIntegralLines
public static PgPolygonSet makeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps)
Static method that computes a set of integral lines on the given geometry of the given vector field. From the center of each element emerges one integral line that is integrated numerically with given step size and number of iterations.- Parameters:
geom- the surface, MUST be triangulation!vec- vector field on surfacegeom.out- if not equalnull, results are written here.stepsize- used for integration of each integral line.numSteps- used for integration of each integral line.- Returns:
- parameter
outif it is notnull, otherwise a new polygon set that contains the results. - See Also:
PnGeodesicRK,PgPolygonOnElementSet
-
makeIntegralLines
public static PgPolygonSet makeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps, int elemStep)
Static method that computes a set of integral lines on the given geometry of the given vector field. From the center of each element emerges one integral line that is integrated numerically with given step size and number of iterations.- Parameters:
geom- the surface, MUST be triangulation!vec- vector field on surfacegeom.out- if not equalnull, results are written here.stepsize- used for integration of each integral line.numSteps- used for integration of each integral line.elemStep- compute integral line from every elemStep-th element.- Returns:
- parameter
outif it is notnull, otherwise a new polygon set that contains the results. - See Also:
PnGeodesicRK,PgPolygonOnElementSet
-
makeIntegralLines
public static PgPolygonSet makeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps, int elemStep, boolean fast, boolean ignoreDir, boolean backward, int maxLinesPerElement, int[] elementCount)
Static method that computes a set of integral lines on the given geometry of the given vector field. From the center of each element emerges one integral line that is integrated numerically with given step size and number of iterations.- Parameters:
geom- the surface, MUST be triangulation!vec- vector field on surfacegeom.out- if not equalnull, results are written here.stepsize- used for integration of each integral line.numSteps- used for integration of each integral line.elemStep- compute integral line from every elemStep-th element.fast- use euler-integration?ignoreDir- for use ofPnVertexRKIgnoreDirectionbackward- also go along negative vector field- Returns:
- parameter
outif it is notnull, otherwise a new polygon set that contains the results. - See Also:
PnGeodesicRK,PgPolygonOnElementSet
-
-
"