public abstract class MultiPath extends MultiVertexGeometry implements Serializable
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
Constructor and Description |
---|
MultiPath() |
Modifier and Type | Method and Description |
---|---|
protected Object |
_getImpl() |
void |
add(MultiPath src,
boolean bReversePaths)
Appends all paths from another multipath.
|
void |
addAttribute(int semantics)
Adds a new attribute to the Geometry.
|
void |
addEnvelope(Envelope2D envSrc,
boolean bReverse)
Adds a rectangular closed Path to the MultiPathImpl.
|
void |
addEnvelope(Envelope envSrc,
boolean bReverse)
Adds a rectangular closed path to this multipath.
|
void |
addPath(MultiPath src,
int srcPathIndex,
boolean bForward)
Copies a path from another multipath.
|
void |
addSegment(Segment segment,
boolean bStartNewPath)
Adds a new segment to this multipath.
|
void |
addSegmentsFromPath(MultiPath src,
int srcPathIndex,
int srcSegmentFrom,
int srcSegmentCount,
boolean bStartNewPath)
Adds segments from a source multipath to this MultiPath.
|
void |
applyTransformation(Transformation2D transform)
Applies 2D affine transformation in XY plane.
|
void |
assignVertexDescription(VertexDescription src)
Assigns the new VertexDescription by adding or dropping attributes.
|
double |
calculateArea2D()
Calculates the area of the geometry.
|
double |
calculateLength2D()
Calculates the length of the geometry.
|
double |
calculatePathLength2D(int pathIndex) |
void |
closeAllPaths()
Closes all open paths by adding an implicit line segment from the end
point to the start point.
|
void |
closePathWithLine()
Closes the last path of this multipath with a line segment.
|
void |
copyTo(Geometry dst)
Copies this geometry to another geometry of the same type.
|
void |
dropAllAttributes()
Drops all attributes from the Geometry with exception of POSITON.
|
void |
dropAttribute(int semantics)
Drops an attribute from the Geometry.
|
double |
getAttributeAsDbl(int semantics,
int index,
int ordinate)
Returns value of the given vertex attribute as double.
|
int |
getAttributeAsInt(int semantics,
int index,
int ordinate)
Returns value of the given vertex attribute as int.
|
Geometry |
getBoundary()
Returns boundary of this geometry.
|
VertexDescription |
getDescription()
Returns the VertexDescription of this geometry.
|
int |
getPathCount()
Returns the number of paths in this multipath.
|
int |
getPathEnd(int pathIndex)
Returns the index immediately following the last index of the path.
|
int |
getPathIndexFromPointIndex(int pointIndex)
Returns the path index from the point index.
|
int |
getPathSize(int pathIndex)
Returns the number of vertices in a path.
|
int |
getPathStart(int pathIndex)
Returns the start index of the path.
|
Point |
getPoint(int index)
Returns given vertex of the Geometry.
|
void |
getPointByVal(int index,
Point outPoint)
Returns given vertex of the Geometry.
|
int |
getPointCount()
Returns the total vertex count in this Geometry.
|
int |
getSegmentCount()
Returns total segment count in the MultiPath.
|
int |
getSegmentCount(int pathIndex)
Returns the segment count in the given multipath path.
|
int |
getStateFlag()
The stateFlag value changes with changes applied to this geometry.
|
Point2D |
getXY(int index)
Returns XY coordinates of the given vertex of the Geometry.
|
void |
getXY(int index,
Point2D pt) |
int |
hashCode()
Returns the hash code for the multipath.
|
void |
insertPath(int pathIndex,
MultiPath src,
int srcPathIndex,
boolean bForward)
Inserts a path from another multipath.
|
void |
insertPoint(int pathIndex,
int beforePointIndex,
Point pt)
Inserts a point.
|
void |
insertPoints(int pathIndex,
int beforePointIndex,
MultiPath src,
int srcPathIndex,
int srcPointIndexFrom,
int srcPointCount,
boolean bForward)
Inserts vertices from the given multipath into this multipath.
|
boolean |
isClosedPath(int pathIndex)
Indicates if the given path is closed (represents a ring).
|
boolean |
isClosedPathInXYPlane(int pathIndex) |
boolean |
isEmpty()
IsEmpty returns TRUE when the Geometry object does not contain geometric
information beyond its original initialization state.
|
void |
lineTo(double x,
double y)
Adds a line segment from the last point to the given end coordinates.
|
void |
lineTo(Point endPoint)
Adds a Line Segment to the given end point.
|
void |
mergeVertexDescription(VertexDescription src)
Merges the new VertexDescription by adding missing attributes from the
src.
|
void |
queryCoordinates(Point[] dst) |
void |
queryCoordinates(Point2D[] dst)
Queries XY coordinates as an array.
|
void |
queryCoordinates(Point2D[] dst,
int dstSize,
int beginIndex,
int endIndex) |
void |
queryEnvelope(Envelope env)
Returns the axis aligned bounding box of the geometry.
|
void |
queryEnvelope2D(Envelope2D env)
Returns tight bbox of the Geometry in X, Y plane.
|
Envelope1D |
queryInterval(int semantics,
int ordinate)
Returns the min and max attribute values at the ordinate of the Geometry.
|
void |
queryLooseEnvelope(Envelope2D env) |
void |
queryPathEnvelope2D(int pathIndex,
Envelope2D env) |
SegmentIterator |
querySegmentIterator()
Returns a SegmentIterator that is set right before the beginning of the
multipath.
|
SegmentIterator |
querySegmentIteratorAtVertex(int startVertexIndex)
Returns a SegmentIterator that is set to a specific vertex of the
MultiPath.
|
void |
removePath(int pathIndex)
Removes the path at the given index.
|
void |
removePoint(int pathIndex,
int pointIndex)
Removes a point at a given index.
|
void |
replaceNaNs(int semantics,
double value)
Replaces NaNs in the attribute with the given value.
|
void |
reverseAllPaths()
Reverses the order of the vertices in each path.
|
void |
reversePath(int pathIndex)
Reverses the order of vertices in the path.
|
void |
setAttribute(int semantics,
int index,
int ordinate,
double value)
Sets the value of given attribute at given posisiotnsis.
|
void |
setAttribute(int semantics,
int index,
int ordinate,
int value)
Same as above, but works with ints.
|
void |
setEmpty()
Returns the geometry to its original initialization state by releasing
all data referenced by the geometry.
|
void |
setPoint(int index,
Point point)
Sets the vertex at given index of the Geometry.
|
void |
setPointByVal(int index,
Point point)
Sets the vertex at given index of the Geometry.
|
void |
setXY(int index,
Point2D pt)
Sets XY coordinates of the given vertex of the Geometry.
|
void |
startPath(double x,
double y)
Starts a new path at given coordinates.
|
void |
startPath(Point point)
Starts a new path at a point.
|
_assignVertexDescriptionImpl, getCoordinates2D, getPoint
addID, addM, copy, createInstance, estimateMemorySize, estimateMemorySize, getDimension, getDimensionFromType, getType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, queryLooseEnvelope2D, toString, vertex_count
public VertexDescription getDescription()
Geometry
getDescription
in class Geometry
public void assignVertexDescription(VertexDescription src)
Geometry
assignVertexDescription
in class Geometry
src
- VertexDescription to assign.public void mergeVertexDescription(VertexDescription src)
Geometry
mergeVertexDescription
in class Geometry
src
- VertexDescription to merge.public void addAttribute(int semantics)
Geometry
addAttribute
in class Geometry
semantics
- The VertexDescription.Semantics to add.public void dropAttribute(int semantics)
Geometry
dropAttribute
in class Geometry
semantics
- The VertexDescription.Semantics to drop.public void dropAllAttributes()
Geometry
dropAllAttributes
in class Geometry
public int getPointCount()
MultiVertexGeometry
getPointCount
in class MultiVertexGeometry
public Point getPoint(int index)
MultiVertexGeometry
getPoint
in class MultiVertexGeometry
public void setPoint(int index, Point point)
MultiVertexGeometry
setPoint
in class MultiVertexGeometry
index
- The index of the vertex being changed.point
- The Point instance to set given vertex attributes from. The
pointSrc can not be empty. public boolean isEmpty()
Geometry
public double calculateArea2D()
Geometry
calculateArea2D
in class Geometry
public double calculateLength2D()
Geometry
GeometryEngine
calculateLength2D
in class Geometry
public double calculatePathLength2D(int pathIndex)
public double getAttributeAsDbl(int semantics, int index, int ordinate)
MultiVertexGeometry
semantics
- The atribute semantics.index
- is the vertex index in the Geometry.ordinate
- is the ordinate of a vertex attribute (for example, y has
ordinate of 1, because it is second ordinate of POSITION)
If attribute is not present, the default value is returned.
See VertexDescription::GetDefaultValue() method.public int getAttributeAsInt(int semantics, int index, int ordinate)
MultiVertexGeometry
semantics
- The atribute semantics.index
- is the vertex index in the Geometry.ordinate
- is the ordinate of a vertex attribute (for example, y has
ordinate of 1, because it is second ordinate of POSITION)
If attribute is not present, the default value is returned.
See VertexDescription::GetDefaultValue() method. Avoid using
this method on non-integer atributes.public void setAttribute(int semantics, int index, int ordinate, double value)
MultiVertexGeometry
semantics
- The atribute semantics.index
- is the vertex index in the Geometry.ordinate
- is the ordinate of a vertex attribute (for example, y has
ordinate of 1, because it is seond ordinate of POSITION)value
- is the value to set. as well as the number of components of
the attribute.
If the attribute is not present in this Geometry, it is added.public void setAttribute(int semantics, int index, int ordinate, int value)
MultiVertexGeometry
public Point2D getXY(int index)
MultiVertexGeometry
getXY
in class MultiVertexGeometry
public void getXY(int index, Point2D pt)
getXY
in class MultiVertexGeometry
public void setXY(int index, Point2D pt)
MultiVertexGeometry
setXY
in class MultiVertexGeometry
public void queryEnvelope(Envelope env)
Geometry
queryEnvelope
in class Geometry
env
- The envelope to return the result in.public void queryEnvelope2D(Envelope2D env)
Geometry
queryEnvelope2D
in class Geometry
env
- The envelope to return the result in.public void queryPathEnvelope2D(int pathIndex, Envelope2D env)
public void queryLooseEnvelope(Envelope2D env)
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 void copyTo(Geometry dst)
Geometry
public Geometry getBoundary()
Geometry
getBoundary
in class Geometry
public void queryCoordinates(Point2D[] dst)
MultiVertexGeometry
queryCoordinates
in class MultiVertexGeometry
public void queryCoordinates(Point2D[] dst, int dstSize, int beginIndex, int endIndex)
public void queryCoordinates(Point[] dst)
queryCoordinates
in class MultiVertexGeometry
public int getSegmentCount()
public int getSegmentCount(int pathIndex)
pathIndex
- The path to determine the segment.public void add(MultiPath src, boolean bReversePaths)
src
- The multipath to append to this multipath.bReversePaths
- TRUE if the multipath is added should be added with its paths
reversed.public void addPath(MultiPath src, int srcPathIndex, boolean bForward)
src
- The multipath to copy from.srcPathIndex
- The index of the path in the the source MultiPath.bForward
- When FALSE, the points are inserted in reverse order.public void addSegmentsFromPath(MultiPath src, int srcPathIndex, int srcSegmentFrom, int srcSegmentCount, boolean bStartNewPath)
src
- The source MultiPath to add segments from.srcPathIndex
- The index of the path in the the source MultiPath.srcSegmentFrom
- The index of first segment in the path to start adding from.
The value has to be between 0 and
src.getSegmentCount(srcPathIndex) - 1.srcSegmentCount
- The number of segments to add. If 0, the function does
nothing.bStartNewPath
- When true, a new path is added and segments are added to it.
Otherwise the segments are added to the last path of this
MultiPath.
If bStartNewPath false, the first point of the first source
segment is not added. This is done to ensure proper connection
to existing segments. When the source path is closed, and the
closing segment is among those to be added, it is added also
as a closing segment, not as a real segment. Use add_segment
instead if you do not like that behavior.
This MultiPath obtains all missing attributes from the src
MultiPath.public void addSegment(Segment segment, boolean bStartNewPath)
segment
- The segment to be added to this mulitpath.bStartNewPath
- TRUE if a new path will be added.public void reverseAllPaths()
public void reversePath(int pathIndex)
pathIndex
- The start index of the path to reverse the order.public void removePath(int pathIndex)
pathIndex
- The start index to remove the path.public void insertPath(int pathIndex, MultiPath src, int srcPathIndex, boolean bForward)
pathIndex
- The start index of the multipath to insert.src
- The multipath to insert into this multipath. Can be the same
as the multipath being modified.srcPathIndex
- The start index to insert the path into the multipath.bForward
- When FALSE, the points are inserted in reverse order.public void insertPoints(int pathIndex, int beforePointIndex, MultiPath src, int srcPathIndex, int srcPointIndexFrom, int srcPointCount, boolean bForward)
pathIndex
- The path index in this multipath to insert points to. Must
correspond to an existing path.beforePointIndex
- The point index before all other vertices to insert in the
given path of this multipath. This value must be between 0 and
GetPathSize(pathIndex), or -1 to insert points at the end of
the given path.src
- The source multipath.srcPathIndex
- The source path index to copy points from.srcPointIndexFrom
- The start point in the source path to start copying from.srcPointCount
- The count of points to add.bForward
- When FALSE, the points are inserted in reverse order.public void insertPoint(int pathIndex, int beforePointIndex, Point pt)
pathIndex
- The path index in this class to insert the point to. Must
correspond to an existing path.beforePointIndex
- The point index in the given path of this multipath. This
value must be between 0 and GetPathSize(pathIndex), or -1 to
insert the point at the end of the given path.pt
- The point to be inserted.public void removePoint(int pathIndex, int pointIndex)
pathIndex
- The path from whom to remove the point.pointIndex
- The index of the point to be removed.public int getPathCount()
public int getPathSize(int pathIndex)
pathIndex
- The index of the path to return the number of vertices from.public int getPathStart(int pathIndex)
pathIndex
- The index of the path to return the start index from.public int getPathEnd(int pathIndex)
pathIndex
- The index of the path to return the end index from.public int getPathIndexFromPointIndex(int pointIndex)
pointIndex
- The index of the point.public void startPath(double x, double y)
x
- The X coordinate of the start point.y
- The Y coordinate of the start point.public void startPath(Point point)
point
- The point to start the path from.public void lineTo(double x, double y)
x
- The X coordinate to the end point.y
- The Y coordinate to the end point.public void lineTo(Point endPoint)
endPoint
- The end point to which the newly added line segment should
point.public void closePathWithLine()
public void closeAllPaths()
public boolean isClosedPath(int pathIndex)
pathIndex
- The index of the path to check to be closed.public boolean isClosedPathInXYPlane(int pathIndex)
public void addEnvelope(Envelope2D envSrc, boolean bReverse)
envSrc
- is the source rectangle.bReverse
- Creates reversed path.public void addEnvelope(Envelope envSrc, boolean bReverse)
envSrc
- Is the envelope to add to this mulitpath.bReverse
- Adds the path reversed (counter-clockwise).public SegmentIterator querySegmentIterator()
public SegmentIterator querySegmentIteratorAtVertex(int startVertexIndex)
startVertexIndex
- The start index of the SegementIterator.public void setEmpty()
Geometry
public void applyTransformation(Transformation2D transform)
Geometry
applyTransformation
in class Geometry
transform
- The affine transformation to be applied to this geometry.public int hashCode()
public void getPointByVal(int index, Point outPoint)
MultiVertexGeometry
getPointByVal
in class MultiVertexGeometry
public void setPointByVal(int index, Point point)
MultiVertexGeometry
setPointByVal
in class MultiVertexGeometry
index
- The index of the vertex being changed.point
- The Point instance to set given vertex attributes from. The
pointSrc can not be empty. public int getStateFlag()
Geometry
getStateFlag
in class Geometry
public void replaceNaNs(int semantics, double value)
Geometry
replaceNaNs
in class Geometry
semantics
- The semantics for which to replace the NaNs.value
- The value to replace NaNs with.Copyright © 2018. All rights reserved.