public static Drawing.Rectangle GetBoundingBox(IEnumerable <Shapes.XFormCells> xfrms) { var bb = new Drawing.BoundingBox(xfrms.Select(ArrangeHelper.GetRectangle)); if (!bb.HasValue) { throw new System.ArgumentException("Could not calculate bounding box"); } return(bb.Rectangle); }
public Drawing.Rectangle GetBoundingBoxOfTree() { if (this.Root.ChildCount < 1) { throw new System.InvalidOperationException("There are no Nodes in the tree"); } var nodes = this.Nodes.ToList(); var bb = new Drawing.BoundingBox(nodes.Select(n => n.Rect)); if (!bb.HasValue) { throw new System.InvalidOperationException("Internal Error: Could not compute bounding box"); } else { return(bb.Rectangle); } }
public static Drawing.Rectangle GetBoundingBox(IEnumerable<Shapes.XFormCells> xfrms) { var bb = new Drawing.BoundingBox(xfrms.Select(ArrangeCommands.GetRectangle)); if (!bb.HasValue) { throw new System.ArgumentException("Could not calculate bounding box"); } else { return bb.Rectangle; } }