jvx.vector
Class PwRotDiv
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.vector.PwRotDiv
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
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
- Author:
- Eike Preuss
- Version:
- 09.12.06, 2.00 revised (kp) Moved to jvx.vector from jvx.geom.
17.06.03, 1.10 revised (ep) RemovedcreateDualElementSet. UsePwModel.dualinstead.
18.12.02, 1.01 revised (ep) Removed some unused things.
17.12.02, 1.00 created (ep)
-
-
Field Summary
Fields Modifier and Type Field and Description static intEDGE_DIVERGENCEstatic intEDGE_DIVERGENCE_AREAstatic intEDGE_ROTATIONstatic intEDGE_ROTATION_AREAstatic intVERTEX_DIVERGENCEstatic intVERTEX_DIVERGENCE_AREAstatic intVERTEX_DIVERGENCE_NOGAUSSstatic intVERTEX_ROTATIONstatic intVERTEX_ROTATION_AREAstatic intVERTEX_ROTATION_NOGAUSS-
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 PwRotDiv()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static voidcolorTextureFromScalarField(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.booleangetColorExistentTexture()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.intgetFieldType()doublegetMaximumValue()doublegetMinimumValue()static PdVectorgetVertexDivergence(PgElementSet surface, int fieldInd, PdVector out)Computes discrete vertex divergence of piecewise constant vector field.static PdVectorgetVertexDivergence(PgElementSet surface, int fieldInd, PdVector out, boolean divArea, boolean gaussFalse)Computes discrete vertex divergence of piecewise constant vector field.static PdVectorgetVertexRotation(PgElementSet surface, int fieldInd, PdVector out)Computes discrete vertex rotation of piecewise constant vector field.static PdVectorgetVertexRotation(PgElementSet surface, int fieldInd, PdVector out, boolean divArea, boolean gaussFalse)Computes discrete vertex rotation of piecewise constant vector field.static PdVectorgetVertexRotation(PgElementSet surface, int fieldInd, PiVector vertIndices, PdVector out)Compute vertex rotation only at given vertex indicesvoidinit()Initialize and reset project, stops the running animation if any.voidmakeTexture()voidsetColorExistentTexture(boolean flag)If true and geometry already has a texture, then the intensity of this texture is used and colored.voidsetFieldType(int fieldType)voidsetGeometry(PgGeometry geom)Assign a geometry on which this workshop operates, and create a backup clone of the geometry.booleanupdate(java.lang.Object event)Updates the geometry if this workshop has changed, i.e. if the event isthisornull.-
Methods inherited from class jvx.project.PjWorkshop
cancel, close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, reset, setDisplay, 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
-
-
-
-
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
-
-
Method Detail
-
init
public void init()
Description copied from class:PjWorkshopInitialize 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:
initin classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geom)
Description copied from class:PjWorkshopAssign a geometry on which this workshop operates, and create a backup clone of the geometry. The backup geometry is restored if the workshop is canceled.Subclasses frequently overwrite this method but are advised to call this method.
- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- 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- triangulationfieldInd- index of element based vector field insurfacevertIndices- array of vertex indices at which rotation shall be computedout- output is put here if non-null- Returns:
- array of rotation values in same order as in
vertIndices; reference toout(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.
-
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 triangulationfieldInd- index of vector field insurface, must be element basedout- output is put here if non-null and correct sizedivArea- weight edge value by one over area of stargaussFalse- 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.
-
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 triangulationfieldInd- index of vector field insurface, must be element basedout- output is put here if non-null and correct sizedivArea- weight edge value by one over area of adjacent elementsgaussFalse- 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.
-
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 triangulationfieldInd- index of vector field insurface, must be element basedout- output is put here if non-null and correct sizedivArea- weight edge value by one over area of stargaussFalse- 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 triangulationfieldInd- index of vector field insurface, must be element basedout- output is put here if non-null and correct sizedivArea- weight edge value by one over area of adjacent elementsgaussFalse- 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:PjWorkshopUpdates the geometry if this workshop has changed, i.e. if the event isthisornull. Also propagates update() to superclass with the original argument event.Some subclasses may register themselves as update listener of the geometry of this workshop. In order to prevent an update loop, this method safely uses isUpdateSender() when updating the geometry.
- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- Parameters:
event- sender of this update.- Returns:
- true if update was correctly handled by superclass.
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
-
"