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); }
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); }
public override bool Touch(Shape2 inShape) { return(Touch((Polygon2)GeoConverter.Convert(inShape, ShapeType.Polygon, false))); }
public virtual bool Touch(Shape2 inShape) { return(false); }
public virtual object Clone() { Shape2 shape = new Shape2(); return(shape); }