ilog.views.maps.geometry
Class IlvMapBezierString

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

public class IlvMapBezierString
extends IlvMapSegmentString

This implementation of IlvMapSegmentString is optimized to handle strings that contain only IlvMapBezierSegment instances. The instances of this class can be rendered by an IlvDefaultFeatureRenderer or by an IlvDefaultCurveRenderer.

Since:
JViews 5.0

Constructor Summary
IlvMapBezierString(IlvCoordinate start)
          Initializes an instance of the class.
 
Method Summary
 void bezierTo(IlvCoordinate control1, IlvCoordinate control2, IlvCoordinate end)
          Adds an bezier at the end of the string.
 IlvMapBezierSegment getBezierSegment(int index)
          Returns the bezier segment of the specified index.
 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.
 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.
 void removeAll()
          Removes all the segments in the string and sets the start point to (0.,0.).
 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

IlvMapBezierString

public IlvMapBezierString(IlvCoordinate start)
Initializes an instance of the class.

Parameters:
start - The start point.
Method Detail

bezierTo

public void bezierTo(IlvCoordinate control1,
                     IlvCoordinate control2,
                     IlvCoordinate end)
Adds an bezier at the end of the string.

Parameters:
control1 - The first control point.
control2 - The second control point.
end - The end point.

getSegmentCount

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

Returns:
The number of segments.

getSegment

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

Parameters:
index - The index of the segment to be retrieved. \a 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.

getBezierSegment

public IlvMapBezierSegment getBezierSegment(int index)
Returns the bezier segment of the specified index.

Parameters:
index - The index of the segment to be retrieved. \a index must have a value between 0 and getSegmentCount() - 1.
Returns:
An IlvMapBezierSegment 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.

removeAll

public void removeAll()
Removes all the segments in the string and sets the start point to (0.,0.).


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

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.

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.