Example #1
0
        public HTModelNode(HTNode node, HTModelNodeComposite parent, HTModel model)
        {
            this.node = node;
            this.parent = parent;
            this.model = model;
            model.IncrementNumberOfNodes();

            z = new HTCoordE();
        }
Example #2
0
        public HTModelNode(HTNode node, HTModelNodeComposite parent, HTModel model)
        {
            this.node   = node;
            this.parent = parent;
            this.model  = model;
            model.IncrementNumberOfNodes();

            z = new HTCoordE();
        }
Example #3
0
        internal HTDrawNodeComposite(HTDrawNodeComposite father, HTModelNodeComposite node, HTDraw model)
            : base(father, node, model)
        {
            this.node      = node;
            this.children  = new ObservableCollection <HTDrawNode>();
            this.geodesics = new Dictionary <HTDrawNode, HTGeodesic>();

            HTModelNode childNode = null;
            HTDrawNode  child     = null;
            HTDrawNode  brother   = null;
            bool        first     = true;
            bool        second    = false;

            for (IEnumerator i = node.Children(); i.MoveNext();)
            {
                childNode = (HTModelNode)i.Current;
                if (childNode.IsLeaf())
                {
                    child = new HTDrawNode(this, childNode, model);
                }
                else
                {
                    child = new HTDrawNodeComposite(this, (HTModelNodeComposite)childNode, model);
                }
                AddChild(child);
                if (first)
                {
                    brother = child;
                    first   = false;
                    second  = true;
                }
                else if (second)
                {
                    child.SetBrother(brother);
                    brother.SetBrother(child);
                    brother = child;
                    second  = false;
                }
                else
                {
                    child.SetBrother(brother);
                    brother = child;
                }
            }
        }
Example #4
0
        internal HTDrawNodeComposite(HTDrawNodeComposite father, HTModelNodeComposite node, HTDraw model)
            : base(father, node, model)
        {
            this.node = node;
            this.children = new ObservableCollection<HTDrawNode>();
            this.geodesics = new Dictionary<HTDrawNode, HTGeodesic>();

            HTModelNode childNode = null;
            HTDrawNode child = null;
            HTDrawNode brother = null;
            bool first = true;
            bool second = false;
            for (IEnumerator i = node.Children(); i.MoveNext(); )
            {
                childNode = (HTModelNode)i.Current;
                if (childNode.IsLeaf())
                {
                    child = new HTDrawNode(this, childNode, model);
                }
                else
                {
                    child = new HTDrawNodeComposite(this, (HTModelNodeComposite)childNode, model);
                }
                AddChild(child);
                if (first)
                {
                    brother = child;
                    first = false;
                    second = true;
                }
                else if (second)
                {
                    child.SetBrother(brother);
                    brother.SetBrother(child);
                    brother = child;
                    second = false;
                }
                else
                {
                    child.SetBrother(brother);
                    brother = child;
                }
            }
        }
 public HTModelNodeComposite(HTNode node, HTModelNodeComposite parent, HTModel model)
     : base(node, parent, model)
 {
     this.children = new ObservableCollection<HTModelNode>();
     HTNode childNode = null;
     HTModelNode child = null;
     for (IEnumerator i = node.Children(); i.MoveNext(); )
     {
         childNode = (HTNode)i.Current;
         if (childNode.IsLeaf())
         {
             child = new HTModelNode(childNode, this, model);
             //Debug.WriteLine("HTModelNode:" + child);
         }
         else
         {
             child = new HTModelNodeComposite(childNode, this, model);
             //Debug.WriteLine("HTModelNodeComposite:" + child);
         }
         AddChild(child);
     }
     ComputeWeight();
 }
        public HTModelNodeComposite(HTNode node, HTModelNodeComposite parent, HTModel model)
            : base(node, parent, model)
        {
            this.children = new ObservableCollection <HTModelNode>();
            HTNode      childNode = null;
            HTModelNode child     = null;

            for (IEnumerator i = node.Children(); i.MoveNext();)
            {
                childNode = (HTNode)i.Current;
                if (childNode.IsLeaf())
                {
                    child = new HTModelNode(childNode, this, model);
                    //Debug.WriteLine("HTModelNode:" + child);
                }
                else
                {
                    child = new HTModelNodeComposite(childNode, this, model);
                    //Debug.WriteLine("HTModelNodeComposite:" + child);
                }
                AddChild(child);
            }
            ComputeWeight();
        }