jvx.vector
Class PwScalarField
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.vector.PwScalarField
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
public class PwScalarField extends PjWorkshop
Compute scalar fields on a given geometry. Each field is registered as vector field with vector dimension 1 with the given geometry.- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 11.05.10, 1.10 revised (mn) Added support for element based scalar functions.
14.11.08, 1.30 revised (kh) Workshop can now be used to analyze fields that have been created outside of the workshop.
02.02.05, 1.20 revised (kh) Some adjustments to the update of the sliders, coloring modified.
12.05.04, 1.10 revised (kh) Added coloring of surface and computation of gradient.
29.02.04, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.String[]m_scalarFieldNamestatic intSCALAR_DIFF_PRINCIPALstatic intSCALAR_EXTREMALITYstatic intSCALAR_GAUSS_CURVATUREstatic intSCALAR_GAUSS_VIA_PRINCIPALstatic intSCALAR_IMPORTED_FUNCTIONstatic intSCALAR_MAX_PRINCIPALstatic intSCALAR_MAX_PRINCIPAL_ABSstatic intSCALAR_MEAN_CURVATUREstatic intSCALAR_MIN_PRINCIPALstatic intSCALAR_MIN_PRINCIPAL_ABSstatic intSCALAR_T_HEIGHTstatic intSCALAR_TOTAL_CURVATUREstatic intSCALAR_X_HEIGHTstatic intSCALAR_Y_HEIGHTstatic intSCALAR_Z_HEIGHT-
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 PwScalarField()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static PgVectorFieldarray2ScalarField(PgPointSet domain, double[] func, PgVectorField scalarField)Method converts a function given as an array of doubles into a scalar field (PgVectorField with dimension of vectors equal one) on the specified domain.voidcancel()Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.static java.awt.ColorcolorMap(double d)Maps (0,1) onto a Color, starting from white to red.static java.awt.ColorcolorMapGray(double d)Maps (0,1) onto a Color using only gray levels.PgVectorFieldcomputeGradient(PgVectorField gradient)Method computes the gradient of the actual scalar field.booleancomputeScalar()Compute color of surface and vertices depending on current color criteria.booleancomputeScalar(PgElementSet geom, int type)Compute color of surface and vertices depending on current color criteria.booleangetAdjustColoring()Get information, whether color sliders are adjusted for new scalar fields.doublegetColorMax()Get maximal color value.doublegetColorMin()Get minimal color value.java.lang.StringgetScalarName(int type)Get name of given scalar field type.intgetScalarType()Get type of current scalar field.voidinit()Initialize and reset project, stops the running animation if any.booleanisShowingOnlyGrayLevels(boolean gl)The workshop and can assign colors to the surface according to the value of the scalar field.voidok()Accept current version of the geometry as new version.voidreset()Reset workshop and geometry to original state.static double[]scalarField2Array(PgVectorField scalarField, double[] func)Method converts a scalar field into an array of doubles.voidsetAdjustColoring(boolean flag)Indicate whether to adjust the color sliders when computing a new scalar field.voidsetColorMax(double value)Sets maximal color value.voidsetColorMin(double value)Sets minimal color value.voidsetGeometry(PgElementSet geom)voidsetScalarType(int type)Set type of current scalar field.voidshowOnlyGrayLevels(boolean gl)The workshop and can assign colors to the surface according to the value of the scalar field.booleanupdate(java.lang.Object event)Each time another geometry is loaded.-
Methods inherited from class jvx.project.PjWorkshop
close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, removeGeometry, setDisplay, setDisplays, setGeometry, 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
-
m_scalarFieldName
public final java.lang.String[] m_scalarFieldName
-
SCALAR_X_HEIGHT
public static final int SCALAR_X_HEIGHT
- See Also:
- Constant Field Values
-
SCALAR_Y_HEIGHT
public static final int SCALAR_Y_HEIGHT
- See Also:
- Constant Field Values
-
SCALAR_Z_HEIGHT
public static final int SCALAR_Z_HEIGHT
- See Also:
- Constant Field Values
-
SCALAR_T_HEIGHT
public static final int SCALAR_T_HEIGHT
- See Also:
- Constant Field Values
-
SCALAR_GAUSS_CURVATURE
public static final int SCALAR_GAUSS_CURVATURE
- See Also:
- Constant Field Values
-
SCALAR_MEAN_CURVATURE
public static final int SCALAR_MEAN_CURVATURE
- See Also:
- Constant Field Values
-
SCALAR_MAX_PRINCIPAL
public static final int SCALAR_MAX_PRINCIPAL
- See Also:
- Constant Field Values
-
SCALAR_MIN_PRINCIPAL
public static final int SCALAR_MIN_PRINCIPAL
- See Also:
- Constant Field Values
-
SCALAR_MAX_PRINCIPAL_ABS
public static final int SCALAR_MAX_PRINCIPAL_ABS
- See Also:
- Constant Field Values
-
SCALAR_MIN_PRINCIPAL_ABS
public static final int SCALAR_MIN_PRINCIPAL_ABS
- See Also:
- Constant Field Values
-
SCALAR_DIFF_PRINCIPAL
public static final int SCALAR_DIFF_PRINCIPAL
- See Also:
- Constant Field Values
-
SCALAR_TOTAL_CURVATURE
public static final int SCALAR_TOTAL_CURVATURE
- See Also:
- Constant Field Values
-
SCALAR_GAUSS_VIA_PRINCIPAL
public static final int SCALAR_GAUSS_VIA_PRINCIPAL
- See Also:
- Constant Field Values
-
SCALAR_IMPORTED_FUNCTION
public static final int SCALAR_IMPORTED_FUNCTION
- See Also:
- Constant Field Values
-
SCALAR_EXTREMALITY
public static final int SCALAR_EXTREMALITY
- 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
-
reset
public void reset()
Reset workshop and geometry to original state.- Overrides:
resetin classPjWorkshop
-
update
public boolean update(java.lang.Object event)
Each time another geometry is loaded.- 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)
-
cancel
public void cancel()
Description copied from class:PjWorkshopCancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.
- Overrides:
cancelin classPjWorkshop
-
ok
public void ok()
Description copied from class:PjWorkshopAccept current version of the geometry as new version. Close workshop. The copy of the original geometry is ignored.Implementation in this class calls
close().- Overrides:
okin classPjWorkshop
-
showOnlyGrayLevels
public void showOnlyGrayLevels(boolean gl)
The workshop and can assign colors to the surface according to the value of the scalar field. Here one can switch between full colors and only grey-levels. If set to true grey-levels are shown, it shows full colors if set to false.
-
isShowingOnlyGrayLevels
public boolean isShowingOnlyGrayLevels(boolean gl)
The workshop and can assign colors to the surface according to the value of the scalar field. One can switch between full colors and only grey-levels. True - greylevels, false - full colors.
-
setColorMin
public void setColorMin(double value)
Sets minimal color value.- Parameters:
value- the color value to be set.
-
getColorMin
public double getColorMin()
Get minimal color value.- Returns:
- value of the color.
-
setColorMax
public void setColorMax(double value)
Sets maximal color value.- Parameters:
value- the color value to be set.
-
getColorMax
public double getColorMax()
Get maximal color value.
-
setGeometry
public void setGeometry(PgElementSet geom)
-
getScalarType
public int getScalarType()
Get type of current scalar field.
-
setScalarType
public void setScalarType(int type)
Set type of current scalar field.
-
setAdjustColoring
public void setAdjustColoring(boolean flag)
Indicate whether to adjust the color sliders when computing a new scalar field.
-
getAdjustColoring
public boolean getAdjustColoring()
Get information, whether color sliders are adjusted for new scalar fields.
-
getScalarName
public java.lang.String getScalarName(int type)
Get name of given scalar field type.
-
computeScalar
public boolean computeScalar()
Compute color of surface and vertices depending on current color criteria.
-
computeScalar
public boolean computeScalar(PgElementSet geom, int type)
Compute color of surface and vertices depending on current color criteria.
-
computeGradient
public PgVectorField computeGradient(PgVectorField gradient)
Method computes the gradient of the actual scalar field. Method usesjv.geom.PgVectorField.computeGradient(jv.geom.PgElementSet, PdVector[], int).- Since:
- JavaView 3.20.002
- Version:
- 21.04.04, 1.00 created (kh)
-
array2ScalarField
public static PgVectorField array2ScalarField(PgPointSet domain, double[] func, PgVectorField scalarField)
Method converts a function given as an array of doubles into a scalar field (PgVectorField with dimension of vectors equal one) on the specified domain.- Parameters:
domain- domain of the function resp. scalar fieldfunc- double array that specifies a function value for each vertex of the domainscalarField- scalar field that will be filled, this argument can be null- Since:
- JavaView 3.20.002
- Version:
- 21.04.04, 1.00 created (kh)
-
scalarField2Array
public static double[] scalarField2Array(PgVectorField scalarField, double[] func)
Method converts a scalar field into an array of doubles. The i-th element of the array get the value of the scalar field at the i-th vertex of the domain.- Parameters:
func- double array that will be filled, this argument can be nullscalarField- scalar field that specifies a function value for each vertex of its domain- Since:
- JavaView 3.20.002
- Version:
- 21.04.04, 1.00 created (kh)
-
colorMapGray
public static java.awt.Color colorMapGray(double d)
Maps (0,1) onto a Color using only gray levels.
-
colorMap
public static java.awt.Color colorMap(double d)
Maps (0,1) onto a Color, starting from white to red.
-
-
"