Пример #1
0
        public bool equals(TDNode other)
        {
            bool test = false;

            if (other == null && p == null && s == null && t == null)
            {
                return(true);
            }
            else if (other == null)
            {
                return(false);
            }
            else
            {
                if (p != null && other.p != null && p.equals(other.p))
                {
                    test = true;
                }
                if (s != null && other.s != null && s.equals(other.s))
                {
                    test = true;
                }
                if (t != null && other.t != null && t.equals(other.t))
                {
                    test = true;
                }

                if (type != other.getType())
                {
                    test = false;
                }

                return(test);
            }
        }
Пример #2
0
        public TrapezoidFace retrieve(TDPoint p)
        {
            TDNode nextNode = root;

            while (nextNode.getType() != TDNode.LEAF)
            {
                nextNode = nextNode.getNext(p);
            }
            return(nextNode.t);
        }
Пример #3
0
        public TDNode retrieveNode(TDPoint p)
        {
            //Debug.Log("Retrieving p=("+p.x+","+p.y+")");

            TDNode nextNode = root;
            int    steps    = 0;
            String s        = "";

            while (nextNode.getType() != TDNode.LEAF)
            {
                //Debug.Log( s+nextNode.print());
                nextNode = nextNode.getNext(p);
                steps++;
                s = s + " ";
            }
            //Debug.Log("Steps: "+steps);
            return(nextNode);
        }