JavaView® v2.00.008

jvx.geom
Class PwBary

java.lang.Object
  |
  +--jvx.geom.PwBary

public class PwBary
extends java.lang.Object

Static methods that handle barycentric coordinates on triangulated element sets.

Version:
26.01.00, 1.04 revised (ep) corrected and changed getTransRepr(-Values).
09.01.00, 1.03 revised (ep) get...Repr-methods extended.
04.01.00, 1.02 revised (ep) getGeodTransRepr corrected.
21.11.99, 1.00 created (ep)
Author:
Eike Preuß

Constructor Summary
PwBary()
           
 
Method Summary
static PdBaryDir[] getGeodRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector localind)
          Calculates the representations of a given vector in all elements of a vertex star by completion to a unnormalized angle of theta/2.
static double getOrientedAngle(PgElementSet geom, int elemInd, PdBaryDir a, PdBaryDir b, boolean recalc)
          Oriented angle between two barycentric vectors.
static PdBaryDir[] getProjRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind)
          Calculates the representations of a given vector in all elements of a vertex star by projection onto the plane the element lays in.
static PdBaryDir[] getTransRepresentation(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind)
          Calculates the representations of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic (half angles).
static double getTransRepresentationValues(PgElementSet geom, int origElem, PdBaryDir origDir, int localvertexindex, PiVector elements, PiVector locind, PdVector betas)
          Calculates the values (beta,theta) of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic.
static double getVertexAngles(PgVertexStar star, PgElementSet geom, PdVector angles)
          Calculates inner angles of the elements of a vertexstar.
static int liesOnVertex(PdBary pos)
          Checks if given barycentric position lies on any vertex
static double norm(PgElementSet geom, int elemInd, PdBaryDir x, boolean forceRecalc)
          Euklidian norm of two intrinsic (barycentric) vectors.
static void projectOntoElement(PgElementSet geom, int elemInd, PdVector dir, PdBaryDir outdir)
          Projects given vector onto elements plane.
static int rotateAtVertex(PgElementSet geom, int elemind, int localvertexind, PdBaryDir dir, PdBaryDir outdir, PdBary bary, double angle)
          Rotates direction at vertex in same orientation as the star.
static void rotateInElement(PgElementSet geom, int elemInd, PdBaryDir dir, double angle, PdBaryDir outdir, boolean recalc)
          Rotates direction in same orientation as the element's.
static double scalar(PgElementSet geom, int elemInd, PdBaryDir x, PdBaryDir y, boolean forceRecalc)
          Computes scalar product of barycentric directions in world coordinates, that means the scalar product of the vectors in euklidian space.
static boolean showsIntoElement(PdBaryDir dir, int vertexindex)
          Checks if given barycentric vector shows into it's element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PwBary

public PwBary()
Method Detail

scalar

public static double scalar(PgElementSet geom,
                            int elemInd,
                            PdBaryDir x,
                            PdBaryDir y,
                            boolean forceRecalc)
Computes scalar product of barycentric directions in world coordinates, that means the scalar product of the vectors in euklidian space. The directions have to live on the same element. If geometry and element index are the same as they were at previous call of scalar and parameter forceRecalc == false then some calculations are skipped.
Parameters:
geom - geometry the barycentric directions live on
elemInd - element the barycentric directions live on
x - one direction
y - other direction
forceRecalc - if true all variables are forced two be recalculated; should only be used if the geometry may not be the same (in world coordinates) as in previous calls
Returns:
scalar product

norm

public static double norm(PgElementSet geom,
                          int elemInd,
                          PdBaryDir x,
                          boolean forceRecalc)
Euklidian norm of two intrinsic (barycentric) vectors.
Parameters:
geom - the geometry the barycentric direction lives on
elemInd - the element the barycentric direction lives on
x - barycentric vector
recalc - used for scalar product
Returns:
sqrt()
See Also:
scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)

getVertexAngles

public static double getVertexAngles(PgVertexStar star,
                                     PgElementSet geom,
                                     PdVector angles)
Calculates inner angles of the elements of a vertexstar. Only for triangulations.
Parameters:
star - the star
geom - the geometry
angles - output: vertex angles of star. if necessary it is resized.
Returns:
sum of the angles

getGeodRepresentation

public static PdBaryDir[] getGeodRepresentation(PgElementSet geom,
                                                int origElem,
                                                PdBaryDir origDir,
                                                int localvertexindex,
                                                PiVector elements,
                                                PiVector localind)
Calculates the representations of a given vector in all elements of a vertex star by completion to a unnormalized angle of theta/2. Element set must be triangulated.
Parameters:
geom - triangulation
origElem - element in which the vector is given
origDir - vector that will be translated to the other elements
localvertexindex - local index in origElem of the vertex at which the vector is given
elements - output: global element indices of the vertex star
localind - output: local vertex indices of common vertex in elements at vertex star
Returns:
array of the calculated directions at success, null else

getTransRepresentation

public static PdBaryDir[] getTransRepresentation(PgElementSet geom,
                                                 int origElem,
                                                 PdBaryDir origDir,
                                                 int localvertexindex,
                                                 PiVector elements,
                                                 PiVector locind)
Calculates the representations of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic (half angles). Element set must be triangulated.
Parameters:
geom - triangulation
origElem - element in which the vector is given
origDir - vector that will be translated to the other elements
localvertexindex - the local index in origElem of the vertex in which the vector is given
elements - output: global element indices of the vertex star
locind - output: local vertex indices of the vertex star
Returns:
array of the calculated directions at success, null else

getTransRepresentationValues

public static double getTransRepresentationValues(PgElementSet geom,
                                                  int origElem,
                                                  PdBaryDir origDir,
                                                  int localvertexindex,
                                                  PiVector elements,
                                                  PiVector locind,
                                                  PdVector betas)
Calculates the values (beta,theta) of a given vector in all elements of a vertex star by parallel translation along a straightest geodesic. Rotate counter-clockwise next edge by angleOfEvaluationPointToEdge - 2*PI/theta*(beta+angle), where angle is the angle between evaluation position and edge. Element set must be triangulated.
Parameters:
geom - set of elements
origElem - element in which the vector is given
origDir - vector that will be translated to the other elements
localvertexindex - the local index in origElem of the vertex in which the vector is given
elements - output: global element indices of the vertex star, beginning with origElem
locind - output: local indices of common vertex of star, beginning with localvertexindex
betas - output: beta values
Returns:
theta

getProjRepresentation

public static PdBaryDir[] getProjRepresentation(PgElementSet geom,
                                                int origElem,
                                                PdBaryDir origDir,
                                                int localvertexindex,
                                                PiVector elements,
                                                PiVector locind)
Calculates the representations of a given vector in all elements of a vertex star by projection onto the plane the element lays in. Element set must be triangulated.
Parameters:
geom - set of elements
origElem - element on which the vector is given
origDir - vector that will be translated to the other elements
localvertexindex - the local index in origElem of the vertex in which the vector is given
elements - output: global element indicee of the vertex star
locind - output: local vertex indices of the vertex star
Returns:
array of the calculated directions at success, null else

projectOntoElement

public static void projectOntoElement(PgElementSet geom,
                                      int elemInd,
                                      PdVector dir,
                                      PdBaryDir outdir)
Projects given vector onto elements plane.
Parameters:
geom - underlying geometry
elemInd - global element index
dir - in world coordinates
outdir - output: barycentric coordinates of the projected vector

getOrientedAngle

public static double getOrientedAngle(PgElementSet geom,
                                      int elemInd,
                                      PdBaryDir a,
                                      PdBaryDir b,
                                      boolean recalc)
Oriented angle between two barycentric vectors.
Parameters:
geom - underlying geometry
elemInd - global element index
a - first vector
b - second vector
recalc - used for scalar product
Returns:
oriented angle out of [-PI, PI]; negative if a must be rotated against the orientation of the triangle; -3*PI if an error occurred
See Also:
scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)

rotateInElement

public static void rotateInElement(PgElementSet geom,
                                   int elemInd,
                                   PdBaryDir dir,
                                   double angle,
                                   PdBaryDir outdir,
                                   boolean recalc)
Rotates direction in same orientation as the element's.
Parameters:
geom - underlying geometry
elemInd - element on that vector lies
dir - barycentric direction
angle - rad
outdir - output: result of rotation
recalc - used for scalar product
See Also:
scalar(jv.geom.PgElementSet, int, jv.vecmath.PdBaryDir, jv.vecmath.PdBaryDir, boolean)

rotateAtVertex

public static int rotateAtVertex(PgElementSet geom,
                                 int elemind,
                                 int localvertexind,
                                 PdBaryDir dir,
                                 PdBaryDir outdir,
                                 PdBary bary,
                                 double angle)
Rotates direction at vertex in same orientation as the star. An angle of 2*Pi means a complete turn around the star.
Parameters:
geom - underlying geometry
elemind - global element index
localvertexind - local index of vertex that is base of the rotation
dir - original vector
outdir - output: result of rotation
bary - output: barycentric coordinates of the base point of the result
angle - normalized angle [0;2*PI] ^= 360°
Returns:
global element index where outdir lies on

showsIntoElement

public static boolean showsIntoElement(PdBaryDir dir,
                                       int vertexindex)
Checks if given barycentric vector shows into it's element.
Parameters:
dir - barycentric vector that shall be checked
vertexindex - local vertex index that is the base of the direction
Returns:
true if barycentric vector shows into it's element

liesOnVertex

public static int liesOnVertex(PdBary pos)
Checks if given barycentric position lies on any vertex
Parameters:
pos - barycentric point
Returns:
localvertexindex if pos lays in jv.vecmath.PuMath.EPS-sphere around any vertex;
-1 else

JavaView® v2.00.008

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