ilog.views.maps.geometry
Class IlvMapCurveString

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.IlvMapCurveString
All Implemented Interfaces:
IlvMapSegment, IlvMapSegmentStringInterface

public class IlvMapCurveString
extends IlvMapSegmentString

This implementation of the IlvMapSegmentString class supports sequences of IlvMapSegment. The instances of this class can be rendered by an IlvDefaultFeatureRenderer or by an IlvDefaultCurveRenderer.

Since:
JViews 3.5

Constructor Summary
IlvMapCurveString()
          Initializes an instance of IlvMapCurveString.
 
Method Summary
 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 point)
          Returns the number of intersections between an horizontal half line defined by its right extremity point and the segment.
 IlvMapSegment getSegment(int index)
          Returns the segment of index index.
 int getSegmentCount()
          Returns the number of segments contained in this curve string.
 IlvCoordinate getStartPoint()
          Returns the start point of the first segment, if it exists.
 void joinSegment(IlvMapSegment segment)
          Joins a segment at the end of the string.
 void removeAll()
          Removes all the segments in the 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

IlvMapCurveString

public IlvMapCurveString()
Initializes an instance of IlvMapCurveString. The created instance has an empty segment list.

Method Detail

getSegmentCount

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

Returns:
The number of segments.

getSegment

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

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 by the user. The returned IlvMapSegment is volatile. This means that it may be modified by the IlvMapSegmentString itself after another call to this function, or after any modification.

removeAll

public void removeAll()
Removes all the segments in the string.


joinSegment

public void joinSegment(IlvMapSegment segment)
Joins a segment at the end of the string. The first point of the segment given as argument is moved to fit the last point of the preceding segment if it exists. Since the segment parameter is not copied, this parameter should not be modified after being joined.

Parameters:
segment - The segment to be joined.

getStartPoint

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

Returns:
The start point.

getEndPoint

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

Returns:
The end point.

setStartPoint

public void setStartPoint(IlvCoordinate start)
Sets the start point of the first segment, if it exists.

Parameters:
start - The start point.

setEndPoint

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

Parameters:
end - The end point.

getHorizontalIntersectionCount

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

Parameters:
point - 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.

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.