Ejemplo n.º 1
0
        /// <summary>
        /// 设置空间的Wave 根节点
        /// </summary>
        /// <param name="RootClass">设计模型根节点</param>
        /// <param name="AttachModellist">辅助节点列表</param>
        public void SetRootClass(ArrayList RootModellist)
        {
            this.HorizontalScroll.Value = 0;
            int StartX = 0;
            int StartY = 0;

            int MaxHeight = 0;


            HTExistModel = new Hashtable();

            for (int i = 0; i < RootModellist.Count; i++)
            {
                ModelClass M = RootModellist[i] as ModelClass;
                if (!HTExistModel.Contains(M.ModelID))
                {
                    WaveRelationClass WRClass = new WaveRelationClass(M);

                    WRClass.SetEveryModelLocation();

                    int MaxWaveLength = WRClass.GetLocationLength();
                    int MaxModelDepth = WRClass.GetLocationWidth();

                    int tWidth  = 0;
                    int tHeight = CtlGlobalClass.UpBlank + CtlGlobalClass.DownBlank + (MaxWaveLength) * CtlGlobalClass.VShapeDis;

                    if (i == 0)
                    {
                        tWidth = CtlGlobalClass.LeftBlank + CtlGlobalClass.RightBlank + (MaxModelDepth) * CtlGlobalClass.HLayerDis;
                    }
                    else
                    {
                        tWidth = CtlGlobalClass.LeftBlank + (MaxModelDepth) * CtlGlobalClass.HLayerDis;
                    }

                    if (tHeight > MaxHeight)
                    {
                        MaxHeight = tHeight;
                    }

                    WRClass.InitModelCord(StartX, StartY, tWidth, tHeight);
                    StartX += tWidth;

                    Hashtable ExistNodeList = WRClass.GetExistNodeList();
                    foreach (int key in ExistNodeList.Keys)
                    {
                        if (!HTExistModel.ContainsKey(key))
                        {
                            HTExistModel.Add(key, ExistNodeList[key]);
                        }
                    }

                    WRClassList.Add(WRClass);
                }
            }

            this.DrawPanel.Top  = 0;
            this.DrawPanel.Left = 0;

            this.DrawPanel.Width  = StartX;
            this.DrawPanel.Height = MaxHeight;



            this.DrawPanel.Refresh();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ���ÿռ��Wave ���ڵ�
        /// </summary>
        /// <param name="RootClass">���ģ�͸��ڵ�</param>
        /// <param name="AttachModellist">�����ڵ��б�</param>
        public void SetRootClass(ArrayList RootModellist)
        {
            this.HorizontalScroll.Value = 0;
            int StartX = 0;
            int StartY = 0;

            int MaxHeight = 0;

            HTExistModel = new Hashtable();

            for (int i = 0; i < RootModellist.Count; i++)
            {
                ModelClass M = RootModellist[i] as ModelClass;
                if (!HTExistModel.Contains(M.ModelID))
                {
                    WaveRelationClass WRClass = new WaveRelationClass(M);

                    WRClass.SetEveryModelLocation();

                    int MaxWaveLength = WRClass.GetLocationLength();
                    int MaxModelDepth = WRClass.GetLocationWidth();

                    int tWidth = 0;
                    int tHeight = CtlGlobalClass.UpBlank + CtlGlobalClass.DownBlank + (MaxWaveLength) * CtlGlobalClass.VShapeDis;

                    if (i == 0)
                    {
                        tWidth = CtlGlobalClass.LeftBlank + CtlGlobalClass.RightBlank + (MaxModelDepth) * CtlGlobalClass.HLayerDis;
                    }
                    else
                    {
                        tWidth = CtlGlobalClass.LeftBlank + (MaxModelDepth) * CtlGlobalClass.HLayerDis;
                    }

                    if (tHeight > MaxHeight)
                    {
                        MaxHeight = tHeight;
                    }

                    WRClass.InitModelCord(StartX, StartY, tWidth, tHeight);
                    StartX += tWidth;

                    Hashtable ExistNodeList =  WRClass.GetExistNodeList();
                    foreach (int key in ExistNodeList.Keys)
                    {
                        if (!HTExistModel.ContainsKey(key))
                        {
                            HTExistModel.Add(key, ExistNodeList[key]);
                        }
                    }

                    WRClassList.Add(WRClass);
                }
            }

            this.DrawPanel.Top = 0;
            this.DrawPanel.Left = 0;

            this.DrawPanel.Width = StartX;
            this.DrawPanel.Height = MaxHeight;

            this.DrawPanel.Refresh();
        }