Interface Point1D<RP extends Point1D<? super RP,​? super RV,​? super RS>,​RV extends Vector1D<? super RV,​? super RP,​? super RS>,​RS extends Segment1D<?,​?>>

    • Method Detail

      • clamp

        default double clamp()
        Clamp the curviline coordinate to the segment.
        Returns:
        the amount that was removed from the coordinate. If the amount is negative it means that the coordinate was negative and clamped to zero. If the amount if positive it means that the coordinate was greater than the segment length and clamped to this length. If the amount is equal to zero it mean that the coordinate was not clamped.
      • isOnSegment

        @Pure
        default boolean isOnSegment()
        Replies if this pint is located on the segment.

        The point is located on the segment only if its curviline coordinate is in [0;length], where length is the length of the segment.

        Returns:
        true if the point is on the segment, otherwise false
      • isOnSameSegment

        @Pure
        default boolean isOnSameSegment​(Point1D<?,​?,​?> point)
        Replies if this point is located on the same segment as the given one.
        Parameters:
        point - the point to test.
        Returns:
        true if the points are on the same segment, otherwise false.
      • equals

        boolean equals​(Object object)
        Description copied from interface: Tuple2D
        Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.
        Specified by:
        equals in interface Tuple2D<RP extends Point1D<? super RP,​? super RV,​? super RS>>
        Overrides:
        equals in class Object
        Parameters:
        object - the object with which the comparison is made
        Returns:
        true or false
      • equals

        @Pure
        default boolean equals​(Point1D<?,​?,​?> tuple)
        Replies if this point is equals to the given point.
        Parameters:
        tuple - the point to test.
        Returns:
        true if this point has the same coordinates on the same segment as for the given point.
      • epsilonEquals

        @Pure
        default boolean epsilonEquals​(Point1D<?,​?,​?> tuple,
                                      double epsilon)
        Returns true if the L-infinite distance between this point and point p is less than or equal to the epsilon parameter, otherwise returns false. The L-infinite distance is equal to MAX[abs(curviline-curviline), abs(curviline-curviline)].

        If the points are not on the same segments, they are not equals.

        Parameters:
        tuple - the point to be compared to this point
        epsilon - the threshold value.
        Returns:
        true if the points are equals, otherwise false
      • hashCode

        @Pure
        int hashCode()
        Returns a hash number based on the data values in this object. Two different Point1D5 objects with identical data values (ie, returns true for equals(Point1D5) ) will return the same hash number. Two vectors with different data members may return the same hash value, although this is not likely.
        Specified by:
        hashCode in interface Tuple2D<RP extends Point1D<? super RP,​? super RV,​? super RS>>
        Overrides:
        hashCode in class Object
        Returns:
        the integer hash code value
      • add

        default void add​(double curvilineMove)
        Add the given values to this point.
        Parameters:
        curvilineMove - is the quantity to add to the curviline coordinate.
      • sub

        default void sub​(double curvilineMove)
        Substract the given values to this point.
        Parameters:
        curvilineMove - is the quantity to substract to the curviline coordinate.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Point1D<?,​?,​?> p1)
        Computes the square of the distance between this point and point p1.
        Parameters:
        p1 - the other point
        Returns:
        the square of the distance
      • getDistance

        @Pure
        default double getDistance​(Point1D<?,​?,​?> p1)
        Computes the distance between this point and point p1.
        Parameters:
        p1 - the other point
        Returns:
        the distance or Double.POSITIVE_INFINITY if not on the same segments.
      • getDistanceL1

        @Pure
        default double getDistanceL1​(Point1D<?,​?,​?> p1)
        Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(curviline1-curviline2) + abs(jutting1-jutting2).
        Parameters:
        p1 - the other point
        Returns:
        the manhattan distance or Double.POSITIVE_INFINITY if not on the same segments.
      • getDistanceLinf

        @Pure
        default double getDistanceLinf​(Point1D<?,​?,​?> p1)
        Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(curviline1-curviline2), abs(jutting1-jutting2)].
        Parameters:
        p1 - the other point
        Returns:
        the L-infinite distance or Double.POSITIVE_INFINITY if not on the same segments.
      • getDistanceCurviline

        @Pure
        default double getDistanceCurviline​(Point1D<?,​?,​?> p1)
        Computes the curviline distance between this point and point p1. The curviline distance is equal to abs(curviline1-curviline2).
        Parameters:
        p1 - the other point
        Returns:
        the curviline distance or Double.POSITIVE_INFINITY if not on the same segments.
      • getDistanceShift

        @Pure
        default double getDistanceShift​(Point1D<?,​?,​?> p1)
        Computes the jutting distance between this point and point p1. The jutting distance is equal to abs(jutting1-jutting2).
        Parameters:
        p1 - the other point
        Returns:
        the jutting distance or Double.POSITIVE_INFINITY if not on the same segments.
      • getCurvilineCoordinate

        @Pure
        default double getCurvilineCoordinate()
        Replies the curviline coordinate.
        Returns:
        the curviline coordinate.
      • setCurvilineCoordinate

        default void setCurvilineCoordinate​(double curviline)
        Set the curviline coordinate.
        Parameters:
        curviline - is the curviline coordinate.
      • getLateralDistance

        @Pure
        default double getLateralDistance()
        Replies the lateral distance.
        Returns:
        the lateral distance.
      • setLateralDistance

        default void setLateralDistance​(double distance)
        Set the shift distance.
        Parameters:
        distance - is the shift distance.
      • getSegment

        @Pure
        RS getSegment()
        Replies the segment.
        Returns:
        the segment or null if the weak reference has lost the segment.
      • setSegment

        default void setSegment​(RS segment)
        Set the segment.
        Parameters:
        segment - is the segment.
      • set

        void set​(RS segment,
                 double curviline,
                 double shift)
        Set this point from the given informations.
        Parameters:
        segment - the segment
        curviline - the curviline coordinate
        shift - the jutting coordinate
      • set

        @Pure
        default void set​(RS segment,
                         Tuple2D<?> tuple)
        Set this point from the given informations.
        Parameters:
        segment - the segment
        tuple - are the coordinates of the point.
      • set

        default void set​(Point1D<? extends RP,​? extends RV,​? extends RS> point)
        Set this point from the given informations.
        Parameters:
        point - are the coordinates of the point.
      • toUnmodifiable

        @Pure
        UnmodifiablePoint1D<RP,​RV,​RS> toUnmodifiable()
        Replies an unmodifiable copy of this point.
        Returns:
        an unmodifiable copy.
      • getGeomFactory

        @Pure
        GeomFactory1D<RV,​RP> getGeomFactory()
        Replies the geometry factory associated to this point.
        Returns:
        the factory.
      • operator_plus

        @Pure
        default RP operator_plus​(Vector2D<?,​?> v)
        Sum of this point and a vector: this + v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector to add
        Returns:
        the result.
      • operator_add

        default void operator_add​(Vector2D<?,​?> v)
        Increment this point with the given vector: this += v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector to add
        See Also:
        Tuple2D.add(double, double)
      • operator_minus

        @Pure
        default RP operator_minus​(Vector2D<?,​?> v)
        Subtract the v vector to this point: this - v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector to substract.
        Returns:
        the result.
      • operator_minus

        @Pure
        default RV operator_minus​(Point2D<?,​?> pt)
        Subtract the p point to this point: this - p.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        pt - the point to substract
        Returns:
        the vector from the p to this.
        See Also:
        Vector2D.sub(Point2D, Point2D)
      • operator_remove

        default void operator_remove​(Vector2D<?,​?> v)
        Subtract the v vector to this: this -= v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector to substract.
      • operator_equals

        @Pure
        default boolean operator_equals​(Tuple2D<?> v)
        Replies if the given vector is equal to this vector: this == v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector.
        Returns:
        test result.
        See Also:
        Tuple2D.equals(Tuple2D)
      • operator_notEquals

        @Pure
        default boolean operator_notEquals​(Tuple2D<?> v)
        Replies if the given vector is different than this vector: this != v.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        v - the vector.
        Returns:
        test result.
        See Also:
        Tuple2D.equals(Tuple2D)
      • operator_upTo

        @Pure
        default double operator_upTo​(Point1D<?,​?,​?> pt)
        Replies if the distance between this and the p point: this .. p.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        pt - the point.
        Returns:
        the distance.
        See Also:
        getDistance(Point1D)
      • operator_elvis

        @Pure
        default Point1D<? extends RP,​? extends RV,​? extends RS> operator_elvis​(Point1D<? extends RP,​? extends RV,​? extends RS> pt)
        If this point is epsilon equal to zero then reply p else reply this: this ?: p.

        This function is an implementation of the operator for the languages that defined or based on the Xtext framework.

        Parameters:
        pt - the point.
        Returns:
        the point.
      • $plus

        @Pure
        default RP $plus​(Vector2D<?,​?> v)
        Sum of this point and a vector: this + v.

        This function is an implementation of the operator for the Scala Language.

        Parameters:
        v - the vector to add
        Returns:
        the result.
      • $minus

        @Pure
        default RP $minus​(Vector2D<?,​?> v)
        Subtract the v vector to this point: this - v.

        This function is an implementation of the operator for the Scala Language.

        Parameters:
        v - the vector to substract.
        Returns:
        the result.
      • $minus

        @Pure
        default RV $minus​(Point2D<?,​?> pt)
        Subtract the p point to this point: this - p.

        This function is an implementation of the operator for the Scala Language.

        Parameters:
        pt - the point to substract
        Returns:
        the vector from the p to this.