org.gvsig.fmap.geom.primitive
Class GeneralPathX

java.lang.Object
  extended by org.gvsig.fmap.geom.primitive.GeneralPathX
All Implemented Interfaces:
Shape, Serializable, Cloneable

Deprecated. use the geometry methods

public class GeneralPathX
extends Object
implements Shape, Cloneable, Serializable

The GeneralPathX class represents a geometric path constructed from straight lines, and quadratic and cubic (Bézier) curves. It can contain multiple subpaths.

The winding rule specifies how the interior of a path is determined. There are two types of winding rules: EVEN_ODD and NON_ZERO.

An EVEN_ODD winding rule means that enclosed regions of the path alternate between interior and exterior areas as traversed from the outside of the path towards a point inside the region.

A NON_ZERO winding rule means that if a ray is drawn in any direction from a given point to infinity and the places where the path intersects the ray are examined, the point is inside of the path if and only if the number of times that the path crosses the ray from left to right does not equal the number of times that the path crosses the ray from right to left.

Version:
1.58, 01/23/03
Author:
Jim Graham
See Also:
Serialized Form

Field Summary
static int[] curvesize
          Deprecated.  
protected static GeometryManager geomManager
          Deprecated.  
static byte SEG_CLOSE
          Deprecated.  
static byte SEG_CUBICTO
          Deprecated.  
static byte SEG_LINETO
          Deprecated.  
static byte SEG_MOVETO
          Deprecated.  
static byte SEG_QUADTO
          Deprecated.  
static int WIND_EVEN_ODD
          Deprecated. An even-odd winding rule for determining the interior of a path.
static int WIND_NON_ZERO
          Deprecated. A non-zero winding rule for determining the interior of a path.
 
Constructor Summary
GeneralPathX()
          Deprecated. Constructs a new GeneralPathX object.
GeneralPathX(int rule)
          Deprecated. Constructs a new GeneralPathX object with the specified winding rule to control operations that require the interior of the path to be defined.
GeneralPathX(int rule, int initialCapacity)
          Deprecated. the capacity grows dynamically
GeneralPathX(PathIterator piter)
          Deprecated. Constructs a new GeneralPathX object from an arbitrary Shape object.
 
Method Summary
 void addSegment(Point[] segment)
          Deprecated.  
 void append(PathIterator pi, boolean connect)
          Deprecated. Appends the geometry of the specified PathIterator object to the path, possibly connecting the new geometry to the existing path segments with a line segment.
 Object clone()
          Deprecated. Creates a new object of the same class as this object.
 void closePath()
          Deprecated. Closes the current subpath by drawing a straight line back to the coordinates of the last moveTo.
 boolean contains(double x, double y)
          Deprecated. Tests if the specified coordinates are inside the boundary of this Shape.
 boolean contains(double x, double y, double w, double h)
          Deprecated. Tests if the specified rectangular area is inside the boundary of this Shape.
 boolean contains(Point2D p)
          Deprecated. Tests if the specified Point2D is inside the boundary of this Shape.
 boolean contains(Rectangle2D r)
          Deprecated. Tests if the specified Rectangle2D is inside the boundary of this Shape.
 Shape createTransformedShape(AffineTransform at)
          Deprecated. Returns a new transformed Shape.
 void curveTo(double x1, double y1, double x2, double y2, double x3, double y3)
          Deprecated. use curveTo(Point, Point, Point)
 void curveTo(Point point1, Point point2, Point point3)
          Deprecated.  
 void flip()
          Deprecated. Convertimos el path a puntos y luego le damos la vuelta.
 Rectangle getBounds()
          Deprecated. Return the bounding box of the path.
 Rectangle2D getBounds2D()
          Deprecated. Returns the bounding box of the path.
 double[] getCoordinatesAt(int index)
          Deprecated.  
 Point2D getCurrentPoint()
          Deprecated. Returns the coordinates most recently added to the end of the path as a Point2D object.
 int getNumCoords()
          Deprecated.  
 int getNumTypes()
          Deprecated.  
 PathIterator getPathIterator(AffineTransform at)
          Deprecated. Returns a PathIterator object that iterates along the boundary of this Shape and provides access to the geometry of the outline of this Shape.
 PathIterator getPathIterator(AffineTransform at, double flatness)
          Deprecated. Returns a PathIterator object that iterates along the boundary of the flattened Shape and provides access to the geometry of the outline of the Shape.
 Point getPointAt(int index)
          Deprecated.  
 double[] getPointCoords()
          Deprecated. use the geometry methods.
 byte[] getPointTypes()
          Deprecated. use the geometry methods.
 byte getTypeAt(int index)
          Deprecated.  
 int getWindingRule()
          Deprecated. Returns the fill style winding rule.
 boolean intersects(double x, double y, double w, double h)
          Deprecated. Tests if the interior of this Shape intersects the interior of a specified set of rectangular coordinates.
 boolean intersects(Rectangle2D r)
          Deprecated. Tests if the interior of this Shape intersects the interior of a specified Rectangle2D.
 boolean isCCW()
          Deprecated. Check if the first part is CCW.
 boolean isClosed()
          Deprecated. Check if the first part is closed.
 boolean isSimple()
          Deprecated.  
 void lineTo(double x, double y)
          Deprecated. use lineTo(Point)
 void lineTo(Point point)
          Deprecated.  
 void moveTo(double x, double y)
          Deprecated. use moveTo(Point)
 void moveTo(Point point)
          Deprecated.  
 void quadTo(double x1, double y1, double x2, double y2)
          Deprecated. use quadTo(Point, Point)
 void quadTo(Point point1, Point point2)
          Deprecated.  
 void reProject(org.cresques.cts.ICoordTrans ct)
          Deprecated.  
 void reset()
          Deprecated. Resets the path to empty.
 int setNumCoords(int numCoords)
          Deprecated.  
 void setNumTypes(int numTypes)
          Deprecated.  
 void setPointCoords(double[] pointCoords)
          Deprecated. use the geometry methods.
 void setPointTypes(byte[] pointTypes)
          Deprecated. use the geometry methods.
 void setWindingRule(int rule)
          Deprecated. Sets the winding rule for this path to the specified value.
 void transform(AffineTransform at)
          Deprecated. Transforms the geometry of this path using the specified AffineTransform.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geomManager

protected static GeometryManager geomManager
Deprecated. 

curvesize

public static final int[] curvesize
Deprecated. 

WIND_EVEN_ODD

public static final int WIND_EVEN_ODD
Deprecated. 
An even-odd winding rule for determining the interior of a path.

See Also:
Constant Field Values

WIND_NON_ZERO

public static final int WIND_NON_ZERO
Deprecated. 
A non-zero winding rule for determining the interior of a path.

See Also:
Constant Field Values

SEG_MOVETO

public static final byte SEG_MOVETO
Deprecated. 
See Also:
Constant Field Values

SEG_LINETO

public static final byte SEG_LINETO
Deprecated. 
See Also:
Constant Field Values

SEG_QUADTO

public static final byte SEG_QUADTO
Deprecated. 
See Also:
Constant Field Values

SEG_CUBICTO

public static final byte SEG_CUBICTO
Deprecated. 
See Also:
Constant Field Values

SEG_CLOSE

public static final byte SEG_CLOSE
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

GeneralPathX

public GeneralPathX()
Deprecated. 
Constructs a new GeneralPathX object. If an operation performed on this path requires the interior of the path to be defined then the default NON_ZERO winding rule is used.

See Also:
WIND_NON_ZERO

GeneralPathX

public GeneralPathX(int rule)
Deprecated. 
Constructs a new GeneralPathX object with the specified winding rule to control operations that require the interior of the path to be defined.

Parameters:
rule - the winding rule
See Also:
WIND_EVEN_ODD, WIND_NON_ZERO

GeneralPathX

public GeneralPathX(int rule,
                    int initialCapacity)
Deprecated. the capacity grows dynamically

Constructs a new GeneralPathX object with the specified winding rule and the specified initial capacity to store path coordinates. This number is an initial guess as to how many path segments are in the path, but the storage is expanded as needed to store whatever path segments are added to this path.

Parameters:
rule - the winding rule
initialCapacity - the estimate for the number of path segments in the path
See Also:
WIND_EVEN_ODD, WIND_NON_ZERO

GeneralPathX

public GeneralPathX(PathIterator piter)
Deprecated. 
Constructs a new GeneralPathX object from an arbitrary Shape object. All of the initial geometry and the winding rule for this path are taken from the specified Shape object.

Parameters:
s - the specified Shape object
Method Detail

moveTo

public void moveTo(double x,
                   double y)
Deprecated. use moveTo(Point)

Adds a point to the path by moving to the specified coordinates.

Parameters:
x - , y the specified coordinates

moveTo

public void moveTo(Point point)
Deprecated. 

lineTo

public void lineTo(double x,
                   double y)
Deprecated. use lineTo(Point)

Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates.

Parameters:
x - , y the specified coordinates

lineTo

public void lineTo(Point point)
Deprecated. 

addSegment

public void addSegment(Point[] segment)
Deprecated. 

quadTo

public void quadTo(double x1,
                   double y1,
                   double x2,
                   double y2)
Deprecated. use quadTo(Point, Point)

Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2, y2), using the specified point (x1, y1) as a quadratic parametric control point.

Parameters:
x1 - , y1 the coordinates of the first quadratic control point
x2 - , y2 the coordinates of the final endpoint

quadTo

public void quadTo(Point point1,
                   Point point2)
Deprecated. 

curveTo

public void curveTo(double x1,
                    double y1,
                    double x2,
                    double y2,
                    double x3,
                    double y3)
Deprecated. use curveTo(Point, Point, Point)

Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.

Parameters:
x1 - , y1 the coordinates of the first Béezier control point
x2 - , y2 the coordinates of the second Bézier control point
x3 - , y3 the coordinates of the final endpoint

curveTo

public void curveTo(Point point1,
                    Point point2,
                    Point point3)
Deprecated. 

closePath

public void closePath()
Deprecated. 
Closes the current subpath by drawing a straight line back to the coordinates of the last moveTo. If the path is already closed then this method has no effect.


isClosed

public boolean isClosed()
Deprecated. 
Check if the first part is closed.

Returns:

append

public void append(PathIterator pi,
                   boolean connect)
Deprecated. 
Appends the geometry of the specified PathIterator object to the path, possibly connecting the new geometry to the existing path segments with a line segment. If the connect parameter is true and the path is not empty then any initial moveTo in the geometry of the appended Shape is turned into a lineTo segment. If the destination coordinates of such a connecting lineTo segment match the ending coordinates of a currently open subpath then the segment is omitted as superfluous. The winding rule of the specified Shape is ignored and the appended geometry is governed by the winding rule specified for this path.

Parameters:
pi - the PathIterator whose geometry is appended to this path
connect - a boolean to control whether or not to turn an initial moveTo segment into a lineTo segment to connect the new geometry to the existing path

getWindingRule

public int getWindingRule()
Deprecated. 
Returns the fill style winding rule.

Returns:
an integer representing the current winding rule.
See Also:
WIND_EVEN_ODD, WIND_NON_ZERO, setWindingRule(int)

setWindingRule

public void setWindingRule(int rule)
Deprecated. 
Sets the winding rule for this path to the specified value.

Parameters:
rule - an integer representing the specified winding rule
Throws:
IllegalArgumentException - if rule is not either WIND_EVEN_ODD or WIND_NON_ZERO
See Also:
WIND_EVEN_ODD, WIND_NON_ZERO, getWindingRule()

getCurrentPoint

public Point2D getCurrentPoint()
Deprecated. 
Returns the coordinates most recently added to the end of the path as a Point2D object.

Returns:
a Point2D object containing the ending coordinates of the path or null if there are no points in the path.

reset

public void reset()
Deprecated. 
Resets the path to empty. The append position is set back to the beginning of the path and all coordinates and point types are forgotten.


transform

public void transform(AffineTransform at)
Deprecated. 
Transforms the geometry of this path using the specified AffineTransform. The geometry is transformed in place, which permanently changes the boundary defined by this object.

Parameters:
at - the AffineTransform used to transform the area

reProject

public void reProject(org.cresques.cts.ICoordTrans ct)
Deprecated. 

createTransformedShape

public Shape createTransformedShape(AffineTransform at)
Deprecated. 
Returns a new transformed Shape.

Parameters:
at - the AffineTransform used to transform a new Shape.
Returns:
a new Shape, transformed with the specified AffineTransform.

getBounds

public Rectangle getBounds()
Deprecated. 
Return the bounding box of the path.

Specified by:
getBounds in interface Shape
Returns:
a Rectangle object that bounds the current path.

getBounds2D

public Rectangle2D getBounds2D()
Deprecated. 
Returns the bounding box of the path.

Specified by:
getBounds2D in interface Shape
Returns:
a Rectangle2D object that bounds the current path.

contains

public boolean contains(double x,
                        double y)
Deprecated. 
Tests if the specified coordinates are inside the boundary of this Shape.

Specified by:
contains in interface Shape
Parameters:
x - , y the specified coordinates
Returns:
true if the specified coordinates are inside this Shape; false otherwise

contains

public boolean contains(Point2D p)
Deprecated. 
Tests if the specified Point2D is inside the boundary of this Shape.

Specified by:
contains in interface Shape
Parameters:
p - the specified Point2D
Returns:
true if this Shape contains the specified Point2D, false otherwise.

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Deprecated. 
Tests if the specified rectangular area is inside the boundary of this Shape.

Specified by:
contains in interface Shape
Parameters:
x - , y the specified coordinates
w - the width of the specified rectangular area
h - the height of the specified rectangular area
Returns:
true if this Shape contains the specified rectangluar area; false otherwise.

contains

public boolean contains(Rectangle2D r)
Deprecated. 
Tests if the specified Rectangle2D is inside the boundary of this Shape.

Specified by:
contains in interface Shape
Parameters:
r - a specified Rectangle2D
Returns:
true if this Shape bounds the specified Rectangle2D; false otherwise.

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Deprecated. 
Tests if the interior of this Shape intersects the interior of a specified set of rectangular coordinates.

Specified by:
intersects in interface Shape
Parameters:
x - , y the specified coordinates
w - the width of the specified rectangular coordinates
h - the height of the specified rectangular coordinates
Returns:
true if this Shape and the interior of the specified set of rectangular coordinates intersect each other; false otherwise.

intersects

public boolean intersects(Rectangle2D r)
Deprecated. 
Tests if the interior of this Shape intersects the interior of a specified Rectangle2D.

Specified by:
intersects in interface Shape
Parameters:
r - the specified Rectangle2D
Returns:
true if this Shape and the interior of the specified Rectangle2D intersect each other; false otherwise.

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Deprecated. 
Returns a PathIterator object that iterates along the boundary of this Shape and provides access to the geometry of the outline of this Shape. The iterator for this class is not multi-threaded safe, which means that this GeneralPathX class does not guarantee that modifications to the geometry of this GeneralPathX object do not affect any iterations of that geometry that are already in process.

Specified by:
getPathIterator in interface Shape
Parameters:
at - an AffineTransform
Returns:
a new PathIterator that iterates along the boundary of this Shape and provides access to the geometry of this Shape's outline

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Deprecated. 
Returns a PathIterator object that iterates along the boundary of the flattened Shape and provides access to the geometry of the outline of the Shape. The iterator for this class is not multi-threaded safe, which means that this GeneralPathX class does not guarantee that modifications to the geometry of this GeneralPathX object do not affect any iterations of that geometry that are already in process.

Specified by:
getPathIterator in interface Shape
Parameters:
at - an AffineTransform
flatness - the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve
Returns:
a new PathIterator that iterates along the flattened Shape boundary.

clone

public Object clone()
Deprecated. 
Creates a new object of the same class as this object.

Overrides:
clone in class Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError - if there is not enough memory.
Since:
1.2
See Also:
Cloneable

setNumTypes

public void setNumTypes(int numTypes)
Deprecated. 

getNumTypes

public int getNumTypes()
Deprecated. 

setNumCoords

public int setNumCoords(int numCoords)
Deprecated. 

getNumCoords

public int getNumCoords()
Deprecated. 

getTypeAt

public byte getTypeAt(int index)
Deprecated. 

setPointTypes

public void setPointTypes(byte[] pointTypes)
Deprecated. use the geometry methods.


getPointTypes

public byte[] getPointTypes()
Deprecated. use the geometry methods.


setPointCoords

public void setPointCoords(double[] pointCoords)
Deprecated. use the geometry methods.

Parameters:
pointCoords -

getPointCoords

public double[] getPointCoords()
Deprecated. use the geometry methods.


getPointAt

public Point getPointAt(int index)
Deprecated. 

getCoordinatesAt

public double[] getCoordinatesAt(int index)
Deprecated. 

flip

public void flip()
Deprecated. 
Convertimos el path a puntos y luego le damos la vuelta.


isCCW

public boolean isCCW()
Deprecated. 
Check if the first part is CCW.

Returns:

isSimple

public boolean isSimple()
Deprecated. 
Returns:
the isSimple


Copyright © 2004-2012 gvSIG. All Rights Reserved.