Exemplo n.º 1
0
        public static IPolygon MakePolygonFromRing(IRing pRing, bool blMakeAreaZ /*使面积为正*/)
        {
            if (pRing == null || pRing.IsEmpty || pRing.IsClosed == false)
            {
                return(null);
            }
            IPolygon            pPolygon            = new PolygonClass();
            IGeometryCollection pGeometryCollection = pPolygon as IGeometryCollection;

            object    pBObj     = Type.Missing;
            object    pAObj     = Type.Missing;
            IGeometry pGeometry = pRing as IGeometry;

            pGeometryCollection.AddGeometry(pGeometry, ref pBObj, ref pAObj);

            if (blMakeAreaZ == false)
            {
                return(pPolygon);
            }

            IArea pArea = pPolygon as IArea;

            if (pArea.Area >= 0)
            {
                return(pPolygon);
            }

            ESRI.ArcGIS.esriSystem.IClone pClone = pRing as ESRI.ArcGIS.esriSystem.IClone;
            IRing pNewRing = pClone.Clone() as IRing;

            pNewRing.ReverseOrientation();
            pGeometry = pNewRing as IGeometry;
            pGeometryCollection.AddGeometry(pGeometry, ref pBObj, ref pAObj);
            return(pPolygon);
        }
Exemplo n.º 2
0
        void ESRI.ArcGIS.esriSystem.IClone.Assign(ESRI.ArcGIS.esriSystem.IClone src)
        {
            GIS.IGasPressureSymbol srcLogoSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol srcMarkerSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol recMarkerSym = null;
            ESRI.ArcGIS.Display.ISymbol srcSym = null;
            ESRI.ArcGIS.Display.ISymbol recSym = null;
            ESRI.ArcGIS.Display.ISymbolRotation srcRotSym = null;
            ESRI.ArcGIS.Display.ISymbolRotation recRotSym = null;
            ESRI.ArcGIS.Display.IMapLevel srcMapLev = null;
            ESRI.ArcGIS.Display.IMapLevel recMapLev = null;
            if (src != null)
            {
                if (src is GIS.IGasPressureSymbol)
                {
                    //  Assign custom interface properties of Source to Reciever.
                    //  Color objects are returned from these properties by value.
                    srcLogoSym = src as IGasPressureSymbol;
                    m_colorBorder = srcLogoSym.ColorBorder;
                    m_colorLeft = srcLogoSym.ColorLeft;
                    m_colorRight = srcLogoSym.ColorRight;
                    m_colorTop = srcLogoSym.ColorTop;

                    //  Assign IMarkerSymbol interface properties of Source to Reciever, but
                    //  dont need to set Color because this is set in ColorTop.
                    //  We know that a Logo markerSymbol implements IMarkerSymbol.
                    srcMarkerSym = src as IMarkerSymbol;
                    recMarkerSym = this;
                    recMarkerSym.Angle = srcMarkerSym.Angle;
                    recMarkerSym.Size = srcMarkerSym.Size;
                    recMarkerSym.XOffset = srcMarkerSym.XOffset;
                    recMarkerSym.YOffset = srcMarkerSym.YOffset;

                    //  Assign ISymbol interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements ISymbol.
                    srcSym = src as ISymbol;
                    recSym = this;
                    recSym.ROP2 = srcSym.ROP2;

                    //  Assign ISymbolRotation interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements ISymbolRotation.
                    srcRotSym = src as ISymbolRotation;
                    recRotSym = this;
                    recRotSym.RotateWithTransform = srcRotSym.RotateWithTransform;

                    //  Assign IMapLevel interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements IMapLevel.
                    srcMapLev = src as IMapLevel;
                    recMapLev = this;
                    recMapLev.MapLevel = srcMapLev.MapLevel;

                    //  Also implements IMarkerMask, but this interface has no properties, only
                    //  a method, and therefore we dont have to assign anything for IMarkerMask.
                    //  Also implements IDiplayName, but this interface only has one property,
                    //  which is read-only, so we dont set anything for IDisplayName either.
                }
            }
        }
Exemplo n.º 3
0
 ESRI.ArcGIS.esriSystem.IClone ESRI.ArcGIS.esriSystem.IClone.Clone()
 {
     //  Simplest way to implement the Clone function is to make use of the IClone Assign
     //  method. Create a new LogoMarkerSymbol and assign to it the properties of the
     //  current class, then pass back this new class, which is then a copy of the current class.
     GIS.IGasPressureSymbol newLogo = null;
     ESRI.ArcGIS.esriSystem.IClone clone = null;
     newLogo = new GIS.GasPressureSymbol();
     clone = newLogo as IClone;
     clone.Assign(this);
     return clone;
 }
Exemplo n.º 4
0
 bool ESRI.ArcGIS.esriSystem.IClone.IsIdentical(ESRI.ArcGIS.esriSystem.IClone other)
 {
     bool tempIClone_IsIdentical = false;
     GIS.IGasPressureSymbol sym = null;
     if (other != null)
     {
         if (other is IGasPressureSymbol)
         {
             sym = (IGasPressureSymbol)other;
             tempIClone_IsIdentical = (sym == this);
         }
     }
     return tempIClone_IsIdentical;
 }
Exemplo n.º 5
0
        bool ESRI.ArcGIS.esriSystem.IClone.IsEqual(ESRI.ArcGIS.esriSystem.IClone other)
        {
            bool tempIClone_IsEqual = false;
            GIS.IGasPressureSymbol srcLogoSym = null;
            GIS.IGasPressureSymbol pRecLogoSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol srcMarkerSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol recMarkerSym = null;
            ESRI.ArcGIS.Display.ISymbol srcSym = null;
            ESRI.ArcGIS.Display.ISymbol recSym = null;
            ESRI.ArcGIS.Display.IDisplayName srcDispName = null;
            ESRI.ArcGIS.Display.IDisplayName recDispName = null;
            ESRI.ArcGIS.Display.ISymbolRotation srcSymRot = null;
            ESRI.ArcGIS.Display.ISymbolRotation recSymRot = null;
            ESRI.ArcGIS.Display.IMapLevel srcMapLev = null;
            ESRI.ArcGIS.Display.IMapLevel recMapLev = null;
            if (other != null)
            {
                if (other is GIS.IGasPressureSymbol)
                {

                    // Check for equality on default interface.
                    srcLogoSym = other as IGasPressureSymbol;
                    pRecLogoSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorBorder.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorBorder.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorLeft.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorLeft.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorRight.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorRight.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorTop.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorTop.RGB))));

                    //  Check for equality on IMarkerSymbol interface.
                    //  We know that a LogoMarkerSymbol implements IMarkerSymbol.
                    srcMarkerSym = other as IMarkerSymbol;
                    recMarkerSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.Angle == srcMarkerSym.Angle);
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(recMarkerSym.Color.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcMarkerSym.Color.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.Size == srcMarkerSym.Size);
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.XOffset == srcMarkerSym.XOffset);
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.YOffset == srcMarkerSym.YOffset);

                    //  Check for equality on ISymbol interface.
                    //  We know that a Logo markerSymbol implements ISymbol.
                    srcSym = other as ISymbol;
                    recSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recSym.ROP2 == srcSym.ROP2);

                    //  Check for equality on IDisplayName interface.
                    //  We know that a Logo markerSymbol implements IDisplayName.
                    srcDispName = other as IDisplayName;
                    recDispName = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recDispName.NameString == srcDispName.NameString);

                    //  Check for equality on ISymbolRotation
                    //  We know that a Logo markerSymbol implements IDisplayName.
                    srcSymRot = other as ISymbolRotation;
                    recSymRot = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recSymRot.RotateWithTransform == srcSymRot.RotateWithTransform);

                    //  Check for equality on IMapLevel
                    //  We know that a Logo markerSymbol implements IMapLevel.
                    srcMapLev = other as IMapLevel;
                    recMapLev = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMapLev.MapLevel == srcMapLev.MapLevel);

                    //  Also implements IMarkerMask, but IMarkerMask has no properties to check.
                }
            }
            return tempIClone_IsEqual;
        }