public interface IConstraint extends IPolyline
About Constrained Regions
In plane geometry, a simple non-self-intersecting polygon divides the
plane into two disjoint regions. So a polygon constraint has the feature
that it defines regions. On the other hand, a finite linear constraint
does not exhibit this feature.
When one or more polygon constraints are added to a TIN, Tinfour implements a special behavior in which any ordinary edges falling in the interior of the associated regions are marked as being members of a constrained region. Here, the word "interior" actually means the region of the plane lying to the left of an polygon edge. So for a polygon given as a simple loop of vertices taken in counterclockwise order, the left side of each edge is to the inside of the loop and thus the usage of the word "interior" agrees with the ordinary idea of interior being the region inside the polygon. However, if the polygon were taken in clockwise order, the left side of each edge would be to the outside of the polygon. So the polygon would essentially represent a "hole" in a constrained region.
The edges associated with a constrained region fall into 3 categories:
An interior edge is populated with the constraint-index of the constraint. Because interior edges are unambiguously members of a single constrained region, the index can be used to trace the edge back to its containing constraint instance. It is possible for two adjacent polygons to share common border edges. In such cases, the edge preserves the index of only one of the constraint polygons. Thus the mapping from border edge to constraint is ambiguous.
Tinfour allows non-polygon constraints to be specified with a geometry that lines in the interior of a constrained region polygon. In such cases, the edge-marking operation does not mark the constrained edges from the linear constraints as being members of the polygon. Instead, the operation simply passes over them. A real-world example might include a road (a linear constraint) passing through a forested area (a polygon constraint). Edges derived from a linear constraint maintain the index of the constraint that specified them.
Modifier and Type | Method and Description |
---|---|
boolean |
definesConstrainedRegion()
Indicates whether the constraint applies a constrained region behavior
when added to a TIN.
|
Object |
getApplicationData()
Gets the application data (if any) stored in the constraint.
|
int |
getConstraintIndex()
Gets an index value used for internal bookkeeping by Tinfour code.
|
IQuadEdge |
getConstraintLinkingEdge() |
IConstraint |
getConstraintWithNewGeometry(List<Vertex> geometry)
Gets a new constraint that has the attributes of this constraint
and the specified geometry.
|
IIncrementalTin |
getManagingTin()
Gets the instance of the incremental TIN interface that
is managing this constraint, if any.
|
Path2D |
getPath2D(AffineTransform transform)
Gets a Java Path2D based on the geometry of the constraint mapped through
an optional affine transform.
|
boolean |
isPointInsideConstraint(double x,
double y)
Indicates if a point at the specified coordinates is unambiguously
inside the constraint.
|
void |
setApplicationData(Object object)
Permits an application to add data elements to the constraint for
its own uses.
|
void |
setConstraintIndex(IIncrementalTin tin,
int index)
Sets an index value used for internal bookkeeping by Tinfour code;
not intended for use by application code.
|
void |
setConstraintLinkingEdge(IQuadEdge linkingEdge)
Sets a reference to an arbitrarily selected edge that was produced
when the constraint was added to a TIN.
|
add, complete, getBounds, getLength, getNominalPointSpacing, getVertices, isPolygon, isValid, refactor
forEach, iterator, spliterator
boolean definesConstrainedRegion()
void setApplicationData(Object object)
object
- an object or null according to the needs of the
calling application.Object getApplicationData()
int getConstraintIndex()
IQuadEdge getConstraintLinkingEdge()
IConstraint getConstraintWithNewGeometry(List<Vertex> geometry)
geometry
- a valid set of vertices.void setConstraintIndex(IIncrementalTin tin, int index)
tin
- the IIncrementalTin instance to while this constraint has been
added (or null if not applicable).index
- a positive integer.void setConstraintLinkingEdge(IQuadEdge linkingEdge)
This method is not intended for use by application code. Application code that sets a constraint index runs the risk of damaging the internal data relations maintained by Tinfour.
linkingEdge
- a valid edge referenceIIncrementalTin getManagingTin()
boolean isPointInsideConstraint(double x, double y)
This method will only return true for polygon constraints. For all other constraint implementations, it will return a value of false.
x
- the Cartesian coordinate for the pointy
- the Cartesian coordinate for the pointPath2D getPath2D(AffineTransform transform)
transform
- a valid transform, or the null to use the identity
transform.Copyright © 2021. All rights reserved.