Esempio n. 1
0
        /// <summary>
        /// Open 3D graph form by index
        /// </summary>
        /// <param name="index"></param>
        public void Open3DGraphForm(int index)
        {
            var isopen = false;
            for (int i = 0; i < this.graph3DList.Count; i++)
            {
                if (this.graph3DList[i].Index == index)
                {
                    this.graph3DList[i].Focus();
                    isopen = true;
                    break;
                }
            }

            if (isopen)
                return;

            Graph3DLib.WayType waytype = Graph3DLib.WayType.LEFT;
            int angle = 0;

            if (index == 1)
            {
                angle = 180;
            }
            else if (index == 2)
            {
                waytype = Graph3DLib.WayType.RIGHT;
                angle = 90;
            }
            else if (index == 3)
            {
                angle = 90;
            }

            var g = new frmGraph3D(this.log, index) { MdiParent = (Form)this.MdiParent, AnalyzeData = this.AnalyzeData, Top = this.graph3DControllerForm.Top + this.graph3DControllerForm.Height, Left = this.graph3DControllerForm.Left };
            g.FormClosed += new FormClosedEventHandler(graph3D_FormClosed);
            g.Resize += new EventHandler(graph_Resize);
            g.RotatebyAngle(waytype, angle);

            this.graph3DList.Add(g);

            if (this.graph3DList.Count == 1)
                this.graph3DList[0].OnAnimationCompleted += new frmGraph3D.AnimationCompletedEventHandler(frmGraph3D_OnAnimationCompleted);

            this.graph3DList[this.graph3DList.Count - 1].SetData(this.dataList[0].ToArray());
            this.graph3DList[this.graph3DList.Count - 1].CreateAnimation();
            this.graph3DList[this.graph3DList.Count - 1].Show();

            this.ArrangeGraphForms();
        }