Class FlyPathGraph

  • Direct Known Subclasses:
    FlyPathGraphCurve, FlyPathGraphSamples

    public class FlyPathGraph
    extends java.lang.Object
    Basic graph structure which identifies relationship between nodes by their indexes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.ArrayList<java.util.TreeMap<java.lang.Float,​java.util.Set<java.lang.Integer>>> m_kListBranchChildList
      Each item is a TreeMap instance which stores all of the child branches for a given branch.
      protected java.util.ArrayList<java.lang.Integer> m_kListBranchParentIndex
      Each item is an Integer which contains the index of the parent branch to which this branch is connected.
      protected java.util.ArrayList<java.lang.Float> m_kListBranchParentNormalizedDist
      Each item in a Float which contains the normalized path distance (in range [0,1]) for the parent branch where this branch started.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(int iBranchParent, float fNormalizedPathDist)
      Add a branch to the already existing branch at the specified distance along the branch.
      int getBranchParentIndex​(int iBranch)
      Return the index of the parent branch for the specified branch.
      float getBranchParentNormalizedDist​(int iBranch)
      Return the normalized distance (in range [0,1]) along the parent branch where the specified branch starts.
      int[] getBranchPointBranches​(int iBranch, int iBranchPoint)
      Return the array of branch indexes for all of the child branches which start at the specified point along the specified parent branch.
      protected java.util.Map.Entry[] getBranchPointEntryArray​(int iBranch)
      Return the array of TreeMap entries which stores all of the child branch information for the specified input branch.
      float[] getBranchPoints​(int iBranch)
      Return array of relative path distances (in range [0,1]) where branch points occur along the specified input branch.
      int getNumBranches()
      Return the number of branches stored for this path graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_kListBranchChildList

        protected java.util.ArrayList<java.util.TreeMap<java.lang.Float,​java.util.Set<java.lang.Integer>>> m_kListBranchChildList
        Each item is a TreeMap instance which stores all of the child branches for a given branch. The key value is a Float which stores the normalized path distance (in range [0,1]) which is where a branch (or more than one branch) starts. The keys are sortable so that the branch points can be fined in order. Each value is a Set instance which contains Integer's which identify the unique index of the child branch. array of TreeMap (key=Float(fNormalizedPathDist)), value=Set(Integer(iChildBranch)))
      • m_kListBranchParentIndex

        protected java.util.ArrayList<java.lang.Integer> m_kListBranchParentIndex
        Each item is an Integer which contains the index of the parent branch to which this branch is connected. A parent branch of -1 is used to indicate there is no parent branch, i.e., the root branch. This ArrayList has the same number of entries as the m_kListBranchParentNormalizedDist ArrayList and the entries correspond.
      • m_kListBranchParentNormalizedDist

        protected java.util.ArrayList<java.lang.Float> m_kListBranchParentNormalizedDist
        Each item in a Float which contains the normalized path distance (in range [0,1]) for the parent branch where this branch started. If there is no parent branch, this value is considered undefined. This ArrayList has the same number of entries as the m_kListBranchParentIndex ArrayList and the entries correspond.
    • Constructor Detail

      • FlyPathGraph

        protected FlyPathGraph()
        Constructor.
      • FlyPathGraph

        protected FlyPathGraph​(FlyPathGraph that)
        Copy constructor.
        Parameters:
        that - FlyPathGraph Instance to be duplicated.
    • Method Detail

      • getBranchParentIndex

        public int getBranchParentIndex​(int iBranch)
        Return the index of the parent branch for the specified branch. See also getBranchParentNormalizedDist() method.
        Parameters:
        iBranch - int Index which specifies the branch for returning its parent branch index.
        Returns:
        int Index of the parent branch. A value of -1 is returned if the specified branch has no parent.
      • getBranchParentNormalizedDist

        public float getBranchParentNormalizedDist​(int iBranch)
        Return the normalized distance (in range [0,1]) along the parent branch where the specified branch starts. See also getBranchParentIndex() method.
        Parameters:
        iBranch - int Index which specifies the branch for returning the normalized distance along the parent branch where this branch starts.
        Returns:
        float Normalized distance (in range [0,1]) along parent branch where the specified branch starts. A value of 0.0f is returned if the specified branch has no parent.
      • getBranchPointBranches

        public int[] getBranchPointBranches​(int iBranch,
                                            int iBranchPoint)
        Return the array of branch indexes for all of the child branches which start at the specified point along the specified parent branch.
        Parameters:
        iBranch - int Index which specifies the branch for which its child branches are to be returned.
        iBranchPoint - int Index of branch point along the specified branch. The vvalid range for this index is determined by array returned by getBranchPoints() method for same input branch.
        Returns:
        int[] Array of branch indexes which identify the child branches for the specified branch point. This array have one entry for each branch which starts at the specified branch point. The order of the child branches referenced by this array is the order in which the branches were found which is by order of longest to shortest.
      • getBranchPoints

        public float[] getBranchPoints​(int iBranch)
        Return array of relative path distances (in range [0,1]) where branch points occur along the specified input branch.
        Parameters:
        iBranch - int Index which specifies the branch for returning its branch points.
        Returns:
        float[] Array of relative path distances, where each value is in the range [0,1] and the values in the array are increasing (i.e., no duplicates). The number of entries in the array is the number of branch points, where each branch point may have more than one branch.
      • getNumBranches

        public int getNumBranches()
        Return the number of branches stored for this path graph. A branch is actually a node in the graph.
        Returns:
        int Number of path graph branches.
      • add

        protected void add​(int iBranchParent,
                           float fNormalizedPathDist)
        Add a branch to the already existing branch at the specified distance along the branch.
        Parameters:
        iBranchParent - int Index of already existing branch which the new branch will become connected to. Negative value to indicate that the branch has no parent.
        fNormalizedPathDist - float Proportional distance along a polyline path (relative to total path length) where the branch point occurs. Value is ignored if the branch has no parent.
      • getBranchPointEntryArray

        protected java.util.Map.Entry[] getBranchPointEntryArray​(int iBranch)
        Return the array of TreeMap entries which stores all of the child branch information for the specified input branch.
        Parameters:
        iBranch - int Index of branch for which its child branch information is to be returned.
        Returns:
        Map.Entry[] Array of TreeMap Entries where key is a Float for the relative path distance of each branch point, and value is a Set of the Integer for the index of each child branch starting at that branch point.