public class PwIntegralLine extends PjWorkshop implements PvPickListenerIf
Assign a surface by setGeometry(PgGeometry)
and a display where the calculated integral line will show up by
setDisplay(PvDisplayIf)
(if you wish that behaviour).
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
.
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 |
---|
PwIntegralLine() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel operation of this workshop by resetting the assigned geometry,
and finally close this workshop.
|
void |
close()
Call this method to shutdown the workshop.
|
PgPolygon |
computeIntegralLine(PgElementSet geom,
int vfIndex,
int elemIndex,
PdBary point,
int numSteps,
double stepSize,
boolean fast,
PgPolygon poly) |
PgPolygon |
computeIntegralLine(PgElementSet geom,
int vfIndex,
int elemIndex,
PdBary point,
int numSteps,
double stepSize,
boolean fast,
PgPolygon poly,
boolean ignoreDir) |
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.
|
boolean |
getFast() |
boolean |
getIgnoreDirection() |
PgPolygon |
getIntegralLine()
Get the polygon instance which is used for integration
|
int |
getNumSteps()
Get the number of steps that will be used
for integration.
|
double |
getStepSize()
Get step size used for integration.
|
int |
getVectorFieldIndex()
Get index of the vector field that will be integrated.
|
void |
init()
Initializes by setting all parameters to initial values and
removing computed integral lines.
|
void |
markVertices(PvPickEvent event)
Mark a set of vertices of a geometry within a given bounding box.
|
void |
pickDisplay(PvPickEvent event)
Get a location in the display with 2d display and 3d world coordinates.
|
void |
pickInitial(PvPickEvent event)
Pick an arbitrary point on a geometry, point may lie inside an element.
|
void |
pickVertex(PgGeometryIf geom,
int vertIndex,
PdVector vector)
Get a picked vertex of a geometry.
|
void |
removeIntegralLine()
Removes previously computed integral line
from the display and internal uses.
|
void |
selectGeometry(PgGeometryIf event)
Inform pick listener when selected geometry is changing.
|
void |
setDisplay(PvDisplayIf disp)
Set the display where computed integral lines will show
up.
|
void |
setFast(boolean flag) |
void |
setGeometry(PgGeometry geo)
Set the geometry that will be used for integration.
|
void |
setIgnoreDirection(boolean flag)
Ignores the direction of vertex based vector fields, i.e.
|
void |
setNumSteps(int num)
Set the number of steps that will be used
for integration.
|
void |
setStepSize(double step)
Set the step size used for integration.
|
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. |
void |
unmarkVertices(PvPickEvent event)
Unmark a set of vertices of a geometry within a given bounding box.
|
boolean |
update(java.lang.Object source)
07.11.04, 1.10 revised (kh) Added checks to avoid calling recompute more than once.
|
getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, 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
getFather, getName, setParent
public void init()
init
in class PjWorkshop
public void setGeometry(PgGeometry geo)
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 null
removes the settings.
setGeometry
in interface PjWorkshopIf
setGeometry
in class PjWorkshop
geo
- triangulated surface with vector field(s)PjWorkshop.getGeometry()
public void setDisplay(PvDisplayIf disp)
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)
step
- positive step sizegetStepSize()
,
setNumSteps(int)
public double getStepSize()
setStepSize(double)
,
getNumSteps()
public void setNumSteps(int num)
num
- number of integration stepsgetNumSteps()
,
setStepSize(double)
public int getNumSteps()
setNumSteps(int)
,
getStepSize()
public void setFast(boolean flag)
public boolean getFast()
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()
setVectorFieldIndex(int)
public PgPolygon getIntegralLine()
public void removeIntegralLine()
getIntegralLine()
.getIntegralLine()
public void close()
close
in class PjWorkshop
public void cancel()
PjWorkshop
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 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 pickInitial(PvPickEvent event)
PvPickListenerIf
pickInitial
in interface PvPickListenerIf
event
- Pick event issued by the displayPvPickListenerIf
public void setIgnoreDirection(boolean flag)
public boolean getIgnoreDirection()
public PgPolygon computeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly)
public PgPolygon computeIntegralLine(PgElementSet geom, int vfIndex, int elemIndex, PdBary point, int numSteps, double stepSize, boolean fast, PgPolygon poly, boolean ignoreDir)
"