示例#1
0
        // Polyline类型  FX 2014.04.08
        public void SetParameter1(IGeometry geometry, double hTop, double hBottom)
        {
            base._hTop    = hTop;
            base._hBottom = hBottom;
            base._minX    = 999999.9;
            base._maxX    = -999999.9;
            base._minY    = 999999.9;
            base._maxY    = -999999.9;
            try
            {
                IPolygon polygon;
                base._z     = hTop;
                this._depth = base._hTop - base._hBottom;
                switch (geometry.GeometryType)
                {
                case gviGeometryType.gviGeometryPoint:
                {
                    IPoint point = geometry as IPoint;
                    base._x = point.X;
                    base._y = point.Y;
                    DrawGeometry.GetRoundVtxs(point, 1.0, 0x18, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                    break;
                }

                case gviGeometryType.gviGeometryPolyline:
                    goto Label_00CD;
                }
                return;

Label_00CD:
                // 将polyline转化为polygon
                IPolyline polyline = geometry as IPolyline;
                if (polyline.PointCount < 4)
                {
                    return;
                }
                polygon = geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolygon, gviVertexAttribute.gviVertexAttributeZ) as IPolygon;
                if (polygon != null)
                {
                    for (int i = 0; i < polyline.PointCount; i++)
                    {
                        IPoint point = polyline.GetPoint(i);
                        polygon.ExteriorRing.AppendPoint(point);
                    }
                }
                if (!polygon.IsClosed)
                {
                    polygon.Close();
                }
                if (polygon.QueryNormal().Z > 0.0)
                {
                    ReversePolygon(ref polygon);
                }
                DrawGeometry.GetPolygonVtxs(polygon, ref this._x, ref this._y, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
            }
            catch (Exception exception)
            {
            }
        }
示例#2
0
        // Polygon类型
        public void SetParameter(IGeometry geometry, double hTop, double hBottom)
        {
            base._hTop    = hTop;
            base._hBottom = hBottom;
            base._minX    = 999999.9;
            base._maxX    = -999999.9;
            base._minY    = 999999.9;
            base._maxY    = -999999.9;
            try
            {
                IPolygon polygon;
                base._z     = hTop;
                this._depth = base._hTop - base._hBottom;
                switch (geometry.GeometryType)
                {
                case gviGeometryType.gviGeometryPoint:
                {
                    IPoint point = geometry as IPoint;
                    base._x = point.X;
                    base._y = point.Y;
                    DrawGeometry.GetRoundVtxs(point, 1.0, 0x18, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                    break;
                }

                case gviGeometryType.gviGeometryPolygon:
                    goto Label_00CD;
                }
                return;

Label_00CD:
                polygon = geometry as IPolygon;
                if (polygon != null)
                {
                    if (polygon.QueryNormal().Z > 0.0)
                    {
                        ReversePolygon(ref polygon);
                    }
                    DrawGeometry.GetPolygonVtxs(polygon, ref this._x, ref this._y, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                }
            }
            catch (Exception exception)
            {
            }
        }