JavaView© v3.95.000

jvx.geom
Class PwRotDiv

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

public class PwRotDiv
extends PjWorkshop

This can be used to color an element set or a texture on an element set with respect to certain scalar fields such as rotation and divergence of element based vector fields.
It cannot yet be used from other classes, though some public (but for now uncommented) methods may prove useful such as computation of the earlier mentioned scalar fields.

Since:
JavaView 2.48.005
See Also:
Serialized Form

Field Summary
static int EDGE_DIVERGENCE
           
static int EDGE_DIVERGENCE_AREA
           
static int EDGE_ROTATION
           
static int EDGE_ROTATION_AREA
           
static int VERTEX_DIVERGENCE
           
static int VERTEX_DIVERGENCE_AREA
           
static int VERTEX_DIVERGENCE_NOGAUSS
           
static int VERTEX_ROTATION
           
static int VERTEX_ROTATION_AREA
           
static int VERTEX_ROTATION_NOGAUSS
           
 
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
PwRotDiv()
           
 
Method Summary
static void colorTextureFromScalarField(PgElementSet surface, java.awt.Color neg, java.awt.Color zero, java.awt.Color pos, double middleVal, double maxVal, PdVector[] scalar)
          surface must have element textures.
 boolean getColorExistentTexture()
           
static PdVector[] getEdgeDivergence(PgElementSet surface, int fieldInd, PdVector[] out)
           
static PdVector[] getEdgeDivergence(PgElementSet surface, int fieldInd, PdVector[] out, boolean divArea, boolean gaussFalse)
          Computes discrete edge divergence of piecewise constant vector field.
static PdVector[] getEdgeRotation(PgElementSet surface, int fieldInd, PdVector[] out)
          Computes discrete edge rotation of piecewise constant vector field.
static PdVector[] getEdgeRotation(PgElementSet surface, int fieldInd, PdVector[] out, boolean divArea, boolean gaussFalse)
          Computes discrete edge rotation of piecewise constant vector field.
 int getFieldType()
           
 double getMaximumValue()
           
 double getMinimumValue()
           
static PdVector getVertexDivergence(PgElementSet surface, int fieldInd, PdVector out)
          Computes discrete vertex divergence of piecewise constant vector field.
static PdVector getVertexDivergence(PgElementSet surface, int fieldInd, PdVector out, boolean divArea, boolean gaussFalse)
          Computes discrete vertex divergence of piecewise constant vector field.
static PdVector getVertexRotation(PgElementSet surface, int fieldInd, PdVector out)
          Computes discrete vertex rotation of piecewise constant vector field.
static PdVector getVertexRotation(PgElementSet surface, int fieldInd, PdVector out, boolean divArea, boolean gaussFalse)
          Computes discrete vertex rotation of piecewise constant vector field.
static PdVector getVertexRotation(PgElementSet surface, int fieldInd, PiVector vertIndices, PdVector out)
          Compute vertex rotation only at given vertex indices
 void init()
          Initialize and reset project, stops the running animation if any.
 void makeTexture()
           
 void setColorExistentTexture(boolean flag)
          If true and geometry already has a texture, then the intensity of this texture is used and colored.
 void setFieldType(int fieldType)
           
 void setGeometry(PgGeometry geom)
          Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
 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, close, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, isModal, ok, removeGeometry, reset, 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

VERTEX_ROTATION

public static final int VERTEX_ROTATION
See Also:
Constant Field Values

VERTEX_ROTATION_AREA

public static final int VERTEX_ROTATION_AREA
See Also:
Constant Field Values

EDGE_ROTATION

public static final int EDGE_ROTATION
See Also:
Constant Field Values

EDGE_ROTATION_AREA

public static final int EDGE_ROTATION_AREA
See Also:
Constant Field Values

VERTEX_DIVERGENCE

public static final int VERTEX_DIVERGENCE
See Also:
Constant Field Values

VERTEX_DIVERGENCE_AREA

public static final int VERTEX_DIVERGENCE_AREA
See Also:
Constant Field Values

EDGE_DIVERGENCE

public static final int EDGE_DIVERGENCE
See Also:
Constant Field Values

EDGE_DIVERGENCE_AREA

public static final int EDGE_DIVERGENCE_AREA
See Also:
Constant Field Values

VERTEX_ROTATION_NOGAUSS

public static final int VERTEX_ROTATION_NOGAUSS
See Also:
Constant Field Values

VERTEX_DIVERGENCE_NOGAUSS

public static final int VERTEX_DIVERGENCE_NOGAUSS
See Also:
Constant Field Values
Constructor Detail

PwRotDiv

public PwRotDiv()
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

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.

setFieldType

public void setFieldType(int fieldType)

getFieldType

public int getFieldType()

getMaximumValue

public double getMaximumValue()

getMinimumValue

public double getMinimumValue()

makeTexture

public void makeTexture()

setColorExistentTexture

public void setColorExistentTexture(boolean flag)
If true and geometry already has a texture, then the intensity of this texture is used and colored.


getColorExistentTexture

public boolean getColorExistentTexture()

colorTextureFromScalarField

public static void colorTextureFromScalarField(PgElementSet surface,
                                               java.awt.Color neg,
                                               java.awt.Color zero,
                                               java.awt.Color pos,
                                               double middleVal,
                                               double maxVal,
                                               PdVector[] scalar)
surface must have element textures. this method is beta and subject to change! Use at your own risk!


getVertexRotation

public static PdVector getVertexRotation(PgElementSet surface,
                                         int fieldInd,
                                         PiVector vertIndices,
                                         PdVector out)
Compute vertex rotation only at given vertex indices

Parameters:
surface - triangulation
fieldInd - index of element based vector field in surface
vertIndices - array of vertex indices at which rotation shall be computed
out - output is put here if non-null
Returns:
array of rotation values in same order as in vertIndices; reference to out (if non-null)

getVertexRotation

public static PdVector getVertexRotation(PgElementSet surface,
                                         int fieldInd,
                                         PdVector out)
Computes discrete vertex rotation of piecewise constant vector field. Not dividing by area; conforming to Gauss.

See Also:
getVertexRotation(PgElementSet, int, PdVector, boolean, boolean)

getVertexRotation

public static PdVector getVertexRotation(PgElementSet surface,
                                         int fieldInd,
                                         PdVector out,
                                         boolean divArea,
                                         boolean gaussFalse)
Computes discrete vertex rotation of piecewise constant vector field.

Parameters:
surface - underlying triangulation
fieldInd - index of vector field in surface, must be element based
out - output is put here if non-null and correct size
divArea - weight edge value by one over area of star
gaussFalse - false: integrate along boundary edges
Returns:
one PdVector per element that contains the edge values; same as out (if given)

getEdgeRotation

public static PdVector[] getEdgeRotation(PgElementSet surface,
                                         int fieldInd,
                                         PdVector[] out)
Computes discrete edge rotation of piecewise constant vector field. Not dividing by area; conforming to Gauss.

See Also:
getEdgeRotation(PgElementSet, int, PdVector[], boolean, boolean)

getEdgeRotation

public static PdVector[] getEdgeRotation(PgElementSet surface,
                                         int fieldInd,
                                         PdVector[] out,
                                         boolean divArea,
                                         boolean gaussFalse)
Computes discrete edge rotation of piecewise constant vector field.

Parameters:
surface - underlying triangulation
fieldInd - index of vector field in surface, must be element based
out - output is put here if non-null and correct size
divArea - weight edge value by one over area of adjacent elements
gaussFalse - false: rotation at boundary edge is zero
Returns:
one PdVector per element that contains the edge values; same as out (if given)

getVertexDivergence

public static PdVector getVertexDivergence(PgElementSet surface,
                                           int fieldInd,
                                           PdVector out)
Computes discrete vertex divergence of piecewise constant vector field. Not dividing by area; conforming to Gauss.

See Also:
getVertexDivergence(PgElementSet, int, PdVector, boolean, boolean)

getVertexDivergence

public static PdVector getVertexDivergence(PgElementSet surface,
                                           int fieldInd,
                                           PdVector out,
                                           boolean divArea,
                                           boolean gaussFalse)
Computes discrete vertex divergence of piecewise constant vector field.

Parameters:
surface - underlying triangulation
fieldInd - index of vector field in surface, must be element based
out - output is put here if non-null and correct size
divArea - weight edge value by one over area of star
gaussFalse - false: integrate along boundary edges
Returns:
one PdVector per element that contains the edge values; same as out (if given)

getEdgeDivergence

public static PdVector[] getEdgeDivergence(PgElementSet surface,
                                           int fieldInd,
                                           PdVector[] out)

getEdgeDivergence

public static PdVector[] getEdgeDivergence(PgElementSet surface,
                                           int fieldInd,
                                           PdVector[] out,
                                           boolean divArea,
                                           boolean gaussFalse)
Computes discrete edge divergence of piecewise constant vector field.

Parameters:
surface - underlying triangulation
fieldInd - index of vector field in surface, must be element based
out - output is put here if non-null and correct size
divArea - weight edge value by one over area of adjacent elements
gaussFalse - false: rotation at boundary edge is zero
Returns:
one PdVector per element that contains the edge values; same as out (if given)

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.

JavaView© v3.95.000

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