public bool Snap(IGeometry igeometry_0, IPoint ipoint_0, double double_0)
        {
            bool flag;

            if (EditorLicenseProviderCheck.Check())
            {
                IPoint ipoint0   = ipoint_0;
                double length    = 1000;
                bool   flag1     = false;
                ILine  lineClass = new Line();
                for (int i = 0; i < this.ifeatureCache_0.Count; i++)
                {
                    IGeometry shape = this.ifeatureCache_0.Feature[i].Shape;
                    if (shape is ISegmentCollection)
                    {
                        IHitTest hitTest = (IHitTest)shape;
                        if ((hitTest is IPolyline ? true : hitTest is IPolygon))
                        {
                            double num        = 0;
                            int    num1       = 0;
                            int    num2       = 0;
                            bool   flag2      = true;
                            IPoint pointClass = new ESRI.ArcGIS.Geometry.Point();
                            if (hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartBoundary,
                                                pointClass, ref num, ref num1, ref num2, ref flag2))
                            {
                                ISegment segment =
                                    ((shape as IGeometryCollection).Geometry[num1] as ISegmentCollection).Segment[num2];
                                if (segment is ICircularArc)
                                {
                                    pointClass = ((ICircularArc)segment).CenterPoint;
                                    lineClass.PutCoords(ipoint0, pointClass);
                                    if (!flag1)
                                    {
                                        length = lineClass.Length;
                                        ipoint_0.PutCoords(pointClass.X, pointClass.Y);
                                        flag1 = true;
                                    }
                                    else if (length > lineClass.Length)
                                    {
                                        length = lineClass.Length;
                                        ipoint_0.PutCoords(pointClass.X, pointClass.Y);
                                        flag1 = true;
                                    }
                                }
                            }
                        }
                    }
                }
                flag = flag1;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Exemple #2
0
 internal static void Init()
 {
     EditorLicenseProviderCheck.m_initOk = true;
     try
     {
         EditorLicenseProviderCheck._licenceseCheck = new EditorLicenseProviderCheck();
     }
     catch
     {
     }
 }
Exemple #3
0
        public static bool Check()
        {
            return(true);

            if (!EditorLicenseProviderCheck.m_initOk)
            {
                EditorLicenseProviderCheck.Init();
            }
            if (EditorLicenseProviderCheck._licenceseCheck == null)
            {
                MessageBox.Show("无法验证编辑模块的的使用许可!", "许可", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            return(EditorLicenseProviderCheck._licenceseCheck != null);
        }
Exemple #4
0
 private static void old_acctor_mc()
 {
     SketchShareEx.m_psnaper            = new PointSnapper();
     SketchShareEx.m_CurrentStep        = 0;
     SketchShareEx.m_SysGrants          = new SysGrants(AppConfigInfo.UserID);
     SketchShareEx.m_pSketchCommandFolw = new SketchCommandFlow();
     SketchShareEx.IsFixLength          = false;
     SketchShareEx.IsFixDirection       = false;
     SketchShareEx.FixLength            = 0;
     SketchShareEx.FixDirection         = 0;
     SketchShareEx.StartPoint           = null;
     SketchShareEx.LastPoint            = null;
     SketchShareEx.IsCreateParrel       = false;
     SketchShareEx.m_offset             = 1;
     SketchShareEx.ConstructOffset      = 5;
     SketchShareEx.PointCount           = 0;
     SketchShareEx.m_pAnchorPoint       = null;
     SketchShareEx.m_bInUse             = false;
     SketchShareEx.m_pPointCollection   = null;
     SketchShareEx.m_pLastPoint1        = null;
     SketchShareEx.m_pEndPoint1         = null;
     SketchShareEx.m_bShowVlaue         = true;
     SketchShareEx.m_totalLength        = 0;
     SketchShareEx.m_bSnapSuccessful    = false;
     SketchShareEx.m_pSym             = new SimpleMarkerSymbol();
     SketchShareEx.m_pPoint           = null;
     SketchShareEx.m_HasLicense       = false;
     SketchShareEx.m_LastPartGeometry = null;
     SketchShareEx.m_bInStreaming     = false;
     SketchShareEx.m_MinDis           = 0;
     SketchShareEx.m_HasLicense       = EditorLicenseProviderCheck.Check();
     SketchShareEx.m_pSym.Style       = esriSimpleMarkerStyle.esriSMSCircle;
     SketchShareEx.m_pSym.Size        = 8;
     SketchShareEx.m_pSym.Outline     = true;
     SketchShareEx.m_pSym.Color       = ColorManage.GetRGBColor(0, 255, 255);
 }
        public bool Snap(IGeometry igeometry_0, IPoint ipoint_0, double double_0)
        {
            bool      flag;
            int       i;
            IHitTest  shape;
            IGeometry geometry;

            if (!EditorLicenseProviderCheck.Check())
            {
                flag = false;
            }
            else if (this.ifeatureCache_0.Count != 0)
            {
                bool   flag1      = false;
                double num        = 0;
                int    num1       = 0;
                int    num2       = 0;
                bool   flag2      = true;
                IPoint pointClass = new ESRI.ArcGIS.Geometry.Point();
                object value      = Missing.Value;
                IArray arrayClass = new Array();
                for (i = 0; i < this.ifeatureCache_0.Count; i++)
                {
                    shape = (IHitTest)this.ifeatureCache_0.Feature[i].Shape;
                    if ((shape is IPolyline ? true : shape is IPolygon) &&
                        shape.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartBoundary, pointClass,
                                      ref num, ref num1, ref num2, ref flag2))
                    {
                        arrayClass.Add(shape);
                    }
                }
                IPointCollection multipointClass = new Multipoint();
                IArray           arrayClass1     = new Array() as IArray;
                for (i = 0; i < arrayClass.Count; i++)
                {
                    ITopologicalOperator2 element = (ITopologicalOperator2)arrayClass.Element[i];
                    for (int j = 0; j < arrayClass.Count; j++)
                    {
                        if (i != j)
                        {
                            if (((IGeometry)arrayClass.Element[i]).GeometryType !=
                                ((IGeometry)arrayClass.Element[j]).GeometryType)
                            {
                                geometry = element.IntersectMultidimension((IGeometry)arrayClass.Element[j]);
                                if (geometry != null)
                                {
                                    IGeometryCollection geometryCollection = geometry as IGeometryCollection;
                                    if (geometryCollection != null)
                                    {
                                        for (int k = 0; k < geometryCollection.GeometryCount; k++)
                                        {
                                            geometry = geometryCollection.Geometry[k];
                                            if (geometry is IPointCollection)
                                            {
                                                multipointClass.AddPointCollection((IPointCollection)geometry);
                                            }
                                            else if (geometry is IPointCollection)
                                            {
                                                multipointClass.AddPoint((IPoint)geometry, ref value, ref value);
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                geometry = element.Intersect((IGeometry)arrayClass.Element[j],
                                                             esriGeometryDimension.esriGeometry0Dimension);
                                if (geometry != null)
                                {
                                    if (geometry is IPointCollection)
                                    {
                                        multipointClass.AddPointCollection((IPointCollection)geometry);
                                    }
                                    else if (geometry is IPointCollection)
                                    {
                                        multipointClass.AddPoint((IPoint)geometry, ref value, ref value);
                                    }
                                }
                            }
                        }
                    }
                }
                shape = (IHitTest)multipointClass;
                if (shape.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartVertex, pointClass,
                                  ref num, ref num1, ref num2, ref flag2))
                {
                    ipoint_0.PutCoords(pointClass.X, pointClass.Y);
                    flag1 = true;
                }
                flag = flag1;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Exemple #6
0
        public bool Snap(IGeometry igeometry_0, IPoint ipoint_0, double double_0)
        {
            bool result;

            if (!EditorLicenseProviderCheck.Check())
            {
                result = false;
            }
            else if (this.int_0 == 0)
            {
                result = false;
            }
            else if (this.ifeatureCache_0.Count == 0)
            {
                result = false;
            }
            else
            {
                double num   = 0.0;
                int    num2  = 0;
                int    num3  = 0;
                bool   flag  = true;
                IPoint point = new ESRI.ArcGIS.Geometry.Point();
                double num4  = double_0 * 3.0;
                bool   flag2 = false;
                for (int i = 0; i < this.ifeatureCache_0.Count; i++)
                {
                    IHitTest hitTest = (IHitTest)this.ifeatureCache_0.get_Feature(i).Shape;
                    if ((this.int_0 & 16) != 0 &&
                        (hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolyline &&
                        hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartEndpoint, point,
                                        ref num, ref num2, ref num3, ref flag) && num4 > num)
                    {
                        num4 = num;
                        ipoint_0.PutCoords(point.X, point.Y);
                        flag2 = true;
                        if (double_0 > num)
                        {
                            result = true;
                            return(result);
                        }
                    }
                    else if ((this.int_0 & 1) != 0 &&
                             hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartVertex, point,
                                             ref num, ref num2, ref num3, ref flag) && num4 > num)
                    {
                        num4 = num;
                        ipoint_0.PutCoords(point.X, point.Y);
                        flag2 = true;
                        if (double_0 > num)
                        {
                            result = true;
                            return(result);
                        }
                    }
                    else if ((this.int_0 & 8) != 0 &&
                             ((hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolyline ||
                              (hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolygon) &&
                             hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartMidpoint, point,
                                             ref num, ref num2, ref num3, ref flag) && num4 > num)
                    {
                        num4 = num;
                        ipoint_0.PutCoords(point.X, point.Y);
                        flag2 = true;
                        if (double_0 > num)
                        {
                            result = true;
                            return(result);
                        }
                    }
                    else if ((this.int_0 & 4) != 0 &&
                             ((hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolyline ||
                              (hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolygon) &&
                             hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartBoundary, point,
                                             ref num, ref num2, ref num3, ref flag) && num4 > num)
                    {
                        num4 = num;
                        ipoint_0.PutCoords(point.X, point.Y);
                        flag2 = true;
                        if (double_0 > num)
                        {
                            result = true;
                            return(result);
                        }
                    }
                    else if ((this.int_0 & 32) != 0 &&
                             (hitTest as IGeometry).GeometryType == esriGeometryType.esriGeometryPolygon &&
                             hitTest.HitTest(ipoint_0, double_0, esriGeometryHitPartType.esriGeometryPartCentroid, point,
                                             ref num, ref num2, ref num3, ref flag) && num4 > num)
                    {
                        num4 = num;
                        ipoint_0.PutCoords(point.X, point.Y);
                        flag2 = true;
                        if (double_0 > num)
                        {
                            result = true;
                            return(result);
                        }
                    }
                }
                result = flag2;
            }
            return(result);
        }
Exemple #7
0
 private static void old_acctor_mc()
 {
     EditorLicenseProviderCheck._licenceseCheck = null;
     EditorLicenseProviderCheck.m_initOk        = false;
 }
Exemple #8
0
 static EditorLicenseProviderCheck()
 {
     EditorLicenseProviderCheck.old_acctor_mc();
 }