public class PwIntegralLineSet extends PjWorkshop
Assign a surface by setGeometry(PgGeometry)
and a display where the calculated integral lines will show up by
setDisplay(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 parameters step size
,
number of steps
and index 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)
.
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 |
---|
PwIntegralLineSet() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
cancel()
Removes previously comuted integral lines from display and invokes the same
method of super-class.
|
boolean |
getBackwardIntegration()
Whether integral lines are computed in negative direction as well.
|
boolean |
getFast()
Whether euler-integration is used (true) or a 4th order runge kutta method (false).
|
boolean |
getIgnoreDirection()
Whether the direction of vertex based vector fields is ignored, i.e.
|
PgPolygonSet |
getIntegralLines()
Get the polygon set instance which is updated by method
makeIntegralLines . |
boolean |
getLimitNumLinesPerElement()
Whether integral lines should stop when they reach a face with
a number of passing integral lines that exceeds a given number.
|
int |
getMaxNumLinesPerElement()
Gets the maximal number of integral lines that may pass through one face.
|
int |
getNumSteps()
Get the number of steps that will be used
for integration in
makeIntegralLines() . |
double |
getStepSize()
Get step size used for integration in
makeIntegralLines() . |
int |
getVectorFieldIndex()
Get index of the vector field that will be integrated
when using
makeIntegralLines() . |
void |
init()
Initializes by setting all parameters to initial values and
removing computed integral lines.
|
void |
makeIntegralLines()
Compute a set of integral lines, each beginning at the center of an element.
|
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.
|
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.
|
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.
|
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.
|
void |
removeGeometry()
Removes the reference to the registered element set and removes this as update
listener from geometry.
|
void |
removeIntegralLines()
Removes previously computed set of integral lines
from the display and internal uses.
|
void |
setBackwardIntegration(boolean flag)
Compute integral lines in negative direction as well.
|
void |
setDisplay(PvDisplayIf disp)
Set the display where computed integral lines will show
up when using the workshop's info panel or method
makeIntegralLines() . |
void |
setFast(boolean flag)
Use euler-integration.
|
void |
setGeometry(PgGeometry geo)
Set the geometry that will be used for integration
when using the workshop's info panel or method
makeIntegralLines() . |
void |
setIgnoreDirection(boolean flag)
Ignores the direction of vertex based vector fields, i.e.
|
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.
|
void |
setMaxNumLinesPerElement(int val)
Sets the maximal number of integral lines that may pass through one face.
|
void |
setNumSteps(int num)
Set the number of steps that will be used
for integration in
makeIntegralLines() . |
void |
setStepSize(double step)
Set the step size used for integration in
makeIntegralLines() . |
void |
setVectorFieldIndex(int vfIndex)
Set the vector field that will be integrated by index in the
element set as set by
setGeometry(PgGeometry) ,
beginning with index 0. |
boolean |
update(java.lang.Object source)
Handle events originating from given object.
|
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, openDialog, 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
getFather, getName, setParent
public void init()
init
in class PjWorkshop
public void setGeometry(PgGeometry geo)
makeIntegralLines()
.
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.
setGeometry
in interface PjWorkshopIf
setGeometry
in class PjWorkshop
geo
- triangulated surface with vector field(s)public void removeGeometry()
removeGeometry
in class PjWorkshop
public void setDisplay(PvDisplayIf disp)
makeIntegralLines()
.
If called with null
as argument this method
will remove the display settings.
A second call of the method will remove the previous setting.
setDisplay
in interface PjWorkshopIf
setDisplay
in class PjWorkshop
disp
- display that will be used to present the results, may be nullpublic boolean update(java.lang.Object source)
update
in interface PsUpdateIf
update
in class PjWorkshop
source
- sender of this update.PsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void setStepSize(double step)
makeIntegralLines()
.step
- positive step sizegetStepSize()
,
setNumSteps(int)
public void setFast(boolean flag)
public boolean getFast()
public void setBackwardIntegration(boolean flag)
public boolean getBackwardIntegration()
public void setLimitNumLinesPerElement(boolean flag)
setMaxNumLinesPerElement(int)
public boolean getLimitNumLinesPerElement()
public void setMaxNumLinesPerElement(int val)
setLimitNumLinesPerElement(boolean)
.setLimitNumLinesPerElement(boolean)
public int getMaxNumLinesPerElement()
setLimitNumLinesPerElement(boolean)
.public void setIgnoreDirection(boolean flag)
public boolean getIgnoreDirection()
public double getStepSize()
makeIntegralLines()
.setStepSize(double)
,
getNumSteps()
public void setNumSteps(int num)
makeIntegralLines()
.num
- number of integration stepsgetNumSteps()
,
setStepSize(double)
public int getNumSteps()
makeIntegralLines()
.setNumSteps(int)
,
getStepSize()
public void setVectorFieldIndex(int vfIndex)
setGeometry(PgGeometry)
,
beginning with index 0.vfIndex
- index of vector field that shall be visualized 0,...getVectorFieldIndex()
,
setGeometry(PgGeometry)
public int getVectorFieldIndex()
makeIntegralLines()
.setVectorFieldIndex(int)
public void makeIntegralLines()
setDisplay(PvDisplayIf)
.
You can get the computed polygon set by method getIntegralLines()
.public PgPolygonSet getIntegralLines()
makeIntegralLines
.makeIntegralLines()
public void removeIntegralLines()
makeIntegralLines()
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 method
getIntegralLines()
.getIntegralLines()
public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
public void cancel()
cancel
in class PjWorkshop
public static PgPolygonSet makeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps)
geom
- the surface, MUST be triangulation!vec
- vector field on surface geom
.out
- if not equal null
, results are written here.stepsize
- used for integration of each integral line.numSteps
- used for integration of each integral line.out
if it is not null
, otherwise
a new polygon set that contains the results.PnGeodesicRK
,
PgPolygonOnElementSet
public static PgPolygonSet makeIntegralLines(PgElementSet geom, PgVectorField vec, PgPolygonSet out, double stepsize, int numSteps, int elemStep)
geom
- the surface, MUST be triangulation!vec
- vector field on surface geom
.out
- if not equal null
, 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.out
if it is not null
, otherwise
a new polygon set that contains the results.PnGeodesicRK
,
PgPolygonOnElementSet
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)
geom
- the surface, MUST be triangulation!vec
- vector field on surface geom
.out
- if not equal null
, 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 of PnVertexRKIgnoreDirection
backward
- also go along negative vector fieldout
if it is not null
, otherwise
a new polygon set that contains the results.PnGeodesicRK
,
PgPolygonOnElementSet
"