ilog.views.maps.geometry
Class IlvMapLineString

java.lang.Object
  extended by ilog.views.maps.IlvMapGeometry
      extended by ilog.views.maps.geometry.IlvMapCurve
          extended by ilog.views.maps.geometry.IlvMapSegmentString
              extended by ilog.views.maps.geometry.IlvMapLineString
All Implemented Interfaces:
IlvMapMultiPointInterface, IlvMapSegment, IlvMapSegmentStringInterface

public class IlvMapLineString
extends IlvMapSegmentString
implements IlvMapMultiPointInterface

This class defines a polyline (line string).

Since:
ILOG JViews 3.0

Constructor Summary
IlvMapLineString()
          Initializes an instance of the class.
IlvMapLineString(IlvCoordinate c)
          Initializes an instance of the class.
IlvMapLineString(int start, int count, IlvCoordinate[] array)
          Initialize an instance of IlvMapLinestring by copying coordinates from the specified array.
 
Method Summary
 void addPoint(IlvCoordinate c)
          Adds a coordinate at the end of the line string.
 Rectangle2D getBounds(Rectangle2D result)
          Returns the bounds of this IlvMapGeometry
 IlvCoordinate getEndPoint()
          Returns the end point of the last segment, if it exists.
 int getHorizontalIntersectionCount(IlvCoordinate c)
          Returns the number of intersections between an horizontal half line defined by its right extremity c and the segment.
 IlvMapLinearSegment getLinearSegment(int index)
          Returns the segment of the specified index as an IlvMapLinearSegment.
 IlvCoordinate getLowerRightCorner()
          Returns the lower right corner of the bounding rectangle of this IlvMapGeometry
 IlvCoordinate getPoint(int index)
          Returns the coordinate of the specified index.
 int getPointCount()
          Returns the number of points in the line string.
 IlvMapSegment getSegment(int index)
          Returns the segment of the specified index.
 int getSegmentCount()
          Returns the number of segments contained in the string.
 IlvCoordinate getStartPoint()
          Returns the start point of the first segment, if it exists.
 IlvCoordinate getUpperLeftCorner()
          Returns the upper left corner of the bounding rectangle of this IlvMapGeometry
 void lineTo(IlvCoordinate c)
          Appends a new linear segment to the string.
 void removeAll()
          Removes all the coordinates from the line string.
 boolean removePoint(IlvCoordinate c)
          Removes a coordinate from the line string.
 void setEndPoint(IlvCoordinate end)
          Sets the end point of the last segment if it exists.
 void setStartPoint(IlvCoordinate start)
          Sets the start point of the first segment, if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapLineString

public IlvMapLineString()
Initializes an instance of the class.


IlvMapLineString

public IlvMapLineString(IlvCoordinate c)
Initializes an instance of the class.

Since:
JViews 3.5

IlvMapLineString

public IlvMapLineString(int start,
                        int count,
                        IlvCoordinate[] array)
Initialize an instance of IlvMapLinestring by copying coordinates from the specified array.

Parameters:
start - The starting index of points to use to build this line string.
count - The number of points to copy.
array - The array of coordinates to use.
Since:
JViews 5.0
Method Detail

removeAll

public void removeAll()
Removes all the coordinates from the line string.

Specified by:
removeAll in interface IlvMapMultiPointInterface
Specified by:
removeAll in interface IlvMapSegmentStringInterface

removePoint

public boolean removePoint(IlvCoordinate c)
Removes a coordinate from the line string.

Specified by:
removePoint in interface IlvMapMultiPointInterface
Parameters:
c - The coordinate to remove.
Returns:
true if the coordinate was in the line string.

getPointCount

public int getPointCount()
Returns the number of points in the line string.

Specified by:
getPointCount in interface IlvMapMultiPointInterface

addPoint

public void addPoint(IlvCoordinate c)
Adds a coordinate at the end of the line string.

Specified by:
addPoint in interface IlvMapMultiPointInterface
Parameters:
c - The coordinate.

getPoint

public IlvCoordinate getPoint(int index)
Returns the coordinate of the specified index. The coordinate is not copied.

Specified by:
getPoint in interface IlvMapMultiPointInterface
Parameters:
index - The index.

lineTo

public void lineTo(IlvCoordinate c)
Appends a new linear segment to the string.

Parameters:
c - The coordinate of the end of the new segment.
Since:
JViews 3.5

getSegmentCount

public int getSegmentCount()
Returns the number of segments contained in the string.

Specified by:
getSegmentCount in interface IlvMapSegmentStringInterface
Returns:
The number of segments.
Since:
JViews 3.5

getSegment

public IlvMapSegment getSegment(int index)
Returns the segment of the specified index.

Specified by:
getSegment in interface IlvMapSegmentStringInterface
Parameters:
index - The index of the segment to be retrieved. index must have a value between 0 and getSegmentCount() - 1.
Returns:
An IlvMapSegment object that should not be modified nor deleted by the user. The returned IlvMapSegment is volatile. This means that it may be modified or deleted by the IlvMapSegmentString itself after another call to this function, or after any modification.
Since:
JViews 3.5

getLinearSegment

public IlvMapLinearSegment getLinearSegment(int index)
Returns the segment of the specified index as an IlvMapLinearSegment.

Parameters:
index - The index of the segment to be retrieved. index must have a value between 0 and getSegmentCount() - 1.
Returns:
An IlvMapLinearSegment object that should not be modified nor deleted by the user. The returned IlvMapSegment is volatile. This means that it may be modified or deleted by the IlvMapSegmentString itself after another call to this function, or after any modification.
Since:
JViews 3.5

getStartPoint

public IlvCoordinate getStartPoint()
Returns the start point of the first segment, if it exists.

Specified by:
getStartPoint in interface IlvMapSegment
Returns:
The start point.
Since:
JViews 3.5

getEndPoint

public IlvCoordinate getEndPoint()
Returns the end point of the last segment, if it exists.

Specified by:
getEndPoint in interface IlvMapSegment
Returns:
The end point.
Since:
JViews 3.5

setStartPoint

public void setStartPoint(IlvCoordinate start)
Sets the start point of the first segment, if it exists. Otherwise, specified point is added as the first point of the string.

Specified by:
setStartPoint in interface IlvMapSegment
Parameters:
start - The start point.
Since:
JViews 3.5

setEndPoint

public void setEndPoint(IlvCoordinate end)
Sets the end point of the last segment if it exists.

Specified by:
setEndPoint in interface IlvMapSegment
Parameters:
end - The end point.
Since:
JViews 3.5

getHorizontalIntersectionCount

public int getHorizontalIntersectionCount(IlvCoordinate c)
Returns the number of intersections between an horizontal half line defined by its right extremity c and the segment. This function is used for point inclusion tests of IlvMapRingInterface.

Specified by:
getHorizontalIntersectionCount in interface IlvMapSegment
Parameters:
c - The point at the right extremity of the horizontal half line.
Returns:
The number of intersections between the point and the segment. Tangent intersections should be counted as: 1 if the point is on the segment, 2 if the point is not on the segment. If the point is on the segment where the tangent is not horizontal, the intersection should not be counted.
Since:
JViews 3.5

getLowerRightCorner

public IlvCoordinate getLowerRightCorner()
Returns the lower right corner of the bounding rectangle of this IlvMapGeometry

Since:
JViews 7.5

getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner()
Returns the upper left corner of the bounding rectangle of this IlvMapGeometry

Since:
JViews 7.5

getBounds

public Rectangle2D getBounds(Rectangle2D result)
Returns the bounds of this IlvMapGeometry

Specified by:
getBounds in interface IlvMapSegment
Specified by:
getBounds in class IlvMapGeometry


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.