visad
Class DelaunayCustom
- java.lang.Object
-
- visad.Delaunay
-
- visad.DelaunayCustom
-
- All Implemented Interfaces:
- java.io.Serializable
public class DelaunayCustom extends Delaunay
DelaunayCustom is a set of constructors to create an instance of Delaunay by passing in a pre-computed triangulation. DelaunayCustom is useful for creating instances of Delaunay that can be passed into IrregularSet. If you want to perform consistency checks on your triangulation, call Delaunay.test() on your DelaunayCustom object after it is constructed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DelaunayCustom(float[][] samples, int[][] tri)construct a Delaunay from point locations and a list of triangles; call finish_triang() to fill in helper arrays (vertices, walk and edges); copy argumentsDelaunayCustom(float[][] samples, int[][] tri, int[][] vertices, int[][] walk, int[][] edges, int num_edges)construct a Delaunay from point locations, a list of triangles, and helper arrays (vertices, walk and edges); copy argumentsDelaunayCustom(float[][] samples, int[][] tri, int[][] vertices, int[][] walk, int[][] edges, int num_edges, boolean copy)construct a Delaunay from point locations, a list of triangles, and helper arrays (vertices, walk and edges); copy arguments
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static booleancheckAndFixSelfIntersection(float[][] samples)determine if a closed path self-intersects, and remove consecutive identical pointsstatic booleancheckSelfIntersection(float[][] samples)determine if a closed path self-intersectsstatic booleancheckSelfIntersection(Gridded2DSet set)determine if a closed path self-intersectsstatic voidclip(float[][] samples, int[][] tris, float xc, float yc, float v, float[][][] outs, int[][][] outt)clip the topology (samples, tris) against the half-plane xc * x + yc * y <= v and return the clipped topologystatic floatcomputeArea(float[][] samples)compute the area inside a set of closed pathsstatic floatcomputeArea(Gridded2DSet set)compute the area inside a set of closed pathsstatic floatcomputeArea(UnionSet set)compute the area inside a set of closed pathsstatic int[][]fill(float[][] samples)check that samples describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples; the trick is that the region may not be convex, but the triangles must all lie inside the regionstatic Irregular2DSetfill(Gridded2DSet set)check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSetstatic Irregular2DSetfill(UnionSet set)check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSetstatic int[][]fillCheck(float[][] samples, boolean check)check that samples describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples; the trick is that the region may not be convex, but the triangles must all lie inside the regionstatic Irregular2DSetfillCheck(Gridded2DSet set, boolean check)check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSetstatic Irregular2DSetfillCheck(UnionSet set, boolean check)check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSetstatic booleaninside(float[][] s, float x, float y)determine if a point is inside a closed pathstatic float[][]link(float[][][] ss)link multiple paths into a single path; this assumes that the paths in ss don't intersect each other but does test for self-intersection by each path-
Methods inherited from class visad.Delaunay
clone, factory, finish_triang, getNonConvex, improve, perturb, sampleString, scale, setNonConvex, test, test, toString
-
-
-
-
Constructor Detail
-
DelaunayCustom
public DelaunayCustom(float[][] samples, int[][] tri) throws VisADExceptionconstruct a Delaunay from point locations and a list of triangles; call finish_triang() to fill in helper arrays (vertices, walk and edges); copy arguments- Parameters:
samples- locations of points for topology - dimensioned float[dimension][number_of_points]tri- list of triangles - dimensioned int[ntris][dim + 1] tris values are indices into second index of samples- Throws:
VisADException- a VisAD error occurred
-
DelaunayCustom
public DelaunayCustom(float[][] samples, int[][] tri, int[][] vertices, int[][] walk, int[][] edges, int num_edges) throws VisADExceptionconstruct a Delaunay from point locations, a list of triangles, and helper arrays (vertices, walk and edges); copy arguments- Parameters:
samples- locations of points for topology - dimensioned float[dimension][number_of_points]tri- list of triangles - dimensioned int[ntris][dim + 1] tris values are indices into second index of samplesvertices- links from vertices to triangles/tetrahedra - dimensioned int[number_of_points][nverts[i]]walk- links from triangles/tetrahedra to neighboring triangles/tetrahedra - dimensioned int[ntris][dim + 1]edges- links from tri/tetra edges to global edge numbers - dimensioned int[ntris][3 * (dim - 1)]num_edges- number of global edges- Throws:
VisADException- a VisAD error occurred
-
DelaunayCustom
public DelaunayCustom(float[][] samples, int[][] tri, int[][] vertices, int[][] walk, int[][] edges, int num_edges, boolean copy) throws VisADExceptionconstruct a Delaunay from point locations, a list of triangles, and helper arrays (vertices, walk and edges); copy arguments- Parameters:
samples- locations of points for topology - dimensioned float[dimension][number_of_points]tri- list of triangles - dimensioned int[ntris][dim + 1] tris values are indices into second index of samplesvertices- links from vertices to triangles/tetrahedra - dimensioned int[number_of_points][nverts[i]]walk- links from triangles/tetrahedra to neighboring triangles/tetrahedra - dimensioned int[ntris][dim + 1]edges- links from tri/tetra edges to global edge numbers - dimensioned int[ntris][3 * (dim - 1)]num_edges- number of global edgescopy- flag indicating whether to copy arrays- Throws:
VisADException- a VisAD error occurred
-
-
Method Detail
-
checkSelfIntersection
public static boolean checkSelfIntersection(Gridded2DSet set) throws VisADException
determine if a closed path self-intersects- Parameters:
set- Gridded2DSet with manifold dimension = 1- Returns:
- true if closed path in set self-intersects
- Throws:
VisADException- a VisAD error occurred
-
checkSelfIntersection
public static boolean checkSelfIntersection(float[][] samples) throws VisADExceptiondetermine if a closed path self-intersects- Parameters:
samples- locations of points on closed path - dimensioned float[2][number_of_points]- Returns:
- true if closed path in samples self-intersects
- Throws:
VisADException- a VisAD error occurred
-
checkAndFixSelfIntersection
public static boolean checkAndFixSelfIntersection(float[][] samples) throws VisADExceptiondetermine if a closed path self-intersects, and remove consecutive identical points- Parameters:
samples- locations of points on closed path - dimensioned float[2][number_of_points] - may be modified on return- Returns:
- true if closed path in samples self-intersects
- Throws:
VisADException- a VisAD error occurred
-
computeArea
public static float computeArea(UnionSet set) throws VisADException
compute the area inside a set of closed paths- Parameters:
set- UnionSet of Gridded2DSets with manifold dimension = 1, interpreted as a set of closed paths- Returns:
- sum of areas inside closed paths
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
computeArea
public static float computeArea(Gridded2DSet set) throws VisADException
compute the area inside a set of closed paths- Parameters:
set- Gridded2DSet with manifold dimension = 1, interpreted as a closed path- Returns:
- area inside closed path
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
computeArea
public static float computeArea(float[][] samples) throws VisADExceptioncompute the area inside a set of closed paths- Parameters:
samples- locations of points on closed path - dimensioned float[2][number_of_points]- Returns:
- area inside closed path
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fill
public static Irregular2DSet fill(Gridded2DSet set) throws VisADException
check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSet- Parameters:
set- Gridded2DSet with manifold dimension = 1, interpreted as a closed path boundary- Returns:
- Irregular2DSet whose triangles form the interior of the region enclosed by set
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fillCheck
public static Irregular2DSet fillCheck(Gridded2DSet set, boolean check) throws VisADException
check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSet- Parameters:
set- Gridded2DSet with manifold dimension = 1, interpreted as a closed path boundarycheck- if true then throw a VisADException if path self- intersects, else just return null- Returns:
- Irregular2DSet whose triangles form the interior of the region enclosed by set
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fill
public static int[][] fill(float[][] samples) throws VisADExceptioncheck that samples describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples; the trick is that the region may not be convex, but the triangles must all lie inside the region- Parameters:
samples- locations of points on closed path - dimensioned float[2][number_of_points]- Returns:
- triangles that form the interior of the region enclosed by samples - dimensioned int[ntris][dim + 1]
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fillCheck
public static int[][] fillCheck(float[][] samples, boolean check) throws VisADExceptioncheck that samples describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples; the trick is that the region may not be convex, but the triangles must all lie inside the region- Parameters:
samples- locations of points on closed path - dimensioned float[2][number_of_points]check- if true then throw a VisADException if path self- intersects, else just return null- Returns:
- triangles that form the interior of the region enclosed by samples - dimensioned int[ntris][dim + 1]
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fill
public static Irregular2DSet fill(UnionSet set) throws VisADException
check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSet- Parameters:
set- UnionSet of Gridded2DSets with manifold dimension = 1, interpreted as a set of closed paths- Returns:
- Irregular2DSet whose triangles form the interior of the region enclosed by set
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
fillCheck
public static Irregular2DSet fillCheck(UnionSet set, boolean check) throws VisADException
check that set describes the boundary of a simply connected plane region; return a decomposition of that region into triangles whose vertices are all boundary points from samples, as an Irregular2DSet- Parameters:
set- UnionSet of Gridded2DSets with manifold dimension = 1, interpreted as a set of closed pathscheck- if true then throw a VisADException if path self- intersects, else just return null- Returns:
- Irregular2DSet whose triangles form the interior of the region enclosed by set
- Throws:
VisADException- path self intersects or a VisAD error occurred
-
link
public static float[][] link(float[][][] ss) throws VisADExceptionlink multiple paths into a single path; this assumes that the paths in ss don't intersect each other but does test for self-intersection by each path- Parameters:
ss- a set of paths - dimensioned float[number_of_paths][2][number_of_points_for_path]- Returns:
- a path dimensioned float [2][number_of_points]
- Throws:
VisADException- a path self intersects or a VisAD error occurred
-
inside
public static boolean inside(float[][] s, float x, float y) throws VisADExceptiondetermine if a point is inside a closed path- Parameters:
s- locations of points on closed path - dimensioned float[2][number_of_points]x- first coordinate of pointy- second coordinate of point- Returns:
- true if point (x, y) is inside the path s
- Throws:
VisADException- a VisAD error occurred
-
clip
public static void clip(float[][] samples, int[][] tris, float xc, float yc, float v, float[][][] outs, int[][][] outt) throws VisADExceptionclip the topology (samples, tris) against the half-plane xc * x + yc * y <= v and return the clipped topology- Parameters:
samples- locations of points for topology - dimensioned float[dimension][number_of_points]tris- list of triangles - dimensioned int[ntris][dim + 1] tris values are indices into second index of samplesxc- x coefficient in half-plane inequalityyc- y coefficient in half-plane inequalityv- constant in half-plane inequalityouts- array dimensioned float[1][][] to take samples of clipped topology - on output dimensioned float[1][2][number_of_output_samples]outt- array dimensioned int[1][][] to take tris of clipped topology - on output dimensioned int[1][number_of_output_triangles][3]- Throws:
VisADException- a VisAD error occurred
-
-
DMelt 3.0 © DataMelt by jWork.ORG