Example #1
0
        public override bool DeCompose(out IArray iarray_0)
        {
            bool flag;

            iarray_0 = null;
            IGeometryCollection mPGeometry = this.m_pGeometry as IGeometryCollection;

            if (mPGeometry.GeometryCount <= 1)
            {
                flag = false;
            }
            else
            {
                iarray_0 = new Array();
                object value  = Missing.Value;
                bool   zAware = false;
                bool   mAware = false;
                double zMin   = 0;
                try
                {
                    zAware = (mPGeometry as IZAware).ZAware;
                    zMin   = (mPGeometry as IZ).ZMin;
                }
                catch
                {
                }
                try
                {
                    mAware = (mPGeometry as IMAware).MAware;
                }
                catch
                {
                }
                for (int i = 0; i < mPGeometry.GeometryCount; i++)
                {
                    IGeometry           geometry     = mPGeometry.Geometry[i];
                    IGeometryCollection polygonClass = new Polygon() as IGeometryCollection;
                    (polygonClass as IZAware).ZAware = zAware;
                    (polygonClass as IMAware).MAware = mAware;
                    polygonClass.AddGeometry(geometry, ref value, ref value);
                    if (zAware)
                    {
                        (polygonClass as IZ).SetConstantZ(zMin);
                    }
                    (polygonClass as ITopologicalOperator).Simplify();
                }
                flag = true;
            }
            return(flag);
        }