Documentation of 'math.geom2d.spline.GeneralPath2D' Java class
GeneralPath2D
math.geom2d.spline

Class GeneralPath2D

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean almostEquals(GeometricObject2D obj, double eps)
      Checks if the two objects are similar up to a given threshold value.
      java.awt.geom.Path2D asAwtShape()
      Transform to a java Path2D object.
      Box2D boundingBox()
      Returns the bounding box of the shape.
      CurveSet2D<? extends Curve2D> clip(Box2D box)
      When a curve is clipped, the result is a set of curves.
      GeneralPath2D clone() 
      void closePath() 
      boolean contains(double x, double y)
      Checks if the shape contains the planar point defined by (x,y).
      boolean contains(Point2D p)
      Checks if the shape contains the given point.
      java.util.Collection<? extends ContinuousCurve2D> continuousCurves()
      Returns the collection of continuous curves which constitute this curve.
      void cubicTo(Point2D p1, Point2D p2, Point2D p3) 
      double distance(double x, double y)
      Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e.
      double distance(Point2D p)
      Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
      void draw(java.awt.Graphics2D g2)
      Draws the curve on the given Graphics2D object.
      boolean equals(java.lang.Object obj) 
      Point2D firstPoint()
      Returns the first point of the curve, or null if this curve is empty.
      double getT0() 
      double getT1() 
      java.util.Collection<Point2D> intersections(LinearShape2D line)
      Returns the intersection points of the curve with the specified line.
      boolean isBounded()
      Returns true, as a curve composed of Bezier pieces is always bounded.
      boolean isEmpty()
      Returns true if the shape does not contain any point.
      boolean isSingular(double pos)
      Checks if a point is singular.
      Point2D lastPoint()
      Returns the last point of the curve, or null if this curve is empty.
      void lineTo(Point2D p) 
      void moveTo(Point2D p) 
      Point2D point(double t)
      Returns the point located at the given position on the curve.
      double position(Point2D point)
      Computes the position of the point on the curve.
      double project(Point2D point)
      Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point.
      void quadTo(Point2D p1, Point2D p2) 
      Curve2D reverse()
      Returns the curve with same trace on the plane with parameterization in reverse order.
      java.util.Collection<Point2D> singularPoints()
      Returns a set of singular points, i.
      Curve2D subCurve(double t0, double t1)
      Returns a portion of the original curve, delimited by two positions on the curve.
      double t0()
      The first parameterization value is equal to 0.
      double t1()
      The last parameterization value is given by the number of elementary operations (moveTo, closePath, lineTo...) minus one (for the initial move).
      Curve2D transform(AffineTransform2D trans)
      Transforms the curve by an affine transform.
      java.util.Collection<Point2D> vertices()
      Returns the set of vertices for this curve.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeneralPath2D

        public GeneralPath2D()
        Initialize an empty path.
      • GeneralPath2D

        public GeneralPath2D(GeneralPath2D path)
        Copy constructor.
    • Method Detail

      • moveTo

        public void moveTo(Point2D p)
      • lineTo

        public void lineTo(Point2D p)
      • closePath

        public void closePath()
      • t0

        public double t0()
        The first parameterization value is equal to 0.
        Specified by:
        t0 in interface Curve2D
      • getT0

        public double getT0()
        Specified by:
        getT0 in interface Curve2D
      • t1

        public double t1()
        The last parameterization value is given by the number of elementary operations (moveTo, closePath, lineTo...) minus one (for the initial move).
        Specified by:
        t1 in interface Curve2D
      • getT1

        public double getT1()
        Specified by:
        getT1 in interface Curve2D
      • point

        public Point2D point(double t)
        Description copied from interface: Curve2D
        Returns the point located at the given position on the curve. If the parameter lies outside the definition range, the parameter corresponding to the closest bound is used instead. This method can be used to draw an approximated outline of a curve, by selecting multiple values for t and drawing lines between them.
        Specified by:
        point in interface Curve2D
      • singularPoints

        public java.util.Collection<Point2D> singularPoints()
        Description copied from interface: Curve2D
        Returns a set of singular points, i. e. which do not locally admit derivative.
        Specified by:
        singularPoints in interface Curve2D
        Returns:
        a collection of Point2D.
        See Also:
        Curve2D.vertices()
      • vertices

        public java.util.Collection<Point2D> vertices()
        Description copied from interface: Curve2D
        Returns the set of vertices for this curve. Vertices can be either singular points, or extremities.
        Specified by:
        vertices in interface Curve2D
        Returns:
        a collection of Point2D.
        See Also:
        Curve2D.singularPoints()
      • isSingular

        public boolean isSingular(double pos)
        Description copied from interface: Curve2D
        Checks if a point is singular.
        Specified by:
        isSingular in interface Curve2D
        Parameters:
        pos - the position of the point on the curve
        Returns:
        true if the point at this location is singular
      • position

        public double position(Point2D point)
        Description copied from interface: Curve2D
        Computes the position of the point on the curve. If the point does not belong to the curve, return Double.NaN. It is complementary to the point(double) method.
        Specified by:
        position in interface Curve2D
        Parameters:
        point - a point belonging to the curve
        Returns:
        the position of the point on the curve
        See Also:
        Curve2D.point(double)
      • project

        public double project(Point2D point)
        Description copied from interface: Curve2D
        Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. This function should always returns a valid value.
        Specified by:
        project in interface Curve2D
        Parameters:
        point - a point to project
        Returns:
        the position of the closest orthogonal projection
      • intersections

        public java.util.Collection<Point2D> intersections(LinearShape2D line)
        Description copied from interface: Curve2D
        Returns the intersection points of the curve with the specified line. The length of the result array is the number of intersection points.
        Specified by:
        intersections in interface Curve2D
      • reverse

        public Curve2D reverse()
        Description copied from interface: Curve2D
        Returns the curve with same trace on the plane with parameterization in reverse order.
        Specified by:
        reverse in interface Curve2D
      • continuousCurves

        public java.util.Collection<? extends ContinuousCurve2D> continuousCurves()
        Description copied from interface: Curve2D
        Returns the collection of continuous curves which constitute this curve.
        Specified by:
        continuousCurves in interface Curve2D
        Returns:
        a collection of continuous curves.
      • subCurve

        public Curve2D subCurve(double t0,
                                double t1)
        Description copied from interface: Curve2D
        Returns a portion of the original curve, delimited by two positions on the curve.
        Specified by:
        subCurve in interface Curve2D
        Parameters:
        t0 - position of the start of the sub-curve
        t1 - position of the end of the sub-curve
        Returns:
        the portion of original curve comprised between t0 and t1.
      • asAwtShape

        public java.awt.geom.Path2D asAwtShape()
        Transform to a java Path2D object.
        Specified by:
        asAwtShape in interface Curve2D
        Returns:
        the shape corresponding to this curve
      • contains

        public boolean contains(Point2D p)
        Description copied from interface: Shape2D
        Checks if the shape contains the given point.
        Specified by:
        contains in interface Shape2D
      • contains

        public boolean contains(double x,
                                double y)
        Description copied from interface: Shape2D
        Checks if the shape contains the planar point defined by (x,y).
        Specified by:
        contains in interface Shape2D
      • distance

        public double distance(Point2D p)
        Description copied from interface: Shape2D
        Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
        Specified by:
        distance in interface Shape2D
      • distance

        public double distance(double x,
                               double y)
        Description copied from interface: Shape2D
        Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape.
        Specified by:
        distance in interface Shape2D
      • isBounded

        public boolean isBounded()
        Returns true, as a curve composed of Bezier pieces is always bounded.
        Specified by:
        isBounded in interface Shape2D
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Shape2D
        Returns true if the shape does not contain any point. This is the case for example for PointSet2D without any point.
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the shape does not contain any point.
      • boundingBox

        public Box2D boundingBox()
        Description copied from interface: Shape2D
        Returns the bounding box of the shape.
        Specified by:
        boundingBox in interface Shape2D
        Returns:
        the bounding box of the shape.
      • clip

        public CurveSet2D<? extends Curve2D> clip(Box2D box)
        Description copied from interface: Curve2D
        When a curve is clipped, the result is a set of curves.
        Specified by:
        clip in interface Curve2D
        Specified by:
        clip in interface Shape2D
        Parameters:
        box - the clipping box
        Returns:
        the clipped shape
      • transform

        public Curve2D transform(AffineTransform2D trans)
        Description copied from interface: Curve2D
        Transforms the curve by an affine transform. The result is an instance of Curve2D.
        Specified by:
        transform in interface Curve2D
        Specified by:
        transform in interface Shape2D
        Parameters:
        trans - an affine transform
        Returns:
        the transformed shape
      • draw

        public void draw(java.awt.Graphics2D g2)
        Description copied from interface: Curve2D
        Draws the curve on the given Graphics2D object.
        Specified by:
        draw in interface Curve2D
        Specified by:
        draw in interface Shape2D
        Parameters:
        g2 - the graphics to draw the curve in
      • almostEquals

        public boolean almostEquals(GeometricObject2D obj,
                                    double eps)
        Description copied from interface: GeometricObject2D
        Checks if the two objects are similar up to a given threshold value. This method can be used to compare the results of geometric computations, that introduce errors due to numerical computations.
        Specified by:
        almostEquals in interface GeometricObject2D
        Parameters:
        obj - the object to compare
        eps - a threshold value, for example the minimal coordinate difference
        Returns:
        true if both object have the same value up to the threshold
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • clone

        public GeneralPath2D clone()
        Specified by:
        clone in interface Curve2D
        Overrides:
        clone in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.