Package org.tinfour.utils
Class TriangleCollector
- java.lang.Object
-
- org.tinfour.utils.TriangleCollector
-
public final class TriangleCollector extends Object
Provides a utility for collecting triangles from a TIN.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidvisitSimpleTriangles(IIncrementalTin tin, Consumer<SimpleTriangle> consumer)Identify all valid triangles in the specified TIN and provide them to the application-supplied Consumer.static voidvisitTriangles(IIncrementalTin tin, Consumer<Vertex[]> consumer)Identify all valid triangles in the specified TIN and provide them to the application-supplied Consumer.static voidvisitTrianglesConstrained(IIncrementalTin tin, Consumer<Vertex[]> consumer)Traverses the TIN, visiting all triangles that are members of a constrained region.static voidvisitTrianglesForConstrainedRegion(IConstraint constraint, Consumer<Vertex[]> consumer)Traverses the interior of a constrained region, visiting the triangles in its interior.
-
-
-
Method Detail
-
visitTrianglesConstrained
public static void visitTrianglesConstrained(IIncrementalTin tin, Consumer<Vertex[]> consumer)
Traverses the TIN, visiting all triangles that are members of a constrained region. As triangles are identified, this method calls the accept method of a consumer. If the TIN has not been bootstrapped, this routine exits without further processing.All triangles produced by this method are valid (non-ghost) triangles with valid, non-null vertices.
Note: If no region-based constraints have been added to the Delaunay triangulation, then none of the triangles in the TIN are treated as being constrained. This method will exit without further processing.
- Parameters:
tin- a valid instanceconsumer- an application-specific consumer.
-
visitTrianglesForConstrainedRegion
public static void visitTrianglesForConstrainedRegion(IConstraint constraint, Consumer<Vertex[]> consumer)
Traverses the interior of a constrained region, visiting the triangles in its interior. As triangles are identified, this method calls the accept method of a consumer.- Parameters:
constraint- a valid instance defining a constrained region that has been added to a TIN.consumer- an application-specific consumer.
-
visitTriangles
public static void visitTriangles(IIncrementalTin tin, Consumer<Vertex[]> consumer)
Identify all valid triangles in the specified TIN and provide them to the application-supplied Consumer. Triangles are provided as an array of three vertices given in clockwise order. If the TIN has not been bootstrapped, this routine exits without further processing. This routine will not call the accept method for "ghost" triangles (those triangles that include the ghost vertex).- Parameters:
tin- a valid TINconsumer- a valid consumer.
-
visitSimpleTriangles
public static void visitSimpleTriangles(IIncrementalTin tin, Consumer<SimpleTriangle> consumer)
Identify all valid triangles in the specified TIN and provide them to the application-supplied Consumer. Triangles are provided as instances of the SimpleTriangle class. If the TIN has not been bootstrapped, this routine exits without further processing. This routine will not call the accept method for "ghost" triangles (those triangles that include the ghost vertex).- Parameters:
tin- a valid TINconsumer- a valid consumer.
-
-