예제 #1
0
        public bool zheng_zai_Sui_Zuan_Zhong = false;//正在随钻中
        //GetItemDataTableByName()
        void createForm()
        {
            //"new" order
            Childform form = new Childform();

            form.MdiParent   = this;
            form.mf          = this.mf;
            form.WindowState = FormWindowState.Maximized;



            form.Show();
        }
예제 #2
0
        /// <summary>
        /// 绘制录井解释图
        /// </summary>
        private void DrawLJJSPicture()
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return;
            }

            DrawCommonData.activeDocument = frm.vdScrollableControl1.BaseControl.ActiveDocument;
            if (!FrameDesign.Validate(this))//验证; 若!=true 则return
            {
                return;
            }



            LJJSBuilder  ljjsBuilder  = new LJJSBuilderImpl();
            LJJSDirector ljjsDirector = new LJJSDirector(ljjsBuilder);

            ljjsDirector.BuildLJJS();

            vdDocument activeDocu = DrawCommonData.activeDocument;

            /**
             * if (DrawCommonData.icount == 1)
             * {
             *
             *  if (SuiZuanForm.startpoint != null && this.zoomed == false)
             *  {
             *      gPoint g1 = new gPoint(SuiZuanForm.startpoint.XValue - 100, SuiZuanForm.startpoint.YValue + 40);
             *      gPoint g2 = new gPoint(g1.x + 900.0, g1.y - 450.0);
             *      frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ZoomWindow(g1, g2);
             *      this.zoomed = true;
             *  }
             *
             * }**/
            Childform cf = this.MdiChildren[0] as Childform;

            //自动缩放到合适的大小
            if (DrawCommonData.icount == 1)
            {
                VectorDraw.Professional.ActionUtilities.vdCommandAction.ZoomE_Ex(cf.vdScrollableControl1.BaseControl.ActiveDocument);
            }

            activeDocu.Redraw(true);

            //commandLine.ExecuteCommand("ze");
            //frm.vdScrollableControl1.BaseControl.ActiveDocument.CommandAction.
        }
예제 #3
0
        public void initdrawdata(string myLineRoadDesignName)
        {
            InitDrawData(myLineRoadDesignName);
            LineRoadWinDesign();



            Childform frm = this.ActiveMdiChild as Childform;


            if (frm == null)
            {
                return;
            }
            frm.vdScrollableControl1.BaseControl.vdMouseDown += new VectorDraw.Professional.Control.MouseDownEventHandler(BaseControl_vdMouseDown);
        }
예제 #4
0
        private vdSelection GetGripsCollection()
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return(null);
            }
            string      selsetname = "VDGRIPSET_" + frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Handle.ToStringValue() + (frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveViewPort != null ? frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveViewPort.Handle.ToStringValue() : "");
            vdSelection gripset    = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.Selections.FindName(selsetname);

            if (gripset == null)
            {
                gripset = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.Selections.Add(selsetname);
            }
            return(gripset);
        }
예제 #5
0
        private void ClearAllGrips(vdSelection GripSelection)
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return;
            }
            foreach (vdFigure fig in GripSelection)
            {
                fig.ShowGrips = false;
            }
            if (GripSelection.Count > 0)
            {
                GripSelection.RemoveAll();
                frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.RefreshGraphicsControl(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.control);
            }
        }
예제 #6
0
        void CommandExecute(string commandname, bool isDefaultImplemented, ref bool success)
        {
            if (string.Compare(commandname, "open", true) == 0)
            {
                success = true;
                createForm();
                Childform form = this.ActiveMdiChild as Childform;
                VectorDraw.Professional.vdObjects.vdDocument doc = form.vdScrollableControl1.BaseControl.ActiveDocument;
                object ret = doc.GetOpenFileNameDlg(0, "", 0);
                if (ret == null)
                {
                    form.Close();
                    return;
                }

                string fname       = (string)ret;
                bool   successopen = doc.Open(fname);
                if (!successopen)
                {
                    System.Windows.Forms.MessageBox.Show("Error openning " + fname);
                    form.Close();
                    return;
                }
                doc.Redraw(false);
            }
            else if (string.Compare(commandname, "new", true) == 0)
            {
                createForm();
                success = true;
            }
            else if (string.Compare(commandname, "pan", true) == 0)
            {
                Childform frm = this.ActiveMdiChild as Childform;
                if (frm == null)
                {
                    return;
                }
                frm.vdScrollableControl1.BaseControl.ActiveDocument.CommandAction.Pan();
            }
        }
예제 #7
0
        public void DrawLJJSPicture()
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return;
            }

            DrawCommonData.activeDocument = frm.vdScrollableControl1.BaseControl.ActiveDocument;

            //   frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ZoomWindow(new VectorDraw.Geometry.gPoint(-170, 0), new VectorDraw.Geometry.gPoint(170.0, 200));

            LJJSBuilder  ljjsBuilder  = new LJJSBuilderImpl();
            LJJSDirector ljjsDirector = new LJJSDirector(ljjsBuilder);

            ljjsDirector.BuildLJJS();

            vdDocument activeDocu = this.cf.vdScrollableControl1.BaseControl.ActiveDocument;

            activeDocu.Redraw(true);
        }
예제 #8
0
        private void BaseLineForm_Load(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;
            // this.mf.cf.MdiParent = this;
            Childform cf = new Childform();

            this.cf      = cf;
            cf.MdiParent = this;

            cf.WindowState = FormWindowState.Maximized;
            cf.Show();

            /**
             * vdEntities arr = this.mf.cf.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities;//获取主窗体中vd画的所有实体
             * foreach(vdFigure figure in arr)
             * {
             *  vdFigure copyfigure = (vdFigure)figure.Clone(cf.vdScrollableControl1.BaseControl.ActiveDocument);
             *  cf.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities.Add(copyfigure);
             * }**/
            this.Fdraw_pic(true);   //没有点绘图按钮
            cf.vdScrollableControl1.BaseControl.ActiveDocument.ZoomExtents();
        }
예제 #9
0
        void BaseControl_vdMouseDown(MouseEventArgs e, ref bool cancel)
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return;
            }

            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            if (frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveActions == null)
            {
                return;
            }
            if (frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveActions.Count > 1)
            {
                return;
            }

            if (frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveAction is VectorDraw.Professional.CommandActions.ActionLine)
            {
                return;
            }
            vdSelection GripEntities = GetGripsCollection();
            gPoint      p1           = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.World2Pixelmatrix.Transform(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveAction.MouseLocation);
            gPoint      p1viewCS     = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.CurrentMatrix.Transform(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveAction.MouseLocation);
            Point       location     = new Point((int)p1.x, (int)p1.y);

            #region Grip Move Code
            if (System.Windows.Forms.Control.ModifierKeys == Keys.None)
            {
                Box box = new Box();
                box.AddPoint(p1viewCS);
                box.AddWidth(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.GlobalProperties.GripSize * frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.PixelSize / 2.0d);

                vdSelection          selset       = new vdSelection();
                vdArray <Int32Array> indexesArray = new vdArray <Int32Array>();
                gPoint pt = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.World2UserMatrix.Transform(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveAction.MouseLocation);
                foreach (vdFigure fig in GripEntities)
                {
                    Int32Array indexes = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.getGripIndexes(fig, box);
                    if (indexes.Count != 0)
                    {
                        selset.AddItem(fig, false, vdSelection.AddItemCheck.Nochecking);
                        indexesArray.AddItem(indexes);
                    }
                }
                if (selset.Count > 0)
                {
                    VectorDraw.Professional.ActionUtilities.CmdMoveGripPoints MoveGrips = new VectorDraw.Professional.ActionUtilities.CmdMoveGripPoints(pt, frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut, selset, indexesArray);
                    frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActionAdd(MoveGrips);
                    VectorDraw.Actions.StatusCode ret = MoveGrips.WaitToFinish();
                    cancel = true;
                    return;
                }
            }
            #endregion

            #region One by One implementation
            vdFigure Fig = null;
            Fig = frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.GetEntityFromPoint(location, frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.GlobalProperties.PickSize, false, vdDocument.LockLayerMethodEnum.EnableGetObjectGrip);
            frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.LockLayerMethodStack.Push(vdDocument.LockLayerMethodEnum.DisableAll | ((frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.LockLayerMethod & vdDocument.LockLayerMethodEnum.EnableGetObjectGrip) != 0 ? vdDocument.LockLayerMethodEnum.EnableAddToSelections : 0));
            bool bShift = ((System.Windows.Forms.Control.ModifierKeys & Keys.Shift) == Keys.Shift);
            if (Fig != null)
            {
                ClearAllGrips(GripEntities);
                GripEntities.AddItem(Fig, true, vdSelection.AddItemCheck.RemoveInVisibleEntities);
                if (cancel)
                {
                    Fig.ShowGrips = false;
                }
                else
                {
                    Fig.ShowGrips = true;
                }
                frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.RefreshGraphicsControl(frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveActionRender.control);
                //  DrawGrips(GripEntities);
            }
            frm.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.LockLayerMethodStack.Pop();
            #endregion
        }