public class LinearConstraint extends PolyLineConstraintAdapter implements IConstraint
Do not use this class for closed polygons.
applicationData, constraintIndex, constraintLinkingEdge, isComplete, length, list, maintainingTin| Constructor and Description |
|---|
LinearConstraint()
The standard constructor
|
LinearConstraint(List<Vertex> vList)
Constructs a constraint with the specified vertices.
|
LinearConstraint(Vertex v0,
Vertex v1)
A convience constructor intended for the frequently occurring case
in which an application wishes to define a constraint as a single
line segment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Called to indicate that the feature is complete and that
no further vertices will be added to it.
|
boolean |
definesConstrainedRegion()
Indicates whether the constraint defines a data area.
|
LinearConstraint |
getConstraintWithNewGeometry(List<Vertex> geometry)
Gets a new constraint that has the attributes of this constraint
and the specified geometry.
|
double |
getNominalPointSpacing()
Get the average distance between points for the feature.
|
Path2D |
getPath2D(AffineTransform transform)
Gets a Java Path2D based on the geometry of the constraint mapped through
an optional affine transform.
|
boolean |
isPolygon()
Indicates whether the instance represents a polygon.
|
boolean |
isValid()
Indicates that sufficient information has been stored in
the polyline to establish a valid geometry.
|
LinearConstraint |
refactor(Iterable<Vertex> geometry)
Creates a new polyline feature with the specified geometry
and transfers any data elements defined by the implementing class
from the current object to the newly created one.
|
add, getApplicationData, getBounds, getConstraintIndex, getConstraintLinkingEdge, getLength, getManagingTin, getVertices, isPointInsideConstraint, iterator, setApplicationData, setConstraintIndex, setConstraintLinkingEdgeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetApplicationData, getConstraintIndex, getConstraintLinkingEdge, getManagingTin, isPointInsideConstraint, setApplicationData, setConstraintIndex, setConstraintLinkingEdgeadd, getBounds, getLength, getVerticesforEach, iterator, spliteratorpublic LinearConstraint()
public LinearConstraint(Vertex v0, Vertex v1)
v0 - the initial vertex of the edgev1 - the final vertex of the edgepublic final void complete()
IPolylineMultiple calls to complete are benign and will be ignored. If vertices are added after complete is called, the behavior is undefined.
public boolean isPolygon()
IPolylinepublic boolean definesConstrainedRegion()
definesConstrainedRegion in interface IConstraintpublic double getNominalPointSpacing()
IPolylinegetNominalPointSpacing in interface IPolylinepublic LinearConstraint getConstraintWithNewGeometry(List<Vertex> geometry)
IConstraintgetConstraintWithNewGeometry in interface IConstraintgeometry - a valid set of vertices.public LinearConstraint refactor(Iterable<Vertex> geometry)
IPolylineThis method is intended to be used in cases where application code performs some kind of transformation on the geometry of the existing object and produces a new object. In doing so, the application code treats the existing object on a read-only basis, but is free to transfer any implementation-specific data from the old object to the new. Examples of possible transformations include an implementation of a point-reduction technique such as Visvalingam's algorithm or point-addition techniques such as curve smoothing.
public boolean isValid()
IPolylinepublic Path2D getPath2D(AffineTransform transform)
getPath2D in interface IConstrainttransform - a valid transform, or the null to use the identity
transform.Copyright © 2021. All rights reserved.