public static Shape2 Convert(Shape2 inShape, ShapeType shapeType, bool inThrowError)
        {
            if (inShape is Circle && shapeType != ShapeType.Circle)
            {
                return(Convert(inShape as Circle, shapeType));
            }
            else if (inShape is Rectangle && shapeType != ShapeType.Rectangle)
            {
                return(Convert(inShape as Rectangle, shapeType));
            }
            else if (inShape is Polygon2 && shapeType != ShapeType.Polygon)
            {
                return(Convert(inShape as Polygon2, shapeType));
            }
            else if (inShape is Stroke2 && shapeType != ShapeType.Stroke)
            {
                return(Convert(inShape as Stroke2, shapeType));
            }

            if (inThrowError)
            {
                throw new Exception("Cannot convert shape");
            }

            return(inShape);
        }
Beispiel #2
0
        public override bool Touch(Shape2 inShape)
        {
            if (inShape is Circle)
            {
                return(Touch(inShape as Circle));
            }
            else if (inShape is Rectangle)
            {
                return(Touch(inShape as Rectangle));
            }
            else if (inShape is Polygon2)
            {
                return(Touch(inShape as Polygon2));
            }
            else if (inShape is Stroke2)
            {
                return(Touch(inShape as Stroke2));
            }

            return(false);
        }
Beispiel #3
0
 public override bool Touch(Shape2 inShape)
 {
     return(Touch((Polygon2)GeoConverter.Convert(inShape, ShapeType.Polygon, false)));
 }
Beispiel #4
0
 public virtual bool Touch(Shape2 inShape)
 {
     return(false);
 }
Beispiel #5
0
        public virtual object Clone()
        {
            Shape2 shape = new Shape2();

            return(shape);
        }