public abstract class Segment extends Geometry implements Serializable
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
Constructor and Description |
---|
Segment()
Creates a segment with start and end points (0,0).
|
Modifier and Type | Method and Description |
---|---|
protected void |
_assignVertexDescriptionImpl(VertexDescription newDescription) |
double |
calculateArea2D()
Calculates the area of the geometry.
|
void |
copyTo(Geometry dst)
Copies this geometry to another geometry of the same type.
|
abstract Segment |
cut(double t1,
double t2)
Returns subsegment between parameters t1 and t2.
|
double |
distance(Segment otherSegment,
boolean bSegmentsKnownDisjoint) |
abstract double |
getAttributeAsDbl(double t,
int semantics,
int ordinate)
Returns the attribute on the segment for the given parameter value.
|
Geometry |
getBoundary()
Returns boundary of this geometry.
|
abstract double |
getClosestCoordinate(Point2D inputPoint,
boolean bExtrapolate)
Finds a closest coordinate on this segment.
|
Point2D |
getCoord2D(double t)
Returns the coordinate of the point on this segment for the given
parameter value.
|
abstract void |
getCoord2D(double t,
Point2D dst)
Returns the coordinate of the point on this segment for the given
parameter value (segments are parametric curves).
|
int |
getDimension()
Returns the topological dimension of the geometry object based on the
geometry's type.
|
double |
getEndAttributeAsDbl(int semantics,
int ordinate)
Returns value of the end vertex attribute's ordinate.
|
int |
getEndAttributeAsInt(int semantics,
int ordinate)
Returns the value of the end vertex attribute's ordinate.
|
double |
getEndX()
Returns the X coordinate of ending point.
|
Point2D |
getEndXY()
Returns XY coordinates of the end point.
|
void |
getEndXY(Point2D pt) |
Point3D |
getEndXYZ()
Returns XYZ coordinates of the end point.
|
double |
getEndY()
Returns the Y coordinate of ending point.
|
double |
getStartAttributeAsDbl(int semantics,
int ordinate)
Returns value of the start vertex attribute's ordinate.
|
int |
getStartAttributeAsInt(int semantics,
int ordinate)
Returns the value of the start vertex attribute's ordinate.
|
double |
getStartX()
Returns the X coordinate of starting point.
|
Point2D |
getStartXY()
Returns XY coordinates of the start point.
|
void |
getStartXY(Point2D pt) |
Point3D |
getStartXYZ()
Returns XYZ coordinates of the start point.
|
double |
getStartY()
Returns the Y coordinate of starting point.
|
abstract int |
intersectionWithAxis2D(boolean bAxisX,
double ordinate,
double[] resultOrdinates,
double[] parameters)
Calculates intersection points of this segment with an infinite line,
parallel to one of the axes.
|
boolean |
isEmpty()
IsEmpty returns TRUE when the Geometry object does not contain geometric
information beyond its original initialization state.
|
boolean |
isEmptyImpl()
Non public abstract version of the function.
|
boolean |
isIntersecting(Point2D pt,
double tolerance)
Returns TRUE if the point and segment intersect (not disjoint) for the
given tolerance.
|
boolean |
isIntersecting(Segment other,
double tolerance)
Returns TRUE if this segment intersects with the other segment with the
given tolerance.
|
void |
queryEnd(Point dstPoint)
Returns coordinates of the end point in this segment.
|
Envelope1D |
queryInterval(int semantics,
int ordinate)
Returns the min and max attribute values at the ordinate of the Geometry.
|
void |
queryStart(Point dstPoint)
Returns coordinates of the start point in a Point class.
|
void |
setEmpty()
Returns the geometry to its original initialization state by releasing
all data referenced by the geometry.
|
void |
setEnd(Point srcPoint)
Sets the coordinates of the end point in a Point class.
|
void |
setEndAttribute(int semantics,
int ordinate,
double value)
Sets the value of end vertex attribute.
|
void |
setEndAttribute(int semantics,
int ordinate,
int value) |
void |
setEndXY(double x,
double y) |
void |
setEndXY(Point2D pt)
Sets the XY coordinates of the end point.
|
void |
setEndXYZ(double x,
double y,
double z) |
void |
setEndXYZ(Point3D pt)
Sets the XYZ coordinates of the end point.
|
void |
setStart(Point srcPoint)
Sets the coordinates of the start point in this segment.
|
void |
setStartAttribute(int semantics,
int ordinate,
double value)
Sets the value of the start vertex attribute.
|
void |
setStartAttribute(int semantics,
int ordinate,
int value) |
void |
setStartXY(double x,
double y) |
void |
setStartXY(Point2D pt)
Sets the XY coordinates of the start point.
|
void |
setStartXYZ(double x,
double y,
double z) |
void |
setStartXYZ(Point3D pt)
Sets the XYZ coordinates of the start point.
|
_getImpl, addAttribute, addID, addM, applyTransformation, assignVertexDescription, calculateLength2D, copy, createInstance, dropAllAttributes, dropAttribute, estimateMemorySize, estimateMemorySize, getDescription, getDimensionFromType, getStateFlag, getType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, queryEnvelope, queryEnvelope2D, queryLooseEnvelope2D, replaceNaNs, toString, vertex_count
public Point2D getStartXY()
public void getStartXY(Point2D pt)
public void setStartXY(Point2D pt)
public void setStartXY(double x, double y)
public Point3D getStartXYZ()
public void setStartXYZ(Point3D pt)
public void setStartXYZ(double x, double y, double z)
public void queryStart(Point dstPoint)
public void setStart(Point srcPoint)
srcPoint
- The new start point of this segment.public double getStartAttributeAsDbl(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.public int getStartAttributeAsInt(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.public void setStartAttribute(int semantics, int ordinate, double value)
semantics
- The attribute semantics.value
- is the array to write values to. The attribute type and the
number of elements must match the persistence type, as well as
the number of components of the attribute.public void setStartAttribute(int semantics, int ordinate, int value)
public double getStartX()
public double getStartY()
public double getEndX()
public double getEndY()
public Point2D getEndXY()
public void getEndXY(Point2D pt)
public void setEndXY(Point2D pt)
pt
- The end point of the segment.public void setEndXY(double x, double y)
public Point3D getEndXYZ()
public void setEndXYZ(Point3D pt)
public void setEndXYZ(double x, double y, double z)
public void queryEnd(Point dstPoint)
dstPoint
- The end point of this segment.public void setEnd(Point srcPoint)
srcPoint
- The new end point of this segment.public double getEndAttributeAsDbl(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.public int getEndAttributeAsInt(int semantics, int ordinate)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.public void setEndAttribute(int semantics, int ordinate, double value)
semantics
- The attribute semantics.ordinate
- The attribute's ordinate.value
- Is the array to write values to. The attribute type and the
number of elements must match the persistence type, as well as
the number of components of the attribute.public void setEndAttribute(int semantics, int ordinate, int value)
public final int getDimension()
Geometry
Returns 0 for point and multipoint.
Returns 1 for lines and polylines.
Returns 2 for polygons and envelopes
Returns 3 for objects with volume
getDimension
in class Geometry
public final boolean isEmpty()
Geometry
public final void setEmpty()
Geometry
public double calculateArea2D()
Geometry
calculateArea2D
in class Geometry
public boolean isIntersecting(Segment other, double tolerance)
public boolean isIntersecting(Point2D pt, double tolerance)
public boolean isEmptyImpl()
protected void _assignVertexDescriptionImpl(VertexDescription newDescription)
_assignVertexDescriptionImpl
in class Geometry
public void copyTo(Geometry dst)
Geometry
public Envelope1D queryInterval(int semantics, int ordinate)
Geometry
queryInterval
in class Geometry
semantics
- The semantics of the interval.ordinate
- The ordinate of the interval.public Point2D getCoord2D(double t)
public abstract void getCoord2D(double t, Point2D dst)
t
- the parameter coordinate along the segment from 0.0 to 1.0.
Value of 0 returns the start point, 1 returns end point.dst
- the coordinate where result will be placed.public abstract double getClosestCoordinate(Point2D inputPoint, boolean bExtrapolate)
inputPoint
- The 2D point to find the closest coordinate on this segment.bExtrapolate
- TRUE if the segment is extrapolated at the end points along
the end point tangents. Otherwise the result is limited to
values between 0 and 1.public abstract int intersectionWithAxis2D(boolean bAxisX, double ordinate, double[] resultOrdinates, double[] parameters)
bAxisX
- TRUE if the function works with the line parallel to the axis
X.ordinate
- The ordinate value of the line (x for axis Y, y for axis X).resultOrdinates
- The value of ordinate in the intersection points One ordinate
is equal to the ordinate parameter. This parameter can be
NULL.parameters
- The value of the parameter in the intersection points (between
0 and 1). This parameter can be NULL.public abstract Segment cut(double t1, double t2)
public abstract double getAttributeAsDbl(double t, int semantics, int ordinate)
public double distance(Segment otherSegment, boolean bSegmentsKnownDisjoint)
public Geometry getBoundary()
Geometry
getBoundary
in class Geometry
Copyright © 2018. All rights reserved.