Class DistanceCalculatorPtr


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

      • DistanceCalculatorPtr

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

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

        public DistanceCalculatorPtr​(DistanceCalculator ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • 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
      • distance

        public DistanceStrategyResult distance​(State state,
                                               DistanceStrategyResultVector result)
        Calculates the distances between frames in the tree

        Parameters:
        state - [in] The state for which to calculate distances.

        result - [out] If non-NULL, the distance results are written
        to result.

        Returns:
        the shortest distance between frame and frame tree
      • distance

        public DistanceStrategyResult distance​(State state)
        Calculates the distances between frames in the tree

        Parameters:
        state - [in] The state for which to calculate distances.



        Returns:
        the shortest distance between frame and frame tree
      • distance

        public DistanceStrategyResult distance​(State state,
                                               Frame frame,
                                               DistanceStrategyResultVector result)
        Calculates the distance between frame and the rest of the tree

        Parameters:
        state - [in] The state for which to calculate distances.

        frame - [in] The frame for which distances are to be calculated

        result - [out] If non-NULL, the distance results are written
        to result.

        Returns:
        the shortest distance between frame and frame tree
      • distance

        public DistanceStrategyResult distance​(State state,
                                               Frame frame)
        Calculates the distance between frame and the rest of the tree

        Parameters:
        state - [in] The state for which to calculate distances.

        frame - [in] The frame for which distances are to be calculated



        Returns:
        the shortest distance between frame and frame tree
      • setDistanceStrategy

        public void setDistanceStrategy​(DistanceStrategyPtr strategy)
        Set the primitive distance calculator to strategy.

        strategy must be non-NULL.

        Ownership of the strategy is not taken.

        Parameters:
        strategy - [in] - the primitive distance calculator to use.
      • addDistanceModel

        public boolean addDistanceModel​(Frame frame,
                                        Geometry faces)
        Adds distance model to frame

        The distance model is constructed based on the list of faces given.

        Parameters:
        frame - [in] frame to which the distance model should associate
        faces - [in] list of faces from which to construct the model
        Returns:
        true if a distance model was succesfully created and linked
        with the frame; false otherwise.
      • clearCache

        public void clearCache()
        Clears the cache of the distance models
      • getComputationTime

        public double getComputationTime()
      • getCount

        public int getCount()
      • resetComputationTimeAndCount

        public void resetComputationTimeAndCount()