JavaView® v2.00.008

vgp.vector.vectorField
Class PjVectorField

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PjProject
              |
              +--jv.loader.PjImportModel
                    |
                    +--vgp.vector.vectorField.PjVectorField
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf, java.lang.Runnable, java.io.Serializable

public class PjVectorField
extends PjImportModel
implements java.lang.Runnable, java.awt.event.ActionListener

Project Vector Field Visualization and Geodesic Runge-Kutta uses PjImportModel to load models from file. Various models may be loaded and are extended by a (more or less) random tangential vector field.

Version:
29. 8.99, 1.00 created
Author:
Eike Preuß
See Also:
PjImportModel, Serialized Form

Field Summary
static int GEODESIC
          Geodesic completion.
static int GEODESIC2
          Geodesic translation along half angle.
static int GEODESIC3
          Geodesic translation dependent on evaluation point (continous).
protected  PdBaryDir[][] m_altvec
          Calculated vector representations.
protected  PdBary m_bary
          Initial barycentric point for integral line m_poly.
protected  PuInteger m_discr
          Discretization of the integral line.
protected  int m_elemInd
          Global element index of initial point for integral line m_poly.
protected  boolean m_fast
          If fast is on, an euler-method is used for integration and not a 4th-order runge-kutta.
protected  PgElementSet m_geom
          The loaded model.
protected  PjImportModel m_import
          Is used to load models from the net or local disk.
protected  PuDouble m_length
          Length of the integral line.
protected  java.lang.Thread m_LIC
          Thread that executes the LIC texture calculation.
protected  java.awt.Button m_LICButton
          Button that starts the LIC texture calculation.
protected  PuInteger m_LICSize
          Size of quadratic LIC texture image.
protected  int m_method
          Method used in calculateRepresentations.
protected  PnGeodesicRK m_ode
          Geodesic Runge-Kutta method that is used to get integral lines
protected  int[] m_origelem
          Global element indices of elements that define the vectors in m_origvec.
protected  int[] m_origlocvertind
          Local vertex index of base vertex of vector m_origvec in element m_origelem.
protected  PdBaryDir[] m_origvec
          Original tangential vectors at vertices. size: geom.getNumVertices().
protected  PgPolygon m_poly
          Integral line that is computed by a runge-kutta-method.
protected  java.awt.Label m_time
          Time it took to calculate LIC texture.
protected  PgVectorField m_vec
          Visual 3D-vector field that is the 3D-representation of m_origvec.
static int PROJECTION
          Is used by method calculateRepresentations.
 
Fields inherited from class jv.loader.PjImportModel
CONFIRM_CANCEL, CONFIRM_CLICKED, CONFIRM_OK, DIR_LIST, FULL_INFO_PANEL, m_baseDir, m_category, m_confirm, m_defBaseDir, m_defCategory, m_defFileName, m_fileName, m_fullFileName, m_geomList, m_infoPanelType, m_numModels, m_parentProject, SMALL_INFO_PANEL
 
Fields inherited from class jv.project.PjProject
m_anim, m_bAutoFit, m_display, m_displayList, m_geometry, m_parm, m_rootGeometry
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Constructor Summary
PjVectorField()
          If (this.instanceOf("PjVectorField")) it calls init-method.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Starts a new thread that calculates the LIC texture.
 void calculateCurve()
          Calculates the integral curve with initial values internally given.
 void calculateRepresentations()
          Calculates the representations of vectors at every vertexstar.
 void calculateVectorField()
          Calculates (pseudo) random vector field.
 void computeLIC()
           
 void init()
          Initialize and reset project, stops the running animation if any.
 boolean load()
          Gets geometry from PjImportModel and then triangulates, updates the number of elements, gets a vector field and fits that all in the display.
 boolean load(java.lang.String fileName)
          Loads geometry via PjImportModel and then calls load().
 void pickInitial(PvPickEvent pos)
          Initiates calculation of an integral line that starts at picked position.
 void run()
          Gets an apropriate Runge-Kutta class and initiates LIC calculation element by element.
 void setFast(boolean flag)
          Sets integration method to euler-mode or 4th-order Runge-Kutta mode.
 void setMethod(int method)
          Sets method used in calculateRepresentations.
 void start()
          Load geometry file if file name has been specified.
 boolean update(java.lang.Object event)
          Event handling method in the update mechanism.
 
Methods inherited from class jv.loader.PjImportModel
getBaseDir, getCategory, getConfirm, getFileName, getInfoPanel, setBase, setCategory, setConfirm, setFileName, setParentProject, setTypeOfInfoPanel
 
Methods inherited from class jv.project.PjProject
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setDisplay, setEnabledAutoFit, setParameter, setTime, setViewer, stop, unmarkVertices
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.anim.PsTimeListenerIf
getName
 
Methods inherited from interface jv.project.PvPickListenerIf
getName
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
 

Field Detail

m_import

protected PjImportModel m_import
Is used to load models from the net or local disk.

m_geom

protected PgElementSet m_geom
The loaded model.

m_length

protected PuDouble m_length
Length of the integral line.

m_discr

protected PuInteger m_discr
Discretization of the integral line.

m_altvec

protected PdBaryDir[][] m_altvec
Calculated vector representations.

m_method

protected int m_method
Method used in calculateRepresentations.
See Also:
PROJECTION, GEODESIC, GEODESIC2, GEODESIC3

PROJECTION

public static final int PROJECTION
Is used by method calculateRepresentations.

GEODESIC

public static final int GEODESIC
Geodesic completion. Is used by method calculateRepresentations.

GEODESIC2

public static final int GEODESIC2
Geodesic translation along half angle. Is used by method calculateRepresentations.

GEODESIC3

public static final int GEODESIC3
Geodesic translation dependent on evaluation point (continous). Is used by method calculateRepresentations.

m_LICSize

protected PuInteger m_LICSize
Size of quadratic LIC texture image.

m_origvec

protected PdBaryDir[] m_origvec
Original tangential vectors at vertices. size: geom.getNumVertices().

m_origelem

protected int[] m_origelem
Global element indices of elements that define the vectors in m_origvec.

m_origlocvertind

protected int[] m_origlocvertind
Local vertex index of base vertex of vector m_origvec in element m_origelem.

m_poly

protected PgPolygon m_poly
Integral line that is computed by a runge-kutta-method.

m_elemInd

protected int m_elemInd
Global element index of initial point for integral line m_poly.

m_bary

protected PdBary m_bary
Initial barycentric point for integral line m_poly.

m_vec

protected PgVectorField m_vec
Visual 3D-vector field that is the 3D-representation of m_origvec.

m_LIC

protected java.lang.Thread m_LIC
Thread that executes the LIC texture calculation.

m_LICButton

protected java.awt.Button m_LICButton
Button that starts the LIC texture calculation.

m_fast

protected boolean m_fast
If fast is on, an euler-method is used for integration and not a 4th-order runge-kutta.

m_ode

protected PnGeodesicRK m_ode
Geodesic Runge-Kutta method that is used to get integral lines

m_time

protected java.awt.Label m_time
Time it took to calculate LIC texture.
Constructor Detail

PjVectorField

public PjVectorField()
If (this.instanceOf("PjVectorField")) it calls init-method.
Method Detail

init

public void init()
Description copied from class: PjProject
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 PjImportModel

start

public void start()
Description copied from class: PjImportModel
Load geometry file if file name has been specified. Otherwise do nothing.
Overrides:
start in class PjImportModel
Following copied from class: jv.project.PjProject
See Also:
PvViewerIf.start(), #isEnabledAutoFit(boolean)

update

public boolean update(java.lang.Object event)
Description copied from interface: PsUpdateIf
Event handling method in the update mechanism. Events not handled will be passed to m_parent or super in this sequence.
Overrides:
update in class PsObject
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

setMethod

public void setMethod(int method)
Sets method used in calculateRepresentations.
See Also:
PROJECTION, GEODESIC, GEODESIC2, GEODESIC3

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Starts a new thread that calculates the LIC texture.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
run()

calculateVectorField

public void calculateVectorField()
Calculates (pseudo) random vector field.

calculateRepresentations

public void calculateRepresentations()
Calculates the representations of vectors at every vertexstar. If current method in m_method is GEODESIC3,i.e. continous geodesic translation, this calculation is done in the runge-kutta class.
See Also:
PnTranslationRK, PwBary.getGeodRepresentation(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, int, jv.vecmath.PiVector, jv.vecmath.PiVector), PwBary.getTransRepresentation(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, int, jv.vecmath.PiVector, jv.vecmath.PiVector), PwBary.getProjRepresentation(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, int, jv.vecmath.PiVector, jv.vecmath.PiVector)

calculateCurve

public void calculateCurve()
Calculates the integral curve with initial values internally given.

pickInitial

public void pickInitial(PvPickEvent pos)
Initiates calculation of an integral line that starts at picked position.
Overrides:
pickInitial in class PjProject
See Also:
calculateCurve()

setFast

public void setFast(boolean flag)
Sets integration method to euler-mode or 4th-order Runge-Kutta mode.
Parameters:
flag - true: euler; false: 4th-order runge-kutta

load

public boolean load(java.lang.String fileName)
Loads geometry via PjImportModel and then calls load().
Overrides:
load in class PjImportModel
See Also:
load()

load

public boolean load()
Gets geometry from PjImportModel and then triangulates, updates the number of elements, gets a vector field and fits that all in the display.

computeLIC

public void computeLIC()

run

public void run()
Gets an apropriate Runge-Kutta class and initiates LIC calculation element by element.
Specified by:
run in interface java.lang.Runnable
See Also:
PnLIC, PnVertexRK, PnTranslationRK

JavaView® v2.00.008

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