SuperMap.Web.Mapping.LayerContainer.SetClip C# (CSharp) Method

SetClip() private method

private SetClip ( FeatureElement fe, Rectangle2D clipBox ) : void
fe SuperMap.Web.Core.FeatureElement
clipBox SuperMap.Web.Core.Rectangle2D
return void
        private void SetClip(FeatureElement fe, Rectangle2D clipBox)
        {
            Rectangle2D bounds = fe.Geometry.Bounds;
            if ((bounds.IsEmpty) || ((bounds.Width / this.Resolution) < 16383.5))
            {
                if (fe.ClippedGeometry != null)
                {
                    fe.ClearClip();
                }
            }
            else if (((fe.ClipBox.IsEmpty) || !clipBox.Within(fe.ClipBox)) || ((fe.ClipBox.Width / this.Resolution) >= 16383.5))
            {
                if (fe.Geometry is GeoRegion)
                {
                    fe.SetClip(new GeoRegionClip(clipBox).Clip(fe.Geometry as GeoRegion), clipBox);
                }
                else if (fe.Geometry is GeoLine)
                {
                    fe.SetClip(new GeoLineClip(clipBox).Clip(fe.Geometry as GeoLine), clipBox);
                }
            }
        }