ilog.views.maps.geometry
Class IlvMapBezierSegment

java.lang.Object
  extended by ilog.views.maps.geometry.IlvMapBezierSegment
All Implemented Interfaces:
IlvMapSegment

public class IlvMapBezierSegment
extends Object
implements IlvMapSegment

This class defines a bezier segment. An IlvMapBezierSegment is a spline defined by four control points called the start point, the first control point, the second control point, and the end point.

Since:
JViews 5.0

Constructor Summary
IlvMapBezierSegment()
          Initializes an instance of the class.
IlvMapBezierSegment(IlvCoordinate start, IlvCoordinate control1, IlvCoordinate control2, IlvCoordinate end)
          Creates an arc segment that goes through the start, the intermediate, and end point given as argument.
 
Method Summary
 Rectangle2D getBounds(Rectangle2D result)
          Returns the bounds of this IlvMapSegment
 IlvCoordinate getControlPoint1()
          Returns the control1 point of the segment.
 IlvCoordinate getControlPoint2()
          Returns the control2 point of the segment.
 IlvCoordinate getEndPoint()
          Returns the end point of the segment.
 int getHorizontalIntersectionCount(IlvCoordinate p)
          Returns the number of intersections between an horizontal half line defined by its right extremity point and the segment.
 IlvCoordinate getStartPoint()
          Returns the start point of the segment.
 void setControlPoint1(IlvCoordinate control1)
          Sets the first control point of the segment.
 void setControlPoint2(IlvCoordinate control2)
          Sets the second control point of the segment.
 void setEndPoint(IlvCoordinate end)
          Sets the end point of the segment.
 void setStartPoint(IlvCoordinate start)
          Sets the start point of the segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapBezierSegment

public IlvMapBezierSegment()
Initializes an instance of the class.


IlvMapBezierSegment

public IlvMapBezierSegment(IlvCoordinate start,
                           IlvCoordinate control1,
                           IlvCoordinate control2,
                           IlvCoordinate end)
Creates an arc segment that goes through the start, the intermediate, and end point given as argument.

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

getStartPoint

public IlvCoordinate getStartPoint()
Returns the start point of the segment.

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

setStartPoint

public void setStartPoint(IlvCoordinate start)
Sets the start point of the segment.

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

setControlPoint1

public void setControlPoint1(IlvCoordinate control1)
Sets the first control point of the segment.

Parameters:
control1 - The control1 point.

getControlPoint1

public IlvCoordinate getControlPoint1()
Returns the control1 point of the segment.

Returns:
The control1 point.

setControlPoint2

public void setControlPoint2(IlvCoordinate control2)
Sets the second control point of the segment.

Parameters:
control2 - The control2 point.

getControlPoint2

public IlvCoordinate getControlPoint2()
Returns the control2 point of the segment.

Returns:
The control2 point.

getEndPoint

public IlvCoordinate getEndPoint()
Returns the end point of the segment.

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

setEndPoint

public void setEndPoint(IlvCoordinate end)
Sets the end point of the segment.

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

getHorizontalIntersectionCount

public int getHorizontalIntersectionCount(IlvCoordinate p)
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. In this release (JViews 5.0), we only check the intersection with the segments defined by the control points.

Specified by:
getHorizontalIntersectionCount in interface IlvMapSegment
Parameters:
p - The point at the right extremity of the horizontal half line.
Returns:
The number of intersections between the point and the segment.

getBounds

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

Specified by:
getBounds in interface IlvMapSegment
Since:
JViews 7.5


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