Interface Path3D<ST extends Shape3D<?,​?,​I,​P,​V,​B>,​IT extends Shape3D<?,​?,​I,​P,​V,​B>,​I extends PathIterator3D<?>,​P extends Point3D<? super P,​? super V>,​V extends Vector3D<? super V,​? super P>,​B extends Shape3D<?,​?,​I,​P,​V,​B>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    I - is the type of the iterator used to obtain the elements of the path.
    P - is the type of the points.
    V - is the type of the vectors.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, Serializable, Shape3D<ST,​IT,​I,​P,​V,​B>
    All Known Subinterfaces:
    Path3afp<ST,​IT,​IE,​P,​V,​B>, Path3ai<ST,​IT,​IE,​P,​V,​B>
    All Known Implementing Classes:
    Path3d, Path3dfx, Path3i, Path3ifx

    public interface Path3D<ST extends Shape3D<?,​?,​I,​P,​V,​B>,​IT extends Shape3D<?,​?,​I,​P,​V,​B>,​I extends PathIterator3D<?>,​P extends Point3D<? super P,​? super V>,​V extends Vector3D<? super V,​? super P>,​B extends Shape3D<?,​?,​I,​P,​V,​B>>
    extends Shape3D<ST,​IT,​I,​P,​V,​B>
    3D Path.
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Thomas PIOTROWSKI, Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Detail

      • getWindingRule

        @Pure
        PathWindingRule getWindingRule()
        Replies the winding rule for the path.
        Returns:
        the winding rule for the path.
      • setWindingRule

        void setWindingRule​(PathWindingRule rule)
        Set the winding rule for the path.
        Parameters:
        rule - is the winding rule for the path.
      • isPolyline

        @Pure
        boolean isPolyline()
        Replies the path is composed only by one MOVE_TO, and a sequence of LINE_TO primitives.
        Returns:
        true if the path does not contain curve primitives, false otherwise.
      • isCurved

        @Pure
        boolean isCurved()
        Replies the path contains a curve..
        Returns:
        true if the path does not contain curve primitives, false otherwise.
      • isMultiParts

        @Pure
        boolean isMultiParts()
        Replies the path has multiple parts, i.e. multiple MOVE_TO are inside. primitives.
        Returns:
        true if the path has multiple move-to primitive, false otherwise.
      • isPolygon

        @Pure
        boolean isPolygon()
        Replies the path is composed only by one MOVE_TO, a sequence of LINE_TO or QUAD_TO or CURVE_TO, and a single CLOSE primitives.
        Returns:
        true if the path does not contain curve primitives, false otherwise.
      • getPathIterator

        @Pure
        I getPathIterator​(double flatness)
        Replies an iterator on the path elements.

        Only PathElementType.MOVE_TO, PathElementType.LINE_TO, and PathElementType.CLOSE types are returned by the iterator.

        The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values. This limit, if there is one, is defined by the particular implementation that is used.

        The iterator for this class is not multi-threaded safe.

        Parameters:
        flatness - is 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:
        an iterator on the path elements.
      • moveTo

        void moveTo​(Point3D<?,​?> position)
        Adds a point to the path by moving to the specified coordinates specified in double precision.
        Parameters:
        position - the new position.
      • lineTo

        void lineTo​(Point3D<?,​?> to)
        Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.
        Parameters:
        to - the end point
      • quadTo

        void quadTo​(Point3D<?,​?> ctrl,
                    Point3D<?,​?> to)
        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 specified coordinates (x2,y2), using the specified point (x1,y1) as a quadratic parametric control point. All coordinates are specified in double precision.
        Parameters:
        ctrl - the quadratic control point
        to - the final end point
      • curveTo

        void curveTo​(Point3D<?,​?> ctrl1,
                     Point3D<?,​?> ctrl2,
                     Point3D<?,​?> to)
        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 specified coordinates (x3,y3), using the specified points (x1,y1) and (x2,y2) as Bézier control points. All coordinates are specified in double precision.
        Parameters:
        ctrl1 - the first Bézier control point
        ctrl2 - the second Bézier control point
        to - the final end point
      • closePath

        void closePath()
        Closes the current subpath by drawing a straight line back to the coordinates of the last moveTo. If the path is already closed or if the previous coordinates are for a moveTo then this method has no effect.
      • toBoundingBoxWithCtrlPoints

        B toBoundingBoxWithCtrlPoints()
        Replies the bounding box of all the points added in this path.

        The replied bounding box includes the (invisible) control points.

        Returns:
        the bounding box with the control points.
        See Also:
        Shape3D.toBoundingBox()
      • toBoundingBoxWithCtrlPoints

        void toBoundingBoxWithCtrlPoints​(B box)
        Compute the bounding box of all the points added in this path.

        The replied bounding box includes the (invisible) control points.

        Parameters:
        box - is the rectangle to set with the bounds.
        See Also:
        Shape3D.toBoundingBox()
      • toIntArray

        @Pure
        default int[] toIntArray()
        Replies the coordinates of this path in an array of integer numbers.
        Returns:
        the coordinates.
      • toIntArray

        @Pure
        int[] toIntArray​(Transform3D transform)
        Replies the coordinates of this path in an array of integer numbers.
        Parameters:
        transform - is the transformation to apply to all the coordinates.
        Returns:
        the coordinates.
      • toFloatArray

        @Pure
        default float[] toFloatArray()
        Replies the coordinates of this path in an array of single precision floating-point numbers.
        Returns:
        the coordinates.
      • toFloatArray

        @Pure
        float[] toFloatArray​(Transform3D transform)
        Replies the coordinates of this path in an array of single precision floating-point numbers.
        Parameters:
        transform - is the transformation to apply to all the coordinates.
        Returns:
        the coordinates.
      • toDoubleArray

        @Pure
        default double[] toDoubleArray()
        Replies the coordinates of this path in an array of double precision floating-point numbers.
        Returns:
        the coordinates.
      • toDoubleArray

        @Pure
        double[] toDoubleArray​(Transform3D transform)
        Replies the coordinates of this path in an array of double precision floating-point numbers.
        Parameters:
        transform - is the transformation to apply to all the coordinates.
        Returns:
        the coordinates.
      • toPointArray

        @Pure
        default P[] toPointArray()
        Replies the points of this path in an array.
        Returns:
        the points.
      • toPointArray

        @Pure
        P[] toPointArray​(Transform3D transform)
        Replies the points of this path in an array.
        Parameters:
        transform - is the transformation to apply to all the points.
        Returns:
        the points.
      • toCollection

        @Pure
        Collection<P> toCollection()
        Replies the collection that is contains all the points of the path.
        Returns:
        the point collection.
      • getPointAt

        @Pure
        P getPointAt​(int index)
        Replies the point at the given index. The index is in [0;size()).
        Parameters:
        index - the index.
        Returns:
        the point at the given index.
      • getCurrentPoint

        @Pure
        P getCurrentPoint()
        Replies the last point in the path.
        Returns:
        the last point.
      • size

        @Pure
        int size()
        Replies the number of points in the path.
        Returns:
        the number of points in the path.
      • getPathElementCount

        @Pure
        int getPathElementCount()
        Replies the number of path elements in this path.
        Returns:
        the number of path elements.
        See Also:
        getPathElementTypeAt(int)
      • getPathElementTypeAt

        @Pure
        PathElementType getPathElementTypeAt​(int index)
        Replies the type of the path element at the given position in this path.
        Parameters:
        index - the index of the path element.
        Returns:
        the type of the path element.
        See Also:
        getPathElementCount()
      • getLength

        @Pure
        default double getLength()
        Replies the total length of the path.
        Returns:
        the length of the path.
      • getLengthSquared

        @Pure
        double getLengthSquared()
        Replies the total squared length of the path.
        Returns:
        the length of the path.
      • removeLast

        void removeLast()
        Remove the last action.
      • setLastPoint

        void setLastPoint​(Point3D<?,​?> point)
        Change the coordinates of the last inserted point.
        Parameters:
        point - the point.
      • containsControlPoint

        @Pure
        boolean containsControlPoint​(Point3D<?,​?> point)
        Replies if the given points exists in the coordinates of this path.
        Parameters:
        point - the point.
        Returns:
        true if the point is a control point of the path.