com.esri.core.geometry
Class Segment

java.lang.Object
  extended by com.esri.core.geometry.Geometry
      extended by com.esri.core.geometry.Segment
All Implemented Interfaces:
Serializable

public abstract class Segment
extends Geometry
implements Serializable

A class that represents members of MultiPaths

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.Type
 
Field Summary
 
Fields inherited from class com.esri.core.geometry.Geometry
m_description
 
Constructor Summary
Segment()
          Creates a segment with same start and end points (at 0,0)
 
Method Summary
 double calculateArea2D()
          Calculates area of the Geometry.
 void copyTo(Geometry dst)
          Copies this geometry to another Geometry of the same type.
abstract  double getClosestCoordinate(com.esri.core.geometry.Point2D inputPoint, boolean bExtrapolate)
          Finds a closest coordinate on the segment.
abstract  com.esri.core.geometry.Point2D getCoord2D(double t)
          Returns the coordinate of the point on the segment for the given parameter value.
 int getDimension()
          Returns the Geometry Dimension.
 Point getEnd()
          Returns coordinates of the end point in a Point class.
 double getEndX()
          Returns the X coordinate of ending point
 double getEndY()
          Returns the Y coordinate of ending point
 Point getStart()
          Returns coordinates of the start point in a Point class.
 double getStartX()
          Returns the X coordinate of starting 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 axes.
 boolean isEmpty()
          Returns True if the Geometry is empty.
 boolean isEmptyImpl()
          Non public abstract version of the function.
 void queryInterval(int semantics, int ordinate, com.esri.core.geometry.Envelope1D env)
          Returns the min and max attribute values at the ordinate of the Geometry
 void setEmpty()
          Sets the Geometry as empty.
 void setEnd(Point srcPoint)
          Sets the XYZ coordinates of the end point in a Point class.
 void setStart(Point srcPoint)
          Sets the XYZ coordinates of the start point in a Point class.
 
Methods inherited from class com.esri.core.geometry.Geometry
_getImpl, addID, addM, addZ, calculateLength2D, createInstance, getType, hasID, hasM, hasZ, isSegment, queryEnvelope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Segment

public Segment()
Creates a segment with same start and end points (at 0,0)

Method Detail

getStartX

public double getStartX()
Returns the X coordinate of starting point

Returns:
the X coordinate of starting point

getStartY

public double getStartY()
Returns the Y coordinate of starting point

Returns:
the Y coordinate of starting point

getEndX

public double getEndX()
Returns the X coordinate of ending point

Returns:
the X coordinate of ending point

getEndY

public double getEndY()
Returns the Y coordinate of ending point

Returns:
the Y coordinate of ending point

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

queryInterval

public void queryInterval(int semantics,
                          int ordinate,
                          com.esri.core.geometry.Envelope1D env)
Description copied from class: Geometry
Returns the min and max attribute values at the ordinate of the Geometry


getStart

public Point getStart()
Returns coordinates of the start point in a Point class.


setStart

public void setStart(Point srcPoint)
Sets the XYZ coordinates of the start point in a Point class.


getEnd

public Point getEnd()
Returns coordinates of the end point in a Point class.


setEnd

public void setEnd(Point srcPoint)
Sets the XYZ coordinates of the end point in a Point class.


isEmptyImpl

public boolean isEmptyImpl()
Non public abstract version of the function.


isEmpty

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

Specified by:
isEmpty in class Geometry

getDimension

public final int getDimension()
Description copied from class: Geometry
Returns the Geometry Dimension. (0 for Point and MultiPoint, 1 for curves, 2 for objects that have area, 3 for objects with volume)

Specified by:
getDimension in class Geometry

setEmpty

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

Specified by:
setEmpty in class Geometry

calculateArea2D

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

Overrides:
calculateArea2D in class Geometry

getCoord2D

public abstract com.esri.core.geometry.Point2D getCoord2D(double t)
Returns the coordinate of the point on the segment for the given parameter value.


getClosestCoordinate

public abstract double getClosestCoordinate(com.esri.core.geometry.Point2D inputPoint,
                                            boolean bExtrapolate)
Finds a closest coordinate on the segment.

Parameters:
inputPoint - is 2D coordinate to find the closest coordinate on the segment to.
bExtrapolate - When True the segment is extrapolated at the end points along the endpoint tangents. Itherwise the result is limited to values between 0 and 1.
Returns:
The parametric coordinate t on the segment (0 corresponds to the start point, 1 corresponds to the end point). Use getCoord2D to obtain the 2D coordinate on the segment from the t. To find the distance, call (inputPoint.sub(seg.getCoord2D(t))).length();

intersectionWithAxis2D

public 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 axes.

Parameters:
bAxisX - When True, the function work with the line parallel to the axis X, otherwise - axis Y.
ordinate - The ordinate value of the line (x for axis Y, y for axis X).
resultOrdinates - The value of ordinate in the intersection points (note that one ordinate is equal to the ordinate param). This param can be NULL.
parameters - The value of the parameter in the intersection points (between 0 and 1). This param can be NULL.
Returns:
The number of intersection points, 0 when no intersection points exist, -1 when the segment coincides with the line (infinite number of intersection points).


Copyright © 2010. All Rights Reserved.