Class PgVectorField
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.geom.PgVectorField
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
public class PgVectorField extends PgGeometry
Vector field along a point set, polygon or surface. Each vector has a vertex or element center of the associated geometry as base point. The base points must be implicitly reconstructed from the associated geometry and the flag 'basedOn'.Note, usually the vector field should also be registered in the geometry.
Usage example:
... PgElementSet surf = new PgElementSet(... ... PgVectorField field = new PgVectorField(3); field.setType(PgVectorField.ELEMENT_BASED); // base points are element midpoints of surface field.setGeometry(surf); // register geometry to use base points from geometry surf.addVectorField(field); // assign vector field to surface, otherwise vector field is not visible ...
- See Also:
PgPointSet,PgElementSet, Serialized Form- Author:
- Konrad Polthier
- Version:
- 04.10.19, 2.81 revised (jr) Bug fix: in PgVectorField.project parallelity check.
07.07.13, 2.80 revised (kp) Unused methods computeGradient() removed where function was given as PgPointSet.
29.08.09, 2.72 revised (fk) implementedadd(PgVectorField).
29.08.09, 2.71 revised (fk) changed method signature from PgVF.sub(v1, v2) to v1.sub(v2).
29.02.04, 2.70 revised (kp) Dimension of vectors better separated from m_dim, method blend() and clone() improved.
10.02.03, 2.60 revised (ep) MakeTangent for 2-dim surfaces in arbitrary dimensional ambient space and for vertex and element based. JavaDoc.
23.01.03, 2.50 revised (kp) Individual material properties activated.
24.06.02, 2.10 revised (ep) getInterpolatedElementSet moved to PwVectorField. New method getGeometry.
09.06.02, 2.00 revised (ep) New methods setDimOfVectors() and getInterpolatedElementBased().
22.03.02, 1.90 revised (ur) Internationalization.
13.09.01, 1.80 revised (ep) setVectors now behaves like documented.
20.05.01, 1.70 revised (kp) Minor revisions in a few methods.
19.05.01, 1.60 revised (kp) Vector field handling slightly revised.
10.12.00, 1.50 revised (ep) Method getDimOfVectors() added.
18.07.00, 1.40 revised (kp) Instance variable m_useGlobalVectorColor renamed to m_bShowVectorColors.
26.06.00, 1.30 revised (ep) Copy() method added.
09.04.00, 1.20 revised (kp) Name changed to PgVectorField_IP from PgVectorField_IP.
20.11.99, 1.10 revised (ep) Removed reference to vertices.
00.00.98, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static intELEMENT_BASEDVectorField is given at element centers.static intVERTEX_BASEDVectorField is given at vertices.-
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.PgGeometryIf
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, BLEND_ALPHA, BLEND_MATERIAL, BLEND_REPLACE, FILTER_DIRECT, FILTER_LINEAR, FILTER_QUADRATIC, HAS_METHOD_MENU, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, m_numLabelTypes, METHOD_EXT, PERIODIC_BOTH, PERIODIC_HEIGHT, PERIODIC_NONE, PERIODIC_WIDTH, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE, SIDE_BACK, SIDE_BOTH, SIDE_FRONT, SIDE_NONE
-
-
Constructor Summary
Constructors Constructor and Description PgVectorField(int aVectorDim)Constructor of an empty vector field which is VERTEX_BASED on default.PgVectorField(int aVectorDim, int basedOn)Constructor of an empty vector field which is VERTEX_BASED on default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(PgVectorField field)Add a vector field to this.booleanapplyModelingMatrix()Multiply the modeling matrix to all vertices and vectors.voidassureVectorColors()Ensure that array of colors for each vector exists and its size is equal to number of vectors.booleanblend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two vector fieldsthis = s*a + t*b, e.g. used in interpolation.voidclearTagVector(int anIndex, int aTag)Removes the given tag from a vector.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.booleancomputeGradient(PgElementSet domain, PdVector image)Compute vector field as the gradient of a map from a domain triangulation to R.booleancomputeGradient(PgElementSet domain, PdVector[] image, int coordinate)Compute vector field as the gradient (of one coordinate) of a map from a domain triangulation to R^n.voidcopy(PsObject object)Copy instance variables by duplication, not by copying a reference.intgetBasedOn()Get flag whether vector field is vertex or element based.intgetDimOfVectors()Get the dimension of vectors, i.e. the number of coordinates of each vector.PgPointSetgetGeometry()If vector field lies on an element set, then this element set is delivered by this method (so the return value might in fact be an PgElementSet).java.awt.ColorgetGlobalVectorColor()Get global vector color which is used if no local colors are available.doublegetGlobalVectorLength()Get length factor of vectors when drawn in display.doublegetGlobalVectorSize()Get thickness in pixels of vectors when drawn in display.intgetNumVectors()Get the number of used vectors.PdVectorgetVector(int anIndex)Returns a reference to one specific vector.java.awt.Color[]getVectorColors()Get array of vector colors.PdVector[]getVectors()Get vertex array for read and write access, but do not modify the size of any vector.PdVector[]getVertices()Get array of base vertices for read access.voidinit()Initializes and resets geometry.booleanisShowingIndividualMaterial()Get flag if this vector field uses its own material properties instead of inheriting material properties of the base geometry.booleanisShowingVectorArrows()Get flag if this vector field shows an arrow at the tip of each vector.booleanisShowingVectorColors()Determine whether showing of individual vector colors is enabled.voidmakeTangent()Projects the vectors into plane of their base elements (element based vector fields), or to the plane orthogonal to the vertex normal (vertex based vector fields, geometry must have vertex normals, otherwise this method simply returns).booleanmerge(PgGeometryIf aField)Merge vector field with current object and store union of both objects in 'this'.voidmultScalar(double scalar)Scale all vectors in the field by a constant factor.voidpaint(PvGeometryIf dc)Major rendering method fills an internal container class supplied by the display.PgGeometryreflect(PdMatrix mat, boolean bOrient, boolean bVector)Generate a cloned geometry and transform vertices by a matrix.booleanremoveVector(int anIndex)voidsetBasedOn(int basedOn)Specifies the number of vectors this instance can hold and alters the interpretation by the viewer (VERTEX_BASED vectors are shown at the vertices, ELEMENT_BASED vectors are shown at the element centers) and possibly other classes.voidsetDimOfVectors(int aDim)Sets the dimension of all vectors.voidsetGeometry(PgPointSet geom)Assign a geometry to serve as the carrier of this vector field.voidsetGlobalVectorColor(java.awt.Color color)Set global vector color to be used if no local colors are available.voidsetGlobalVectorLength(double length)Set length factor of vectors when drawn in display.voidsetGlobalVectorSize(double size)Set thickness in pixels of vectors when drawn in display.voidsetIndex(int ind)Set the index of this vector field.voidsetMaxNumVectors(int aNumVectors)All vector allocation should be done in 'setMaxNumVectors' method should not be called directly, only subclass#setMaxNumVectors() may call it.voidsetNumVectors(int numVectors)Set number of vectors.voidsetTagVector(int anIndex, int aTag)Sets the given tag for a vector.voidsetVector(int anIndex, double x)Sets vector at given index as scalar value, i.e. as 1-dim vector.voidsetVector(int anIndex, double x, double y)Sets vector at given index to the 2-dim vector (x,y).voidsetVector(int anIndex, double x, double y, double z)Sets vector at given index to the 3-dim vector (x,y,z).booleansetVector(int anIndex, PdVector aVector)Copies vector to vector field at specified index.voidsetVectorColors(java.awt.Color[] colorList)Copy vector colors of list to existing array of vector colors.booleansetVectors(PdVector[] aVectorList)Copy all vectors of vector list to an existing array of vectors.voidshowIndividualMaterial(boolean flag)Set flag if this vector field uses its own material properties instead of inheriting material properties of the base geometry.voidshowVectorArrows(boolean flag)Set flag if this vector field shows an arrow at the tip of each vector.voidshowVectorColors(boolean flag)Set flag to enable drawing of individual vector colors.voidsub(PgVectorField field)Subtract vector fields, this = this - field.java.lang.StringtoString()Create a multi-line string representation with detailed information about all instance variables.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jv.project.PgGeometry
addDisplay, addElement, addPolygon, addVertex, applyAmbientMatrix, clearTagElement, clearTagPolygon, clearTagVertex, convertWorldToModel, fillMethodMenu, fillMethodMenu, getAmbientBounds, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getBounds, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getElement, getGeometryInfo, getJvx, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getPolygon, getState, getTextureImage, getTextureImageName, getTitle, getType, getVersion, getVersionType, getVertex, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, hasTagVertex, intersectionWithLine, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, projectFromAmbientSpace, removeDisplay, removeElement, removeMethodMenus, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setDimOfVertices, setElement, setEnabledInstanceSharing, setGeometryInfo, setJvx, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setPolygon, setState, setTagElement, setTagPolygon, setTagVertex, setTextureImage, setTextureImageName, setTitle, setType, setVersion, setVersionType, setVertex, setVisible, showBndBox, showCenter, showName, showTitle
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.project.PgGeometryIf
assureInspector, getInfoPanel, getName, hasTag, setName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Field Detail
-
VERTEX_BASED
public static final int VERTEX_BASED
VectorField is given at vertices.- See Also:
- Constant Field Values
-
ELEMENT_BASED
public static final int ELEMENT_BASED
VectorField is given at element centers.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PgVectorField
public PgVectorField(int aVectorDim)
Constructor of an empty vector field which is VERTEX_BASED on default. The dimension of each vector may differ from the dimension of the underlying geometry.- Parameters:
aVectorDim- uniform number of components of all vectors- See Also:
PgVectorField(int, int)
-
PgVectorField
public PgVectorField(int aVectorDim, int basedOn)Constructor of an empty vector field which is VERTEX_BASED on default.The parameter 'basedOn' must be VERTEX_BASED or ELEMENT_BASED. Specifies the number of vectors this instance can hold and alters the interpretation by the viewer (VERTEX_BASED vectors are shown at the vertices, ELEMENT_BASED vectors are shown at the element centers) and possibly other classes.
The dimension of each vector may differ from the dimension of the underlying geometry.
- Parameters:
aVectorDim- uniform number of components of all vectorsbasedOn- flag determining how to compute the vector base point from geometry- Version:
- 20.11.99, 1.00 created (ep)
-
-
Method Detail
-
init
public void init()
Description copied from class:PgGeometryInitializes and resets geometry.- Overrides:
initin classPgGeometry
-
toString
public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.- Specified by:
toStringin interfacePgGeometryIf- Overrides:
toStringin classPgGeometry
-
clone
public java.lang.Object clone()
Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. The parent relationship is maintained only within this class but not to external classes. In general, all links of the clone to external objects are set tonull.Link to associated point set and element set is set to
null.- Specified by:
clonein interfacePgGeometryIf- Overrides:
clonein classPgGeometry- See Also:
copy(PsObject)- Version:
- 21.10.00, 1.00 created (kp)
-
copy
public void copy(PsObject object)
Copy instance variables by duplication, not by copying a reference.The base surface and base points are kept unchanged, and they must typically be set by hand using setGeometry().
The argument was changed from PgGeometry to PsObject since there were problems in J/Link which preferred to use PsObject#copy(PsObject) instead of PgGeometry#copy(PsObject).
- Overrides:
copyin classPgGeometry- See Also:
PsObject.clone()- Author:
- Eike Preuss
- Version:
- 08.11.02, 1.10 revised (kp) Argument changed to PsObject from PgGeometry.
26.06.00, 1.00 created (ep)
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPgGeometry- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
setGeometry
public void setGeometry(PgPointSet geom)
Assign a geometry to serve as the carrier of this vector field. If the vector field is element based then the geometry must be instance of class PgElementSet, if it is vertex based then the geometry must be instance of class PgPointSet.
You should probably also calladdVectorField(PgVectorField)of the geometry.HACK: Automatically adjust the number of vectors either to the number of vertices or elements of the geometry depending on the value of getBasedOn().
- Version:
- 20.05.01, 2.00 revised (kp) Both setGeometry() methods merged.
No longer adjust dimension of vectors.
20.11.99, 1.10 created (ep) Method setGeometry(PgElementSet).
00.00.98, 1.00 created (kp) Method setGeometry(PgPointSet).
-
getGeometry
public PgPointSet getGeometry()
If vector field lies on an element set, then this element set is delivered by this method (so the return value might in fact be an PgElementSet). Otherwise it returns the base points as a PgPointSet.
-
applyModelingMatrix
public boolean applyModelingMatrix()
Multiply the modeling matrix to all vertices and vectors. The modeling matrix of this geometry is set to the identity matrix.- Overrides:
applyModelingMatrixin classPgGeometry- Returns:
trueif operation was applied successfully.- Since:
- JavaView 2.36
- Version:
- 04.09.02, 1.00 created (kp)
-
getBasedOn
public int getBasedOn()
Get flag whether vector field is vertex or element based.- Returns:
- either VERTEX_BASED or ELEMENT_BASED
-
setBasedOn
public void setBasedOn(int basedOn)
Specifies the number of vectors this instance can hold and alters the interpretation by the viewer (VERTEX_BASED vectors are shown at the vertices, ELEMENT_BASED vectors are shown at the element centers) and possibly other classes.- Parameters:
basedOn- must be VERTEX_BASED or ELEMENT_BASED.- Version:
- 20.11.99, 1.00 created (ep)
-
getGlobalVectorLength
public double getGlobalVectorLength()
Get length factor of vectors when drawn in display.
-
getGlobalVectorSize
public double getGlobalVectorSize()
Get thickness in pixels of vectors when drawn in display.
-
getGlobalVectorColor
public java.awt.Color getGlobalVectorColor()
Get global vector color which is used if no local colors are available.
-
setGlobalVectorLength
public void setGlobalVectorLength(double length)
Set length factor of vectors when drawn in display.
-
setGlobalVectorSize
public void setGlobalVectorSize(double size)
Set thickness in pixels of vectors when drawn in display.
-
setGlobalVectorColor
public void setGlobalVectorColor(java.awt.Color color)
Set global vector color to be used if no local colors are available.
-
getVectors
public PdVector[] getVectors()
Get vertex array for read and write access, but do not modify the size of any vector. Note, that the actual size of the vector array may differ from getNumVectors() for efficiency reasons. Therefore, do not use vector.length but use getNumVectors().
-
setVectors
public boolean setVectors(PdVector[] aVectorList)
Copy all vectors of vector list to an existing array of vectors. Length of argument vector list must be equal or larger than getNumVectors(). All vectors are copied. The dimension of all argument vectors must be equal toPgPointSet.getDimOfVectors()of the geometry.Dimension of vectors of this vector field is adjusted.
- Parameters:
aVectorList- array with new vectors
-
isShowingVectorArrows
public boolean isShowingVectorArrows()
Get flag if this vector field shows an arrow at the tip of each vector.- Returns:
- true if arrows are shown
- Since:
- JavaView 2.49.005
- Version:
- 23.01.03, 1.00 created (kp)
-
showVectorArrows
public void showVectorArrows(boolean flag)
Set flag if this vector field shows an arrow at the tip of each vector.- Parameters:
flag- true if arrows are shown- Since:
- JavaView 2.49.005
- Version:
- 23.01.03, 1.00 created (kp)
-
isShowingIndividualMaterial
public boolean isShowingIndividualMaterial()
Get flag if this vector field uses its own material properties instead of inheriting material properties of the base geometry.- Returns:
- true if individual material of this vector field is used
- Since:
- JavaView 2.49.005
- Version:
- 23.01.03, 1.00 created (kp)
-
showIndividualMaterial
public void showIndividualMaterial(boolean flag)
Set flag if this vector field uses its own material properties instead of inheriting material properties of the base geometry.- Parameters:
flag- true if individual material of this vector field is used- Since:
- JavaView 2.49.005
- Version:
- 07.10.17, 1.10 revised (kp) Update showing of vector arrows.
23.01.03, 1.00 created (kp)
-
isShowingVectorColors
public boolean isShowingVectorColors()
Determine whether showing of individual vector colors is enabled.
-
showVectorColors
public void showVectorColors(boolean flag)
Set flag to enable drawing of individual vector colors.
-
assureVectorColors
public void assureVectorColors()
Ensure that array of colors for each vector exists and its size is equal to number of vectors.- Version:
- 19.07.00, 1.10 revised (kp) Allocate m_maxNumVectors colors instead of m_numVertices.
-
getVectorColors
public java.awt.Color[] getVectorColors()
Get array of vector colors.
-
setVectorColors
public void setVectorColors(java.awt.Color[] colorList)
Copy vector colors of list to existing array of vector colors. Length of argument list must be equal or larger than getNumVertices(). All vertex colors are copied. The dimension of all argument colors must be equal to getDimOfColors() of the geometry.- Parameters:
colorList- array with new vertex colors
-
getVertices
public PdVector[] getVertices()
Get array of base vertices for read access.
-
getDimOfVectors
public int getDimOfVectors()
Get the dimension of vectors, i.e. the number of coordinates of each vector. This number may differ from the dimension of the underlying geometry.
-
setMaxNumVectors
public void setMaxNumVectors(int aNumVectors)
All vector allocation should be done in 'setMaxNumVectors' method should not be called directly, only subclass#setMaxNumVectors() may call it. The user should change the number of vectors via setNumVectors().- Version:
- 22.06.07, 1.20 revised (kp) Method made public to allow better control of allocations.
19.07.00, 1.10 revised (kp) Adjust m_numVectors if smaller than new m_maxNumVectors.
-
getNumVectors
public int getNumVectors()
Get the number of used vectors.
-
setNumVectors
public void setNumVectors(int numVectors)
Set number of vectors. In general, the number should either be equal to the number of base vertices or base elements.- Version:
- 05.08.04, 1.60 revised (kp) No action if same number is requested.
-
setDimOfVectors
public void setDimOfVectors(int aDim)
Sets the dimension of all vectors. Higher entries are simply cut off. Additional entries are set to zero as inPdVector.- See Also:
PdVector.setSize(int)
-
setIndex
public void setIndex(int ind)
Set the index of this vector field. Method is solely used by the paint() method of the associated geometry.
-
paint
public void paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. This method is called by geometry container paint methods when they want this vector field to be displayed.- Specified by:
paintin interfacePgGeometryIf- Overrides:
paintin classPgGeometry- See Also:
PgPointSet.paint(PvGeometryIf)
-
clearTagVector
public void clearTagVector(int anIndex, int aTag)Removes the given tag from a vector.
-
setTagVector
public void setTagVector(int anIndex, int aTag)Sets the given tag for a vector.
-
getVector
public PdVector getVector(int anIndex)
Returns a reference to one specific vector. Nevertheless you should usesetVector(int, PdVector)to change values of vectors.
-
removeVector
public boolean removeVector(int anIndex)
-
setVector
public boolean setVector(int anIndex, PdVector aVector)Copies vector to vector field at specified index.- Parameters:
aVector- vector to be copiedanIndex- index beginning with 0
-
setVector
public void setVector(int anIndex, double x)Sets vector at given index as scalar value, i.e. as 1-dim vector.- Version:
- 21.02.04, 1.00 created (kp)
-
setVector
public void setVector(int anIndex, double x, double y)Sets vector at given index to the 2-dim vector (x,y).
-
setVector
public void setVector(int anIndex, double x, double y, double z)Sets vector at given index to the 3-dim vector (x,y,z).
-
merge
public boolean merge(PgGeometryIf aField)
Merge vector field with current object and store union of both objects in 'this'. Number of vectors is the sum of both objects.- Specified by:
mergein interfacePgGeometryIf- Overrides:
mergein classPgGeometry- Parameters:
aField- Vector field to be merged into 'this'- Returns:
trueif method was successfull- Author:
- Konrad Polthier
- Version:
- 22.07.00, 1.10 revised (kp) Argument changed to class PgGeometryIf.
02.08.98, 1.00 created (kp)
-
blend
public boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two vector fieldsthis = s*a + t*b, e.g. used in interpolation.- Specified by:
blendin interfacePgGeometryIf- Overrides:
blendin classPgGeometry- Parameters:
s- weight of vertices of first geometryag- first geometry used for blendingt- weight of vertices of second geometrybg- second geometry used for blending- Returns:
- true on success
- Author:
- Konrad Polthier
- Version:
- 29.02.04, 2.00 revised (kp) Full revision.
31.12.97, 1.00 created (kp)
-
computeGradient
public boolean computeGradient(PgElementSet domain, PdVector[] image, int coordinate)
Compute vector field as the gradient (of one coordinate) of a map from a domain triangulation to R^n. The image is given as an array of PdVectors, each vector is the image of the vertex of the domain with same index. The parameter coordinate specifies the coordinate of the image the gradient is computed from.As a result the current vector field becomes the element based gradient of the map, tangential to triangles in the domain.
- Parameters:
domain- domain triangulation, may be a curved surfaceimage- the image values of a vector-valued piecewise linear map at the vertices of the domaincoordinate- index of a coordinate component of the image the gradient is computed from- Version:
- 20.03.04, 1.20 revised (kh) Moved body to private method computeGradient(PgElementSet, PdVector, PdVector[], int)
01.03.04, 1.10 created (kh) Created from body of computeGradient(PgElementSet, PgPointSet, int).
25.11.99, 1.00 created (kp)
-
computeGradient
public boolean computeGradient(PgElementSet domain, PdVector image)
Compute vector field as the gradient of a map from a domain triangulation to R. Image is given as a PdVector, each entry of the PdVector is the image of the vertex of the domain with same index.As a result the current vector field becomes the element based gradient of the map, tangential to triangles in the domain.
- Parameters:
domain- domain triangulation, may be a curved surfaceimage- the image values of a scalar-valued piecewise linear map at the vertices of the domain- Version:
- 20.03.04, 1.20 revised (kh) Moved body to private method computeGradient(PgElementSet, PdVector, PdVector[], int)
01.03.04, 1.10 revised (kh) Moved body form computeGradient(PgElementSet, PgPointSet, int).
25.11.99, 1.00 created (kp)
-
makeTangent
public void makeTangent()
Projects the vectors into plane of their base elements (element based vector fields), or to the plane orthogonal to the vertex normal (vertex based vector fields, geometry must have vertex normals, otherwise this method simply returns).
-
reflect
public PgGeometry reflect(PdMatrix mat, boolean bOrient, boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. For example, this method is called to calculate mirror images of a geometry. Orientation of geometry affects surface vectors.- Specified by:
reflectin interfacePgGeometryIf- Overrides:
reflectin classPgGeometry- Parameters:
mat- 3*3 or 4*4 transformation matrixbOrient- flag whether to keep the orientation of the geometrybVector- flag whether to keep the orientation of vectors- Returns:
- new reflected copy of the geometry
- Author:
- Konrad Polthier
- Version:
- 27.05.05, 1.00 created (kp)
-
multScalar
public void multScalar(double scalar)
Scale all vectors in the field by a constant factor.- Author:
- Felix Kaelberer
- Version:
- 19.09.2007, 1.00 created (fk)
-
sub
public void sub(PgVectorField field)
Subtract vector fields, this = this - field.- Since:
- JavaView 3.90
- Version:
- 01.09.09, 1.10 revised (fk) made non-static to be consistent with other add/sub-methods. 12.07.05, 1.00 created (kh)
-
add
public void add(PgVectorField field)
Add a vector field to this.- Since:
- JavaView 3.99
- Version:
- 01.09.09, 1.00 created (fk)
-
-
"