Esempio n. 1
0
        public override void OnClick()
        {
            frmInputValue1 frmInputValue = new frmInputValue1();

            frmInputValue.Text = "输入偏移值";
            if (frmInputValue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                double    inputValue  = frmInputValue.InputValue1;
                double    inputValue2 = frmInputValue.InputValue2;
                IGeometry shape       = EditTools.EditFeature.Shape;
                if (shape != null && EditTools.PartIndex != -1 && EditTools.PointIndex != -1 &&
                    (shape.GeometryType == esriGeometryType.esriGeometryPolyline ||
                     shape.GeometryType == esriGeometryType.esriGeometryPolygon))
                {
                    IPointCollection pointCollection =
                        (shape as IGeometryCollection).get_Geometry(EditTools.PartIndex) as IPointCollection;
                    IPoint point = pointCollection.get_Point(EditTools.PointIndex);
                    point.X += inputValue;
                    point.Y += inputValue2;
                    double arg_C5_0 = point.Z;
                    pointCollection.UpdatePoint(EditTools.PointIndex, point);
                    (shape as IGeometryCollection).GeometriesChanged();
                    Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StartEditOperation();
                    EditTools.EditFeature.Shape = shape;
                    EditTools.EditFeature.Store();
                    Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StopEditOperation();
                    (_context.FocusMap as IActiveView).Refresh();
                }
            }
        }
Esempio n. 2
0
        public override void OnClick()
        {
            frmInputValue1 frmInputValue = new frmInputValue1();

            frmInputValue.Text = "输入x, y值";
            if (frmInputValue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                double inputValue  = frmInputValue.InputValue1;
                double inputValue2 = frmInputValue.InputValue2;
                double dx          = inputValue - EditTools.CurrentPosition.X;
                double dy          = inputValue2 - EditTools.CurrentPosition.Y;
                Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StartEditOperation();
                IEnumFeature enumFeature = _context.FocusMap.FeatureSelection as IEnumFeature;
                enumFeature.Reset();
                for (IFeature feature = enumFeature.Next(); feature != null; feature = enumFeature.Next())
                {
                    ITransform2D transform2D = feature.Shape as ITransform2D;
                    if (transform2D != null)
                    {
                        transform2D.Move(dx, dy);
                        feature.Shape = (transform2D as IGeometry);
                        feature.Store();
                    }
                }
                Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StopEditOperation();
                (_context.FocusMap as IActiveView).Refresh();
            }
        }
Esempio n. 3
0
        public override void OnClick()
        {
            frmInputValue1 frmInputValue = new frmInputValue1();

            frmInputValue.Text        = "输入x, y增量";
            frmInputValue.InputValue1 = SketchShareEx.m_pAnchorPoint.X;
            frmInputValue.InputValue2 = SketchShareEx.m_pAnchorPoint.Y;
            if (frmInputValue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.ParseInput(frmInputValue.InputValue1, frmInputValue.InputValue2);
            }
        }
Esempio n. 4
0
        public override void OnClick()
        {
            frmInputValue1 frmInputValue = new frmInputValue1();

            frmInputValue.Text = "输入方向/长度";
            ILine line = new Line();

            line.PutCoords(SketchShareEx.LastPoint, SketchShareEx.m_pAnchorPoint);
            frmInputValue.InputValue1 = 180.0 * line.Angle / 3.1415926;
            frmInputValue.InputValue2 = line.Length;
            if (frmInputValue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.ParseInput(frmInputValue.InputValue1, frmInputValue.InputValue2);
            }
        }
Esempio n. 5
0
        public override void OnClick()
        {
            frmInputValue1 frmInputValue = new frmInputValue1();

            frmInputValue.Text        = "输入X, Y值";
            frmInputValue.InputValue1 = EditTools.CurrentPosition.X;
            frmInputValue.InputValue2 = EditTools.CurrentPosition.Y;
            if (frmInputValue.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                double    inputValue  = frmInputValue.InputValue1;
                double    inputValue2 = frmInputValue.InputValue2;
                IGeometry shape       = EditTools.EditFeature.Shape;
                if (shape != null && EditTools.PartIndex != -1 && EditTools.PointIndex != -1 &&
                    (shape.GeometryType == esriGeometryType.esriGeometryPolyline ||
                     shape.GeometryType == esriGeometryType.esriGeometryPolygon))
                {
                    double num     = 0.0;
                    int    index   = -1;
                    int    num2    = -1;
                    double double_ = CommonHelper.ConvertPixelsToMapUnits((IActiveView)_context.FocusMap, 4.0);
                    IPoint point;
                    bool   flag;
                    if (
                        GeometryOperator.TestGeometryHit(double_, EditTools.CurrentPosition, shape, out point, ref num,
                                                         ref index, ref num2, out flag) && !flag)
                    {
                        IPath  path   = (IPath)((IGeometryCollection)shape).get_Geometry(index);
                        IPoint point2 = new Point();
                        point2.PutCoords(inputValue, inputValue2);
                        object value = Missing.Value;
                        object obj   = num2;
                        ((IPointCollection)path).AddPoint(point2, ref value, ref obj);
                        (shape as IGeometryCollection).GeometriesChanged();
                        Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StartEditOperation();
                        EditTools.EditFeature.Shape = shape;
                        EditTools.EditFeature.Store();
                        Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace.StopEditOperation();
                        (_context.FocusMap as IActiveView).PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null,
                                                                          null);
                    }
                }
            }
        }