Class DistanceUtilPtr


  • public class DistanceUtilPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • DistanceUtilPtr

        public DistanceUtilPtr​(long cPtr,
                               boolean cMemoryOwn)
      • DistanceUtilPtr

        public DistanceUtilPtr()
        Default constructor yielding a NULL-pointer.
      • DistanceUtilPtr

        public DistanceUtilPtr​(DistanceUtil ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • deref

        public DistanceUtil deref()
        The pointer stored in the object.
      • __ref__

        public DistanceUtil __ref__()
        Dereferencing operator.
      • getDeref

        public DistanceUtil getDeref()
        Member access operator.
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • distanceLineLineSqr

        public double distanceLineLineSqr​(Vector3D p1,
                                          Vector3D p2,
                                          Vector3D q1,
                                          Vector3D q2)
        computes the squared euclidean distance between line segments
        (line(p1,p2),line(q1,q2))
        Parameters:
        p1 - [in] start point on line segment 1
        p2 - [in] end point on line segment 1
        q1 - [in] start point on line segment 2
        q2 - [in] end point on line segment 2
        Returns:
        distance between line segments
      • distanceLineLine

        public double distanceLineLine​(Vector3D p1,
                                       Vector3D p2,
                                       Vector3D q1,
                                       Vector3D q2)
        computes the euclidean distance between line segments (line(p1,p2),line(q1,q2))
        Parameters:
        p1 - [in] start point on line segment 1
        p2 - [in] end point on line segment 1
        q1 - [in] start point on line segment 2
        q2 - [in] end point on line segment 2
        Returns:
        distance between line segments