com.esri.core.geometry
Class MultiPath

java.lang.Object
  extended by com.esri.core.geometry.Geometry
      extended by com.esri.core.geometry.MultiPath
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Polygon, Polyline

public abstract class MultiPath
extends Geometry
implements Serializable

A base class for Polygon and Polyline

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.Type
 
Field Summary
protected  com.esri.core.geometry.MultiPathImpl m_impl
           
 
Fields inherited from class com.esri.core.geometry.Geometry
m_description
 
Constructor Summary
MultiPath()
           
 
Method Summary
protected  Object _getImpl()
           
 void add(MultiPath src, boolean bReversePaths)
          Appends all paths from another MultiPath.
 void addEnvelope(Envelope envSrc, boolean bReverse)
          Adds a rectangular closed Path to the MultiPathImpl.
 void addPath(MultiPath src, int srcPathIndex, boolean bForward)
          Copies a Path from another MultiPathImpl.
 double calculateArea2D()
          Calculates area of the Geometry.
 double calculateLength2D()
          Calculates length of the Geometry.
 void closeAllPaths()
          Closes all open curves by adding an implicit line segment from the end point to the start point.
 void closePathWithArc()
          Closes last path of the MultiPathImpl with the Line Segment.
 void closePathWithLine()
          Closes last path of the MultiPathImpl with the Line Segment.
 void copyTo(Geometry dst)
          Copies this geometry to another Geometry of the same type.
 int getPathCount()
          Returns the number of paths in a multipath Geometry.
 int getPathEnd(int pathIndex)
          Returns the end index of the path (== GetPathSize(pathIndex) + GetPathSize(pathIndex)).
 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)
           
 int getPointCount()
           
 int getSegmentCount()
          Returns total segment count in the MultiPathImpl.
 int getSegmentCount(int pathIndex)
          Returns the segment count in the given MultiPathImpl path.
 int hashCode()
           
 boolean hasNonLinearSegments()
          Returns True if the MultiPath contains non-linear segments.
 boolean hasNonLinearSegments(int pathIndex)
          Returns True if the given path might have non-linear segments.
 void insertPoints(int pathIndex, int beforePointIndex, MultiPath src, int srcPathIndex, int srcPointIndexFrom, int srcPointCount, boolean bForward)
          Inserts a part of a path from the given MultiPath.
 boolean isClosedPath(int pathIndex)
          Returns True if the given path is closed (represents a Ring).
 boolean isEmpty()
          Returns True if the Geometry is empty.
 void lineTo(double x, double y)
          Adds a Line Segment from the last Point to the given endPoint.
 void lineTo(Point endPoint)
          Adds a Line Segment to the given endPoint.
 SegmentIterator querySegmentIterator()
          Returns a SegmentIterator that set right before the beginning of the MultiPathImpl such that the call to NextPath will set the iterator to the first path of the MultiPathImpl.
 SegmentIterator querySegmentIteratorAtVertex(int startVertexIndex)
          Returns a SegmentIterator that set to a specific vertex of the MultiPathImpl.
 void setEmpty()
          Sets the Geometry as empty.
 void setPoint(int index, Point point)
           
 void startPath(double x, double y)
          Starts a new Path at the Point.
 void startPath(Point point)
           
 
Methods inherited from class com.esri.core.geometry.Geometry
addID, addM, addZ, createInstance, getDimension, getType, hasID, hasM, hasZ, isSegment, queryEnvelope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_impl

protected com.esri.core.geometry.MultiPathImpl m_impl
Constructor Detail

MultiPath

public MultiPath()
Method Detail

getPointCount

public int getPointCount()

getPoint

public Point getPoint(int index)

setPoint

public void setPoint(int index,
                     Point point)

isEmpty

public boolean isEmpty()
Description copied from class: Geometry
Returns True if the Geometry is empty.

Specified by:
isEmpty in class Geometry

calculateArea2D

public double calculateArea2D()
Description copied from class: Geometry
Calculates area of the Geometry.

Overrides:
calculateArea2D in class Geometry

calculateLength2D

public double calculateLength2D()
Description copied from class: Geometry
Calculates length of the Geometry.

Overrides:
calculateLength2D in class Geometry

copyTo

public void copyTo(Geometry dst)
Description copied from class: Geometry
Copies this geometry to another Geometry of the same type. The result Geometry is exact copy.

Specified by:
copyTo in class Geometry

hasNonLinearSegments

public boolean hasNonLinearSegments()
Returns True if the MultiPath contains non-linear segments.


getSegmentCount

public int getSegmentCount()
Returns total segment count in the MultiPathImpl.


getSegmentCount

public int getSegmentCount(int pathIndex)
Returns the segment count in the given MultiPathImpl path.


addPath

public void addPath(MultiPath src,
                    int srcPathIndex,
                    boolean bForward)
Copies a Path from another MultiPathImpl. src The source MultiPathImpl. \src The source MultiPathImpl to copy path from. \srcPathIndex is the index of the path in the the source MultiPathImpl. This MultiPathImpl obtains all missing attributes from the src MultiPathImpl.


getPathCount

public int getPathCount()
Returns the number of paths in a multipath Geometry.


getPathSize

public int getPathSize(int pathIndex)
Returns the number of vertices in a path.


getPathStart

public int getPathStart(int pathIndex)
Returns the start index of the path.


getPathEnd

public int getPathEnd(int pathIndex)
Returns the end index of the path (== GetPathSize(pathIndex) + GetPathSize(pathIndex)).


getPathIndexFromPointIndex

public int getPathIndexFromPointIndex(int pointIndex)
Returns the path index from the Point index. This is O(log N) operation.


startPath

public void startPath(double x,
                      double y)
Starts a new Path at the Point.


startPath

public void startPath(Point point)

lineTo

public void lineTo(double x,
                   double y)
Adds a Line Segment from the last Point to the given endPoint.


lineTo

public void lineTo(Point endPoint)
Adds a Line Segment to the given endPoint.

Parameters:
endPoint - - the end Point to which the newly added line segment should point

closePathWithLine

public void closePathWithLine()
Closes last path of the MultiPathImpl with the Line Segment. This method is implicitly called for the Polygon class.


closePathWithArc

public void closePathWithArc()
Closes last path of the MultiPathImpl with the Line Segment.


closeAllPaths

public void closeAllPaths()
Closes all open curves by adding an implicit line segment from the end point to the start point.


isClosedPath

public boolean isClosedPath(int pathIndex)
Returns True if the given path is closed (represents a Ring).


hasNonLinearSegments

public boolean hasNonLinearSegments(int pathIndex)
Returns True if the given path might have non-linear segments.


addEnvelope

public void addEnvelope(Envelope envSrc,
                        boolean bReverse)
Adds a rectangular closed Path to the MultiPathImpl. \param envSrc is the source rectangle. \param bReverse Creates reversed path.


querySegmentIterator

public SegmentIterator querySegmentIterator()
Returns a SegmentIterator that set right before the beginning of the MultiPathImpl such that the call to NextPath will set the iterator to the first path of the MultiPathImpl.


querySegmentIteratorAtVertex

public SegmentIterator querySegmentIteratorAtVertex(int startVertexIndex)
Returns a SegmentIterator that set to a specific vertex of the MultiPathImpl. The call to NextSegment will return the segment that starts at the vertex. Call to PreviousSegment will return the segment that starts at the previous vertex.


setEmpty

public void setEmpty()
Description copied from class: Geometry
Sets the Geometry as empty.

Specified by:
setEmpty in class Geometry

_getImpl

protected Object _getImpl()
Overrides:
_getImpl in class Geometry

hashCode

public int hashCode()
Overrides:
hashCode in class Object

add

public void add(MultiPath src,
                boolean bReversePaths)
Appends all paths from another MultiPath.

Parameters:
src - The source MultiPath

insertPoints

public void insertPoints(int pathIndex,
                         int beforePointIndex,
                         MultiPath src,
                         int srcPathIndex,
                         int srcPointIndexFrom,
                         int srcPointCount,
                         boolean bForward)
Inserts a part of a path from the given MultiPath.

Parameters:
pathIndex - The path index in this class to insert points to. Must correspond to an existing path.
beforePointIndex - The point index in the given path of this MultiPath before which the vertices need to be inserted. 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 added points will be reverted.


Copyright © 2010. All Rights Reserved.