ilog.cpl.graphic.views
Class IlpPolyPoints

java.lang.Object
  extended by ilog.cpl.graphic.views.IlpPolyPoints
Direct Known Subclasses:
IlpPolygon, IlpPolyline

public abstract class IlpPolyPoints
extends Object

An instance of this class describes a sequence of consecutive line segments in the 2-D plane.

Subclasses are: IlpPolyline, where the starting point and end point usually differ, and IlpPolygon, which describes polygons.

Since:
JTGO 3.0

Constructor Summary
protected IlpPolyPoints()
          Note that _numsegments can validly be 0.
 
Method Summary
abstract  void applyTransform(IlvTransformer t)
          Applies a transform to the points, thereby destructively modifying the polyline and its segments.
abstract  ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines computeThickLinkShape(float thickness, float miterlimit)
          Returns the two polylines bounding the result of blowing up this polyline to a given thickness.
 boolean equals(Object other)
           
 Rectangle getBounds()
          Deprecated. This method was renamed to getBounds2D. Please use (IlvRect)getBounds2D() instead.
 Rectangle2D getBounds2D()
          Returns the smallest rectangle covering all points.
 int getClosestSegment(IlvPoint p)
          Returns the index of the segment which is closest to a given point.
 IlvPoint getGravity0()
          Returns the center of gravity of all points.
 IlvPoint getGravity1()
          Returns the center of gravity of all segments.
abstract  ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection getMedian()
          Returns the "midpoint" of the polyline, and the direction of the segment containing it.
abstract  int getNumberOfPoints()
          Returns the number of points in the polyline.
 int getNumberOfSegments()
          Returns the number of segments in the polyline.
 IlvPoint getPoint(int index)
          Returns a specific point (0 <= index < getNumberOfPoints()).
 IlvPoint[] getPoints()
          Returns the array of points.
 IlvPoint[] getPointsCloned()
          Returns a fresh copy of the array of points.
 IlpLineSegment getSegment(int index)
          Returns a specific segment (0 <= index < getNumberOfSegments()).
 IlpLineSegment[] getSegments()
          Returns the array of segments.
 int hashCode()
           
abstract  void insertPoint(IlvPoint p)
          Inserts a point where it fits best.
abstract  void insertPoint(int index, IlvPoint p)
          Inserts a point into a specific segment.
abstract  void movePoint(int index, IlvPoint p)
          Moves a specific point to a new location.
abstract  void removePoint(int index)
          Removes a specific point.
abstract  void removeRedundantPoints()
          Removes all redundant points (points which are between their neighbours).
abstract  void reverse()
          Reverses the order of the points, the order of the segments, and the directions of the segments.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlpPolyPoints

protected IlpPolyPoints()
Note that _numsegments can validly be 0. For IlpPolyline, this is valid if and only if _from == _to.

Method Detail

getNumberOfSegments

public int getNumberOfSegments()
Returns the number of segments in the polyline.


getSegment

public IlpLineSegment getSegment(int index)
Returns a specific segment (0 <= index < getNumberOfSegments()). The segment should not be modified.


getSegments

public IlpLineSegment[] getSegments()
Returns the array of segments. Neither the array nor the segments contained therein should be modified.


getNumberOfPoints

public abstract int getNumberOfPoints()
Returns the number of points in the polyline.


getPoint

public IlvPoint getPoint(int index)
Returns a specific point (0 <= index < getNumberOfPoints()). The point should not be modified.


getPoints

public IlvPoint[] getPoints()
Returns the array of points. Neither the array nor the points contained therein should be modified.


getPointsCloned

public IlvPoint[] getPointsCloned()
Returns a fresh copy of the array of points. Both the array and the points contained therein may be modified.

Internal method or field: do not use!

getClosestSegment

public int getClosestSegment(IlvPoint p)
Returns the index of the segment which is closest to a given point.


getBounds

public Rectangle getBounds()
Deprecated. This method was renamed to getBounds2D. Please use (IlvRect)getBounds2D() instead.

Returns the smallest integer rectangle covering all points.


getBounds2D

public Rectangle2D getBounds2D()
Returns the smallest rectangle covering all points.

Returns:
An IlvRect object.

getGravity0

public IlvPoint getGravity0()
Returns the center of gravity of all points.

Internal method or field: do not use!

getGravity1

public IlvPoint getGravity1()
Returns the center of gravity of all segments.

Internal method or field: do not use!

getMedian

public abstract ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection getMedian()
Returns the "midpoint" of the polyline, and the direction of the segment containing it.

Internal method or field: do not use!

computeThickLinkShape

public abstract ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines computeThickLinkShape(float thickness,
                                                                                          float miterlimit)
Returns the two polylines bounding the result of blowing up this polyline to a given thickness.

Parameters:
miterlimit - see comments in class IltGraphicUtil
Internal method or field: do not use!

applyTransform

public abstract void applyTransform(IlvTransformer t)
Applies a transform to the points, thereby destructively modifying the polyline and its segments.


reverse

public abstract void reverse()
Reverses the order of the points, the order of the segments, and the directions of the segments. This destructively modifies the polyline and its segments.


insertPoint

public abstract void insertPoint(int index,
                                 IlvPoint p)
Inserts a point into a specific segment.

Parameters:
index - Satisfies 0 <= index < getNumberOfSegments().
p - The point to be inserted.

insertPoint

public abstract void insertPoint(IlvPoint p)
Inserts a point where it fits best.


movePoint

public abstract void movePoint(int index,
                               IlvPoint p)
Moves a specific point to a new location.

Parameters:
index - Satisfies 0 <= index < getNumberOfPoints().
p - The point to be moved.

removePoint

public abstract void removePoint(int index)
Removes a specific point.

Parameters:
index - Satisfies 0 <= index < getNumberOfPoints().

removeRedundantPoints

public abstract void removeRedundantPoints()
Removes all redundant points (points which are between their neighbours).


equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


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