JavaView© v3.95.000

jvx.vector
Class PwScalarField

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

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

Field Summary
static int SCALAR_DIFF_PRINCIPAL
           
static int SCALAR_EXTREMALITY
           
static int SCALAR_FUNCTION
           
static int SCALAR_GAUSS_CURVATURE
           
static int SCALAR_MAX_PRINCIPAL
           
static int SCALAR_MAX_PRINCIPAL_ABS
           
static int SCALAR_MEAN_CURVATURE
           
static int SCALAR_MIN_PRINCIPAL
           
static int SCALAR_MIN_PRINCIPAL_ABS
           
static int SCALAR_T_HEIGHT
           
static int SCALAR_X_HEIGHT
           
static int SCALAR_Y_HEIGHT
           
static int SCALAR_Z_HEIGHT
           
 
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
PwScalarField()
          Constructor.
 
Method Summary
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.
 void cancel()
          Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.
static java.awt.Color colorMap_backup(double d)
          Maps (0,1) onto a Color, starting from white to red.
static java.awt.Color colorMap(double d)
          Maps (0,1) onto a Color, starting from white to red.
static java.awt.Color colorMapGray(double d)
          Maps (0,1) onto a Color using only gray levels.
 PgVectorField computeGradient(PgVectorField gradient)
          Method computes the gradient of the actual scalar field.
 boolean computeScalar(PgElementSet geom, int type)
          Compute color of surface and vertices depending on current color criteria.
 java.lang.String getScalarName(int type)
          Get name of given scalar field type.
 int getScalarType()
          Get type of current scalar field.
 void init()
          Initialize and reset project, stops the running animation if any.
 void reset()
          Reset workshop and geometry to original state.
static double[] scalarField2Array(PgVectorField scalarField, double[] func)
          Method converts a scalar field into an array of doubles.
 void setGeometry(PgElementSet geom)
           
 void setScalarType(int type)
          Set type of current scalar field.
 boolean update(java.lang.Object event)
          Each time another geometry is loaded.
 
Methods inherited from class jvx.project.PjWorkshop
close, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, isModal, ok, removeGeometry, setDisplay, setDisplays, setGeometry, 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

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_EXTREMALITY

public static final int SCALAR_EXTREMALITY
See Also:
Constant Field Values

SCALAR_FUNCTION

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

PwScalarField

public PwScalarField()
Constructor.

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

reset

public void reset()
Reset workshop and geometry to original state.

Overrides:
reset in class PjWorkshop

update

public boolean update(java.lang.Object event)
Each time another geometry is loaded.

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.

cancel

public void cancel()
Description copied from class: PjWorkshop
Cancel 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:
cancel in class PjWorkshop

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.


getScalarName

public java.lang.String getScalarName(int type)
Get name of given scalar field type.


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 uses jv.geom.PgVectorField.computeGradient(jv.geom.PgElementSet, PdVector[], int).

Since:
JavaView 3.20.002

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 field
func - double array that specifies a function value for each vertex of the domain
scalarField - scalar field that will be filled, this argument can be null
Since:
JavaView 3.20.002

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 null
scalarField - scalar field that specifies a function value for each vertex of its domain
Since:
JavaView 3.20.002

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.


colorMap_backup

public static java.awt.Color colorMap_backup(double d)
Maps (0,1) onto a Color, starting from white to red.


JavaView© v3.95.000

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