JavaView© v3.95.000

jvx.geom
Class PwHodge

java.lang.Object
  extended byjv.object.PsObject
      extended byjvx.project.PjWorkshop
          extended byjvx.geom.PwHodge
All Implemented Interfaces:
java.lang.Cloneable, PjWorkshopIf, PsUpdateIf, java.io.Serializable

public class PwHodge
extends PjWorkshop

Study hodge splitting of discrete vector fields. An vector field is split in gradient and rotation free parts with a remaining harmonic component.

See Also:
Serialized Form

Field Summary
static int DETECT_SADDLES
           
static int DETECT_SINKS_SOURCES
           
static int DETECT_VORTICES
           
 
Fields inherited from class jv.object.PsObject
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
 
Constructor Summary
PwHodge()
           
 
Method Summary
 void close()
          Removes geometry and displays from workshop, and closes super workshop.
 boolean getAutoUpdate()
           
 int getDetectionFlags()
          Compare the DETECT_... constants.
 PvDisplayIf getDisplay(int dispIndex)
          Returns one of the three displays: rotation-free, divergence-free and harmonic component and their features.
 boolean getDisplayVisibility(int dispIndex)
          Handling of the displays that show the vector field components and the potentials.
 PgVectorField getDivergenceFree()
          Call method minimize() before using this method.
 PgVectorField getHarmonic()
          Call method minimize() before using this method.
 PgElementSet getPotentialU()
          Call method minimize() before using this method.
 PgElementSet getPotentialW()
          Call method minimize() before using this method.
 PgVectorField getRotationFree()
          Call method minimize() before using this method.
 PgSurfaceGraph getUGraph()
          Call method minimize() before using this method.
 int getVectorFieldIndex()
           
 boolean getVisibleComponent(int index)
           
 boolean getVisibleFeat(int index)
           
 boolean getVisibleGraph(int index)
           
 PgSurfaceGraph getWGraph()
          Call method minimize() before using this method.
 boolean getZeroBoundsU()
           
 boolean getZeroBoundsW()
           
 void init()
          Initialize and reset project, stops the running animation if any.
 void minimize()
          Initiates minimization of the two energies that produce the three parts of the decomposition.
 void removeGeometry()
          Remove the assigned geometry and its backup clone.
 void reset()
          TODO: Not implemented yet.
 void setAutoUpdate(boolean flag)
          Invoke minimization on updates of geometry.
 void setDetectionFlags(int flag)
          Sets which features to include in feature detection.
 void setDisplaySize(int dispIndex, int width, int height)
          Sets the size of one of the three displays: rotation-free, divergence-free and harmonic component and their features.
 void setDisplayVisibility(int dispIndex, boolean visible)
          Handling of the displays that show the vector field components and the potentials.
 void setGeometry(PgGeometry geom)
          Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
 void setIconScale(double value)
          Scales the icons that are drawn for sinks, sources, vortices and saddles.
 void setVectorField(PgElementSet domain, int vfIndex)
          Sets the current vector field and underlying domain.
 void setVisibleComponent(int index, boolean visible)
           
 void setVisibleFeat(int index, boolean visible)
           
 void setVisibleGraph(int index, boolean visible)
           
 void setZeroBounds(boolean flag)
          Whether the two resulting potentials should be zero on the boundary.
 void setZeroBoundsU(boolean flag)
          Sets zero boundary condition of potential of rotation free part (so this vector field is tangential to boundary edges if set).
 void setZeroBoundsW(boolean flag)
          Sets zero boundary condition of potential of divergence free part (so this part is orthogonal to boundary edges if set).
 void stop()
          Stop minimization explicitly before it is completed.
 boolean update(java.lang.Object event)
          Updates the geometry if this workshop has changed, i.e. if the event is this or null.
 
Methods inherited from class jvx.project.PjWorkshop
cancel, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, isModal, ok, setDisplay, setDisplays, setModal, 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
 

Field Detail

DETECT_SINKS_SOURCES

public static int DETECT_SINKS_SOURCES

DETECT_VORTICES

public static int DETECT_VORTICES

DETECT_SADDLES

public static int DETECT_SADDLES
Constructor Detail

PwHodge

public PwHodge()
Method Detail

init

public void init()
Description copied from class: PjWorkshop
Initialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.

Overrides:
init in class PjWorkshop

setVectorField

public void setVectorField(PgElementSet domain,
                           int vfIndex)
Sets the current vector field and underlying domain. This is a VERY computing intensive operation, because the are set up again. Call update(this) afterwards.

Parameters:
domain - Reference to geometry that is base of vector field. Must be triangulation.
vfIndex - Vector field to decomposite. Should be element based.

setZeroBounds

public void setZeroBounds(boolean flag)
Whether the two resulting potentials should be zero on the boundary. That means that the vector field components are orthogonal and tangential to the boundary edges respectively.


setZeroBoundsU

public void setZeroBoundsU(boolean flag)
Sets zero boundary condition of potential of rotation free part (so this vector field is tangential to boundary edges if set).


getZeroBoundsU

public boolean getZeroBoundsU()

setZeroBoundsW

public void setZeroBoundsW(boolean flag)
Sets zero boundary condition of potential of divergence free part (so this part is orthogonal to boundary edges if set).


getZeroBoundsW

public boolean getZeroBoundsW()

setAutoUpdate

public void setAutoUpdate(boolean flag)
Invoke minimization on updates of geometry.

Parameters:
flag -

getAutoUpdate

public boolean getAutoUpdate()

getRotationFree

public PgVectorField getRotationFree()
Call method minimize() before using this method.


getDivergenceFree

public PgVectorField getDivergenceFree()
Call method minimize() before using this method.


getHarmonic

public PgVectorField getHarmonic()
Call method minimize() before using this method.


getPotentialU

public PgElementSet getPotentialU()
Call method minimize() before using this method.

Returns:
potential of rotation free part

getPotentialW

public PgElementSet getPotentialW()
Call method minimize() before using this method.

Returns:
potential of divergence free part

getUGraph

public PgSurfaceGraph getUGraph()
Call method minimize() before using this method.

Returns:
potential of rotation free part

getWGraph

public PgSurfaceGraph getWGraph()
Call method minimize() before using this method.

Returns:
potential of divergence free part

setVisibleComponent

public void setVisibleComponent(int index,
                                boolean visible)

getVisibleComponent

public boolean getVisibleComponent(int index)

setVisibleGraph

public void setVisibleGraph(int index,
                            boolean visible)

getVisibleGraph

public boolean getVisibleGraph(int index)

setVisibleFeat

public void setVisibleFeat(int index,
                           boolean visible)

getVisibleFeat

public boolean getVisibleFeat(int index)

setDetectionFlags

public void setDetectionFlags(int flag)
Sets which features to include in feature detection. Default is to detect nothing (flag==0).

Parameters:
flag - binary flag; combine the DETECT_... constants with binary OR operator.

getDetectionFlags

public int getDetectionFlags()
Compare the DETECT_... constants.

See Also:
setDetectionFlags(int)

setIconScale

public void setIconScale(double value)
Scales the icons that are drawn for sinks, sources, vortices and saddles.

Parameters:
value - default is 1.

getVectorFieldIndex

public int getVectorFieldIndex()

update

public boolean update(java.lang.Object event)
Description copied from class: PjWorkshop
Updates the geometry if this workshop has changed, i.e. if the event is this or null. Also propagates update() to superclass with the original argument event.

Some subclasses may register themself as update listener of the geometry of this workshop. In order to prevent an update loop, this method savely uses isUpdateSender() when updating the geometry.

Specified by:
update in interface PsUpdateIf
Overrides:
update in class PjWorkshop
Parameters:
event - sender of this update.
Returns:
true if update was correctly handled by superclass.

setDisplayVisibility

public void setDisplayVisibility(int dispIndex,
                                 boolean visible)
Handling of the displays that show the vector field components and the potentials.


getDisplayVisibility

public boolean getDisplayVisibility(int dispIndex)
Handling of the displays that show the vector field components and the potentials.


getDisplay

public PvDisplayIf getDisplay(int dispIndex)
Returns one of the three displays: rotation-free, divergence-free and harmonic component and their features.

Parameters:
dispIndex - 0-2

setDisplaySize

public void setDisplaySize(int dispIndex,
                           int width,
                           int height)
Sets the size of one of the three displays: rotation-free, divergence-free and harmonic component and their features.

Parameters:
dispIndex - 0-2

minimize

public void minimize()
Initiates minimization of the two energies that produce the three parts of the decomposition. As the minimization is done in seperate threads this method perhaps returns without instant effect. The update method of the parent of this PwHodge object is called with this object as argument when the computation of the vector field parts is finished.

A call of minimize() will terminate instantly, if there is already an unterminated minimization process running at the moment!!! To ensure that a new minimization is initiated, call stop() first and then minimize()!


setGeometry

public void setGeometry(PgGeometry geom)
Description copied from class: PjWorkshop
Assign a geometry on which this workshop operates, and create a backup clone of the geometry. The backup geometry is restored if the workshop is cancelled.

Subclasses frequently overwrite this method but are adviced to call this method.

Specified by:
setGeometry in interface PjWorkshopIf
Overrides:
setGeometry in class PjWorkshop
Parameters:
geom - the workshop modifies this geometry.

removeGeometry

public void removeGeometry()
Description copied from class: PjWorkshop
Remove the assigned geometry and its backup clone. Subclasses frequently overwrite this method but are adviced to call this method.

Overrides:
removeGeometry in class PjWorkshop

stop

public void stop()
Stop minimization explicitly before it is completed. update(this) needs to be called to inform info panel.


close

public void close()
Removes geometry and displays from workshop, and closes super workshop.

Overrides:
close in class PjWorkshop

reset

public void reset()
TODO: Not implemented yet.

Overrides:
reset in class PjWorkshop

JavaView© v3.95.000

The software JavaView© is copyright protected. All Rights Reserved.