Beispiel #1
0
        private void editEvents_OnChangeFeature(IObject Object)
        {
            IFeatureChanges changes = Object as IFeatureChanges;

            if (this._bCreateNew)
            {
                this._bCreateNew = false;
            }
            else if ((changes != null) && changes.ShapeChanged)
            {
                if (this._setArea)
                {
                    IFeature pFeature = UniqueInstance.TargetLayer.FeatureClass.GetFeature(Object.OID);
                    this.SetFeatureArea(pFeature);
                }
                if (this._checkOverlap && (UniqueInstance.LinageShape == null))
                {
                    IFeature feature = UniqueInstance.TargetLayer.FeatureClass.GetFeature(Object.OID);
                    if ((feature != null) && !this.CheckFeatureOverlap(feature.ShapeCopy, true))
                    {
                        XtraMessageBox.Show("要素与其他要素重叠!");
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///     Gets the difference in shape between the original and existing shape.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <returns>
        ///     Returns a <see cref="IGeometry" /> representing the difference in the shape; otherwise <c>null</c>
        /// </returns>
        public static IGeometry GetDifference(this IFeature source)
        {
            if (source == null)
            {
                return(null);
            }

            IFeatureChanges featureChanges = (IFeatureChanges)source;

            if (featureChanges.ShapeChanged && featureChanges.OriginalShape != null)
            {
                ITopologicalOperator topologicalOperator = (ITopologicalOperator)source.ShapeCopy;
                return(topologicalOperator.Difference(featureChanges.OriginalShape));
            }

            return(null);
        }
        public static void FabricGeometryRowChange(ESRI.ArcGIS.Geodatabase.IObject obj)
        {
            if (obj is IFeature)
            {
                IFeatureChanges pFeatChanges = obj as IFeatureChanges;
                if (!pFeatChanges.ShapeChanged)
                {
                    return;
                }
                if (pFeatChanges.OriginalShape.IsEmpty) //means new fabric parcel
                {
                    return;
                }
            }

            if (InMemTableExistsForRow(obj))
            {
                // code for fabric geometry change here
                MessageBox.Show("Fabric geometry change");
            }
        }
        /// <summary>
        /// Indicates if the shape has changed.
        /// </summary>
        /// <param name="feature"></param>
        /// <returns></returns>
        public static bool ShapeChanged(this IFeature feature)
        {
            IFeatureChanges rowChanges = feature as IFeatureChanges;

            return(rowChanges.ShapeChanged);
        }