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
Direct Known Subclasses:
Line

public abstract class Segment
extends Geometry
implements Serializable

A base class for segments. Presently only Line segments are supported.

Since:
1.0
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, m_touchFlag
 
Constructor Summary
Segment()
          Creates a segment with start and end points (0,0).
 
Method Summary
 double calculateArea2D()
          Calculates the area of the geometry.
 void copyTo(Geometry dst)
          Copies this geometry to another geometry of the same type.
 int getDimension()
          Returns the topological dimension of the geometry object based on the geometry's type.
 double getEndX()
          Returns the X coordinate of ending point.
 double getEndY()
          Returns the Y coordinate of ending point.
 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 the axes.
 boolean isEmpty()
          Indicates if the geometry object contains geometric information.
 boolean isEmptyImpl()
          Non public abstract version of the function.
 void queryEnd(Point dstPoint)
          Returns coordinates of the end point in this segment.
 void queryStart(Point dstPoint)
          Returns coordinates of the start point in a Point class.
 void setEmpty()
          Sets 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 setStart(Point srcPoint)
          Sets the coordinates of the start point in this segment.
 
Methods inherited from class com.esri.core.geometry.Geometry
_getImpl, applyTransformation, calculateLength2D, copy, getDimensionFromType, getStateFlag, getType, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, 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 start and end points (0,0).

Since:
1.0
Method Detail

queryStart

public void queryStart(Point dstPoint)
Returns coordinates of the start point in a Point class.

Since:
1.0

setStart

public void setStart(Point srcPoint)
Sets the coordinates of the start point in this segment.

Parameters:
srcPoint - The new start point of this segment.
Since:
1.0

getStartX

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

Returns:
The X coordinate of starting point.
Since:
1.0

getStartY

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

Returns:
The Y coordinate of starting point.
Since:
1.0

getEndX

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

Returns:
The X coordinate of ending point.
Since:
1.0

getEndY

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

Returns:
The Y coordinate of ending point.
Since:
1.0

queryEnd

public void queryEnd(Point dstPoint)
Returns coordinates of the end point in this segment.

Parameters:
dstPoint - The end point of this segment.
Since:
1.0

setEnd

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

Parameters:
srcPoint - The new end point of this segment.
Since:
1.0

getDimension

public final int getDimension()
Description copied from class: Geometry
Returns the topological dimension of the geometry object based on the geometry's type.

Returns 0 for point and multipoint.

Returns 1 for lines and polylines.

Returns 2 for polygons and envelopes

Returns 3 for objects with volume

Specified by:
getDimension in class Geometry
Returns:
Returns the integer value of the dimension of geometry.
Since:
1.0

isEmpty

public final boolean isEmpty()
Description copied from class: Geometry
Indicates if the geometry object contains geometric information. IsEmpty returns true when the geometry object does not contain geometric information beyond its original initialization state.

Specified by:
isEmpty in class Geometry
Returns:
boolean Returns true if this geometry is empty.
Since:
1.0

setEmpty

public final void setEmpty()
Description copied from class: Geometry
Sets the geometry to its original initialization state by releasing all data referenced by the geometry.

Specified by:
setEmpty in class Geometry
Since:
1.0

calculateArea2D

public double calculateArea2D()
Description copied from class: Geometry
Calculates the area of the geometry. If the spatial reference is a Geographic Coordinate System (WGS84) then the 2D area calculation is defined in angular units.

Overrides:
calculateArea2D in class Geometry
Returns:
A double value representing the 2D area of the geometry.
Since:
1.0

isEmptyImpl

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

Since:
1.0

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 an exact copy.

Specified by:
copyTo in class Geometry
Since:
1.0

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

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.
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).
Since:
1.0


Copyright © 2012. All Rights Reserved.