コード例 #1
0
ファイル: HTDrawNode.cs プロジェクト: wuyanna/HyperTree
        public HTDrawNode(HTDrawNodeComposite father, HTModelNode node, HTDraw model)
        {
            this.father = father;
            this.node = node;
            this.model = model;

            label = new HTNodeLabel(this);

            ze = new HTCoordE(node.GetCoordinates());
            oldZe = new HTCoordE(ze);
            zs = new HTCoordS();

            model.MapNode(node.GetNode(), this);
            return;
        }
コード例 #2
0
ファイル: HTDrawNode.cs プロジェクト: wuyanna/HyperTree
        public HTDrawNode(HTDrawNodeComposite father, HTModelNode node, HTDraw model)
        {
            this.father = father;
            this.node   = node;
            this.model  = model;

            label = new HTNodeLabel(this);

            ze    = new HTCoordE(node.GetCoordinates());
            oldZe = new HTCoordE(ze);
            zs    = new HTCoordS();

            model.MapNode(node.GetNode(), this);
            return;
        }
コード例 #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;
                }
            }
        }
コード例 #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;
                }
            }
        }