public class PnStraightestGeodesic
extends java.lang.Object
setGeometry
is called, or only when needed.
Example:
exp = new PnStraightestGeodesic(geom); exp.eval(inPoint, inDir, outPoint, outDir, outPoly); // turn around and go back outDir.multScalar(-1); exp.eval(outPoint, outDir, revOutPoint, revOutDir);Now
inPoint
represents the same point as revOutPoint
.
Point being: If the geometry boundary is reached, outDir
is scaled down
to preserve this invariant. In this case, inDir and revOutDir may represent vectors of
different length.
inPoint
and revOutPoint
are not necessarily
on the same triangle (see below), but outPoly.getVertexBary(0)
and
revOutPoint
are.
Of course, outPoint
is the last point of outPoly
.
Barycentric coordinates are used to represent points and vectors. The geometry must be triangulated.
Modifier and Type | Field and Description |
---|---|
static double |
BARYEPS
Default accuracy used at checks for zero in barycentric coordinates (used e.g. in exp(...)).
|
double |
m_eps
This accuracy is actually used for zero-checks in barycentric coordinates (used e.g. in exp(...)).
|
Constructor and Description |
---|
PnStraightestGeodesic(PgElementSet geometry)
Creates a new instance of PnStraightestGeodesic.
|
PnStraightestGeodesic(PgElementSet geometry,
boolean precompute)
Creates a new instance of PnStraightestGeodesic.
|
Modifier and Type | Method and Description |
---|---|
int |
eval(PdBary basePoint,
PdBaryDir dir,
PdBary outPoint)
Evaluates the exponential map.
|
int |
eval(PdBary basePoint,
PdBaryDir dir,
PdBary outPoint,
PdBaryDir outDir)
Evaluates the exponential map.
|
int |
eval(PdBary base,
PdBaryDir dir,
PdBary outPoint,
PdBaryDir outDir,
PgPolygonOnElementSet outPoly)
Evaluates the exponential map.
|
int |
eval(PdBary basePoint,
PdBaryDir dir,
PgPolygonOnElementSet outPoly)
Evaluates the exponential map.
|
int |
eval(PdBary basePoint,
PdBaryDir dir,
PgPolygonOnElementSet outPoly,
PdBaryDir outDir)
Evaluates the exponential map.
|
double |
getAccuracy()
Returns the accuracy used when testing barycentric coordinates for zero.
|
PgElementSet |
getGeometry()
Returns the underlying geometry.
|
boolean |
isSavingMatrices()
Returns whether the linear transformations that rotate from one element into its
neighbor are saved in an array.
|
void |
setAccuracy(double accuracy)
Sets the accuracy used when testing a barycentric coordinate for zero.
|
void |
setGeometry(PgElementSet geom)
Sets the underlying geometry.
|
void |
setSavingMatrices(boolean bStoreMatrices)
Sets if the edge transformations should be stored for later use.
|
public static double BARYEPS
public double m_eps
public PnStraightestGeodesic(PgElementSet geometry)
geometry
- The underlying geometry.public PnStraightestGeodesic(PgElementSet geometry, boolean precompute)
geometry
- The underlying geometry.precompute
- Compute the 3x3-matrices that represent the rotations
around edges of adjacent elements. For every edge, 2 matrices are computed.public int eval(PdBary basePoint, PdBaryDir dir, PdBary outPoint)
basePoint
- The point defining the tangent space.dir
- The input vector in tangent space at which the exponential map is evaluated.outPoint
- The output point.public int eval(PdBary basePoint, PdBaryDir dir, PdBary outPoint, PdBaryDir outDir)
basePoint
- The point defining the tangent space.dir
- The input vector in tangent space at which the exponential map is evaluated.outPoint
- The output point.outDir
- Parallel translation of dir.public int eval(PdBary basePoint, PdBaryDir dir, PgPolygonOnElementSet outPoly, PdBaryDir outDir)
basePoint
- The point defining the tangent space.dir
- The input vector in tangent space at which the exponential map is evaluated.outDir
- Parallel translation of dir.outPoly
- Output geodesic.public int eval(PdBary basePoint, PdBaryDir dir, PgPolygonOnElementSet outPoly)
basePoint
- The point defining the tangent space.dir
- The input vector in tangent space at which the exponential map is evaluated.outPoly
- Output geodesic.public int eval(PdBary base, PdBaryDir dir, PdBary outPoint, PdBaryDir outDir, PgPolygonOnElementSet outPoly)
base
is the first point of the outPoly.
However, in the special case where base
is on an edge or a vertex,
and dir
doesn't
point at base
's element, base
won't be included in the output, but only the
representation in a triangle dir
points at.base
- The point defining the tangent space.dir
- The input vector in tangent space at which the exponential map is evaluated.outPoint
- The output point, may be null.outDir
- Parallel translation of dir, may be null.outPoly
- Output geodesic, may be null.public void setGeometry(PgElementSet geom)
geom
- The new underlying geometry. Must be triangulated.public PgElementSet getGeometry()
public double getAccuracy()
public void setAccuracy(double accuracy)
Math.abs(b)<m_accuracy
accuracy
- Accuracy to be used.public boolean isSavingMatrices()
public void setSavingMatrices(boolean bStoreMatrices)
bStoreMatrices
- matrices are stored."